# Enable QEC and FTQC curves The optional quantum error correction stage maps readout classifier outputs into stim noise models, then estimates logical error rate and wall-clock QEC cycle time. Idle / wait noise scales with readout duration plus a constant post-acquire **control overhead**. Cycle wall-clock is readout + control + decoder latency. Install the QEC extra first: ```bash pip install -e ".[qec]" ``` That extra pulls in Stim and PyMatching. Optional: ``beliefmatching`` for the BB default decoder. Without the extra, enabling ``qec`` fails at import time. ## YAML configuration ```yaml qec: enabled: true codes: [surface, color, bb] experiments: [memory] decoders: surface: pymatching color: sinter_internal bb: belief_matching control_overhead_ns: 100.0 tau_idle_ns: 50000.0 include_decode_in_idle: false ler_duration_curve: true synthetic_duration_curve: true curve_shots: 2000 readout_binding: full_readout_ns: 500 scale_idle_with_duration: true ``` ### What each code is | Code | Circuit | Default decoder | |------|---------|-----------------| | ``surface`` | stim ``surface_code:rotated_memory_z`` | pymatching | | ``color`` | stim ``color_code:memory_xyz`` | sinter_internal (pymatching) | | ``bb`` | bivariate bicycle CSS **code-capacity** memory (circulant A,B) | belief_matching | ``walking_surface`` remains an experimental stub (surface + magic noise) and is not part of the public FTQC story. Set ``synthetic_duration_curve`` when classifiers did not run a duration sweep and you still want illustrative length-versus-error points. Prefer real sweep points when they exist. ```bash arcade run path/to/config.yaml ``` Demo export for the website: ```bash python scripts/export_qec_figures.py --shots 200 ``` ## Caveats - Demo curves use small shot counts; captions say so. - BB is code-capacity (not a full circuit-level BB schedule). - Idle map ``p = 1 - exp(-T/τ)`` is a coherence-scale model — set ``tau_idle_ns`` for your device.