Skip to content
Tutorials Center
My learning

Topics

Lesson 7 of 39 ยท Qubits and Superposition

Measurement and the Born Rule

Learn how measuring a qubit works: the Born rule, collapse, shots and counts, measuring in other bases, and how to simulate repeated measurements in NumPy.

Everything in a quantum computation is reversible and deterministic until the moment you read out a result. Measurement is the one step that is irreversible and random. It is also the only way information ever leaves a quantum computer, so understanding it precisely is essential.

This lesson states the rules, simulates them in Python, and clears up the most common confusions: what "collapse" means, why you run a circuit many times, and how to measure in a basis other than 0/1.

The Born rule

If a qubit is in the state alpha|0> + beta|1> and you measure it in the computational basis, then:

  • You get 0 with probability |alpha|^2.
  • You get 1 with probability |beta|^2.

This is the Born rule. For a general state vector with 2^n amplitudes, the probability of reading the bit string k is |amplitude[k]|^2. Because the state is normalized, these probabilities add up to 1.

Collapse

After a measurement returns 0, the qubit is in the state |0>. After it returns 1, the qubit is in |1>. The superposition is gone, and measuring again immediately gives the same answer. This update is called collapse (or state update). The pre-measurement amplitudes are not recoverable from the outcome. One result tells you almost nothing about what the amplitudes were.

Python Born rule and collapse

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Shots and counts

Because one run gives a single random sample, physical experiments repeat the same circuit many times. Each repetition is a shot, and the tally of outcomes is called counts. With enough shots the fractions approach the Born probabilities. This is also how real quantum hardware is used: you ask for, say, 1024 or 4096 shots and read the histogram.

The accuracy of an estimated probability p from N shots is roughly sqrt(p(1-p)/N). To halve the uncertainty you need four times as many shots, so precision gets expensive.

Python Estimating probabilities from shots

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The exact counts depend on the random seed, but the trend, error shrinking with the square root of the number of shots, does not.

A simulator can read the state vector directly and give exact probabilities. Real hardware cannot. It only returns samples. Good algorithm design accounts for how many shots are needed to be confident.

Measuring several qubits

For an n-qubit register the outcomes are bit strings. With two qubits, the state vector has four entries ordered 00, 01, 10, 11 and the probabilities are the four squared magnitudes. Measuring only some of the qubits is allowed too: you add up the probabilities of all outcomes consistent with the observed bits, then keep only matching amplitudes and renormalize. We will implement that in Multi-Qubit States and the Tensor Product and use it in Quantum Teleportation.

Measuring in another basis

Hardware natively measures in the 0/1 basis. To measure in another basis, apply a gate that rotates that basis onto 0/1 first, then measure normally:

  • X basis (|+> versus |->): apply H, then measure. |+> becomes |0> and |-> becomes |1>.
  • Y basis: apply Sโ€  (a quarter-turn phase undo) and then H, then measure.

This is just the basis change from The Qubit and Its State Vector in circuit form. A qubit in |+> gives a random bit if measured in the Z basis but a certain result if measured in the X basis.

Python Measuring in the X basis with a Hadamard

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The Z-basis measurement cannot tell |+> from |->, but a single Hadamard before the measurement tells them apart perfectly. This shows that the phase is real information and that choosing a basis is choosing a question.

The uncertainty principle in action

No state is certain in both the Z basis and the X basis. |0> is certain in Z and random in X. |+> is certain in X and random in Z. This trade-off is a consequence of the geometry of the Bloch sphere: the axes are perpendicular, so being at a pole of one axis puts you on the equator for the others. Measuring in one basis also disturbs information that was encoded in another.

Measurement is not a gate

Gates are unitary: reversible, norm-preserving, deterministic. Measurement is none of these:

  • It is random.
  • It is irreversible: the amplitudes before are lost.
  • It is described by projectors (see Matrices and Unitaries), not unitary matrices.

Circuit diagrams therefore draw it with its own symbol, usually a small meter, and often only at the end. A rule of thumb called the deferred measurement principle says measurements in the middle of a circuit can always be postponed to the end, with controlled gates replacing classical control. Mid-circuit measurement still matters in practice, especially for error correction.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A qubit is in the state [0.6, 0.8]. What is the probability of measuring 1?

    By the Born rule, P(1) = |0.8|^2 = 0.64.
  2. 2. What happens to the state right after a measurement returns 0?

    The state collapses to the measured basis state, so measuring again gives 0 again.
  3. 3. How do you measure a qubit in the X basis on hardware that only measures 0/1?

    H maps |+> to |0> and |-> to |1>, so a 0/1 measurement afterwards reads the X basis.
  4. 4. To make a probability estimate twice as precise, you need about how many times the shots?

    The uncertainty falls like 1/sqrt(N), so halving it needs four times as many shots.

Summary

  • The Born rule: probability of an outcome is the squared magnitude of its amplitude.
  • Measurement collapses the state to the observed outcome and is irreversible.
  • A circuit is run for many shots; counts approximate the probabilities.
  • To measure in another basis, rotate it onto the 0/1 basis first (Hadamard for X).
  • Measurement is described by projectors, not by unitary gates.

Next: Multi-Qubit States and the Tensor Product