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

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

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

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:

GroupExamplesIssue
Optimization and training loopsVQE, QCBM training, QuGAN, GateLearning#31
Hamiltonian and time evolutionGround-state solvers, HHL, QSVD, ODE-style evolutions#32
Rich Grover oraclesGrover inference, variational-generator variants#33
Measurement games and external workflowsMermin magic square, chemistry import#34
Arithmetic oraclesShor 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