Skip to content

Commit

Permalink
removed the deprecated code since 0.23 (`qiskit.visualization.pulse…
Browse files Browse the repository at this point in the history
…`) (Qiskit#11213)

* removed the deprecated code

* fixed lint and docs

* Update releasenotes/notes/remove-deprecated-visualization-pulse-8adf40ff1a69df63.yaml

Co-authored-by: Raghav <83136390+Raghav-Bell@users.noreply.github.com>

* Update releasenotes/notes/remove-deprecated-visualization-pulse-8adf40ff1a69df63.yaml

* Fix reno

* Fix reno

---------

Co-authored-by: Raghav <83136390+Raghav-Bell@users.noreply.github.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Elena Peña Tapia <epenatap@gmail.com>
  • Loading branch information
4 people authored and FabianBrings committed Nov 23, 2023
1 parent aefc492 commit 4c4f25b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1,475 deletions.
75 changes: 1 addition & 74 deletions qiskit/pulse/instructions/instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
sched += Delay(duration, channel) # Delay is a specific subclass of Instruction
"""
from abc import ABC, abstractmethod
from typing import Callable, Iterable, List, Optional, Set, Tuple
from typing import Iterable, List, Optional, Set, Tuple

from qiskit.circuit import Parameter
from qiskit.pulse.channels import Channel
from qiskit.pulse.exceptions import PulseError
from qiskit.utils import optionals as _optionals

from qiskit.utils.deprecation import deprecate_func


# pylint: disable=bad-docstring-quotes
Expand Down Expand Up @@ -222,76 +219,6 @@ def is_parameterized(self) -> bool:
"""Return True iff the instruction is parameterized."""
return any(self.parameters)

@deprecate_func(
additional_msg=(
"No direct alternative is being provided to drawing individual pulses. But, "
"instructions can be visualized as part of a complete schedule using "
"``qiskit.visualization.pulse_drawer``."
),
since="0.23.0",
package_name="qiskit-terra",
)
@_optionals.HAS_MATPLOTLIB.require_in_call
def draw(
self,
dt: float = 1,
style=None,
filename: Optional[str] = None,
interp_method: Optional[Callable] = None,
scale: float = 1,
plot_all: bool = False,
plot_range: Optional[Tuple[float]] = None,
interactive: bool = False,
table: bool = True,
label: bool = False,
framechange: bool = True,
channels: Optional[List[Channel]] = None,
):
"""Plot the instruction.
Args:
dt: Time interval of samples
style (Optional[SchedStyle]): A style sheet to configure plot appearance
filename: Name required to save pulse image
interp_method: A function for interpolation
scale: Relative visual scaling of waveform amplitudes
plot_all: Plot empty channels
plot_range: A tuple of time range to plot
interactive: When set true show the circuit in a new window
(this depends on the matplotlib backend being used supporting this)
table: Draw event table for supported instructions
label: Label individual instructions
framechange: Add framechange indicators
channels: A list of channel names to plot
Returns:
matplotlib.figure: A matplotlib figure object of the pulse schedule
"""
# pylint: disable=cyclic-import
from qiskit.visualization.pulse.matplotlib import ScheduleDrawer
from qiskit.visualization.utils import matplotlib_close_if_inline

drawer = ScheduleDrawer(style=style)
image = drawer.draw(
self,
dt=dt,
interp_method=interp_method,
scale=scale,
plot_range=plot_range,
plot_all=plot_all,
table=table,
label=label,
framechange=framechange,
channels=channels,
)
if filename:
image.savefig(filename, dpi=drawer.style.dpi, bbox_inches="tight")

matplotlib_close_if_inline(image)
if image and interactive:
image.show()
return image

def __eq__(self, other: "Instruction") -> bool:
"""Check if this Instruction is equal to the `other` instruction.
Expand Down
13 changes: 0 additions & 13 deletions qiskit/visualization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,6 @@
pass_manager_drawer
Pulse Visualizations
====================
.. autosummary::
:toctree: ../stubs/
pulse_drawer
~qiskit.visualization.pulse.IQXStandard
~qiskit.visualization.pulse.IQXSimple
~qiskit.visualization.pulse.IQXDebugging
Timeline Visualizations
=======================
Expand Down Expand Up @@ -285,8 +274,6 @@
from .pass_manager_visualization import pass_manager_drawer
from .pass_manager_visualization import staged_pass_manager_drawer

from .pulse.interpolation import step_wise, linear, cubic_spline
from .pulse.qcstyle import PulseStyle, SchedStyle
from .pulse_v2 import draw as pulse_drawer

from .timeline import draw as timeline_drawer
Expand Down
17 changes: 0 additions & 17 deletions qiskit/visualization/pulse/__init__.py

This file was deleted.

123 changes: 0 additions & 123 deletions qiskit/visualization/pulse/interpolation.py

This file was deleted.

Loading

0 comments on commit 4c4f25b

Please sign in to comment.