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

Fix tests failing against Qiskit main due to change in delay behavior #1509

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/library/characterization/test_t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from qiskit.circuit import Delay, Parameter
from qiskit.circuit.library import CXGate, Measure, RXGate
from qiskit.qobj.utils import MeasLevel
from qiskit.providers.fake_provider import GenericBackendV2
from qiskit.transpiler import InstructionProperties, Target
from qiskit_ibm_runtime.fake_provider import FakeAthensV2
from qiskit_experiments.test.noisy_delay_aer_simulator import NoisyDelayAerBackend
Expand Down Expand Up @@ -310,7 +311,8 @@ def test_roundtrip_serializable(self):

def test_circuit_roundtrip_serializable(self):
"""Test circuit round trip JSON serialization"""
exp = T1([0], [1, 2, 3, 4, 5])
backend = GenericBackendV2(num_qubits=2)
exp = T1([0], [1, 2, 3, 4, 5], backend=backend)
self.assertRoundTripSerializable(exp._transpiled_circuits())

def test_analysis_config(self):
Expand Down
8 changes: 5 additions & 3 deletions test/library/characterization/test_tphi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""
from test.base import QiskitExperimentsTestCase
from qiskit.exceptions import QiskitError
from qiskit.providers.fake_provider import GenericBackendV2
from qiskit_experiments.library import Tphi, T2Hahn, T2Ramsey
from qiskit_experiments.test.noisy_delay_aer_simulator import NoisyDelayAerBackend
from qiskit_experiments.library.characterization.analysis import (
Expand Down Expand Up @@ -146,11 +147,12 @@ def test_roundtrip_serializable(self):

def test_circuits_roundtrip_serializable(self):
"""Test round trip JSON serialization"""
exp = Tphi([0], [1], [2])
backend = GenericBackendV2(num_qubits=2)
exp = Tphi([0], [1e-6], [2e-6], backend=backend)
self.assertRoundTripSerializable(exp._transpiled_circuits())
exp = Tphi([0], [1], [2], "hahn", 3)
exp = Tphi([0], [1e-6], [2e-6], "hahn", 3, backend=backend)
self.assertRoundTripSerializable(exp._transpiled_circuits())
exp = Tphi([0], [1], [2], "ramsey", 0)
exp = Tphi([0], [1e-6], [2e-6], "ramsey", 0, backend=backend)
self.assertRoundTripSerializable(exp._transpiled_circuits())

def test_analysis_config(self):
Expand Down