Skip to content

Commit 8e50bec

Browse files
authored
Deprecate pulse and restless related experiments and classes (#1476)
This change deprecates the experiments that rely on scanning the parameters of pulses in pulse gate calibrations. Qiskit 2.0 will remove support for pulse gate calibrations, making these experiments impossible to run. The `Calibrations` and `BasisGateLibrary` classes are also deprecated since they have no use without pulse gate calibrations to track. It is planned that Qiskit Pulse will be moved to Qiskit Dynamics and perhaps the experiments and calibrations can be adapted to that use case for calibrating simulated experiments. For now though, this code is removed from Qiskit Experiments to help with making the package more maintainable. Some additional helper code (like the experiments analysis classes and methods of `BackendTiming` and `BackendData`) are also deprecated. Support for restless experiments is also deprecated with this change. Restless support is distinct from pulse support, but it is deprecated with the same motivation of simplifying the package overall. With improvements in the reliability of IBM Quantum's qubit initialization, circuit exectuion has already become reasonably fast and restless measurements do not add much performance improvement. It is expected that the restless features are little used as there has been no user feedback about them.
1 parent bd05f2a commit 8e50bec

28 files changed

+494
-11
lines changed

docs/manuals/characterization/stark_experiment.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
AC Stark Effect
22
===============
33

4+
.. caution::
5+
6+
The experiments described in this manual are deprecated as of Qiskit
7+
Experiments 0.8 and will be removed in a future release. They rely on Qiskit
8+
Pulse, which is `deprecated in Qiskit SDK
9+
<https://github.com/Qiskit/qiskit/issues/13063>`_, with planned removal in
10+
Qiskit 2.0.
11+
412
When a qubit is driven with an off-resonant tone,
513
the qubit frequency :math:`f_0` is slightly shifted through what is known as the (AC) Stark effect.
614
This technique is sometimes used to characterize qubit properties in the vicinity of
@@ -145,6 +153,14 @@ by a variant of the Hahn-echo pulse sequence [5]_.
145153

146154
%matplotlib inline
147155

156+
import warnings
157+
158+
warnings.filterwarnings(
159+
"ignore",
160+
message=".*Due to the deprecation of Qiskit Pulse.*",
161+
category=DeprecationWarning,
162+
)
163+
148164
from qiskit_experiments.library import StarkRamseyXY
149165
from qiskit import schedule, pulse
150166
from qiskit_ibm_runtime.fake_provider import FakeHanoiV2

docs/manuals/measurement/restless_measurements.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Restless Measurements
22
=====================
33

4+
.. caution::
5+
6+
Support for restless measurements is deprecated as of Qiskit Experiments 0.8
7+
and will be removed in a future version.
8+
49
When running circuits, the qubits are typically reset to the ground state after
510
each measurement to ensure that the next circuit has a well-defined initial state.
611
This can be done passively by waiting several :math:`T_1`-times so that qubits in
@@ -65,6 +70,14 @@ they use always starts with the qubits in the ground state.
6570
.. jupyter-execute::
6671
:hide-code:
6772

73+
import warnings
74+
75+
warnings.filterwarnings(
76+
"ignore",
77+
message=".*Support for restless.*",
78+
category=DeprecationWarning,
79+
)
80+
6881
# Temporary workaround for missing support in Qiskit and qiskit-ibm-runtime
6982
from qiskit_experiments.test.patching import patch_sampler_test_support
7083
patch_sampler_test_support()

docs/tutorials/calibrations.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Calibrations: Schedules and gate parameters from experiments
22
============================================================
33

4+
.. caution::
5+
6+
Support for calibrating pulses is deprecated as of Qiskit Experiments 0.8
7+
and will be removed in a future version. There is no alternative support
8+
path because Qiskit Pulse is `deprecated in Qiskit SDK
9+
<https://github.com/Qiskit/qiskit/issues/13063>`_ with planned removal in
10+
Qiskit 2.0.
11+
412
To produce high fidelity quantum operations, we want to be able to run good gates. The
513
calibration module in Qiskit Experiments allows users to run experiments to find the
614
pulse shapes and parameter values that maximize the fidelity of the resulting quantum
@@ -33,6 +41,17 @@ This automatic updating can also be disabled using the ``auto_update`` flag.
3341
This tutorial requires the :mod:`qiskit_dynamics` package to run simulations.
3442
You can install it with ``python -m pip install qiskit-dynamics``.
3543

44+
.. jupyter-execute::
45+
:hide-code:
46+
47+
import warnings
48+
49+
warnings.filterwarnings(
50+
"ignore",
51+
message=".*Due to the deprecation of Qiskit Pulse.*",
52+
category=DeprecationWarning,
53+
)
54+
3655
.. jupyter-execute::
3756

3857
import pandas as pd

docs/tutorials/data_processor.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ The code below sets up the Rabi experiment.
6868
This tutorial requires the :mod:`qiskit_dynamics` package to run simulations.
6969
You can install it with ``python -m pip install qiskit-dynamics``.
7070

71+
.. jupyter-execute::
72+
:hide-code:
73+
74+
import warnings
75+
76+
warnings.filterwarnings(
77+
"ignore",
78+
message=".*Due to the deprecation of Qiskit Pulse.*",
79+
category=DeprecationWarning,
80+
)
81+
7182
.. jupyter-execute::
7283

7384
import numpy as np

docs/tutorials/visualization.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ First, we display the default figure from a :class:`.Rabi` experiment as a start
3838
:external+qiskit_ibm_runtime:doc:`qiskit-ibm-runtime <index>` packages to run simulations. You can install them
3939
with ``python -m pip install qiskit-dynamics qiskit-aer qiskit-ibm-runtime``.
4040

41+
.. jupyter-execute::
42+
:hide-code:
43+
44+
import warnings
45+
46+
warnings.filterwarnings(
47+
"ignore",
48+
message=".*Due to the deprecation of Qiskit Pulse.*",
49+
category=DeprecationWarning,
50+
)
51+
4152
.. jupyter-execute::
4253

4354
import numpy as np

qiskit_experiments/calibration_management/basis_gate_library.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from qiskit.circuit import Parameter
2626
from qiskit import pulse
2727
from qiskit.pulse import ScheduleBlock
28+
from qiskit.utils.deprecation import deprecate_func
2829

2930
from qiskit_experiments.calibration_management.calibration_key_types import DefaultCalValue
3031
from qiskit_experiments.exceptions import CalibrationError
@@ -39,6 +40,14 @@ class BasisGateLibrary(ABC, Mapping):
3940
# Parameters that do not belong to a schedule, a set of names
4041
__parameters_without_schedule__ = set()
4142

43+
@deprecate_func(
44+
since="0.8",
45+
package_name="qiskit-experiments",
46+
additional_msg=(
47+
"Due to the deprecation of Qiskit Pulse, support for pulse "
48+
"gate calibrations has been deprecated."
49+
),
50+
)
4251
def __init__(
4352
self,
4453
basis_gates: Optional[List[str]] = None,

qiskit_experiments/calibration_management/calibrations.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ class Calibrations:
6363
ScheduleBlock are supported.
6464
"""
6565

66+
@deprecate_func(
67+
since="0.8",
68+
package_name="qiskit-experiments",
69+
additional_msg=(
70+
"Due to the deprecation of Qiskit Pulse, support for pulse "
71+
"gate calibrations has been deprecated."
72+
),
73+
)
6674
def __init__(
6775
self,
6876
coupling_map: Optional[List[List[int]]] = None,

qiskit_experiments/curve_analysis/standard_analysis/resonance.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import lmfit
1818
import numpy as np
1919

20+
from qiskit.utils.deprecation import deprecate_func
21+
2022
import qiskit_experiments.curve_analysis as curve
2123
from qiskit_experiments.framework import Options
2224

@@ -59,6 +61,14 @@ class ResonanceAnalysis(curve.CurveAnalysis):
5961
6062
"""
6163

64+
@deprecate_func(
65+
since="0.8",
66+
package_name="qiskit-experiments",
67+
additional_msg=(
68+
"Due to the deprecation of Qiskit Pulse, experiments and related classses "
69+
"involving pulse gate calibrations like this one have been deprecated."
70+
),
71+
)
6272
def __init__(
6373
self,
6474
name: Optional[str] = None,

qiskit_experiments/framework/backend_data.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class unifies data access for various data fields.
1818
import warnings
1919
from qiskit.providers.models import PulseBackendConfiguration # pylint: disable=no-name-in-module
2020
from qiskit.providers import BackendV1, BackendV2
21+
from qiskit.utils.deprecation import deprecate_func
2122

2223

2324
class BackendData:
@@ -53,6 +54,14 @@ def name(self):
5354
return self._backend.name
5455
return str(self._backend)
5556

57+
@deprecate_func(
58+
since="0.8",
59+
package_name="qiskit-experiments",
60+
additional_msg=(
61+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
62+
"pulse like this one have been deprecated."
63+
),
64+
)
5665
def control_channel(self, qubits):
5766
"""Returns the backend control channel for the given qubits"""
5867
try:
@@ -67,6 +76,14 @@ def control_channel(self, qubits):
6776
return []
6877
return []
6978

79+
@deprecate_func(
80+
since="0.8",
81+
package_name="qiskit-experiments",
82+
additional_msg=(
83+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
84+
"pulse like this one have been deprecated."
85+
),
86+
)
7087
def drive_channel(self, qubit):
7188
"""Returns the backend drive channel for the given qubit"""
7289
try:
@@ -81,6 +98,14 @@ def drive_channel(self, qubit):
8198
return None
8299
return None
83100

101+
@deprecate_func(
102+
since="0.8",
103+
package_name="qiskit-experiments",
104+
additional_msg=(
105+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
106+
"pulse like this one have been deprecated."
107+
),
108+
)
84109
def measure_channel(self, qubit):
85110
"""Returns the backend measure channel for the given qubit"""
86111
try:
@@ -95,6 +120,14 @@ def measure_channel(self, qubit):
95120
return None
96121
return None
97122

123+
@deprecate_func(
124+
since="0.8",
125+
package_name="qiskit-experiments",
126+
additional_msg=(
127+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
128+
"pulse like this one have been deprecated."
129+
),
130+
)
98131
def acquire_channel(self, qubit):
99132
"""Returns the backend acquire channel for the given qubit"""
100133
try:
@@ -122,6 +155,15 @@ def granularity(self):
122155
return 1
123156

124157
@property
158+
@deprecate_func(
159+
since="0.8",
160+
package_name="qiskit-experiments",
161+
is_property=True,
162+
additional_msg=(
163+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
164+
"pulse like this one have been deprecated."
165+
),
166+
)
125167
def min_length(self):
126168
"""Returns the backend's time constraint minimum duration"""
127169
try:
@@ -134,6 +176,15 @@ def min_length(self):
134176
return 0
135177

136178
@property
179+
@deprecate_func(
180+
since="0.8",
181+
package_name="qiskit-experiments",
182+
is_property=True,
183+
additional_msg=(
184+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
185+
"pulse like this one have been deprecated."
186+
),
187+
)
137188
def pulse_alignment(self):
138189
"""Returns the backend's time constraint pulse alignment"""
139190
try:
@@ -146,6 +197,15 @@ def pulse_alignment(self):
146197
return 1
147198

148199
@property
200+
@deprecate_func(
201+
since="0.8",
202+
package_name="qiskit-experiments",
203+
is_property=True,
204+
additional_msg=(
205+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
206+
"pulse like this one have been deprecated."
207+
),
208+
)
149209
def acquire_alignment(self):
150210
"""Returns the backend's time constraint acquire alignment"""
151211
try:
@@ -212,6 +272,15 @@ def provider(self):
212272
return None
213273

214274
@property
275+
@deprecate_func(
276+
since="0.8",
277+
package_name="qiskit-experiments",
278+
is_property=True,
279+
additional_msg=(
280+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
281+
"pulse like this one have been deprecated."
282+
),
283+
)
215284
def drive_freqs(self):
216285
"""Returns the backend's qubit drive frequencies"""
217286
if self._v1:
@@ -223,6 +292,15 @@ def drive_freqs(self):
223292
return []
224293

225294
@property
295+
@deprecate_func(
296+
since="0.8",
297+
package_name="qiskit-experiments",
298+
is_property=True,
299+
additional_msg=(
300+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
301+
"pulse like this one have been deprecated."
302+
),
303+
)
226304
def meas_freqs(self):
227305
"""Returns the backend's measurement stimulus frequencies.
228306

qiskit_experiments/framework/backend_timing.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from qiskit import QiskitError
1818
from qiskit.providers.backend import Backend
19+
from qiskit.utils.deprecation import deprecate_func
1920

2021
from qiskit_experiments.framework import BackendData
2122

@@ -283,6 +284,14 @@ def round_delay(
283284

284285
return samples_out
285286

287+
@deprecate_func(
288+
since="0.8",
289+
package_name="qiskit-experiments",
290+
additional_msg=(
291+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
292+
"pulse like this one have been deprecated."
293+
),
294+
)
286295
def round_pulse(
287296
self, *, time: Optional[float] = None, samples: Optional[Union[int, float]] = None
288297
) -> int:
@@ -363,6 +372,14 @@ def delay_time(
363372

364373
return self.dt * self.round_delay(time=time, samples=samples)
365374

375+
@deprecate_func(
376+
since="0.8",
377+
package_name="qiskit-experiments",
378+
additional_msg=(
379+
"Due to the deprecation of Qiskit Pulse, utility functions involving "
380+
"pulse like this one have been deprecated."
381+
),
382+
)
366383
def pulse_time(
367384
self, *, time: Optional[float] = None, samples: Optional[Union[int, float]] = None
368385
) -> float:

0 commit comments

Comments
 (0)