Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update calibration and mixin tests to work with BackendV2 #900

Merged
merged 13 commits into from
Mar 27, 2023
4 changes: 2 additions & 2 deletions qiskit_experiments/calibration_management/calibrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ def from_backend(
)

if add_parameter_defaults:
for qubit, freq in enumerate(backend_data.drive_freqs):
for qubit, freq in enumerate(getattr(backend.defaults(), "qubit_freq_est", [])):
Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add TODO comment so that not to forget? I think we should upgrade "IBM" V2 model properly. When we designed the QubitProperty class, we tried to avoid adding superconducting technology specific properties, so that terra is technology agnostic. We expected IBM provider to override this class to return cavity frequency and anharmonicity, and actually it returns IBMQubitProperty. However, cavity frequency is currently missing. And I'm not sure if this is the right place to report readout frequency. I wrote an issue in the provider and hope you will add some comment to Qiskit/qiskit-ibm-provider#387

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the TODO for? Removing usage of backend.defaults()? Maybe we should revisit this after more discussion of your next comment about drive_freqs and Qiskit/qiskit-ibm-provider#387.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .congirutation() and .properties() in BackendV2 are something temporary for migration and will be deprecated gradually, @mtreinish ? So I don't want to permanently introduce .defaults().

cals.add_parameter_value(freq, cals.drive_freq, qubit, update_inst_map=False)

for meas, freq in enumerate(backend_data.meas_freqs):
for meas, freq in enumerate(getattr(backend.defaults(), "meas_freq_est", [])):
cals.add_parameter_value(freq, cals.meas_freq, meas, update_inst_map=False)

# Update the instruction schedule map after adding all parameter values.
Expand Down
38 changes: 15 additions & 23 deletions qiskit_experiments/framework/backend_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,29 +205,6 @@ def provider(self):
return None
return None

@property
def drive_freqs(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to delete these methods. meas_freqs has note about missing frequency, and I think this is sufficient to communicate with users. Actually I don't like V1 model, because we have qubit frequencies in three places, i.e. backend.defaults().qubit_freq_est, backend.properties().qubit_properties(), and backend.configuration().hamiltonian. This method unifies where to get frequency, and good for novice developers.

Probably we can update API so that this can take index of target element -- like t1 method you implemented.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that confuses me is the role of PulseDefaults now. I opened #877 about this. BackendData provides compatibility between V1 and V2, but defaults() is not in the base class for either V1 or V2. It is in the IBM classes for both V1 and V2. I think the IBM provider is the only one that implements qiskit pulse support, so it is hard to distinguish between what is IBM-specific and what is pulse-specific. I think it is fair for experiments referencing the drive frequencies to use pulse-specific API's (and so probably fair to use defaults() unless all of its utility is supposed to be moved to Target).

I don't think it is worth giving up access to the measurement frequencies when using V2 because the measurement frequencies are still available in the same place we have been referencing for V1.

Moving away from defaults() seems fine if that is the direction that we are supposed to go. It might be better to do that in a separate step from initial V2 compatibility. This is a little pedantic but I think the frequencies should live in two places. One place (like backend.properties()) can hold resonant frequencies of the device and the other (like backend.defaults() or maybe backend.target in the future) can hold frequencies used by the control electronics. For IBM superconducting transmon qubits, readout is done by coupling to a resonator whose frequency changes (by 2 chi) depending on the state of the qubit. Typically readout is done by driving half-way in between these two frequencies. There is less distinction for qubits but even there for finite ZZ one needs to decide to drive at the frequency of the qubit with its neighbors in 0 or with them in 0+1.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One reason my last comment is pedantic -- while in calibrations we are interested in determining the frequencies at which to drive the control and measurement tones, all of the usages of drive_freqs/meas_freqs currently are rough numbers -- used either to set default frequencies for calibrations and center frequencies for spectroscopy. The resonant frequencies are probably good enough as starting points.

Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One place (like backend.properties()) can hold resonant frequencies of the device and the other (like backend.defaults() or maybe backend.target in the future) can hold frequencies used by the control electronics.

This is good point. We also need to think about how dynamics simulator consumes this backend to build a device Hamiltonian. Thus clear separation of device parameters from the control parameters is reasonable way to go.

I'm also fine with doing this in two steps as you suggest, namely re-introducing the defaults in IBM V2 backends. What I really don't like is the separation of device vs control parameter is not clear in these objects. I think we need the refactoring of data structure with V2.

(edit) I think BackendData is the place where we can introduce this context to some extent, without future breaking API change.

"""Returns the backend's qubit drive frequencies"""
if self._v1:
return getattr(self._backend.defaults(), "qubit_freq_est", [])
elif self._v2:
return [property.frequency for property in self._backend.target.qubit_properties]
return []

@property
def meas_freqs(self):
"""Returns the backend's measurement stimulus frequencies.

.. note::
Currently BackendV2 does not have access to this data.
"""
if self._v1:
return getattr(self._backend.defaults(), "meas_freq_est", [])
elif self._v2:
# meas_freq_est is currently not part of the BackendV2
return []
return []

@property
def num_qubits(self):
"""Returns the backend's number of qubits"""
Expand Down Expand Up @@ -255,3 +232,18 @@ def is_simulator(self):
return True

return False

def qubit_t1(self, qubit: int) -> float:
"""Return the T1 value for a qubit from the backend properties

Args:
qubit: the qubit index to return T1 for

Returns:
The T1 value
"""
if self._v1:
return self._backend.properties().qubit_property(qubit)["T1"][0]
if self._v2:
return self._backend.qubit_properties(0).t1
wshanks marked this conversation as resolved.
Show resolved Hide resolved
return float("nan")
2 changes: 1 addition & 1 deletion qiskit_experiments/framework/restless_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def _t1_check(self, rep_delay: float) -> bool:

try:
t1_values = [
self._backend.properties().qubit_property(physical_qubit)["T1"][0]
self._backend_data.qubit_t1(physical_qubit)
for physical_qubit in self._physical_qubits
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _backend_center_frequency(self) -> float:
if self.backend is None:
raise QiskitError("backend not set. Cannot determine the center frequency.")

return self._backend_data.drive_freqs[self.physical_qubits[0]]
return self.backend.defaults().qubit_freq_est[self.physical_qubits[0]]

def _template_circuit(self, freq_param) -> QuantumCircuit:
"""Return the template quantum circuit."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from qiskit.providers import Backend
import qiskit.pulse as pulse

from qiskit_experiments.framework import Options, BackendData
from qiskit_experiments.framework import Options
from qiskit_experiments.library.characterization.spectroscopy import Spectroscopy
from .analysis.resonator_spectroscopy_analysis import ResonatorSpectroscopyAnalysis

Expand Down Expand Up @@ -138,7 +138,7 @@ def __init__(
"Cannot automatically compute absolute frequencies without a backend."
)

center_freq = BackendData(backend).meas_freqs[qubit]
center_freq = backend.defaults().meas_freqs_est[qubit]
frequencies += center_freq

super().__init__(qubit, frequencies, backend, absolute, analysis, **experiment_options)
Expand All @@ -156,7 +156,7 @@ def _backend_center_frequency(self) -> float:
if self.backend is None:
raise QiskitError("backend not set. Cannot call center_frequency.")

return self._backend_data.meas_freqs[self.physical_qubits[0]]
return self.backend.defaults().meas_freq_est[self.physical_qubits[0]]

def _template_circuit(self) -> QuantumCircuit:
"""Return the template quantum circuit."""
Expand Down
55 changes: 55 additions & 0 deletions qiskit_experiments/test/fake_pulse_backends.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Fake backend class for tests."""

from qiskit.exceptions import QiskitError
from qiskit.providers.fake_provider import FakeArmonkV2, FakeAthensV2, FakeBelemV2
from qiskit.providers.models import PulseDefaults
from qiskit.providers.fake_provider.utils.json_decoder import decode_pulse_defaults


class PulseDefaultsMixin:
"""Mixin class to add defaults() to a fake backend

In particular, this class works with
``qiskit.providers.fake_provider.fake_backend.FakeBackendV2`` classes that
have a ``defs_filename`` attribute with the path to a pulse defaults json
file.
"""

_defaults = None

def defaults(self):
"""Returns a snapshot of device defaults"""
if not self._defaults:
self._set_defaults_from_json()
return self._defaults

def _set_defaults_from_json(self):
if not self.props_filename:
raise QiskitError("No properties file has been defined")
defs = self._load_json(self.defs_filename)
decode_pulse_defaults(defs)
self._defaults = PulseDefaults.from_dict(defs)


class FakeArmonkV2Pulse(FakeArmonkV2, PulseDefaultsMixin):
"""FakeArmonkV2 with pulse defaults"""


class FakeAthensV2Pulse(FakeAthensV2, PulseDefaultsMixin):
"""FakeAthensV2 with pulse defaults"""


class FakeBelemV2Pulse(FakeBelemV2, PulseDefaultsMixin):
"""FakeBelemV2 with pulse defaults"""
48 changes: 45 additions & 3 deletions qiskit_experiments/test/mock_iq_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
import numpy as np

from qiskit import QuantumCircuit
from qiskit.circuit.library import XGate, SXGate
from qiskit.result import Result
from qiskit.providers.fake_provider import FakeOpenPulse2Q
from qiskit.providers.fake_provider.fake_backend import FakeBackendV2

from qiskit.qobj.utils import MeasLevel
from qiskit_experiments.exceptions import QiskitError
Expand All @@ -31,7 +33,46 @@
)


class MockRestlessBackend(FakeOpenPulse2Q):
class FakeOpenPulse2QV2(FakeBackendV2):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about the reason not to use BackendV2Converter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main reason is that I started this PR before it existed. I wonder if it would work or would suffer from the issues that I hack around below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this:

from qiskit.providers.fake_provider import FakeOpenPulse2Q
from qiskit.providers.backend_compat import BackendV2Converter

class FakeOpenPulse2QV2(BackendV2Converter):
    def __init__(self):
        v1backend = FakeOpenPulse2Q()
        super().__init__(v1backend)

but I encountered several test errors. A lot of them were this problem:

  File "/home/wshanks/Documents/Code/qiskit-experiments/test/library/characterization/test_half_angle.py", line 39, in test_end_to_end
    exp_data = hac.run(backend)                                                                                                                                
  File "/home/wshanks/Documents/Code/qiskit-experiments/qiskit_experiments/framework/base_experiment.py", line 238, in run
    transpiled_circuits = experiment._transpiled_circuits()                                                                                                    
  File "/home/wshanks/Documents/Code/qiskit-experiments/qiskit_experiments/framework/base_experiment.py", line 319, in _transpiled_circuits
    transpiled = transpile(self.circuits(), self.backend, **transpile_opts)                                                                                    
  File "/home/wshanks/.conda/envs/qiskit/lib/python3.10/site-packages/qiskit/compiler/transpiler.py", line 326, in transpile
    unique_transpile_args, shared_args = _parse_transpile_args(                                                                                                
  File "/home/wshanks/.conda/envs/qiskit/lib/python3.10/site-packages/qiskit/compiler/transpiler.py", line 656, in _parse_transpile_args                       
    inst_map = _parse_inst_map(inst_map, backend)                                                                                                              
  File "/home/wshanks/.conda/envs/qiskit/lib/python3.10/site-packages/qiskit/compiler/transpiler.py", line 818, in _parse_inst_map                             
    inst_map = backend.target.instruction_schedule_map()                                                                                                       
  File "/home/wshanks/.conda/envs/qiskit/lib/python3.10/site-packages/qiskit/providers/backend_compat.py", line 244, in target                                 
    self._target = convert_to_target(                                                                                                                          
  File "/home/wshanks/.conda/envs/qiskit/lib/python3.10/site-packages/qiskit/providers/backend_compat.py", line 87, in convert_to_target                       
    duration=properties.readout_length(qubit),                                                                                                                 
  File "/home/wshanks/.conda/envs/qiskit/lib/python3.10/site-packages/qiskit/providers/models/backendproperties.py", line 453, in readout_length
    return self.qubit_property(qubit, "readout_length")[0]  # Throw away datetime at index 1                                                    
  File "/home/wshanks/.conda/envs/qiskit/lib/python3.10/site-packages/qiskit/providers/models/backendproperties.py", line 389, in qubit_property
    raise BackendPropertyError(                                                                                                                                
qiskit.providers.exceptions.BackendPropertyError: "Couldn't find the property 'readout_length' for qubit 0." 

FakeBackendV2 follows a different code path from BackendConverter. They use different convert_to_target functions. BackendConverter assumes that readout_length is in the properties here:

https://github.com/Qiskit/qiskit-terra/blob/a1a67a11741000f8f3b6d6a8766dab7e3cd06847/qiskit/providers/backend_compat.py#L86-L89

while FakeBackendV2 checks for readout_length but does not error if it is not there:

https://github.com/Qiskit/qiskit-terra/blob/a1a67a11741000f8f3b6d6a8766dab7e3cd06847/qiskit/providers/fake_provider/utils/backend_converter.py#L80-L85

I tried working around that with this (thisi is also working around errors from description and max_experiments being missing):

from qiskit.providers.fake_provider import FakeOpenPulse2Q
from qiskit.providers.backend_compat import BackendV2Converter


class FakeOpenPulse2QV2(BackendV2Converter):
    def __init__(self):
        backend_v1 = FakeOpenPulse2Q()
        backend_v1.configuration().description = "FakeOpenPulse2Q"
        backend_v1.configuration().max_experiments = 100
        cmd_def = backend_v1.defaults().cmd_def
        measure = next(c for c in cmd_def if c.name == "measure")
        readout_length = max(getattr(i, "duration", 0) for i in measure.sequence)
        for qubit in backend_v1._properties._qubits.values():
            qubit["readout_length"] = (readout_length * backend_v1.configuration().dt, qubit["readout_error"][1])
        super().__init__(backend_v1, add_delay=True)
        self._defaults = backend_v1._defaults

but I still had further errors. The next one that needed to be addressed was that u2 and id were in the basis gates but not in the properties which led to an error in a transpiler pass.

At that point, I decided it was more trouble than it was worth to get this working. Maybe BackendConverter should be more robust, but likely FakeOpenPulse2Q just does not have complete enough metadata to match what is expected of a BackendV1 instance. We could fix that but likely it would be better just to make a BackendV2 equivalent class directly in terra.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Will. This is good to know. I agree we should have Fake V2 in Terra in future.

"""BackendV2 version of FakeOpenPulse2Q"""

def __init__(self):
# FakeOpenPulse2Q has its data hard-coded rather than in json files. We
# prepopulate the dicts so that FakeBackendV2 does not try to load them
# from files.
#
# We have to use a hack to populate _conf_dict
backend_v1 = FakeOpenPulse2Q()
self._conf_dict_real = backend_v1._configuration.to_dict()
super().__init__()
self._props_dict = backend_v1._properties.to_dict()
self._defs_dict = backend_v1._defaults.to_dict()
self._defaults = backend_v1._defaults

# Workaround a bug in FakeOpenPulse2Q. It defines u1 on qubit 1 in the
# cmd_def in the defaults json file but not in the gates in the
wshanks marked this conversation as resolved.
Show resolved Hide resolved
# properties json. The code FakeBackendV2 uses to build the Target
wshanks marked this conversation as resolved.
Show resolved Hide resolved
# assumes these two are consistent.
u1_0 = next(g for g in self._props_dict["gates"] if g["gate"] == "u1")
self._props_dict["gates"].append(u1_0.copy())
self._props_dict["gates"][-1]["qubits"] = [1]

@property
def _conf_dict(self):
# FakeBackendV2 sets this in __init__. As a hack, we use this property
# to prevent it from overriding our values.
return self._conf_dict_real

@_conf_dict.setter
def _conf_dict(self, value):
pass

def defaults(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this method is not provided by the provider, I'm not sure if this is really right approach. Actually this mixin generates the mixture of V1 and V2 model, which will never exist outside the QE -- so I'm not sure what is tested by this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaults() is not in the BackendV1 or BackendV2 base classes but it is the BackendV1 and BackendV2 subclasses produced by qiskit-ibmq-provider and qiskit-ibm-provider. The main thing that changed is that fake BackendV1 classes in terra implement defaults() while the BackendV2 versions do not, so switching the tests to the V2 versions required addressing the defaults() issue. The classes hold all the PulseDefaults data. They just don't expose it through defaults(). This is why there is so little code in fake_pulse_backends.py.

I think we could probably make a PR to terra to add FakeOpenPulse2QV2 directly and remove the need for the hacks here (other than adding defaults() back like fake_pulse_backends.py).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could probably make a PR to terra to add FakeOpenPulse2QV2 directly and remove the need for the hacks here (other than adding defaults() back like fake_pulse_backends.py).

Yes, I think updating terra code (probably provider too) is proper direction. Otherwise, we cannot get defaults data set once we switch to actual V2 backends.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry I didn't notice IBM V2 backend reports defaults object. So what you are doing seems right. We just need to update FakeV2 backends based on IBM one in terra.

https://github.com/Qiskit/qiskit-ibm-provider/blob/06490ab5ccfabc1ceae79bc3e8ba3f8bb82296fa/qiskit_ibm_provider/ibm_backend.py#L714-L735

"""Pulse defaults"""
return self._defaults


class MockRestlessBackend(FakeOpenPulse2QV2):
"""An abstract backend for testing that can mock restless data."""

def __init__(self, rng_seed: int = 0):
Expand Down Expand Up @@ -144,7 +185,8 @@ def __init__(
self._angle_per_gate = angle_per_gate
super().__init__(rng_seed=rng_seed)

self.configuration().basis_gates.extend(["sx", "x"])
self.target.add_instruction(SXGate(), properties={(0,): None})
self.target.add_instruction(XGate(), properties={(0,): None})

def _compute_outcome_probabilities(self, circuits: List[QuantumCircuit]):
"""Compute the probabilities of being in the excited state or
Expand All @@ -170,7 +212,7 @@ def _compute_outcome_probabilities(self, circuits: List[QuantumCircuit]):
self._precomputed_probabilities[(idx, "01")] = [prob_1, prob_0, 0, 0]


class MockIQBackend(FakeOpenPulse2Q):
class MockIQBackend(FakeOpenPulse2QV2):
"""A mock backend for testing with IQ data."""

def __init__(
Expand Down
24 changes: 12 additions & 12 deletions test/calibration/test_calibrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
from qiskit import transpile, QuantumCircuit
from qiskit.pulse.transforms import inline_subroutines, block_to_schedule
import qiskit.pulse as pulse
from qiskit.providers.fake_provider import FakeArmonkV2, FakeBelemV2
from qiskit_experiments.framework import BackendData
from qiskit_experiments.calibration_management.calibrations import Calibrations, ParameterKey
from qiskit_experiments.calibration_management.parameter_value import ParameterValue
from qiskit_experiments.calibration_management.basis_gate_library import FixedFrequencyTransmon
from qiskit_experiments.exceptions import CalibrationError
from qiskit_experiments.test.fake_pulse_backends import FakeArmonkV2Pulse, FakeBelemV2Pulse


class TestCalibrationsBasic(QiskitExperimentsTestCase):
Expand Down Expand Up @@ -274,7 +274,7 @@ def test_qubit_input(self):
def test_from_backend(self):
"""Test that when generating calibrations from backend
the data is passed correctly"""
backend = FakeBelemV2()
backend = FakeBelemV2Pulse()
cals = Calibrations.from_backend(backend)
config_args = cals.config()["kwargs"]
control_channel_map_size = len(config_args["control_channel_map"].chan_map)
Expand Down Expand Up @@ -1446,7 +1446,7 @@ def test_save_load_library(self):
"""

library = FixedFrequencyTransmon()
backend = FakeArmonkV2()
backend = FakeArmonkV2Pulse()
cals = Calibrations.from_backend(backend, libraries=[library])

cals.parameters_table()
Expand All @@ -1459,7 +1459,7 @@ def test_save_load_library(self):
self.assertEqual(cals.get_parameter_value("amp", (0,), "x"), 0.5)
self.assertEqual(
cals.get_parameter_value("drive_freq", (0,)),
BackendData(backend).drive_freqs[0],
backend.defaults().qubit_freq_est[0],
)


Expand All @@ -1470,7 +1470,7 @@ def test_setup_withLibrary(self):
"""Test that we can setup with a library."""

cals = Calibrations.from_backend(
FakeArmonkV2(),
FakeArmonkV2Pulse(),
libraries=[
FixedFrequencyTransmon(basis_gates=["x", "sx"], default_values={"duration": 320})
],
Expand All @@ -1491,7 +1491,7 @@ def test_setup_withLibrary(self):
def test_instruction_schedule_map_export(self):
"""Test that exporting the inst map works as planned."""

backend = FakeBelemV2()
backend = FakeBelemV2Pulse()

cals = Calibrations.from_backend(
backend,
Expand Down Expand Up @@ -1520,7 +1520,7 @@ def test_inst_map_transpilation(self):
"""Test that we can use the inst_map to inject the cals into the circuit."""

cals = Calibrations.from_backend(
FakeArmonkV2(),
FakeArmonkV2Pulse(),
libraries=[FixedFrequencyTransmon(basis_gates=["x"])],
)

Expand Down Expand Up @@ -1570,7 +1570,7 @@ def test_inst_map_updates(self):
"""Test that updating a parameter will force an inst map update."""

cals = Calibrations.from_backend(
FakeBelemV2(),
FakeBelemV2Pulse(),
libraries=[FixedFrequencyTransmon(basis_gates=["sx", "x"])],
)

Expand Down Expand Up @@ -1619,7 +1619,7 @@ def test_cx_cz_case(self):
a CX on qubits 0, 1 in the inst. map and a CZ on qubits 1, 2.
"""

cals = Calibrations.from_backend(FakeBelemV2())
cals = Calibrations.from_backend(FakeBelemV2Pulse())

sig = Parameter("σ")
dur = Parameter("duration")
Expand Down Expand Up @@ -1666,7 +1666,7 @@ def test_cx_cz_case(self):
def test_alternate_initialization(self):
"""Test that we can initialize without a backend object."""

backend = FakeBelemV2()
backend = FakeBelemV2Pulse()
library = FixedFrequencyTransmon(basis_gates=["sx", "x"])

backend_data = BackendData(backend)
Expand All @@ -1690,7 +1690,7 @@ class TestSerialization(QiskitExperimentsTestCase):
def test_serialization(self):
"""Test the serialization."""

backend = FakeBelemV2()
backend = FakeBelemV2Pulse()
library = FixedFrequencyTransmon(basis_gates=["sx", "x"])

cals = Calibrations.from_backend(backend, libraries=[library])
Expand All @@ -1700,7 +1700,7 @@ def test_serialization(self):

def test_equality(self):
"""Test the equal method on calibrations."""
backend = FakeBelemV2()
backend = FakeBelemV2Pulse()
library = FixedFrequencyTransmon(basis_gates=["sx", "x"])

cals1 = Calibrations.from_backend(
Expand Down
Loading