|q⟩ Bad Qubits

beginner · Programming · Two Qubits & Tensor Products

Counting Amplitudes Grows Fast

One qubit needs two complex amplitudes to describe its state. Two qubits need four. Three need eight. The pattern is 2n2^n — and that number grows so fast it becomes the central fact of quantum computation.

Why the count doubles with every qubit

A single qubit lives in a two-dimensional Hilbert space spanned by 0|0\rangle and 1|1\rangle:

ψ=α00+α11,α0,α1C.|\psi\rangle = \alpha_0|0\rangle + \alpha_1|1\rangle, \qquad \alpha_0,\alpha_1 \in \mathbb{C}.

When you add a second qubit the joint state space is the tensor product of both single-qubit spaces. The computational-basis states of two qubits are all pairwise combinations: 00,01,10,11|00\rangle, |01\rangle, |10\rangle, |11\rangle — exactly four basis vectors, so the state vector has four amplitudes. A third qubit doubles that to eight, because each of the four two-qubit states gets paired with 0|0\rangle and with 1|1\rangle. In general:

ψ=k=02n1αkk,αkC.|\psi\rangle = \sum_{k=0}^{2^n - 1} \alpha_k |k\rangle, \qquad \alpha_k \in \mathbb{C}.

The nn-qubit register has 2n2^n basis states, so the state vector holds 2n2^n complex amplitudes.

The numbers get large very quickly

| Qubits nn | Amplitudes 2n2^n | Memory (approx.) | |:-----------:|:----------------:|:----------------:| | 1 | 2 | 32 B | | 10 | 1 024 | 16 KB | | 20 | 1 048 576 | 16 MB | | 30 | 109\approx 10^9 | 16 GB | | 50 | 1015\approx 10^{15} | 16384\approx 16\,384 TB |

Each amplitude is a complex number requiring 16 bytes (two 64-bit floats). At 50 qubits, storing the full state vector would take roughly 250×161.8×10162^{50} \times 16 \approx 1.8 \times 10^{16} bytes — far beyond any classical supercomputer available today.

What this means in practice

Classical simulators — including the one running your exercises in this platform — must store and update every amplitude. That is why your browser can comfortably simulate 15–20 qubits but would run out of memory trying to simulate 50. When you read about a quantum computer demonstrating "quantum advantage," the core claim is almost always that the 2n2^n scaling makes its computation impossible to reproduce classically in a reasonable time.

Understanding this exponential is also key to reading quantum algorithms. Grover's algorithm, for example, searches an unsorted list of N=2nN = 2^n items in O(N)O(\sqrt{N}) steps rather than O(N)O(N) classical steps — its speedup is only meaningful once NN is large, which is precisely where classical simulation breaks down.

Sign in on the full site to ask questions and join the discussion.