diff --git a/crates/circuit/src/dag_circuit.rs b/crates/circuit/src/dag_circuit.rs index 6607a65de853..7655dd7ca614 100644 --- a/crates/circuit/src/dag_circuit.rs +++ b/crates/circuit/src/dag_circuit.rs @@ -6242,10 +6242,9 @@ impl DAGCircuit { for instr in iter { let op_name = instr.op.name(); let (all_cbits, vars): (Vec, Option>) = { - // Check if the clbits are already included if self.may_have_additional_wires(py, &instr) { let mut clbits: HashSet = - HashSet::from_iter(self.cargs_cache.intern(instr.clbits).iter().copied()); + HashSet::from_iter(self.cargs_interner.get(instr.clbits).iter().copied()); let (additional_clbits, additional_vars) = self.additional_wires(py, instr.op.view(), instr.condition())?; for clbit in additional_clbits { @@ -6253,7 +6252,7 @@ impl DAGCircuit { } (clbits.into_iter().collect(), Some(additional_vars)) } else { - (self.cargs_cache.intern(instr.clbits).to_vec(), None) + (self.cargs_interner.get(instr.clbits).to_vec(), None) } }; @@ -6268,7 +6267,7 @@ impl DAGCircuit { new_nodes.push(new_node); // Check all the qubits in this instruction. - for qubit in self.qargs_cache.intern(qubits_id) { + for qubit in self.qargs_interner.get(qubits_id) { // Retrieve each qubit's last node let qubit_last_node = if let Some(node) = qubit_last_nodes.remove(qubit) { node