Tutorials
Each tutorial starts from an empty file and ends at a number you can check, in a few minutes. Code is Python first, with the Rust equivalent where the two differ in more than syntax. Every Python block on these pages runs in CI, as does every Rust block.
| Tutorial | You end with |
|---|---|
| Simulate and Sample | GHZ probabilities, shot counts, and a backend picked by hand |
| Variational Circuits and Gradients | An optimized Ising energy from adjoint gradients, and a batched parameter sweep |
| Noisy Simulation | GHZ fidelity under gate noise, readout error, and a device calibration |
| A QEC Memory Experiment | Decoded logical error rates for a repetition code at three distances |
| Dynamic Circuits | Teleportation with mid-circuit measurement and feed-forward |
| Large and Structured Circuits | 1000-qubit Clifford sampling, a Clifford+T expectation, and an MPS run with its error bound |
Install the package first:
pip install prism-q
Each tutorial has a runnable script in
bindings/python/examples/,
and the Rust programs in
examples/ cover the same
ground:
python bindings/python/examples/qec_memory.py
cargo run --release --example qec_memory