From ad8aa795a9624e03976acf86be8dcc7d307f907e Mon Sep 17 00:00:00 2001 From: Helena Zhang Date: Fri, 7 Jul 2023 09:51:31 -0400 Subject: [PATCH] Update tests with complex amp pulses (#1217) ### Summary This PR removes complex amplitudes from pulses in tests after https://github.com/Qiskit/qiskit-terra/pull/10357. --- test/calibration/test_calibrations.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/test/calibration/test_calibrations.py b/test/calibration/test_calibrations.py index 0d8f4d78a7..9e301839aa 100644 --- a/test/calibration/test_calibrations.py +++ b/test/calibration/test_calibrations.py @@ -1007,9 +1007,7 @@ def setUp(self): self.cals.add_schedule(tcp, num_qubits=2) self.cals.add_parameter_value(ParameterValue(40, self.date_time), "σ", schedule="xp") - self.cals.add_parameter_value( - ParameterValue(0.1 + 0.01j, self.date_time), "amp", (3,), "xp" - ) + self.cals.add_parameter_value(ParameterValue(0.1, self.date_time), "amp", (3,), "xp") self.cals.add_parameter_value(ParameterValue(0.3, self.date_time), "amp", (3, 2), "cr") self.cals.add_parameter_value(ParameterValue(0.2, self.date_time), "amp_rot", (3, 2), "cr") self.cals.add_parameter_value(ParameterValue(0.8, self.date_time), "amp", (3, 2), "tcp") @@ -1049,11 +1047,11 @@ def test_get_schedule(self): with pulse.align_left(): pulse.play(GaussianSquare(640, 0.2, 40, 20), DriveChannel(2)) # Rotary tone pulse.play(GaussianSquare(640, 0.3, 40, 20), ControlChannel(10)) # CR tone. - pulse.play(Gaussian(160, 0.1 + 0.01j, 40), DriveChannel(3)) + pulse.play(Gaussian(160, 0.1, 40), DriveChannel(3)) with pulse.align_left(): pulse.play(GaussianSquare(640, -0.2, 40, 20), DriveChannel(2)) # Rotary tone pulse.play(GaussianSquare(640, -0.3, 40, 20), ControlChannel(10)) # CR tone. - pulse.play(Gaussian(160, 0.1 + 0.01j, 40), DriveChannel(3)) + pulse.play(Gaussian(160, 0.1, 40), DriveChannel(3)) # We inline to make the schedules comparable with the construction directly above. schedule = self.cals.get_schedule("cr", (3, 2)) @@ -1624,7 +1622,7 @@ def test_save_load_parameter_values(self): with self.assertWarns(DeprecationWarning): self.cals.save("csv", overwrite=True, file_prefix=self._prefix) - self.assertEqual(self.cals.get_parameter_value("amp", (3,), "xp"), 0.1 + 0.01j) + self.assertEqual(self.cals.get_parameter_value("amp", (3,), "xp"), 0.1) self.cals._params = defaultdict(list) @@ -1636,8 +1634,7 @@ def test_save_load_parameter_values(self): self.cals.load_parameter_values(self._prefix + "parameter_values.csv") val = self.cals.get_parameter_value("amp", (3,), "xp") - self.assertEqual(val, 0.1 + 0.01j) - self.assertTrue(isinstance(val, complex)) + self.assertEqual(val, 0.1) val = self.cals.get_parameter_value("σ", (3,), "xp") self.assertEqual(val, 40)