diff --git a/qiskit_ibm_runtime/transpiler/passes/scheduling/dynamical_decoupling.py b/qiskit_ibm_runtime/transpiler/passes/scheduling/dynamical_decoupling.py index 0ef841829..af1958ea5 100644 --- a/qiskit_ibm_runtime/transpiler/passes/scheduling/dynamical_decoupling.py +++ b/qiskit_ibm_runtime/transpiler/passes/scheduling/dynamical_decoupling.py @@ -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 diff --git a/qiskit_ibm_runtime/transpiler/passes/scheduling/scheduler.py b/qiskit_ibm_runtime/transpiler/passes/scheduling/scheduler.py index 20fee4c3b..4032dff37 100644 --- a/qiskit_ibm_runtime/transpiler/passes/scheduling/scheduler.py +++ b/qiskit_ibm_runtime/transpiler/passes/scheduling/scheduler.py @@ -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") diff --git a/test/unit/test_local_mode.py b/test/unit/test_local_mode.py index d0736eaa5..a0259d4bd 100644 --- a/test/unit/test_local_mode.py +++ b/test/unit/test_local_mode.py @@ -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()])