Skip to content

Commit

Permalink
Update unit tests for Qiskit 1.3 (#2041)
Browse files Browse the repository at this point in the history
* wip 1.3 unit tests

* Update remaining dynamical decoupling tests

* pass optimization_level

* Add scheduler tests back

* Revert change in test_dd

* Add dd calibration test back

---------

Co-authored-by: ptristan3 <[email protected]>
  • Loading branch information
kt474 and ptristan3 authored Nov 21, 2024
1 parent 9906af5 commit eeb5b4c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/unit/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_raise_faulty_edge(self):
for i in range(num_qubits - 2):
circ.cx(i, i + 1)

transpiled = transpile(circ, backend=fake_backend)
transpiled = transpile(circ, backend=fake_backend, optimization_level=1)
edge_qubits = [0, 1]
ibm_backend = create_faulty_backend(fake_backend, faulty_edge=("cx", edge_qubits))
sampler = SamplerV2(ibm_backend)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_ibm_primitives_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def test_raise_faulty_edge(self, primitive):
circ = QuantumCircuit(num_qubits, num_qubits)
for i in range(num_qubits - 2):
circ.cx(i, i + 1)
transpiled = transpile(circ, backend=fake_backend)
transpiled = transpile(circ, backend=fake_backend, optimization_level=1)
observable = SparsePauliOp("Z" * num_qubits)

edge_qubits = [0, 1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def test_dd_with_calibrations_with_parameters(self, param_value):
for instruction in dd_circuit.data:
op = instruction.operation
if isinstance(op, RXGate):
self.assertEqual(op.duration, rx_duration)
self.assertEqual(op._params, [param_value])

def test_insert_dd_ghz_xy4_with_alignment(self):
"""Test DD with pulse alignment constraints."""
Expand Down
4 changes: 2 additions & 2 deletions test/unit/transpiler/passes/scheduling/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ def test_c_if_plugin_conversion_with_transpile(self):
qc = QuantumCircuit(qr0, cr)
qc.x(qr0[0]).c_if(cr[0], True)

qc_transpiled = transpile(qc, backend, initial_layout=[0])
qc_transpiled = transpile(qc, backend, initial_layout=[0], optimization_level=1)

scheduled = pm.run(qc_transpiled)

Expand Down Expand Up @@ -2052,7 +2052,7 @@ def test_c_if_plugin_conversion_with_transpile(self):
qc = QuantumCircuit(qr0, cr)
qc.x(qr0[0]).c_if(cr[0], True)

qc_transpiled = transpile(qc, backend, initial_layout=[0])
qc_transpiled = transpile(qc, backend, initial_layout=[0], optimization_level=1)

scheduled = pm.run(qc_transpiled)

Expand Down

0 comments on commit eeb5b4c

Please sign in to comment.