A qubit is usually introduced as a bit that is "both 0 and 1 at once". That sentence has launched a thousand articles and it explains almost nothing, because a coin spinning in the air is also loosely "both", and a spinning coin is not a quantum computer.

So we wrote a simulator small enough to read in one sitting — no library, just complex arithmetic — and measured what actually distinguishes a qubit from a coin. The distinguishing number turned out to be a zero.

One qubit, and where the halves come from

A single qubit's state is two numbers, called amplitudes: one attached to the outcome 0, one attached to the outcome 1. They are not probabilities. Probabilities are what you get when you square them.

Start a qubit at 0 and apply a Hadamard gate — the standard "put it in superposition" operation — and the amplitudes become 0.7071067811865475 for each outcome. That is 1 over the square root of 2, to the last digit our arithmetic carries. Square it and you get 0.5.

Then we measured it 100,000 times. The outcomes split 50.1% zero and 49.9% one.

Nothing surprising has happened yet. This is the part that does behave like a fair coin, and if you stopped here you would be entitled to ask what the fuss is about. The fuss starts with two qubits.

The zero that a coin cannot produce

Take two qubits. Put the first in superposition, then apply a controlled-NOT: flip the second qubit wherever the first is 1. This is the standard recipe for a Bell pair, and it takes two lines of arithmetic.

Now the register has only two possible outcomes instead of four. Both qubits read 0, or both read 1, each with probability one half. The outcomes 01 and 10 have amplitude zero.

We sampled that state 100,000 times. The two qubits disagreed on 0 of them.

To make sure that zero meant something, we ran the obvious control alongside it: two qubits each put into superposition independently, with no controlled-NOT between them. Same simulator, same sampler, same 100,000 shots. Those two disagreed 49,921 times.

A comparison of two two-qubit states sampled 100,000 times each in our own simulator. The Bell pair, built with a Hadamard gate followed by a controlled-NOT, produces only the outcomes 00 and 11, roughly 50,000 times each, and the two qubits disagree on exactly 0 shots. Two independently superposed qubits, with no controlled-NOT between them, produce all four outcomes at roughly 25,000 each, and disagree on 49,921 shots. A note records that the single-qubit Hadamard amplitude is 0.7071067811865475, which is one over the square root of two.
Same shot count, same sampler. The only difference is one gate.

That pair of numbers — 0 against 49,921 — is the whole distinction, and it needs no adjectives. Two fair coins disagree about half the time. There is no way to weight two independent coins so they always agree while each still comes up heads half the time. The Bell pair does exactly that.

What "correlated" is and is not

Be careful here. This is where popular accounts reach for the word "spooky" and imply something travels between the qubits.

What we measured is that the two outcomes agree. We did not measure one qubit causing the other, and nothing in the arithmetic says it does. The amplitudes for 01 and 10 are zero from the moment the controlled-NOT is applied — before any measurement happens at all. The correlation is a property of the state, not an event that occurs when you look.

That distinction matters practically. If measuring one qubit sent a signal to the other, you could use it to communicate. You cannot. Each qubit on its own still reads 0 half the time and 1 half the time; the correlation is only visible once you compare the two records, and comparing them requires carrying one of them to the other by ordinary means.

Why the amplitudes have to be able to cancel

Amplitudes are not just probabilities under another name because they can be negative or, more generally, complex.

Probabilities only add. Two ways of reaching the same outcome make that outcome more likely. Amplitudes add too, but a positive and a negative amplitude arriving at the same outcome cancel, and the outcome becomes less likely, or impossible.

That cancellation is what a quantum algorithm is made of. The machine is not searching every possibility in parallel and picking the winner, which is the usual and wrong summary. It is arranging for the amplitudes of wrong answers to cancel and the amplitude of the right answer to survive. Our companion guide on how much faster quantum search really is counts that process happening, step by step, and shows what it costs.

The 01 and 10 outcomes in the Bell pair are the simplest possible example: they are not unlikely, they are cancelled. Zero shots out of 100,000 is what cancellation looks like from the outside.

Reading the numbers yourself

Everything above is ordinary arithmetic on four numbers, and none of it needs quantum hardware. If you want to check the probabilities, our percentage calculator will take 49,921 out of 100,000 and give you back the 49.9% we quoted. If you want to see how quickly the number of possible outcomes grows as qubits are added — two qubits give four outcomes, ten give 1,024 — our permutation and combination calculator is doing the same counting that sets the size of the state vector.

And if you want to satisfy yourself that a fair sampler really does land near half, our random number generator will give you a run to count. The 50.1/49.9 split above is what fairness looks like at 100,000 trials; at 100 trials it would look considerably less convincing, which is worth remembering before drawing conclusions from a short run of anything.

What this does not tell you

A simulator is not a quantum computer, and running one proves nothing about whether the hardware works. Ours holds a handful of qubits in ordinary memory, and it does so by storing every amplitude explicitly — which is precisely the thing that stops working as qubits are added. Each extra qubit doubles the list. Thirty qubits is a billion amplitudes; fifty is beyond any classical machine. To put that in ordinary terms: storing fifty qubits at the precision we used here would need about 18 petabytes of memory — 2 to the 50th amplitudes at sixteen bytes each — which is why the line between "simulate it" and "build it" falls where it does rather than being a matter of patience.

That doubling is the honest reason people build quantum computers, and also the reason a simulator can only ever illustrate. The arithmetic is exact and checkable at this scale. Whether it can be made to hold together in hardware at a useful scale is a separate question, and one that the overhead arithmetic answers unkindly.

The short version

A qubit is not a bit that is both values at once. It is a pair of amplitudes that can cancel, and cancellation is the only thing here a coin cannot imitate. The measurement that shows it is not the 50/50 split — a coin does that — but the Bell pair's 0 disagreements in 100,000 shots against 49,921 for the same qubits left uncorrelated. If you remember one number from this page, remember the zero.

Sources and method

  • All figures produced by measure-qubit-amplitudes.cjs in this repository, using a state-vector simulator written for the purpose with no external library.
  • Sampling uses a seeded linear congruential generator, so the 100,000-shot counts above reproduce exactly on re-run rather than drifting between runs.
  • Normalisation is asserted after every gate; the simulator aborts rather than reporting figures from a state that has lost total probability 1.

This guide explains the arithmetic behind a widely used metaphor. It is educational and is not investment, security or engineering advice.