Skip to content

Commit

Permalink
update tolerances
Browse files Browse the repository at this point in the history
  • Loading branch information
coruscating committed Oct 16, 2023
1 parent c04a650 commit 43ab791
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
1 change: 0 additions & 1 deletion qiskit_experiments/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
MockIQParallelBackend
T2HahnBackend
NoisyDelayAerBackend
SingleTransmonTestBackend
Helpers
=======
Expand Down
2 changes: 1 addition & 1 deletion test/library/calibration/test_half_angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def setUp(self):
super().setUp()
library = FixedFrequencyTransmon()

self.backend = SingleTransmonTestBackend(noise=False)
self.backend = SingleTransmonTestBackend(noise=False, atol=1e-3)
self.cals = Calibrations.from_backend(self.backend, libraries=[library])

def test_amp_parameter_error(self):
Expand Down
17 changes: 9 additions & 8 deletions test/library/calibration/test_rabi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@
class TestRabiEndToEnd(QiskitExperimentsTestCase):
"""Test the rabi experiment."""

def setUp(self):
@classmethod
def setUpClass(cls):
"""Setup the tests."""
super().setUp()
super().setUpClass()

self.qubit = 0
cls.qubit = 0

with pulse.build(name="x") as sched:
pulse.play(pulse.Drag(160, Parameter("amp"), 40, 0.4), pulse.DriveChannel(self.qubit))
pulse.play(pulse.Drag(160, Parameter("amp"), 40, 0.4), pulse.DriveChannel(cls.qubit))

self.sched = sched
self.backend = SingleTransmonTestBackend(noise=False)
cls.sched = sched
cls.backend = SingleTransmonTestBackend(noise=False, atol=1e-3)

# pylint: disable=no-member
def test_rabi_end_to_end(self):
Expand Down Expand Up @@ -101,7 +102,7 @@ def setUp(self):
super().setUp()

self.qubit = 0
self.backend = SingleTransmonTestBackend(noise=False)
self.backend = SingleTransmonTestBackend(noise=False, atol=1e-4)
self.anharmonicity = self.backend.anharmonicity
with pulse.build(name="x") as sched:
with pulse.frequency_offset(self.anharmonicity, pulse.DriveChannel(self.qubit)):
Expand All @@ -115,7 +116,7 @@ def setUp(self):
def test_ef_rabi_end_to_end(self):
"""Test the EFRabi experiment end to end."""

test_tol = 0.01
test_tol = 0.05

# Note that the backend is not sophisticated enough to simulate an e-f
# transition so we run the test with a tiny frequency shift, still driving the e-g transition.
Expand Down
6 changes: 4 additions & 2 deletions test/library/calibration/test_rough_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TestRoughFrequency(QiskitExperimentsTestCase):
def setUp(self):
"""Setup the tests."""
super().setUp()
self.backend = SingleTransmonTestBackend(noise=False)
self.backend = SingleTransmonTestBackend(noise=False, atol=1e-3)

def test_init(self):
"""Test that initialization."""
Expand All @@ -53,7 +53,9 @@ def test_update_calibrations(self):

freq01 = BackendData(self.backend).drive_freqs[0]

backend_5mhz = SingleTransmonTestBackend(qubit_frequency=freq01 + 5e6, noise=False)
backend_5mhz = SingleTransmonTestBackend(
qubit_frequency=freq01 + 5e6, noise=False, atol=1e-3
)

library = FixedFrequencyTransmon()
cals = Calibrations.from_backend(self.backend, libraries=[library])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def setUp(self):
"""Setup test variables."""
super().setUp()

self.backend = SingleTransmonTestBackend(noise=False)
self.backend = SingleTransmonTestBackend(noise=False, atol=1e-3)

# Build x12 schedule
self.qubit = 0
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_discrimination_analysis(self, n_states):

fidelity = exp_data.analysis_results("fidelity").value

self.assertGreaterEqual(fidelity, 0.96)
self.assertGreaterEqual(fidelity, 0.93)

# check that the discriminator differentiates n different states
discrim_lbls = exp_data.analysis_results("discriminator_config").value["attributes"][
Expand Down

0 comments on commit 43ab791

Please sign in to comment.