Skip to content

Commit

Permalink
Fix: Adapt to new DAGCircuit limitations
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss committed Sep 12, 2024
1 parent 18591ce commit 676766d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub(super) fn compose_transforms<'a>(
let doomed_nodes = dag
.op_nodes(true)
.filter_map(|node| {
if let Some(NodeType::Operation(op)) = dag.dag.node_weight(node) {
if let Some(NodeType::Operation(op)) = dag.dag().node_weight(node) {
if (gate_name.as_str(), *gate_num_qubits)
== (op.op.name(), op.op.num_qubits())
{
Expand Down Expand Up @@ -171,7 +171,7 @@ fn get_example_gates(
) -> PyResult<Box<HashMap<(String, u32), PackedInstruction>>> {
let mut example_gates = example_gates.unwrap_or_default();
for node in dag.op_nodes(true) {
if let Some(NodeType::Operation(op)) = dag.dag.node_weight(node) {
if let Some(NodeType::Operation(op)) = dag.dag().node_weight(node) {
example_gates.insert((op.op.name().to_string(), op.op.num_qubits()), op.clone());
if op.op.control_flow() {
let OperationRef::Instruction(inst) = op.op.view() else {
Expand Down

0 comments on commit 676766d

Please sign in to comment.