Quantum measurement
Predict a distribution, sample it and understand what measurement changes.
- Distinguish exact probabilities from finite-shot counts.
- Explain state change under a projective measurement.
- Use sampling uncertainty without treating it as hardware noise.
One shot gives one outcome
Section titled “One shot gives one outcome”A computational-basis measurement of 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 stays there after a Z-basis measurement. The important point is that arbitrary inspection without disturbance is unavailable.
Fresh preparations matter
Section titled “Fresh preparations matter”If you measure 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.
Interpret the interval
Section titled “Interpret the interval”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.
A different basis
Section titled “A different basis”To measure a qubit in X using a Z-readout device, apply H first. This turns into and into . 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”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.
Worked example: an asymmetric preparation
Section titled “Worked example: an asymmetric preparation”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.
Measurement basis is part of the question
Section titled “Measurement basis is part of the question”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.
Predict before collecting counts
Section titled “Predict before collecting counts”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.
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.
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.
Take it further
Keep the state fixed, change the seed, then increase the shots. Compare interval widths rather than demanding identical counts.
Initial setup · reference state
| Basis | Amplitude a + bi | Magnitude | Phase (rad) | Probability |
|---|---|---|---|---|
| |0⟩ | 0.707107 + 0i | 0.707107 | 0.000000 | 50.0% |
| |1⟩ | 0.707107 + 0i | 0.707107 | 0.000000 | 50.0% |
Signs and complex phases are part of the state. Phase is undefined for a zero amplitude. A shared global phase changes no probabilities; relative phases can affect a later operation. Values are rounded to six decimal places.
Prediction to try: Predict approximate counts and plausible fluctuations at this shot budget. Do not demand exact equality.
Challenge: Keep the state fixed, change the seed, then increase the shots. Compare interval widths rather than demanding identical counts.
Open the live experiment studioTo 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.
Practice: identify the wrong repetition
Section titled “Practice: identify the wrong repetition”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.
Check your understanding
Section titled “Check your understanding”After measuring plus in Z and obtaining zero, what does an immediate ideal Z measurement give?
Answer: Zero with certainty. The first measurement leaves zero. Fresh plus preparations are needed to sample the original distribution.
Reference: IBM Quantum — Quantum mechanics basics.
Ready for the next step?
Your progress stays in this browser.