diff --git a/docs/manuals/characterization/stark_experiment.rst b/docs/manuals/characterization/stark_experiment.rst index 6819d4272a..68e51d353e 100644 --- a/docs/manuals/characterization/stark_experiment.rst +++ b/docs/manuals/characterization/stark_experiment.rst @@ -1,6 +1,14 @@ AC Stark Effect =============== +.. caution:: + + The experiments described in this manual are deprecated as of Qiskit + Experiments 0.8 and will be removed in a future release. They rely on Qiskit + Pulse, which is `deprecated in Qiskit SDK + `_, with planned removal in + Qiskit 2.0. + When a qubit is driven with an off-resonant tone, the qubit frequency :math:`f_0` is slightly shifted through what is known as the (AC) Stark effect. This technique is sometimes used to characterize qubit properties in the vicinity of diff --git a/docs/manuals/measurement/restless_measurements.rst b/docs/manuals/measurement/restless_measurements.rst index 379d5fe391..9f7e6078cf 100644 --- a/docs/manuals/measurement/restless_measurements.rst +++ b/docs/manuals/measurement/restless_measurements.rst @@ -1,6 +1,11 @@ Restless Measurements ===================== +.. caution:: + + Support for restless measurements is deprecated as of Qiskit Experiments 0.8 + and will be removed in a future version. + When running circuits, the qubits are typically reset to the ground state after each measurement to ensure that the next circuit has a well-defined initial state. This can be done passively by waiting several :math:`T_1`-times so that qubits in diff --git a/docs/tutorials/calibrations.rst b/docs/tutorials/calibrations.rst index 1412d94a8a..377a9dfb0c 100644 --- a/docs/tutorials/calibrations.rst +++ b/docs/tutorials/calibrations.rst @@ -1,6 +1,14 @@ Calibrations: Schedules and gate parameters from experiments ============================================================ +.. caution:: + + Support for calibrating pulses is deprecated as of Qiskit Experiments 0.8 + and will be removed in a future version. There is no alternative support + path because Qiskit Pulse is `deprecated in Qiskit SDK + `_ with planned removal in + Qiskit 2.0. + To produce high fidelity quantum operations, we want to be able to run good gates. The calibration module in Qiskit Experiments allows users to run experiments to find the pulse shapes and parameter values that maximize the fidelity of the resulting quantum diff --git a/qiskit_experiments/curve_analysis/standard_analysis/resonance.py b/qiskit_experiments/curve_analysis/standard_analysis/resonance.py index 375b4cc166..156f92d1d2 100644 --- a/qiskit_experiments/curve_analysis/standard_analysis/resonance.py +++ b/qiskit_experiments/curve_analysis/standard_analysis/resonance.py @@ -17,6 +17,8 @@ import lmfit import numpy as np +from qiskit.utils.deprecation import deprecate_func + import qiskit_experiments.curve_analysis as curve from qiskit_experiments.framework import Options @@ -59,6 +61,14 @@ class ResonanceAnalysis(curve.CurveAnalysis): """ + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, experiments and related classses " + "involving pulse gate calibrations like this one have been deprecated." + ), + ) def __init__( self, name: Optional[str] = None, diff --git a/qiskit_experiments/framework/backend_data.py b/qiskit_experiments/framework/backend_data.py index d28cba1f20..b9e5eb52ae 100644 --- a/qiskit_experiments/framework/backend_data.py +++ b/qiskit_experiments/framework/backend_data.py @@ -18,6 +18,7 @@ class unifies data access for various data fields. import warnings from qiskit.providers.models import PulseBackendConfiguration # pylint: disable=no-name-in-module from qiskit.providers import BackendV1, BackendV2 +from qiskit.utils.deprecation import deprecate_func class BackendData: @@ -50,6 +51,14 @@ def name(self): return self._backend.name return str(self._backend) + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def control_channel(self, qubits): """Returns the backend control channel for the given qubits""" try: @@ -64,6 +73,14 @@ def control_channel(self, qubits): return [] return [] + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def drive_channel(self, qubit): """Returns the backend drive channel for the given qubit""" try: @@ -78,6 +95,14 @@ def drive_channel(self, qubit): return None return None + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def measure_channel(self, qubit): """Returns the backend measure channel for the given qubit""" try: @@ -92,6 +117,14 @@ def measure_channel(self, qubit): return None return None + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def acquire_channel(self, qubit): """Returns the backend acquire channel for the given qubit""" try: @@ -119,6 +152,15 @@ def granularity(self): return 1 @property + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + is_property=True, + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def min_length(self): """Returns the backend's time constraint minimum duration""" try: @@ -131,6 +173,15 @@ def min_length(self): return 0 @property + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + is_property=True, + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def pulse_alignment(self): """Returns the backend's time constraint pulse alignment""" try: @@ -143,6 +194,15 @@ def pulse_alignment(self): return 1 @property + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + is_property=True, + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def acquire_alignment(self): """Returns the backend's time constraint acquire alignment""" try: @@ -209,6 +269,15 @@ def provider(self): return None @property + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + is_property=True, + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def drive_freqs(self): """Returns the backend's qubit drive frequencies""" if self._v1: @@ -220,6 +289,15 @@ def drive_freqs(self): return [] @property + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + is_property=True, + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def meas_freqs(self): """Returns the backend's measurement stimulus frequencies. diff --git a/qiskit_experiments/framework/backend_timing.py b/qiskit_experiments/framework/backend_timing.py index 523971391b..0eea6fce67 100644 --- a/qiskit_experiments/framework/backend_timing.py +++ b/qiskit_experiments/framework/backend_timing.py @@ -16,6 +16,7 @@ from qiskit import QiskitError from qiskit.providers.backend import Backend +from qiskit.utils.deprecation import deprecate_func from qiskit_experiments.framework import BackendData @@ -283,6 +284,14 @@ def round_delay( return samples_out + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def round_pulse( self, *, time: Optional[float] = None, samples: Optional[Union[int, float]] = None ) -> int: @@ -363,6 +372,14 @@ def delay_time( return self.dt * self.round_delay(time=time, samples=samples) + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, utility functions involving " + "pulse like this one have been deprecated." + ), + ) def pulse_time( self, *, time: Optional[float] = None, samples: Optional[Union[int, float]] = None ) -> float: diff --git a/qiskit_experiments/library/characterization/analysis/cr_hamiltonian_analysis.py b/qiskit_experiments/library/characterization/analysis/cr_hamiltonian_analysis.py index 9fa793600d..2d1a41f624 100644 --- a/qiskit_experiments/library/characterization/analysis/cr_hamiltonian_analysis.py +++ b/qiskit_experiments/library/characterization/analysis/cr_hamiltonian_analysis.py @@ -15,6 +15,8 @@ from typing import List, Dict import numpy as np +from qiskit.utils.deprecation import deprecate_func + import qiskit_experiments.curve_analysis as curve from qiskit_experiments.framework import AnalysisResultData from qiskit_experiments.visualization import PlotStyle @@ -44,6 +46,14 @@ class CrossResonanceHamiltonianAnalysis(curve.CompositeCurveAnalysis): """ + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, experiments and related classses " + "involving pulse gate calibrations like this one have been deprecated." + ), + ) def __init__(self): analyses = [] for control_state in (0, 1): diff --git a/qiskit_experiments/library/characterization/analysis/drag_analysis.py b/qiskit_experiments/library/characterization/analysis/drag_analysis.py index 351349ec08..33093be1e9 100644 --- a/qiskit_experiments/library/characterization/analysis/drag_analysis.py +++ b/qiskit_experiments/library/characterization/analysis/drag_analysis.py @@ -13,11 +13,13 @@ """DRAG pulse calibration experiment.""" import warnings -from typing import List, Union +from typing import List, Optional, Union import lmfit import numpy as np +from qiskit.utils.deprecation import deprecate_func + import qiskit_experiments.curve_analysis as curve from qiskit_experiments.framework import ExperimentData from qiskit_experiments.exceptions import AnalysisError @@ -253,3 +255,33 @@ def _initialize( self._options.data_subfit_map = data_subfit_map super()._initialize(experiment_data) + + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, experiments and related classses " + "involving pulse gate calibrations like this one have been deprecated." + ), + ) + def __init__( + self, + models: Optional[List[lmfit.Model]] = None, + name: Optional[str] = None, + ): + """Initialize data fields that are privately accessed by methods. + + Args: + models: List of LMFIT ``Model`` class to define fitting functions and + parameters. If multiple models are provided, the analysis performs + multi-objective optimization where the parameters with the same name + are shared among provided models. When multiple models are provided, + user must specify the ``data_subfit_map`` value in the analysis options + to allocate experimental results to a particular fit model. + name: Optional. Name of this analysis. + """ + super().__init__() + + self._models = models or [] + self._name = name or self.__class__.__name__ + self._plot_config_cache = {} diff --git a/qiskit_experiments/library/characterization/analysis/resonator_spectroscopy_analysis.py b/qiskit_experiments/library/characterization/analysis/resonator_spectroscopy_analysis.py index fa2fc44661..6fecffe2f2 100644 --- a/qiskit_experiments/library/characterization/analysis/resonator_spectroscopy_analysis.py +++ b/qiskit_experiments/library/characterization/analysis/resonator_spectroscopy_analysis.py @@ -12,9 +12,11 @@ """Spectroscopy analysis class for resonators.""" -from typing import List, Tuple +from typing import List, Optional, Tuple import numpy as np +from qiskit.utils.deprecation import deprecate_func + import qiskit_experiments.curve_analysis as curve from qiskit_experiments.framework import AnalysisResultData, ExperimentData from qiskit_experiments.framework.matplotlib import get_non_gui_ax @@ -25,6 +27,20 @@ class ResonatorSpectroscopyAnalysis(curve.ResonanceAnalysis): """Class to analysis resonator spectroscopy.""" + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, experiments and related classses " + "involving pulse gate calibrations like this one have been deprecated." + ), + ) + def __init__( + self, + name: Optional[str] = None, + ): + super().__init__(name=name) + @classmethod def _default_options(cls): """Return default analysis options. diff --git a/qiskit_experiments/library/driven_freq_tuning/p1_spect_analysis.py b/qiskit_experiments/library/driven_freq_tuning/p1_spect_analysis.py index 857f440bb8..154f0715aa 100644 --- a/qiskit_experiments/library/driven_freq_tuning/p1_spect_analysis.py +++ b/qiskit_experiments/library/driven_freq_tuning/p1_spect_analysis.py @@ -16,6 +16,8 @@ import numpy as np from uncertainties import unumpy as unp +from qiskit.utils.deprecation import deprecate_func + import qiskit_experiments.data_processing as dp import qiskit_experiments.visualization as vis from qiskit_experiments.data_processing.exceptions import DataProcessorError @@ -48,6 +50,20 @@ class StarkP1SpectAnalysis(BaseAnalysis): """ + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, experiments and related classses " + "involving pulse gate calibrations like this one have been deprecated." + ), + ) + def __init__(self): + """Initialize the analysis object.""" + # Pass through to parent. This method is only here to be decorated by + # deprecate_func + super().__init__() + @property def plotter(self) -> vis.CurvePlotter: """Curve plotter instance.""" diff --git a/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan_analysis.py b/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan_analysis.py index bde5750c32..fb24772514 100644 --- a/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan_analysis.py +++ b/qiskit_experiments/library/driven_freq_tuning/ramsey_amp_scan_analysis.py @@ -19,6 +19,8 @@ import numpy as np from uncertainties import unumpy as unp +from qiskit.utils.deprecation import deprecate_func + import qiskit_experiments.curve_analysis as curve import qiskit_experiments.visualization as vis from qiskit_experiments.framework import ExperimentData, AnalysisResultData @@ -154,6 +156,14 @@ class StarkRamseyXYAmpScanAnalysis(curve.CurveAnalysis): """ + @deprecate_func( + since="0.8", + package_name="qiskit-experiments", + additional_msg=( + "Due to the deprecation of Qiskit Pulse, experiments and related classses " + "involving pulse gate calibrations like this one have been deprecated." + ), + ) def __init__(self): models = [ diff --git a/releasenotes/notes/deprecate-pulse-2a13fc783985ac27.yaml b/releasenotes/notes/deprecate-pulse-2a13fc783985ac27.yaml index e720b04b81..262dfd94f9 100644 --- a/releasenotes/notes/deprecate-pulse-2a13fc783985ac27.yaml +++ b/releasenotes/notes/deprecate-pulse-2a13fc783985ac27.yaml @@ -17,7 +17,7 @@ deprecations: - | Also due to the deprecation of Qiskit Pulse, support for providing pulse gate calibrations to excite higher levels has been deprecated from - :class:`qiskit_experiments.library.MultiStateDiscrimination`. + :class:`.MultiStateDiscrimination`. - | The ``Calibrations`` class and all of Qiskit Experiments' calibration support is deprecated. The calibrations features were based on adjusting