From 9f06c824bb0982b19750de588401eec7f450ac4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Tue, 28 Nov 2023 10:34:29 +0100 Subject: [PATCH] Fix lint, backend estimator test --- qiskit/providers/fake_provider/fake_generic.py | 13 ++++++------- test/python/primitives/test_backend_estimator.py | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/qiskit/providers/fake_provider/fake_generic.py b/qiskit/providers/fake_provider/fake_generic.py index 31ad6ddb35c3..6a4b10cc0753 100644 --- a/qiskit/providers/fake_provider/fake_generic.py +++ b/qiskit/providers/fake_provider/fake_generic.py @@ -77,8 +77,8 @@ def __init__( control_flow (bool): Flag to enable control flow directives on the backend (defaults to False). - calibrate_gates (list[str] | None): List of gate names which should contain - default calibration entries. These must be a subset of ``basis_gates``. + calibrate_gates (list[str] | None): List of gate names (subset of basis_gates) + to add default calibration entries to. rng (np.random.Generator): Optional fixed-seed generator for default random values. """ @@ -122,7 +122,7 @@ def __init__( if name not in self.supported_operations: raise QiskitError( f"Provided base gate {name} is not a supported " - f"operation ({self.supported_operations})." + f"operation ({self.supported_operations.keys()})." ) gate = self.supported_operations[name] noise_params = self.noise_defaults[name] @@ -229,7 +229,7 @@ def add_calibrations_from_instruction_schedule_map( """Add calibration entries from provided pulse defaults to target. Args: - defaults (PulseDefaults): pulse defaults with instruction schedule map + inst_map (InstructionScheduleMap): pulse defaults with instruction schedule map Returns: None @@ -391,9 +391,8 @@ def __init__( control_flow (bool): Flag to enable control flow directives on the backend (defaults to False). - calibrate_gates (list[str] | None): List of gate names which should contain - default calibration entries (overriden if an ``instruction_schedule_map`` is - provided). These must be a subset of ``basis_gates``. + calibrate_gates (list[str] | None): List of gate names (subset of basis_gates) + to add default calibration entries to. seed (int): Optional seed for generation of default values. """ diff --git a/test/python/primitives/test_backend_estimator.py b/test/python/primitives/test_backend_estimator.py index a098dc8328ac..bccd55721d90 100644 --- a/test/python/primitives/test_backend_estimator.py +++ b/test/python/primitives/test_backend_estimator.py @@ -410,7 +410,7 @@ def test_layout(self, backend): value = estimator.run(qc, op, shots=10000).result().values[0] if optionals.HAS_AER and not isinstance(backend, FakeBackendSimple): - self.assertEqual(value, -0.8908) + self.assertEqual(value, -0.8902) else: self.assertEqual(value, -1)