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

feat!: Let Hugr implement Circuit #91

Merged
merged 2 commits into from
Sep 12, 2023
Merged

feat!: Let Hugr implement Circuit #91

merged 2 commits into from
Sep 12, 2023

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Sep 6, 2023

  • Replaces the HierarchyView bound in Circuit with HugrView (from feat: Implement petgraph traits on Hugr hugr#498), which is implemented by Hugr.
    • This simplifies the tests, where we don't need to wrap Hugrs anymore.
    • We still need a lifetime for the Commands iterator, so Circuit::Comands now has a generic lifetime.
  • Uses the new PetgraphWrapper when needed instead of requiring Petgraph traits on everything.
    • This lets us drop the lifetime from Circuit<'a>.

Closes #84.
Blocked by CQCL/hugr#498.

aborgna-q added a commit that referenced this pull request Sep 8, 2023
Multiple small changes to the hugr API.

Note that this doesn't update to the current HEAD, #91 will adapt to the
changes from CQCL/hugr#498 and simplify the
circuits.
The goal of this separate PR is to reduce the diff noise there.
@aborgna-q aborgna-q force-pushed the feat/hugr-as-circuit branch from 772f1ba to 9fc92da Compare September 8, 2023 10:20
@aborgna-q aborgna-q marked this pull request as ready for review September 8, 2023 10:20
@aborgna-q aborgna-q requested a review from croyzor September 8, 2023 10:22
@aborgna-q aborgna-q changed the title feat: Let Hugr implement Circuit feat!: Let Hugr implement Circuit Sep 8, 2023
Copy link
Contributor

@croyzor croyzor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@aborgna-q aborgna-q merged commit 0215748 into main Sep 12, 2023
@aborgna-q aborgna-q deleted the feat/hugr-as-circuit branch September 12, 2023 10:40
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 this pull request may close these issues.

Add a helper for viewing the hugr as a circuit.
2 participants