Circuit visualization
Render circuit diagrams
Export an ordered QP101 circuit document or render it directly as SVG.
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.
Results
Rendered examples
Operation types
| Type | Purpose |
|---|---|
gate, noise | Quantum operations and faults |
repeat, tick | Structure and timing |
detector, observable_include | QEC annotations |
qubit_coords, shift_coords | Visualization coordinates |
Interactive schema browser
Loading schema
Fetching qp101.schema.json.