Skip to content

entropicalabs/QEC-Tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QEC Tutorials (Surface Code) — Loom + Stim + PyMatching

<img src="https://qbraid-static.s3.amazonaws.com/logos/Launch_on_qBraid_white.png" width="150">

A small, notebook-first set of tutorials for surface-code quantum error correction (QEC) using Loom (Entropica Labs’ Python library for building and running QEC experiments), with simulations executed in Stim and decoding via PyMatching.

These materials are designed to be run directly on qBraid (recommended) and are intended as part of the teaching content hosted there.


What you’ll learn

Across two core notebooks, you will:

  • Define and inspect the rotated surface code (stabilizers, logical operators, boundaries).
  • Prepare logical basis states via syndrome measurement and understand Pauli frame tracking.
  • Run a logical memory experiment under circuit-level noise, build a detector error model, and decode with minimum-weight perfect matching.
  • Reproduce (numerically) the surface-code threshold behavior in a memory setting.
  • Understand the core ideas behind lattice surgery and how it enables multi-patch logical operations.
  • Build intuition for a logical CNOT using lattice surgery, and verify Loom’s AuxCNOT implementation end-to-end.

Repository contents

The core of the repo are the two notebooks below:

  1. 1_memory_exp.ipynbMemory Experiment with the Rotated Surface Code

    • Introduces stabilizer formalism (light recap) and operator measurements
    • Defines the rotated surface code and its stabilizers/logicals
    • Shows logical state initialization (Z/X eigenstates) via syndrome measurement
    • Runs noisy memory experiments in Stim and decodes using PyMatching
    • Demonstrates threshold-style scaling by sweeping physical error rates and code distances
  2. 2_auxcnot_op.ipynbAuxCNOT operation on the Rotated Surface Code

    • Introduces lattice surgery (merge/split) as a tool for logical operations
    • Develops the logical-CNOT construction step-by-step
    • Uses Loom’s AuxCNOT and verifies the resulting logical action by Stim sampling

Supporting files:

  • pyproject.toml / uv.lock — minimal Python dependencies and reproducible environment lock
  • _static_1/, _static_2/ — images/diagrams used by the notebooks

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •