-
Notifications
You must be signed in to change notification settings - Fork 40
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
Create a finite state machine analysis pass to propagate Pauli basis states, and use it to disentangle CNOTs and SWAPs #1154
Conversation
…states whenever possible. The knowledge of the snapshot midcircuit states can be useful when: - Deducing CNOT effect and decouple them - Replace complicated circuits whose results are |01+-LR> with standard preparation routines - Potentially more
…other passes can query (this is done via the mlir analysis framework) - add a transformation pass --disentangle-CNOT (with test) - both passes are changed to function passes
Note that this is a hackweek project and is not on any roadmaps, so it's not urgent Edit (2024/12/20): this is a P2 item now |
Adding do-not-merge label to freeze this branch for assessment |
…er is now already concise)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1154 +/- ##
=======================================
Coverage 96.68% 96.68%
=======================================
Files 75 75
Lines 8266 8266
Branches 867 867
=======================================
Hits 7992 7992
Misses 221 221
Partials 53 53 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work 💯 Nothing structural or major that needs changing, just some minor tweaks :)
#1297 but on catalyst instead of on @[ritu-thombre99](https://github.com/ritu-thombre99)'s fork, so I can clean it up : ) --------- Co-authored-by: Ritu Thombre <[email protected]> Co-authored-by: Ritu Thombre <[email protected]>
Addressed the comments, but Erick is on vacation : )
…states, and use it to disentangle CNOTs and SWAPs (#1154) **Context:** In circuits that mostly involve the six Pauli eigenstates, the effect of gates can be described by a simple six-state finite state machine. This allows us to deduce their midcircuit state at compile time. The knowledge of the snapshot midcircuit states can be useful when: - Deducing CNOT/Toffoli/SWAP/... effect and decouple them. We decouple CNOT and SWAP in this PR. - Replace complicated circuits whose results are |01+-LR> with standard preparation routines - Potentially more **Description of the Change:** Added an analysis for propagating simple states (and tests). Also added CNOT and SWAP decomposition pass `disentangle-CNOT`, `disentangle-SWAP` (and tests). Credit to [Ritu Thombre](https://github.com/ritu-thombre99) for the work on the SWAP gates! **Benefits:** More compile time circuit information for potential compile time transformation/optimization. **Possible Drawbacks:** This algorithm is from an external paper. We need to properly cite it. https://arxiv.org/abs/2012.07711 (fig.5) **Related GitHub Issues:** closes #1268 [sc-74649] [sc-74650] --------- Co-authored-by: Ritu Thombre <[email protected]> Co-authored-by: Ritu Thombre <[email protected]>
Context:
In circuits that mostly involve the six Pauli eigenstates, the effect of gates can be described by a simple six-state finite state machine. This allows us to deduce their midcircuit state at compile time.
The knowledge of the snapshot midcircuit states can be useful when:
Description of the Change:
Added an analysis for propagating simple states (and tests).
Also added CNOT and SWAP decomposition pass
disentangle-CNOT
,disentangle-SWAP
(and tests).Credit to Ritu Thombre for the work on the SWAP gates! #1297
Benefits:
More compile time circuit information for potential compile time transformation/optimization.
Possible Drawbacks:
This algorithm is from an external paper. We need to properly cite it.
https://arxiv.org/abs/2012.07711 (fig.5)
Related GitHub Issues: closes #1268
[sc-74649]
[sc-74650]