Skip to content

Commit

Permalink
Fix: Adapt to Qiskit#13033
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss committed Aug 27, 2024
1 parent 9d27271 commit 7056ab4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/circuit/src/dag_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6242,18 +6242,17 @@ impl DAGCircuit {
for instr in iter {
let op_name = instr.op.name();
let (all_cbits, vars): (Vec<Clbit>, Option<Vec<PyObject>>) = {
// Check if the clbits are already included
if self.may_have_additional_wires(py, &instr) {
let mut clbits: HashSet<Clbit> =
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 {
clbits.insert(clbit);
}
(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)
}
};

Expand All @@ -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
Expand Down

0 comments on commit 7056ab4

Please sign in to comment.