Measure a qubit
This is the full version of the one-qubit demonstration on the home page. A qubit holds a blend of 0 and 1 until it is measured; measuring gives one answer and ends the blend. Set the blend with the slider, then measure one copy, a hundred or a thousand, and watch the observed counts settle towards the prediction. It goes with What is a qubit, really? and Superposition without the hype.
The experiment
A qubit holds a blend of 0 and 1. Set the blend, then measure: each measurement gives one answer, and many measurements reveal the blend.
Move left for a lower chance of 1, right for a higher chance. At the centre, both outcomes are equally likely.
Show the maths
|ψ⟩ = 0.71|0⟩ + 0.71|1⟩
This is how physicists write the state. The two numbers are amplitudes: √(1−p) in front of |0⟩ and √p in front of |1⟩, where p is the chance of reading 1. Squaring each gives its probability. Real qubits can also carry a phase, which this demo leaves out, and the numbers shown are rounded to two decimals. Superposition explains the notation step by step.
Predicted probabilities
- 050%
- 150%
What the state predicts. It never changes until you move the slider.
Observed measurements
Latest result –
- Last run
- –
- Total at this setting
- 0
Compare: the chance of 1
Set the chance of reading 1, then measure.
Why the counts don't match exactly
Each measurement gives either 0 or 1, and ends the blend, so every measurement uses a freshly prepared copy of the same state. Even at 50%, 100 copies won't necessarily give exactly 50 ones. The more copies you measure, the closer the observed share usually gets to the prediction.
Results add up until you move the slider or press Reset. Moving the slider clears them, so results from different settings are never mixed. Results are simulated in your browser; nothing is sent anywhere.
What the experiment shows
- Prediction and observation are different things. The predicted chances come from the state you set and never change until you move the slider. The observed counts come from simulated measurements and vary from run to run.
- One measurement tells you almost nothing. You get a 0 or a 1, and the blend is gone. The blend only shows up as a pattern across many freshly prepared copies, which is exactly how researchers read a real quantum computer: run the same circuit many times and look at the counts.
- More copies, closer match. At 50%, a hundred copies will rarely give exactly fifty ones; a thousand copies usually land within a few percent of the prediction. That is ordinary statistics, not anything quantum, and it is why published results quote the number of shots.
What it leaves out
- Phase. The slider covers one family of states, with real, non-negative amplitudes √(1−p) and √p. Real qubits also carry a phase, which has no effect on a single measurement in this basis but matters when amplitudes combine. Superposition introduces it; How quantum gates work shows it changing.
- Noise. The simulation is ideal: every copy is prepared perfectly and read perfectly. Real hardware adds errors on both, which Why qubits are so fragile explains.
- Measurement in other bases. Everything here measures in the 0/1 basis. Measuring the same state another way gives different odds; that is the subject of the gates lesson.
The simulation runs in your browser with a pseudo-random number generator; nothing you do is stored or sent anywhere. The model is tested automatically: amplitudes are √(1−p) and √p, predicted probabilities are their squares, and counts at one setting accumulate until the setting changes.
Sources and further reading
Tags show what kind of source each one is (how this site is made). Spotted an error? Email hello@plainquantum.com.
- BookQuantum Computation and Quantum Information (10th anniversary edition)Michael Nielsen and Isaac Chuang, Cambridge University Press, 2010
- CourseBasics of quantum information (free course)IBM Quantum Learning
- Peer-reviewed paperQuantum Computing in the NISQ era and beyondJohn Preskill, Quantum, 2018