Example Catalog
The example catalogue walks through eight worked quantum algorithms at textbook depth. Each page motivates the algorithm, derives the key identity, shows the circuit (SVG + annotated JSON excerpt + download link), runs it from the CLI, and interprets the result.
Start with Getting Started and the Circuit JSON Conventions if you have not read them.
Foundational
- Entangled States — Bell pair and GHZ state; the first taste of entanglement.
- Quantum Fourier Transform — the phase-encoding primitive underlying phase estimation, Shor, and HHL.
Standard subroutines
- Phase Estimation — read eigenphases into an ancilla register using an inverse QFT.
- Ancilla Protocols — Hadamard test and swap test; ancilla + controlled-U + basis change estimates overlaps.
Algorithms
- Bernstein–Vazirani — single-query learning of a linear Boolean function.
- Grover Search — amplitude amplification for unstructured search.
Variational
- QAOA for MaxCut — variational algorithm for combinatorial optimization (static parameters; training deferred).
- Quantum Circuit Born Machine — parametric circuit as a probability generator (static parameters; training deferred).
Deferred coverage
The following categories need features tracked in open issues:
| Group | Examples | Issue |
|---|---|---|
| Optimization and training loops | VQE, QCBM training, QuGAN, GateLearning | #31 |
| Hamiltonian and time evolution | Ground-state solvers, HHL, QSVD, ODE-style evolutions | #32 |
| Rich Grover oracles | Grover inference, variational-generator variants | #33 |
| Measurement games and external workflows | Mermin magic square, chemistry import | #34 |
| Arithmetic oracles | Shor order finding | #35 |
Regenerating all artifacts
All embedded SVGs, probability JSONs, and plots live under
docs/src/examples/generated/. Every example page lists a copy-paste bash
block to regenerate its own artifacts. To rebuild everything at once:
cargo build -p yao-cli --no-default-features
YAO_ARTIFACT_DIR=docs/src/examples/generated YAO_BIN=target/debug/yao bash examples/cli/generate_artifacts.sh
python3 scripts/plot_cli_results.py docs/src/examples/generated/results docs/src/examples/generated/plots