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

Add a helper for viewing the hugr as a circuit. #84

Closed
aborgna-q opened this issue Sep 5, 2023 · 1 comment · Fixed by #91
Closed

Add a helper for viewing the hugr as a circuit. #84

aborgna-q opened this issue Sep 5, 2023 · 1 comment · Fixed by #91
Assignees
Labels
enhancement New feature or request

Comments

@aborgna-q
Copy link
Collaborator

Currently to manipulate a Hugr as a `Circuit, we have to explicitly create a sibling view:

let hugr = ...;
let circ: SiblingGraph<'_> = SiblingGraph::new(&hugr, hugr.root());

We do this everywhere for the test, and probably users will too. It'd be nice to have a helper method on the circuit module for this.

@aborgna-q aborgna-q added enhancement New feature or request P-low labels Sep 5, 2023
@aborgna-q
Copy link
Collaborator Author

With CQCL/hugr#494 we may even be able to view the Hugr directly as a circuit.

@aborgna-q aborgna-q self-assigned this Sep 8, 2023
aborgna-q added a commit that referenced this issue Sep 12, 2023
- Replaces the `HierarchyView` bound in `Circuit` with `HugrView` (from
CQCL/hugr#498), which is implemented by
`Hugr`.
- This simplifies the tests, where we don't need to wrap `Hugr`s
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant