-
Notifications
You must be signed in to change notification settings - Fork 59
Add pass that applies Clifford+T -> Pauli frame protocols #2269
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
Open
joeycarter
wants to merge
19
commits into
main
Choose a base branch
from
joeycarter/pauli-frame-tracker-passes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Contributor
Author
|
Update: Fixed with a code refactor. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2269 +/- ##
==========================================
- Coverage 97.21% 96.99% -0.23%
==========================================
Files 93 93
Lines 11243 11243
Branches 1075 1075
==========================================
- Hits 10930 10905 -25
- Misses 246 266 +20
- Partials 67 72 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Context: In #2188, we added a new
PauliFramedialect to Catalyst to represent programs using Pauli frame tracking protocols. This PR adds a new compilation pass,to-pauli-frame, which applies these Pauli frame tracking protocols to a Clifford+T program.Description of the Change: Applying the
to-pauli-framepass applies the following transformations:pauli_frame.init_qregop immediately afterquantum.allocops, taking the!quantum.regas its input operand. A similar pattern that inserts apauli_frame.initop immediately after a single-qubit allocation opquantum.alloc_qbis also applied.pauli_frame.updateops, e.g. it replaces a Pauli X gate with apauli_frame.update [1, 0]op, where the attributes in the square brackets are the [x, z] parity bits.pauli_frame.update_with_cliffordops immediately before Clifford ops (H, S, and CNOT).pauli_frame.flushop, which returns the x- and z-parity bits for the given qubit, and applies the X and Z gates to that qubit, conditional on the returned parity bits.pauli_frame.correct_measurementops immediately afterquantum.measureops.Benefits: This is a proof-of-concept prototype that allows us to express quantum programs in Catalyst IR using Pauli frame tracking protocols.
Possible Drawbacks: This prototype is by no means production grade and the final version of this compilation pass used for utility-scale workloads will need updating for both functional purposes (e.g. to communicate with a remote process running the Pauli frame tracking process) and scalability purposes (e.g. flushing the Pauli frame for each qubit before performing terminal measurement processes is not optimal, as it requires many calls into the Pauli frame process to retrieve the Pauli records, and as it currently inlines all of these operations into the main region that performs the quantum execution). The scalability issues might be avoided by carefully defining a new operation that corrects the measurement results in an array of samples in one go.
Another detail that we have not considered in this prototype is handling the Pauli byproduct corrections in a program's MBQC representation. This is a more challenging task because of the state-teleportation that occurs in MBQC, and it will need to be addressed in a future PR.
[sc-103533]