Lesson 6 of 9
Measurement: one answer, once
Explain why a quantum program must be run many times, and what that costs.
01 · Learn · the idea
You spent three moves building a state where the right answer sits at 96%. You measure. Out comes one number, and the state is gone.
How it works
- Measuring gives ONE draw from the distribution, not a readout of it
- The state collapses — there is nothing left to look at again
- So you repeat the whole thing: prepare, run, measure, discard each repeat is a shot
- Shots needed depend on p: missing n times is (1−p)ⁿ
- And you need a cheap ORDINARY way to check a candidate answer
In numbers
Shots needed to be 99.9% sure of seeing the right answer
Halving the success rate does not double the work. Near the bottom it multiplies it — which is why so much quantum engineering is really about keeping p high.
Side by side
Two moves or three, on the sixteen-box search
The common misread
That the machine computes the answer and you then read it off. You get a single sample, and you cannot tell by looking whether it came from the 96% or the 0.3%.
The words
- shot
- one full run: prepare, compute, measure, discard
- collapse
- what measuring does — every amplitude becomes one definite outcome
Carry this
The forgotten step is nearly always the one where the work has to leave the system and become usable outside it. Ask how the result gets out, and what that costs.
Full lesson
Ninety-six per cent, and then it is gone
You have run the search. The state is exactly where you wanted it: the right answer sits at 96%, the fifteen wrong ones at a fraction of a per cent each. You can picture the whole arrangement of amplitudes.
You measure.
Out comes a single number. One box. And the arrangement you spent three moves building is destroyed — every amplitude collapsed to a single definite outcome. There is no way to look again, because there is nothing left to look at.
This is the tax on the whole enterprise, and it is easy to miss because the popular story stops at “the answer is in there”.
What you get is a sample, not a readout
The distinction matters. A quantum machine does not hand you its amplitudes. It hands you one draw from them.
You built a distribution. You get one sample of it. And you cannot look at that sample and tell whether it came from the 96% or from the 0.3%. It is just a number.
So a quantum program is not “run it and read the answer”. It is:
prepare the state → run the circuit → measure → write down what came out → throw everything away → do it all again.
Each repetition is called a shot. Real programs take thousands.
The arithmetic of being sure
How many shots do you need? It depends entirely on how good the state was.
If the right answer has probability p, then the chance of missing it n times running is (1−p)ⁿ. Set that below one in a thousand and you get the shot count:
- p = 96% → 3 shots
- p = 50% → 10 shots
- p = 30% → 20 shots
- p = 10% → 66 shots
- p = 5% → 135 shots
- p = 1% → 688 shots
Notice how badly this falls apart at the bottom. Halving your success rate does not double the work; near the bottom it multiplies it. A great deal of quantum engineering is really about keeping p high enough that the shot count stays sane.
And you must be able to check
There is a second condition, and it disqualifies more proposals than the first.
You get a number out. You do not know whether it is the good one. So you need a cheap, ordinary way to test a candidate answer.
For factoring, that test is trivial: multiply the two factors and see if you get the original number back. For the box search, open the box. For a chemistry simulation, you are sampling an energy, and repeated samples build the distribution you actually wanted — the samples are the answer.
But for a problem where checking a proposed answer is itself hard, sampling buys you nothing at all. You are handed a guess you cannot evaluate, thousands of times. A quantum speed-up needs a classical checker, and when someone describes a quantum application without saying what the checker is, that is usually the missing piece.
The cost nobody quotes
Put the shot count together with the run length and something slightly awkward appears.
Take the sixteen-box search. Three moves gets the answer to 96.1%, which needs 3 shots — 3 × 4 units of machine time, call it 12. But two moves gets to 90.8%, which also needs only 3 shots, at 3 × 3 = 9 units.
Two moves is cheaper than three, even though three is more accurate.
The “optimal” number of repetitions depends on what you are counting. Optimising the success probability and optimising the total machine time are different problems with different answers, and the headline figure is almost always the first one.
The general habit
The step that gets forgotten is nearly always the one where the work leaves the system and has to become usable outside it.
A model that predicts well but cannot say why. A study with a real effect that no clinic can administer. A machine that builds a beautiful state and hands you one sample. In each case the impressive part is genuine, and the question that decides whether it matters is the dull one: how does the result get out, and what does that cost?
02 · Try · the lab
03 · Check · quick quiz
1. A quantum circuit leaves the right answer at 10%. Roughly how many shots are needed to be 99.9% sure of seeing it?
- About 66
- About 10
- About 100
- About 1,000
Answer
About 66 — The chance of missing it n times is 0.9 to the n, and that drops below one in a thousand at 66. Notice how fast this grows as p falls — at 1% it is 688.
2. Why does a quantum speed-up usually need a cheap classical way to check an answer?
- Each shot returns one number, and you cannot tell a good one from a bad one by looking
- Because the quantum machine's output is encrypted
- To confirm the machine has not overheated during the run
- Because quantum answers are only approximate and need rounding
Answer
Each shot returns one number, and you cannot tell a good one from a bad one by looking — You get a sample, not a readout. Factoring works partly because checking is trivial — multiply the factors back. Where checking is itself hard, thousands of unevaluable guesses buy nothing.
3. Three moves of the sixteen-box search reach 96.1%; two moves reach 90.8%. Both need 3 shots. Which costs less machine time?
- Two moves — same number of shots, but each shot is shorter
- Three moves, because higher accuracy always means fewer repeats
- They cost the same, since the shot count is identical
- Neither; machine time depends only on the number of qubits
Answer
Two moves — same number of shots, but each shot is shorter — Three shots of a two-move run is 9 units; three shots of a three-move run is 12. Optimising accuracy and optimising total time are different problems, and the headline is almost always the first.