Noise-Free Simulation Limits
A dense state-vector simulator stores one complex amplitude for each of the 2^n basis states — 16 bytes each in QPU137 — so memory doubles with every qubit added: 20 qubits need 16 MiB, 30 need 16 GiB, and 45 needed about half a petabyte on a supercomputer. That exponential curve, not a lack of engineering effort, is why browser simulation stops in the mid-twenties.
What does an ideal simulator actually store?
The QPU137 simulator is a state-vector simulator: it keeps the complete quantum state as one long array called the state vector, holding one amplitude — the complex number whose squared magnitude gives a measurement probability — for every possible basis state, that is, every possible assignment of 0s and 1s to the qubits.
Count the basis states: 1 qubit has 2 (|0⟩, |1⟩), 2 qubits have 4, 3 qubits have 8, 5 qubits have 32. Each new qubit doubles the count, so n qubits need 2^n amplitudes.
Each amplitude is stored as two 64-bit floating-point numbers — a real part and an imaginary part — which is 8 + 8 = 16 bytes per amplitude, before any working buffers. Multiply the two numbers together and you have the entire memory story of ideal simulation.
You’ve read the opening of chapter 12 — 7 more sections follow, with worked examples and circuits you can run on the page. A free account unlocks every chapter of every course (paid plans aren’t live yet — early readers get everything free).