diff --git a/qiskit_ibm_provider/transpiler/passes/scheduling/dynamical_decoupling.py b/qiskit_ibm_provider/transpiler/passes/scheduling/dynamical_decoupling.py index 54845454c..7e184c79a 100644 --- a/qiskit_ibm_provider/transpiler/passes/scheduling/dynamical_decoupling.py +++ b/qiskit_ibm_provider/transpiler/passes/scheduling/dynamical_decoupling.py @@ -328,7 +328,7 @@ def _pre_runhook(self, dag: DAGCircuit) -> None: if self._qubits and physical_index not in self._qubits: continue - for gate in seq: + for index, gate in enumerate(seq): try: # Check calibration. gate_length = dag.calibrations[gate.name][ @@ -352,6 +352,12 @@ def _pre_runhook(self, dag: DAGCircuit) -> None: seq_length_.append(gate_length) # Update gate duration. # This is necessary for current timeline drawer, i.e. scheduled. + + if hasattr( + gate, "to_mutable" + ): # TODO this check can be removed after Qiskit 1.0, as it is always True + gate = gate.to_mutable() + seq[index] = gate gate.duration = gate_length self._dd_sequence_lengths[qubit].append(seq_length_)