Tutorials¶
Eight pages, in order. Each one builds on the last, and each is short enough to read in a sitting.
Every Python snippet on these pages is executed by the test suite. They are not illustrations of the API — they are tests of it, so a rename that breaks a tutorial breaks the build. The outputs shown were produced by running the code, not written by hand.
-
Build, draw, run, measure. The
CircuitSpec/slot idea that everything else depends on, and why shots come with an error bar. -
Angle, basis, amplitude and Pauli feature maps — the choice that fixes what your model can represent, before training starts.
-
Six methods, one function. Plus the two ways a hand-rolled parameter-shift returns a smooth, plausible, wrong answer.
-
A block vocabulary where a new ansatz is one line and inherits gradients, resource counting and a torch layer for free.
-
VQCin two lines,QuantumLayerin anynn.Module, and the input gradient that decides whether your classical pre-net trains at all. -
No variational training, a convex solver — and a quadratic circuit cost plus exponential concentration waiting for you.
-
Why depth buys frequencies, measured rather than asserted, and the commuting block that silently collapses the whole model.
-
Barren plateaus, cost locality, and three optimisers that exploit structure a general-purpose one cannot see.
Running them yourself¶
Everything except tutorials 5 and 6 needs only a bare install:
Tutorial 5 needs qmlkit[torch], and the classification section of tutorial 6 needs
qmlkit[sklearn]. Both pages say so where it matters.
If you would rather have one script than eight pages, the repository ships
examples/quickstart.py, which walks the same ground end to end.