Development · master
About these docs

Run it

From Stim circuit to SVG or JSON

QP101 preserves gates, repeat blocks, detectors, noise, coordinates, and annotations in execution order.

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 render_svg --in circuit.stim --out circuit.svg
rstim export_json --in circuit.stim --out circuit.qp101.json

Expected files: circuit.svg shows the one-qubit circuit; circuit.qp101.json is its ordered circuit document. Open the SVG in your browser.

Operation types
TypePurpose
gate, noiseQuantum operations and faults
repeat, tickStructure and timing
detector, observable_includeQEC annotations
qubit_coords, shift_coordsVisualization coordinates
Interactive schema browser

Loading schema

Fetching qp101.schema.json.

Example documents