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 Steane-type and teleportation-based QEC for the Steane code #115

Merged
merged 28 commits into from
Jan 7, 2025

Conversation

perlinm
Copy link

@perlinm perlinm commented Dec 16, 2024

Teleportation-based QEC is essentially just one-bit teleportation, in which only one type of error (X or Z) is preserved in the teleported state. Teleporting in two different ways thereby corrects all errors.

I used state vector simulations to verify that these circuits correct all physical single-qubit errors by:

  1. Initializing a logical Steane qubit in a random logical state.
  2. Applying a single-qubit X, Y, or Z error.
  3. Running a qubit.steane_qec cycle.
  4. Asserting that the (physical) state vector of the logical qubit is equal to the state vector before the applied error (up to global phase).

I am not entirely certain that I am using/storing classical registers correctly, so @ciaranra please take a look.

Finally: the methods here write a flag qubit to remember whether there were non-trivial syndromes. It may make sense to "guarantee" that this flag qubit is set correctly and remove this suggestive comment. Thoughts?

@perlinm perlinm requested a review from ciaranra as a code owner December 16, 2024 23:44
@perlinm perlinm marked this pull request as draft December 16, 2024 23:44
@perlinm perlinm marked this pull request as ready for review December 17, 2024 00:33
@perlinm
Copy link
Author

perlinm commented Dec 17, 2024

Something funny is going on in my testing, so I'm going to mark this as a draft until I figure it out...

UPDATE: I think I fixed it. I'm still not sure I'm setting classical registers correctly though.

@perlinm perlinm marked this pull request as draft December 17, 2024 05:20
@perlinm perlinm changed the title Add Steane-type QEC for the Steane code Add Steane-type and teleportation-based QEC for the Steane code Dec 17, 2024
@perlinm perlinm marked this pull request as ready for review December 17, 2024 06:34
Comment on lines 403 to 405
def qec(self, flag_bit: Bit | None = None):
def qec(self, flag: Bit | None = None):
Copy link
Author

@perlinm perlinm Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also renamed flag_bit --> flag in this PR, for consistency with conventions elsewhere in the repo.

@perlinm
Copy link
Author

perlinm commented Dec 21, 2024

I think this PR fixes #112, which appears to just be an incorrect type hint

@ciaranra
Copy link
Member

ciaranra commented Jan 2, 2025

Good questions. At first glance everything looks good... but I'll comb over everything shortly.

More future facing stuff (not this PR):
I am putting the final touches on SLR->PHIR, which should allow for establishing proper internal tests for most of the code (might need to think about non-Clifford stuff). Hopefully that will help confirming behavior. Also, probably would be good to do a documentation sweep and check/establish for style consistency and provide guides in the documentation so we can keep straight how things are approached.

Copy link
Member

@ciaranra ciaranra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ciaranra ciaranra merged commit 5982e51 into PECOS-packages:development Jan 7, 2025
17 checks passed
@perlinm perlinm deleted the steane-qec branch January 7, 2025 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants