From 894f05d894e4d30c82832d5afff44085c6795d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Tue, 22 Oct 2024 17:12:25 +0100 Subject: [PATCH] Fix num root ports in extract_dfg --- tket2/src/circuit/extract_dfg.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tket2/src/circuit/extract_dfg.rs b/tket2/src/circuit/extract_dfg.rs index 38b12d85..ce2cf0a9 100644 --- a/tket2/src/circuit/extract_dfg.rs +++ b/tket2/src/circuit/extract_dfg.rs @@ -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(())