Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
1ucian0 committed Oct 30, 2024
1 parent ad6a1dd commit d565922
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
18 changes: 11 additions & 7 deletions test/python/circuit/test_scheduled_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,17 @@ def test_per_qubit_durations_loose_constrain(self):

def test_per_qubit_durations(self):
"""Test target with custom instruction_durations"""
target = GenericBackendV2(
3,
calibrate_instructions=True,
coupling_map=[[0, 1], [1, 2]],
basis_gates=["cx", "h"],
seed=42,
).target
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="argument ``calibrate_instructions`` is deprecated",
):
target = GenericBackendV2(
3,
calibrate_instructions=True,
coupling_map=[[0, 1], [1, 2]],
basis_gates=["cx", "h"],
seed=42,
).target
target.update_instruction_properties("cx", (0, 1), InstructionProperties(0.00001))
target.update_instruction_properties("cx", (1, 2), InstructionProperties(0.00001))
target.update_instruction_properties("h", (0,), InstructionProperties(0.000002))
Expand Down
18 changes: 11 additions & 7 deletions test/python/compiler/test_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1657,13 +1657,17 @@ def test_scheduling_instruction_constraints_backend(self):

def test_scheduling_instruction_constraints(self):
"""Test that scheduling-related loose transpile constraints work with target."""
target = GenericBackendV2(
2,
calibrate_instructions=True,
coupling_map=[[0, 1]],
basis_gates=["cx", "h"],
seed=42,
).target
with self.assertWarnsRegex(
DeprecationWarning,
expected_regex="argument ``calibrate_instructions`` is deprecated",
):
target = GenericBackendV2(
2,
calibrate_instructions=True,
coupling_map=[[0, 1]],
basis_gates=["cx", "h"],
seed=42,
).target
qc = QuantumCircuit(2)
qc.h(0)
qc.delay(0.000001, 1, "s")
Expand Down

0 comments on commit d565922

Please sign in to comment.