This repository contains implementations comparing standard fixed-bulk conventions vs diagonal schedules for surface code syndrome extraction in two scenarios:
diagonal_plaquettes.py: CustomDiagonalPlaquetteGeneratorthat provides diagonal schedule plaquettes (schedule [6,4,3,5] for Z and [1,4,3,2] for X). Handles both memory experiments and X-junction spatial cubes.
Compares standard vs diagonal schedule memory experiments:
# Basic comparison (k=1,2,3, default noise levels)
./venv/bin/python complete_comparison.py
# Custom k values
./venv/bin/python complete_comparison.py --k-values 2 3 4
# Custom shots and noise levels
./venv/bin/python complete_comparison.py --shots 100000 --noise-levels 0.001 0.002 0.003
# Skip certain analyses
./venv/bin/python complete_comparison.py --skip-distance --skip-logical-errorCompares standard vs diagonal schedule for spatial X-junctions:
# Basic comparison (distance, detector count, etc.)
./venv/bin/python compare_x_junction.py
# Include logical error rate analysis (requires pymatching)
./venv/bin/python compare_x_junction.py --error-rates
# Custom shots and noise levels
./venv/bin/python compare_x_junction.py --error-rates --shots 100000 --noise-levels 0.001 0.002 0.003Outputs include:
- Graph-like distance for both circuits
- Number of qubits, detectors, and observables
- Crumble URLs for visualization
- Logical error rates and plot (when using
--error-rates)
- Same Detector Count: Both diagonal and standard circuits produce the same number of detectors, ensuring each ancilla connects to the same number of data qubits
- Corner Handling: Properly handles 3-body corner plaquettes when two adjacent arms are missing in spatial cubes
- Boundary Plaquettes: 2-body boundary plaquettes derived from diagonal bulk schedules with appropriate qubit omissions
- Python 3.13+
- Dependencies in
venv/(activate withsource venv/bin/activate) - tqec library (installed in venv)