Skip to content
Quantum ComputingAN INTERACTIVE OPEN TEXTBOOK
charithj.com.au

Quantum measurement

Predict a distribution, sample it and understand what measurement changes.

16 min readDr. Charith Jayasekara↓ Chapter PDF
By the end, you’ll be able to
  • Distinguish exact probabilities from finite-shot counts.
  • Explain state change under a projective measurement.
  • Use sampling uncertainty without treating it as hardware noise.

A computational-basis measurement of α∣0⟩+β∣1⟩\alpha\lvert0\rangle+\beta\lvert1\rangle produces 0 or 1 according to the squared amplitudes. After an ideal projective measurement, the qubit is in the corresponding basis state.

Measurement does not always change a state. A qubit already in ∣0⟩\lvert0\rangle stays there after a Z-basis measurement. The important point is that arbitrary inspection without disturbance is unavailable.

If you measure ∣+⟩\lvert+\rangle once and get 0, immediately measuring that same qubit in Z again gives 0. To estimate the original 50/50 distribution, repeat the preparation and experiment, not just the final measurement on the collapsed state.

The lab’s shots are independent preparations. Its “exact” bars come from the mathematical statevector. Hardware does not supply those amplitudes directly.

For 100 independent fair shots, the expected count of 1 is 50, but 47 or 54 would be ordinary fluctuations. A 95% Wilson interval estimates a range for the underlying probability from the observed count, assuming independent identically prepared trials. It is not a guarantee about an individual outcome or a complete model of hardware error.

To measure a qubit in X using a Z-readout device, apply H first. This turns ∣+⟩\lvert+\rangle into ∣0⟩\lvert0\rangle and ∣−⟩\lvert-\rangle into ∣1⟩\lvert1\rangle. Always name the basis when interpreting results.

Try it: change only the seed, then change only the shot count. Which changes alter the state? Neither. Explain why counts and interval widths still change.

Draw the two different repetition procedures

Section titled “Draw the two different repetition procedures”
WORKED DIAGRAM · F09Fresh preparations versus repeated readout
Fresh preparations versus repeated readoutThe lower lane illustrates the branch in which the first Z result was 0. Without a new preparation or intervening operation, the next Z result is also 0.Fresh shotPrepare |+⟩ againMeasure ZNew random bitSame qubitFirst Z result: 0Measure Z againResult: 0
The lower lane illustrates the branch in which the first Z result was 0. Without a new preparation or intervening operation, the next Z result is also 0.

The upper path starts a new experiment for every observation. The lower path measures the same system again after an outcome has already selected a basis state. Those procedures answer different statistical questions. The first estimates the original preparation’s distribution; the second checks the repeatability of an ideal measurement on its post-measurement state.

For a zero result in Z, the unnormalised projected state is the original zero amplitude times the zero ket. Its squared norm is the probability of that result. Dividing by the square root of that probability gives the conditional state. The phase of its sole nonzero amplitude is global, so the physical conditional state is zero. The same reasoning gives one after a one result.

Prepare amplitudes one half for zero and i times square root of three over two for one. A first Z measurement gives zero with probability one quarter and one with probability three quarters. If the result is zero, an immediate second Z measurement gives zero with certainty. If the first result is one, the second gives one with certainty. The joint outcome pairs are therefore 00 and 11, with probabilities one quarter and three quarters.

Now insert H between those two measurements. Whatever the first result, H transforms the remaining basis state into an equal-Z-probability state. The joint pairs become 00 and 01 with probability one eighth each, and 10 and 11 with probability three eighths each. Changing the operation between measurements changes the conditional distribution; “collapse” is not a rule that the qubit must forever retain one classical value.

Compare this with applying H before the first measurement. In that case, the original two amplitudes still interfere. The calculation must use the original complex state rather than an imagined pre-existing random basis label. Ordering the preparation, gates and measurements explicitly prevents confusion between these experiments.

A Z-basis measurement distinguishes zero from one. An X-basis measurement distinguishes plus from minus and can be implemented by applying H before a Z detector. The output is still recorded as a classical label, but its interpretation depends on that readout rotation. A histogram labelled zero and one without a stated basis is incomplete evidence.

For the plus state, Z is random while X is deterministic. This is not a contradiction. The two measurement settings ask about different observable properties. You cannot assume their outcomes are simultaneously readable values stored in a qubit. To estimate both distributions, divide many identically prepared trials between the settings rather than trying to extract every property from one copy.

Exact probabilities, frequencies and uncertainty

Section titled “Exact probabilities, frequencies and uncertainty”

The exact probability is a model prediction. A frequency is an observed count divided by the number of shots. The frequency generally differs from the probability, even in a perfect ideal sampler. At probability one half, one thousand shots have a count standard deviation of about 15.8, corresponding to roughly 1.6 percentage points in frequency. A gap of a few percentage points can be ordinary finite-sample variation.

The lab reports a Wilson interval for the probability of one after a run. Its interpretation assumes independent trials from a fixed probability. A 95-percent interval procedure covers the true probability in about 95 percent of repeated applications under that model; it is not a guarantee that every displayed interval contains the model value. Changing seeds generates another sample, not another underlying quantum state.

The lab below starts from plus, so your initial prediction should be centred on equal counts. State a plausible range rather than an exact split, then run the measurements. Compare the exact probability, observed frequency and interval. Increase the shot budget and predict whether the frequency must move closer on every run, or whether only its typical fluctuation size decreases.

L15 · INTERACTIVE LABRuns on your device

Shots & statistical uncertainty

This lab starts with |+⟩. Each shot is a fresh preparation. Exact probabilities, observed frequencies and a Wilson interval describe different aspects of the experiment.

Experiment controls

Predict approximate counts and plausible fluctuations at this shot budget. Do not demand exact equality.

Record a prediction to enable the results.

Results are hidden.

Prepare your experiment using the controls. Record a prediction, then reveal the statevector or run the experiment.

Changing the preparation or circuit starts a new prediction.

MODEL · Ideal pure-state vector, complex double precisionORDER · q0 is the leftmost bit
Take it further

Keep the state fixed, change the seed, then increase the shots. Compare interval widths rather than demanding identical counts.

To investigate an asymmetric state, set the polar angle to 120 degrees, leave the phase fixed and predict three quarters ones. Make a new prediction and run again. Changing the phase alone should not change the Z distribution, but changing the polar angle should. These comparisons distinguish a state property from sampling variability.

A student prepares plus once, measures zero, then measures the same qubit 999 more times and gets zero each time. They report that plus has zero probability of producing one. Explain the error and give the corrected experimental procedure.

Check your reasoning

The first observation selected the zero state. The remaining observations concern that conditional state, not the original plus preparation. Reprepare plus before every measurement to estimate its distribution. The corrected ideal experiment gives independent half-and-half outcomes; the repeated measurements of a single collapsed state are correlated and cannot be treated as one thousand fresh plus trials.

PAUSE & THINK

After measuring plus in Z and obtaining zero, what does an immediate ideal Z measurement give?

Choose your answer

Reference: IBM Quantum — Quantum mechanics basics.

ONE IDEA FURTHER

Ready for the next step?

Your progress stays in this browser.