Skip to content

Commit

Permalink
Run black
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelishman committed Feb 2, 2024
1 parent 1ba6190 commit 70d8b83
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions test/terra/backends/aer_simulator/test_truncate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 4 additions & 8 deletions test/terra/noise/test_device_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ 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)
for gate in (library.SXGate(), library.XGate(), library.RZGate(Parameter("a"))):
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(
Expand All @@ -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"""

Expand Down
4 changes: 4 additions & 0 deletions test/terra/noise/test_noise_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
def fake_7q_v2():
"""Generate a dummy 7q V2 backend."""
return FakeLagosV2()

else:
from qiskit.providers.fake_provider import (
FakeBackend,
Expand All @@ -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


Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 70d8b83

Please sign in to comment.