Decoding with pymatching

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

Decoding with pymatching is an AI agent skill from the GitHub repository AndyLiuin/QEC-Autoresearch-Skills. Provides guidance for decoding graphlike Stim detector models and sampled trajectories with PyMatching, using the repo's registry-backed decoder service and explicit graphlike-DEM constraints.

How to use this skill

Skill file

Decoding With PyMatching

What This Skill Is For

Use this skill when a task needs an executable matching-based decoder lane over

registered QEC artifacts:

paper or benchmark narrative.

When To Use It Versus Alternatives

Use this skill when the workflow is:

hypergraph-aware routes.

Prefer CODE0 when the goal is

the repo's parity-check-oriented baseline lane.

Prefer CODE0 when the

main problem is backend selection across matching, color-code-specialized,

hypergraph-aware, erasure-aware, or search-based decoder families.

Do not present this lane as a universal decoder abstraction. It is the repo's

graphlike matching lane.

Required Artifacts And Assumptions

Expected inputs:

Expected outputs:

Assumptions to make explicit:

circuit.

Standard Workflow Checklist

  1. Read CODE0 and confirm the

current decoder-lane assumptions.

  1. Check CODE0

for the intended tool surface.

  1. Confirm the detector-model bundle was compiled with

require_graphlike=True.

  1. Confirm the detector-model and trajectory artifacts come from the same

source circuit.

  1. Package the result as a DecoderResult artifact instead of returning raw

predictions inline.

Validation Loop

Before closing work:

  1. confirm the graphlike-DEM assumption is recorded,
  2. confirm the detector-model and trajectory bundles are compatible,
  3. confirm the decoder configuration is recorded,
  4. confirm the result is described as a PyMatching lane, not as a general

QLDPC decoder result.

Common Issues And Fixes

Non-graphlike detector model

Problem: the DEM artifact was compiled without graphlike decomposition or still

contains structure that does not fit the matching reduction.

Fix: rebuild the detector model with require_graphlike=True and stop if that

projection is not scientifically acceptable.

Matching used as a universal answer

Problem: a graphlike matching result gets reused for a color-code-specialized,

hypergraph, or heralded-erasure workload that needs a richer decoder story.

Fix: route back through CODE0

and record why the matching reduction is or is not valid.

Benchmark overclaim

Problem: one successful MWPM run gets described as if the repo already ships a

full benchmark lane.

Fix: keep the summary narrow and record that multi-decoder aggregation still

belongs to the benchmark layer.

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.