Reproducing magic state cultivation workflows

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

Reproducing magic state cultivation workflows is an AI agent skill from the GitHub repository AndyLiuin/QEC-Autoresearch-Skills. Guides staged reproduction of magic-state-cultivation workflows from Strilanc's reference repo, including circuit generation, long-run statistics collection, and plot regeneration without collapsing those stages together.

How to use this skill

Skill file

Reproducing Magic-State-Cultivation Workflows

What This Skill Is For

Use this skill when the task is to reproduce or adapt the staged workflow behind magic-state-cultivation:

When To Use It Versus Alternatives

Use this skill when the user wants the repo structure and execution order used in Craig Gidney's cultivation codebase.

Use CODE0 when the task is only low-level circuit authoring.

Do not use this skill for generic magic-state distillation summaries with no implementation intent.

Required Artifacts And Assumptions

Expected inputs:

Expected outputs:

Assumptions to make explicit:

Standard Workflow Checklist

  1. Read CODE0.
  2. Decide which stage is actually needed: step1_make_circuits, step2_collect, step3_plot, or custom tools/make_circuits.
  3. Start from a tiny custom circuit before planning full paper-scale recollection.
  4. Keep circuit generation, statistics collection, and plotting as separate artifacts.
  5. If using custom circuit generation, write down circuit_type, basis, gateset, d1, d2, r1, and r2 explicitly.
  6. Treat paper-scale recollection as a batch workflow, not an interactive default.

Validation Loop

Before closing work:

  1. confirm the selected stage matches the user's actual need,
  2. confirm any large compute requirement is stated plainly,
  3. confirm generated circuits can be inspected before long data collection begins,
  4. confirm plots are tied to named input stats instead of being treated as standalone evidence.

Common Issues And Fixes

Stage collapse

Problem: circuit generation, data collection, and plotting are described as one opaque command.

Fix: split the workflow into the same staged pipeline used upstream.

Paper-scale recollection by default

Problem: a local run is planned as if full statistics recollection were cheap.

Fix: use a small custom circuit or reduced shot/error targets first.

Hidden parameter drift

Problem: custom generation omits the exact cultivation parameters.

Fix: record all generation arguments before running or rewriting anything.

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.