Create a finite state machine analysis pass to propagate Pauli basis states, and use it to disentangle CNOTs
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 in this PR.
- Replace complicated circuits whose results are |01+-LR> with standard preparation routines
- Potentially more
Description of the Change:
Added an analysis pass --propagate-simple-states (and tests).
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:
sc epic: https://app.shortcut.com/xanaduai/epic/74389
[sc-74649]
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
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 96.68%. Comparing base (
48edd02) to head (e5401f4). Report is 166 commits behind head on main.
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.