Skip to main content

Watch: Quantum Computing from Scratch, in Python

The quantum-from-scratch series is now a playlist. Ten episodes, animated and narrated, built from the same posts and the same code.

The series builds a quantum computer simulator from nothing. No framework, no library that already knows what a qubit is, just NumPy and the arithmetic written out until it is explicit. A state is a vector. An operation is a matrix. To compose operations you multiply. That much is ordinary linear algebra, and the series makes a point of building the ordinary classical version first, so the quantum one turns out to be almost a one-line edit: let the weights carry a minus sign, recover a probability only by squaring at the end, and suddenly two routes to the same outcome can cancel. Everything that sounds like magic afterward, superposition, interference, the algorithms, is that one change and nothing else.

To make the change visible, the whole series speaks one visual language: amplitude bars. Every state is a row of bars, and every gate is something you watch happen to them. When two routes cancel, you see the bars fall to nothing. When Grover’s search concentrates weight on the answer, you watch it pile up. The animation is not decoration here; it is the point, because interference is exactly the kind of thing that is hard to believe from an equation and obvious once you have seen it move.

There are ten episodes because I added a new one at the very front: a classical on-ramp. Before any qubit appears, it builds classical probability from the coin under the cup, the definite fact in the dark and the odds that live in your head rather than in the coin. That episode follows the opening of my book Multitudes: The Indifference of Measure, whose Part I builds the same physics from the same coin, in pictures rather than code. If the on-ramp lands for you, the book is the long version.

The playlist

Discussion