Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

TutorialYou end with
Simulate and SampleGHZ probabilities, shot counts, and a backend picked by hand
Variational Circuits and GradientsAn optimized Ising energy from adjoint gradients, and a batched parameter sweep
Noisy SimulationGHZ fidelity under gate noise, readout error, and a device calibration
A QEC Memory ExperimentDecoded logical error rates for a repetition code at three distances
Dynamic CircuitsTeleportation with mid-circuit measurement and feed-forward
Large and Structured Circuits1000-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