Create global-rotation QEC code tutorial#156
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
|
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. |
|
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.
|
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 |
|
Hi @rafaelha , Thanks much for the PR merge. I am looking forward to contributing more to tsim and other repos in QuEra. |
|
Hi @rafaelha can you please close this issue because my name is not reflecting in leadership board and I didn't heard back from UH team. Thanks much. |

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.
