Simulating erasure qubit protocols

From AndyLiuin/QEC-Autoresearch-Skills · View interactive version

Simulating erasure qubit protocols is an AI agent skill from the GitHub repository AndyLiuin/QEC-Autoresearch-Skills. Guides erasure-aware Stim simulation using the local Erasure_qubit-1 repo, with explicit separation between latent-erasure sampling, approximate decoding circuits, posterior or multi-check processing, and small local smoke runs.

How to use this skill

Skill file

Simulating Erasure-Qubit Protocols

What This Skill Is For

Use this skill when the task is to reproduce or adapt erasure-aware circuit simulations similar to the local Erasure_qubit-1 repo:

When To Use It Versus Alternatives

Use this skill when the main issue is erasure information, erasure-detection events, or posterior-informed decoding.

Use CODE0 when the task is generic Stim authoring with no erasure-specific logic.

Use CODE0 when the detector model already exists and erasure modeling is not the active design problem.

Required Artifacts And Assumptions

Expected inputs:

Expected outputs:

Assumptions to make explicit:

Standard Workflow Checklist

  1. Read CODE0.
  2. Identify the intended subworkflow: src/ for HGP coloration plus sliding-window decoding, multi_check/ for true-process versus approximate-decoder separation, multi_check1/ for alternate or exact multi-check variants, or BP_multi_check/ for posterior and BP-assisted branches.
  3. Keep latent-erasure sampling and approximate decoding-circuit construction as separate steps.
  4. Start with a small-shot run and only then widen shot count, check count, or OSD order.
  5. Record the exact erasure parameters and decoder configuration before comparing runs.
  6. Preserve syndrome, posterior, or erasure-detection artifacts instead of only reporting final logical error rates.

Validation Loop

Before closing work:

  1. confirm the workflow names both the sampling circuit and the decoding circuit,
  2. confirm erasure, depolarizing, and detection-noise parameters are explicit,
  3. confirm the local-versus-cluster decoder setting is stated,
  4. confirm the first run is a smoke test, not a production threshold claim.

Common Issues And Fixes

Sampling/decoding collapse

Problem: one circuit is treated as both the true noisy process and the decoding model.

Fix: follow the local repo pattern and separate them explicitly.

Decoder configuration drift

Problem: OSD settings change across runs without being tracked.

Fix: write down osd_method, order, window, commit, and check-count choices.

Jumping straight to multi-check sweeps

Problem: large multi-check runs start before a small local path works.

Fix: smoke test a tiny instance first.

Launching multiprocessing from stdin

Problem: the src/sinter_decoding.py path is launched from an inline stdin snippet and Python spawn workers fail to recover the entry script.

Fix: run the real script or module path directly, or reduce to a single-worker local smoke harness before scaling back up to the repo's sinter.collect(...) path.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.