Skip to content

Measurement

A qubit’s state is two amplitudes. So can we read those amplitudes out? We cannot, and the reason shapes everything else in quantum computing.

When you measure a qubit in the state α∣0⟩+β∣1⟩\alpha\ket{0} + \beta\ket{1}, you do not see α\alpha or β\beta. You get a single classical bit:

  • 0 with probability ∣α∣2|\alpha|^2,
  • 1 with probability ∣β∣2|\beta|^2.

This is the Born rule, and it explains the normalisation condition from the last lesson. The two probabilities must add up to one, so ∣α∣2+∣β∣2=1|\alpha|^2 + |\beta|^2 = 1.

Check

You measure the state 0.6∣0⟩−0.8∣1⟩0.6\ket{0} - 0.8\ket{1}. What is the probability of getting 1?

The second half of the rule is just as important. After the measurement, the qubit is no longer in its old state:

  • if you saw 0, the qubit is now in ∣0⟩\ket{0},
  • if you saw 1, the qubit is now in ∣1⟩\ket{1}.

The amplitudes α\alpha and β\beta are gone. Measuring again gives the same answer as the first time, with certainty, and tells you nothing new.

So one qubit gives you one bit, and only once. To estimate ∣α∣2|\alpha|^2 you need many fresh copies of the same state, measuring each one and counting.

Try it. Build the state ∣+⟩\ket{+}, then press Measure ×100 a few times. Each press prepares the state afresh 100 times and measures each copy.

PuzzleA fair coin

Starting from ∣0⟩\ket{0}, make a state that gives 0 and 1 with equal probability.

This puzzle needs JavaScript.

The counts are close to 50 and 50 but not exactly, and they change every time. That randomness is not a limitation of the simulator. As far as anyone knows, it is a basic feature of nature.

Now make ∣−⟩=12(∣0⟩−∣1⟩)\ket{-} = \tfrac{1}{\sqrt2}(\ket{0} - \ket{1}) and measure it.

PuzzleMake the minus state

Starting from ∣0⟩\ket{0}, make the state ∣−⟩\ket{-}.

This puzzle needs JavaScript.

Hint

HH turns ∣1⟩\ket{1} into ∣−⟩\ket{-}. So first get to ∣1⟩\ket{1}.

The measurement counts for ∣−⟩\ket{-} look just like the counts for ∣+⟩\ket{+}: half zeros, half ones. If measurement is all we can do, are these two really different states?

They are, and you can prove it with a circuit. The gate HH, called the Hadamard gate, acts like this:

H∣0⟩=∣+⟩,H∣1⟩=∣−⟩.H\ket{0} = \ket{+}, \qquad H\ket{1} = \ket{-}.

It also works in reverse: H∣+⟩=∣0⟩H\ket{+} = \ket{0} and H∣−⟩=∣1⟩H\ket{-} = \ket{1}. So if someone hands you a qubit that is either ∣+⟩\ket{+} or ∣−⟩\ket{-}, apply HH and then measure. You get 0 for ∣+⟩\ket{+} and 1 for ∣−⟩\ket{-}, every time.

The sign between the two terms is called a relative phase. A direct measurement cannot see it, but a gate applied before the measurement can turn it into something visible.

Why does applying HH twice bring ∣0⟩\ket{0} back to ∣0⟩\ket{0}? Follow the amplitudes:

∣0⟩→  H  12∣0⟩+12∣1⟩→  H  12⋅12(∣0⟩+∣1⟩)+12⋅12(∣0⟩−∣1⟩).\ket{0} \xrightarrow{\;H\;} \tfrac{1}{\sqrt2}\ket{0} + \tfrac{1}{\sqrt2}\ket{1} \xrightarrow{\;H\;} \tfrac{1}{\sqrt2}\cdot\tfrac{1}{\sqrt2}\bigl(\ket{0} + \ket{1}\bigr) + \tfrac{1}{\sqrt2}\cdot\tfrac{1}{\sqrt2}\bigl(\ket{0} - \ket{1}\bigr).

Collect terms. The amplitude of ∣0⟩\ket{0} is 12+12=1\tfrac12 + \tfrac12 = 1. The amplitude of ∣1⟩\ket{1} is 12−12=0\tfrac12 - \tfrac12 = 0.

There are two routes to ∣1⟩\ket{1}, and their amplitudes are equal and opposite, so they cancel. The two routes to ∣0⟩\ket{0} add up. This is interference, and it cannot happen with probabilities, which are never negative. A coin flipped twice is still random. A qubit “flipped” twice with HH is certain.

The next puzzle uses interference to do something that looks impossible with the gates you are given.

PuzzleFlip without the flip gate

Take ∣0⟩\ket{0} to ∣1⟩\ket{1} using only HH and ZZ. The gate ZZ leaves ∣0⟩\ket{0} alone and sends ∣1⟩\ket{1} to −∣1⟩-\ket{1}.

This puzzle needs JavaScript.

Hint

ZZ changes the sign of the ∣1⟩\ket{1} amplitude, so it turns ∣+⟩\ket{+} into ∣−⟩\ket{-}. What does HH do to ∣−⟩\ket{-}?

On its own, ZZ does nothing you could ever see by measuring: it only changes a sign. Placed between two HH gates, that sign decides which paths cancel, and the outcome flips from certain 0 to certain 1.

RecallAnswer from memory, then check
LessonFinish this lesson