From 70d8b839358fa88b9aed0726e0b43ceb1726e4b0 Mon Sep 17 00:00:00 2001 From: Jake Lishman Date: Fri, 2 Feb 2024 15:47:30 +0000 Subject: [PATCH] Run black --- test/terra/backends/aer_simulator/test_truncate.py | 1 + test/terra/noise/test_device_models.py | 12 ++++-------- test/terra/noise/test_noise_model.py | 4 ++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/terra/backends/aer_simulator/test_truncate.py b/test/terra/backends/aer_simulator/test_truncate.py index 32c21e8190..136623b9e5 100644 --- a/test/terra/backends/aer_simulator/test_truncate.py +++ b/test/terra/backends/aer_simulator/test_truncate.py @@ -12,6 +12,7 @@ import qiskit from qiskit import transpile, QuantumCircuit + if qiskit.__version__.startswith("0."): from qiskit.providers.fake_provider import FakeQuito as Fake5QV1 else: diff --git a/test/terra/noise/test_device_models.py b/test/terra/noise/test_device_models.py index c1269f02c4..43d90fda91 100644 --- a/test/terra/noise/test_device_models.py +++ b/test/terra/noise/test_device_models.py @@ -34,7 +34,7 @@ def target_7q(): """Build an arbitrary 7q ``Target`` with noisy instructions.""" num_qubits = 7 qubit_properties = [ - QubitProperties(t1=1.5e-4, t2=1.5e-4, frequency=4_700_000_000.0 + q*50_000_000.0) + QubitProperties(t1=1.5e-4, t2=1.5e-4, frequency=4_700_000_000.0 + q * 50_000_000.0) for q in range(num_qubits) ] target = Target(num_qubits=7, qubit_properties=qubit_properties) @@ -42,8 +42,7 @@ def target_7q(): target.add_instruction( gate, properties={ - (q,): InstructionProperties(duration=50e-9, error=2e-4) - for q in range(num_qubits) + (q,): InstructionProperties(duration=50e-9, error=2e-4) for q in range(num_qubits) }, ) target.add_instruction( @@ -56,21 +55,18 @@ def target_7q(): target.add_instruction( Reset(), properties={ - (q,): InstructionProperties(duration=4e-6, error=None) - for q in range(num_qubits) + (q,): InstructionProperties(duration=4e-6, error=None) for q in range(num_qubits) }, ) target.add_instruction( Measure(), properties={ - (q,): InstructionProperties(duration=3e-6, error=1.5e-2) - for q in range(num_qubits) + (q,): InstructionProperties(duration=3e-6, error=1.5e-2) for q in range(num_qubits) }, ) return target - class TestDeviceNoiseModel(QiskitAerTestCase): """Testing device noise model""" diff --git a/test/terra/noise/test_noise_model.py b/test/terra/noise/test_noise_model.py index 3ab737ad52..ebad6ffe75 100644 --- a/test/terra/noise/test_noise_model.py +++ b/test/terra/noise/test_noise_model.py @@ -48,6 +48,7 @@ def fake_7q_v2(): """Generate a dummy 7q V2 backend.""" return FakeLagosV2() + else: from qiskit.providers.fake_provider import ( FakeBackend, @@ -60,6 +61,7 @@ def fake_7q_v2(): """Generate a dummy 7q V2 backend.""" return GenericBackendV2(num_qubits=7, coupling_map=CouplingMap.from_ring(7), seed=0) + from test.terra.common import QiskitAerTestCase @@ -333,8 +335,10 @@ def properties(self): def test_create_noise_model_without_user_warnings(self): """Test if never issue user warnings when creating a noise model from backend. See issue#1631 for the details.""" + class BadlyCalibratedBackendV2(BackendV2): """A backend with `t2 > 2*t1` due to awkward calibration statistics.""" + @property def target(self): return Target(