Skip to content

Commit

Permalink
applying suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderivrii committed Jul 8, 2024
1 parent e663f57 commit 18ad1aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/circuit/src/dag_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3201,8 +3201,9 @@ def _format(operand):
}
}

let elements : Vec<_> = qubits_in_cone.iter().map(|&qubit| qubit.0.into_py(py)).collect();
Ok(PySet::new_bound(py, &elements)?.unbind())
let qubits_in_cone_vec: Vec<_> = qubits_in_cone.iter().map(|&&qubit| qubit).collect();
let elements = self.qubits.map_indices(&qubits_in_cone_vec[..]);
Ok(PySet::new_bound(py, elements)?.unbind())
}

/// Return a dictionary of circuit properties.
Expand Down Expand Up @@ -3286,7 +3287,7 @@ impl DAGCircuit {
self.dag
.edges_directed(node, Outgoing)
.filter_map(|e| match e.weight() {
Wire::Qubit(_) => Some(e.source()),
Wire::Qubit(_) => Some(e.target()),
_ => None,
})
.unique()
Expand Down

0 comments on commit 18ad1aa

Please sign in to comment.