diff --git a/crates/transpiler/src/passes/constrained_reschedule.rs b/crates/transpiler/src/passes/constrained_reschedule.rs index 54bbabafa6bb..a7280094f766 100644 --- a/crates/transpiler/src/passes/constrained_reschedule.rs +++ b/crates/transpiler/src/passes/constrained_reschedule.rs @@ -208,7 +208,7 @@ fn push_node_back( // Compute overlap if there is qubits overlap let qreg_overlap = if !this_qubits.is_disjoint(&next_qubits) { - new_t1q - next_t0q + new_t1q.saturating_sub(next_t0q) } else { 0 }; @@ -219,7 +219,7 @@ fn push_node_back( && !this_clbits.is_disjoint(&next_clbits) { if let (Some(t1c), Some(t0c)) = (new_t1c, next_t0c) { - t1c - t0c + t1c.saturating_sub(t0c) } else { 0 }