An Interactive Quantum Circuit Playground
Every quantum computation ends with a measurement. Understanding what happens in that moment - and why it is irreversible - is essential to understanding how quantum algorithms actually produce answers.
You have a qubit in superposition: some mixture of |0⟩ and |1⟩. You want to know what it is. So you measure it. And the superposition - the careful, precise quantum state you have been manipulating with gates - is instantly gone.
Measurement collapses the qubit. The moment you measure, the qubit jumps into one of the two classical states: either 0 or 1. Which one it jumps to is determined by the amplitudes. If the qubit had a 70% amplitude for |0⟩ (meaning 70% probability), it will collapse to |0⟩ about 70% of the time and to |1⟩ about 30% of the time - across many repeated trials. Think of a spinning coin balanced on its edge: while it spins, it is not "heads" or "tails," it is some blend of both possibilities. The instant it lands, that blend resolves into one definite face - and you cannot un-land it.
After the collapse, the qubit is in a definite classical state. All the quantum information about the phase and superposition is gone. This is called the measurement problem, and it is one of the deepest mysteries in physics. Why does the act of observation cause this collapse? Physicists have several interpretations of what is actually happening, and they still argue about it. But the math - what the probabilities are and how collapse works - is precise and experimentally verified.
The rule that converts amplitudes to measurement probabilities is called Born's rule, named after physicist Max Born. It states: the probability of measuring a particular outcome is the square of the magnitude of the corresponding amplitude.
If the amplitude for |0⟩ is a complex number α, then the probability of measuring 0 is |α|² (the magnitude of α, squared). The same for |1⟩: probability equals |β|². Since probabilities must sum to 1, we always have |α|² + |β|² = 1. This is called normalization - the state vector is always normalized. It is the same bookkeeping rule as slicing a pie: however you cut the amplitudes between the two outcomes, the squared pieces always add back up to one whole pie.
The amplitude itself can be negative or complex, but probabilities are always positive real numbers between 0 and 1. This is why phase - the imaginary part and sign of the amplitude - does not directly appear in measurement outcomes but still matters enormously for interference.
Because measurement is probabilistic, a single measurement of a qubit in superposition tells you very little. You get one random outcome. To verify the actual state, you must prepare the same quantum state many times and measure it many times, collecting statistics. It is like trying to figure out if a coin is weighted by flipping it once - one flip tells you almost nothing, but a thousand flips reveal the true odds.
This is a fundamental constraint on quantum computing: you cannot simply "read out" the full state of a qubit. The state is rich with information - amplitudes, phases - but a single measurement only reveals one classical bit (0 or 1). Quantum algorithms are engineered so that the final state, right before measurement, makes the correct answer have very high probability. You still measure randomly, but the right answer is overwhelmingly likely.
Here is a surprising consequence of how measurement works: you cannot copy a qubit. If you could, you could copy the state, measure the copy, and leave the original intact, learning the full quantum state without destroying it. But the math of quantum mechanics does not allow copying an unknown quantum state. This is called the no-cloning theorem.
In classical computing, copying is free - you copy files all the time. In quantum computing, each qubit's state is unique and cannot be duplicated. This has profound implications for quantum error correction (which we cover in Lesson 9) and for quantum cryptography (Lesson 14).
Given that measurement destroys superposition, quantum algorithm design is largely about answering one question: how do you engineer the quantum state so that, right before you measure, the answer you want has an overwhelmingly high probability?
This is where interference - the topic of Lesson 4 - becomes essential. The algorithm needs to guide the quantum calculation so that all the paths that lead to wrong answers destructively interfere (cancel each other out), while all the paths leading to the correct answer constructively interfere (reinforce each other). It is similar to noise-cancelling headphones, but run in reverse and aimed at answers instead of sound waves: wrong-answer waves are arranged to cancel each other out, while the right-answer wave is arranged to build up. Then you measure, get the answer with high probability, and you are done.
This interference-based amplification of correct answers is the core design principle behind most useful quantum algorithms.
Measurement collapses a qubit's superposition into a single definite classical state (0 or 1) with probabilities determined by the amplitudes squared. This collapse is irreversible and destroys all quantum information - which is why quantum algorithms must be designed so the correct answer has very high probability before measurement.
A qubit is in a superposition where it has a 75% chance of measuring as |0⟩. You measure it and get |0⟩. You then measure again immediately. What do you get?
A qubit's amplitude for |1⟩ is α = -0.6i (a negative imaginary number). According to Born's rule, what is the probability of measuring |1⟩?
Why can't you simply measure a qubit once, write down its amplitudes, and call it done - the way you'd read a value out of a classical variable?
Why can't you make a perfect copy of an unknown qubit's state by measuring it and then preparing a fresh qubit in the same state?