Skip to content

Commit

Permalink
Update unit tests for Qiskit 1.2 (#1810)
Browse files Browse the repository at this point in the history
* Update unit tests for Qiskit 1.2

* fix dd tests
  • Loading branch information
kt474 authored Jul 23, 2024
1 parent 18b571d commit d5b0b83
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,17 +490,17 @@ def _pad(
theta, phi, lam, phase = OneQubitEulerDecomposer().angles_and_phase(u_inv)
if isinstance(next_node, DAGOpNode) and isinstance(next_node.op, (UGate, U3Gate)):
# Absorb the inverse into the successor (from left in circuit)
theta_r, phi_r, lam_r = next_node.op.params
next_node.op.params = Optimize1qGates.compose_u3(
theta_r, phi_r, lam_r, theta, phi, lam
)
op = next_node.op
theta_r, phi_r, lam_r = op.params
op.params = Optimize1qGates.compose_u3(theta_r, phi_r, lam_r, theta, phi, lam)
next_node.op = op
sequence_gphase += phase
elif isinstance(prev_node, DAGOpNode) and isinstance(prev_node.op, (UGate, U3Gate)):
# Absorb the inverse into the predecessor (from right in circuit)
theta_l, phi_l, lam_l = prev_node.op.params
prev_node.op.params = Optimize1qGates.compose_u3(
theta, phi, lam, theta_l, phi_l, lam_l
)
op = prev_node.op
theta_l, phi_l, lam_l = op.params
op.params = Optimize1qGates.compose_u3(theta, phi, lam, theta_l, phi_l, lam_l)
prev_node.op = op
sequence_gphase += phase
else:
# Don't do anything if there's no single-qubit gate to absorb the inverse
Expand Down
5 changes: 4 additions & 1 deletion qiskit_ibm_runtime/transpiler/passes/scheduling/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ def _get_duration(self, node: DAGNode, dag: Optional[DAGCircuit] = None) -> int:
# If node has calibration, this value should be the highest priority
cal_key = tuple(indices), tuple(float(p) for p in node.op.params)
duration = dag.calibrations[node.op.name][cal_key].duration
node.op.duration = duration

op = node.op.to_mutable()
op.duration = duration
node.op = op
else:
# map to outer dag to get the appropriate durations
duration = self._durations.get(node.op, indices, unit="dt")
Expand Down
1 change: 0 additions & 1 deletion test/unit/test_local_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ def test_primitive_v2_with_not_accepted_options(self, primitive, backend):
with warnings.catch_warnings(record=True) as warns:
job = inst.run(**get_primitive_inputs(inst, backend=backend))
_ = job.result()
self.assertEqual(len(warns), 1)
self.assertIn("dynamical_decoupling", str(warns[0].message))

@combine(session_cls=[Session, Batch], backend=[FakeManila(), FakeManilaV2(), AerSimulator()])
Expand Down

0 comments on commit d5b0b83

Please sign in to comment.