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

Package::from_hugr shouldn't wrap twice #1620

Closed
aborgna-q opened this issue Oct 30, 2024 · 0 comments · Fixed by #1621
Closed

Package::from_hugr shouldn't wrap twice #1620

aborgna-q opened this issue Oct 30, 2024 · 0 comments · Fixed by #1621
Assignees

Comments

@aborgna-q
Copy link
Collaborator

Given a dataflow-container hugr like

graph LR
    subgraph 0 ["(0) DFG"]
        direction LR
        1["(1) Input"]
        2["(2) Output"]
        3["(3) tket2.quantum.QAlloc"]
        3--"0:0<br>qubit"-->2
    end
Loading

Package::from_hugr wraps it into a module, but it adds an extra layer of indirection

 graph LR
    subgraph 0 ["(0) Module"]
        direction LR
        subgraph 1 ["(1) FuncDefn: #quot;main#quot;"]
            direction LR
            2["(2) Input"]
            3["(3) Output"]
            subgraph 4 ["(4) DFG"]
                direction LR
                5["(5) Input"]
                6["(6) Output"]
                7["(7) tket2.quantum.QAlloc"]
                7--"0:0<br>qubit"-->6
            end
            4--"0:0<br>qubit"-->3
        end
    end
Loading

Instead of nesting the DFG, we should make it a FuncDefn directly and avoid the extra layer of indirection.
This would facilitate roundtrips in tket2 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant