Skip to content

Commit

Permalink
Fix num root ports in extract_dfg
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Oct 22, 2024
1 parent cf4f32c commit 894f05d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tket2/src/circuit/extract_dfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ pub(super) fn rewrite_into_dfg(circ: &mut Circuit) -> Result<(), CircuitMutError
_ => signature,
};

circ.hugr.set_num_ports(
circ.parent(),
signature.input_count() + 1,
signature.input_count() + 1,
);
circ.hugr.replace_op(circ.parent(), DFG { signature })?;

Ok(())
Expand Down

0 comments on commit 894f05d

Please sign in to comment.