Skip to content

Commit

Permalink
fix dd tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kt474 committed Jul 22, 2024
1 parent 2816294 commit 0693aef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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

0 comments on commit 0693aef

Please sign in to comment.