Create global-rotation QEC code tutorial#156
Open
shalini9894 wants to merge 2 commits into
Open
Conversation
## Summary This PR adds a tutorial notebook for issue QuEraComputing#119: - adds ‘docs/demos/global_rotations_qec_codes.ipynb‘ - wires the notebook into the Tutorials section of ‘mkdocs.yml‘ - verifies the Tsim ‘R_Z(alpha)‘ angle convention with a one-qubit check - simulates the unentangled 15-qubit baseline, the ‘[[7,1,3]]‘ Steane / 2D colour- code curve, and the ‘[[15,1,3]]‘ Reed-Muller / 3D colour-code curve - includes a wrong-stabilizer-sign 3D control - uses Stim flow checks for stabilizer and logical-operator verification - keeps the default notebook deterministic and documentation-build safe - includes optional finite-shot sampling and optional CuPy dense-vector code paths for Colab experiments ## Scientific scope The notebook is an ideal Tsim tutorial calculation inspired by Fig. 4a of the linked Nature paper. It does not reproduce the experiment’s raw data, atom-layout encoder, hardware noise, lookup-table decoder, acceptance filtering, loss postselection, or purity/stabilizer normalization pipeline. ## Validation - executed the notebook from a clean kernel - checked Tsim ‘R_Z(alpha)‘ against the analytic one-qubit convention - checked Steane encoder logical/stabilizer flows with Stim - checked Reed-Muller CSS ranks, commutation relations, logical anticommutation, preparation flows, and T-angle response - checked selected full Tsim global-RZ circuits against the diagonal dense-vector implementation - ran formatting checks for the notebook
Collaborator
|
Hi, thanks for the submission! This looks great! However, I think something is wrong with the 3D code, red curve. I would have expected plateaus around T/T_dag/S/S_dag, just like the experimental data from the paper. |
Author
|
Hi @rafaelha , Please give me sometime I will rectify this asap. |
Thanks. This deploy-preview failure was due to the notebook importing `SteaneEncoder` from `tsim.utils.encoder` while the PR branch did not yet define that encoder in `src/tsim/utils/encoder.py`. I added a small `SteaneEncoder` class beside the existing encoder utilities. It uses the same `[[7,1,3]]` Steane circuit convention as the notebook, with stabilizer supports `0123`, `1245`, `2346`, logical support `015`, and encoding qubit `6`. The final `Z 5 1` sign correction is included so the all-positive `|+_L>` preparation passes the Stim stabilizer/logical flow checks. I also verified: - `from tsim.utils.encoder import SteaneEncoder` - Stim logical input-to-output flows - Stim prepared-state stabilizer/logical flows - the notebook execution path This should fix the deploy preview import error. I also worked on creating the 3D code much closer to the original experimental data in Fig. 4a.
Author
|
Hi @rafaelha, I have updated the code and now the graph looks very much closer to the original Fig.4a. Please have a look. Also I added a new class for SteaneEncoder since the checks were failing and it was failing due to import error. I recitifed that. So, it should work now. Please confirm. Here is the graph. Fixes #119 |
4 tasks
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
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.

Summary
This PR adds a tutorial notebook for issue #119:
adds ‘docs/demos/global_rotations_qec_codes.ipynb‘
wires the notebook into the Tutorials section of ‘mkdocs.yml‘
verifies the Tsim ‘R_Z(alpha)‘ angle convention with a one-qubit check
simulates the unentangled 15-qubit baseline, the ‘[[7,1,3]]‘ Steane / 2D colour- code curve, and the ‘[[15,1,3]]‘ Reed-Muller / 3D colour-code curve
includes a wrong-stabilizer-sign 3D control
uses Stim flow checks for stabilizer and logical-operator verification
keeps the default notebook deterministic and documentation-build safe
includes optional finite-shot sampling and optional CuPy dense-vector code paths for Colab experiments
Scientific scope
The notebook is an ideal Tsim tutorial calculation inspired by Fig. 4a of the linked Nature paper. It does not reproduce the experiment’s raw data, atom-layout encoder, hardware noise, lookup-table decoder, acceptance filtering, loss post selection, or purity/stabilizer normalization pipeline.
Validation
AI Disclosure:
I used AI tools to understand how to formulate this issue into a tutorial notebook after reading the research paper.
