diff --git a/qiskit_experiments/framework/backend_data.py b/qiskit_experiments/framework/backend_data.py index d28cba1f20..3eea026cfe 100644 --- a/qiskit_experiments/framework/backend_data.py +++ b/qiskit_experiments/framework/backend_data.py @@ -25,14 +25,17 @@ class BackendData: def __init__(self, backend): """Inits the backend and verifies version""" - warnings.filterwarnings( - "ignore", message=".*qiskit.qobj.pulse_qobj.*", category=DeprecationWarning - ) + self._backend = backend self._v1 = isinstance(backend, BackendV1) self._v2 = isinstance(backend, BackendV2) + if self._v2: - self._parse_additional_data() + with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", message=".*qiskit.qobj.pulse_qobj.*", category=DeprecationWarning + ) + self._parse_additional_data() def _parse_additional_data(self): # data specific parsing not done yet in upstream qiskit diff --git a/releasenotes/notes/primitives_add-1a3bcbb2f189d18e.yaml b/releasenotes/notes/primitives_add-1a3bcbb2f189d18e.yaml index 01877f3abc..7e716ce507 100644 --- a/releasenotes/notes/primitives_add-1a3bcbb2f189d18e.yaml +++ b/releasenotes/notes/primitives_add-1a3bcbb2f189d18e.yaml @@ -7,9 +7,9 @@ upgrade: When only a ``backend`` is set on an experiment, :meth:`qiskit_experiments.framework.BaseExperiment.run` now defaults to wrapping the ``backend`` in a :class:`qiskit_ibm_runtime.SamplerV2` and using that to execute the circuits. A new ``sampler`` argument is also - accepted by ``run()`` to allow for a custom :class:`qiskit.primitives.SamplerV2` + accepted by ``run()`` to allow for a custom :class:`qiskit.primitives.BaseSamplerV2` instance to be used for circuit execution. ``run()`` also accepts a ``backend_run`` option which will cause the old ``backend.run`` path to be used for circuit execution. - However, the ``backend.run()`` method is scheduled to be deprecated by + However, the ``backend.run()`` method is scheduled to be removed from qiskit-ibm-runtime in the near future.