Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test nested circuit regions & command iterator. #42

Closed
aborgna-q opened this issue Jul 20, 2023 · 1 comment · Fixed by #381
Closed

Test nested circuit regions & command iterator. #42

aborgna-q opened this issue Jul 20, 2023 · 1 comment · Fixed by #381
Assignees
Labels
bug Something isn't working

Comments

@aborgna-q
Copy link
Collaborator

aborgna-q commented Jul 20, 2023

Make sure that nested HUGRs are supported by the Circuit interface.

Update the command iterator once everything is checked.
https://github.com/CQCL-DEV/tket2/pull/37#discussion_r1269154445

@aborgna-q aborgna-q self-assigned this Jun 4, 2024
@aborgna-q
Copy link
Collaborator Author

This is quite relevant after #370. The commands iterator does not currently filter nodes from other regions, so in this example it tries to output the FuncDefn node:

graph LR
    subgraph 0 ["(0) Module"]
        direction LR
        subgraph 1 ["(1) FuncDefn"]
            direction LR
            2["(2) Input"]
            2--"0:0<br>qubit"-->4
            2--"1:1<br>qubit"-->5
            3["(3) Output"]
            4["(4) quantum.tket2.H"]
            4--"0:0<br>qubit"-->5
            5["(5) quantum.tket2.CX"]
            5--"0:0<br>qubit"-->3
            5--"1:0<br>qubit"-->6
            6["(6) quantum.tket2.T"]
            6--"0:1<br>qubit"-->3
        end
    end
Loading

@aborgna-q aborgna-q added the bug Something isn't working label Jun 4, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 4, 2024
The commands iterator did a toposort on the whole Hugr, ignoring the
hierarchy.
This generated problems with #370, since circuits may now be nested
somewhere in the hugr.
It would also have caused problems with circuit boxes, but we don't
support that yet here.

We use a `SiblingGraph` now, to ensure that we only explore the
top-level region of the circuit.
Subcircuits will be returned as a single command.

Adds a `build_module_with_circuit` helper to build circuits inside
modules.

Closes #42.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant