Development · master
About these docs

Run it

Analyze once, sample directly

Requires rstim on PATH. If you installed only rustqec with Cargo, add the Stim-style CLI below; the native package already includes it. Run in a scratch directory. The example below provides its complete input.

cargo install --locked rstim --version 0.3.0 --bin rstim --features cli,codegen-css,shot-viewer

This deterministic example resets one qubit, applies an X error with probability 1, then measures a detector and observable. Create the input in your current working directory:

cat > circuit.stim <<'STIM'
R 0
X_ERROR(1) 0
M 0
DETECTOR rec[-1]
OBSERVABLE_INCLUDE(0) rec[-1]
STIM
rstim analyze_errors --in circuit.stim --out model.dem
rstim sample_dem --in model.dem --shots 1 --out_format dets

Expected: model.dem contains error(1) D0 L0; sampling prints shot D0 L0. Next: choose a decoder.

Example results

Detection and DEM sampling

These are separate, recorded workloads. Compare implementations only within the same workload and metric; reproduction details and limits are below.

WorkloadImplementationMetricResult
Surface d=13, r=13 detectrstim compiledElapsed time · lower is better34.339 ms
Surface d=13, r=13 detectStim CLIElapsed time · lower is better266.172 ms
Surface d=11, r=100 DEM samplerstimThroughput · higher is better329 shots/s
Surface d=11, r=100 DEM sampleStimThroughput · higher is better2,669 shots/s

Benchmark evidence

Checked DEM results

Loading detector-model evidence.