feat!: Add ResourceScope::is_convex#1057
Draft
lmondada wants to merge 3 commits intolm/new-new-subcircuitfrom
Draft
feat!: Add ResourceScope::is_convex#1057lmondada wants to merge 3 commits intolm/new-new-subcircuitfrom
lmondada wants to merge 3 commits intolm/new-new-subcircuitfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## lm/new-new-subcircuit #1057 +/- ##
========================================================
Coverage ? 80.27%
========================================================
Files ? 154
Lines ? 19669
Branches ? 18582
========================================================
Hits ? 15789
Misses ? 2994
Partials ? 886
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d3c5a60 to
7b02be7
Compare
de70bd6 to
296ff69
Compare
296ff69 to
fdce2c3
Compare
fdce2c3 to
8af0f6d
Compare
7b02be7 to
7343d5f
Compare
8af0f6d to
bbf170f
Compare
7343d5f to
0565168
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'll put this as draft for the time being, given that it is already stacked on top of other two PRs.
Does what the title says: using
ResourceScope's resource path tracking, we can check convexity of subcircuits very efficiently. Heavily inspired by portgraph'sLineConvexChecker, see Quantinuum/portgraph#240.Note that to be able to implement the convexity check, I changed
Positionfrom being a port property (i.e. each resource had its own position), to being a node-wide property. See the first of the two commits in this PR.As is, the conversion
Subcircuit->SiblingSubgraphis correct but unnecessarily slow: at construction time, hugr will check convexity of the subgraph again. My plan is to open a PR in hugr that allows us to bypass convexity checks and use that here in place ofSiblingSubgraph::try_new.