Skip to content

Conversation

@perlinm
Copy link
Contributor

@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
Contributor 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
Contributor 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
Contributor 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
ciaranra added a commit to ciaranra/PECOS-alt that referenced this pull request May 25, 2025
* Unroll broadcast face rotations (PECOS-packages#110)

* Upgrade to using uv instead of pip (PECOS-packages#111)

* Adding uv to Makefile

* Turn on artifact generation (PECOS-packages#117)

* Add T gates with active error correction (PECOS-packages#118)

* remove t_tel_cor

* bugfix in tdg_cor

* fix t_cor

* Permute all variables of the Steane code (PECOS-packages#114)

* compute the swap of CRegs

* Add Steane-type and teleportation-based QEC for the Steane code (PECOS-packages#115)

* fix qec_steane_z

* set flag bit correctly

* add qec_steane_.*tel templates

* fix Steane.qec_steane_tel

* permute all qubits for teleportation

* fix teleportation-based QEC

* two flag bits for Steane.qec_tel

* rename flag_bit --> flag, in agreement with elsewhere in the repo

* fix If statement

* fix Steane QEC and an incorrect type hint

---------

Co-authored-by: Michael A. Perlin <[email protected]>
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