Level 9 · Plain-English Explainers
How a Quantum Computer Works
About 4,945 words · roughly 22 minute read · sources checked December 2, 2026
A quantum computer is not a faster laptop. It is a different kind of machine that stores information in physical systems that obey quantum mechanics and processes it by steering the way their probabilities add up. If you remember one sentence from this page, make it this one: a quantum algorithm arranges for the wrong answers to cancel and the right answer to reinforce, and then you look.
This page explains the whole pipeline in plain English, in the order it happens in a real computation: prepare, create superpositions, entangle, interfere, measure. Each step comes with a small calculation that I ran, so you can see that the claims are not hand-waving. No physics background is needed, only the idea of a list of numbers and the idea of adding them.
Where I describe hardware, I stay at the level of what each approach is trying to do, and I say when something is background that I did not look up. Detailed hardware numbers are in the hardware lessons of this site.
What you will learn
- What a qubit stores, as a list of two numbers, and why measuring it gives only one bit.
- What gates do to those numbers, with a worked example on three qubits.
- What entanglement is, shown with the two-qubit Bell state.
- Why interference, not ‘trying all answers at once’, is the real source of any speed-up.
- A complete worked search on four items that succeeds with certainty after one step.
- How many numbers a classical computer needs to track n qubits, and why that explodes.
- What the hardware has to do, and why errors are the central engineering problem.
Start with an ordinary bit
Every classical computer, from a phone to a data centre, stores information as bits. A bit is either 0 or 1, and a computation is a long sequence of simple operations (AND, OR, NOT) that turn some bits into other bits. At any moment, the machine is in exactly one definite state: this pattern of 0s and 1s and no other.
Three bits can be in any of 2³ = 8 patterns, from 000 to 111, but at any one time they hold exactly one of them. To do something with all eight patterns, a classical machine has to visit them one after another, or use eight copies of the hardware.
A quantum computer changes this in a specific, limited way. Its basic unit, the qubit, can be prepared so that, instead of being 0 or 1, it carries a pair of numbers that say how much of each is ‘present’. Those numbers are not probabilities yet. They are called amplitudes, and they can be positive, negative or even complex. What happens next depends on how they add.
A qubit is a pair of amplitudes
The state of one qubit is written as two numbers, (a, b), with a² + b² = 1 (for real amplitudes). The number a goes with the outcome 0 and b with the outcome 1. When you finally measure the qubit, you get 0 with probability a² and 1 with probability b².
| Qubit state (a, b) | P(0) = a² | P(1) = b² | In words |
|---|---|---|---|
| (1, 0) | 1 | 0 | Definitely 0, like an ordinary bit |
| (0, 1) | 0 | 1 | Definitely 1 |
| (0.707, 0.707) | 0.5 | 0.5 | An equal superposition: a fair coin |
| (0.707, −0.707) | 0.5 | 0.5 | Also a fair coin, but with a minus sign |
| (0.6, 0.8) | 0.36 | 0.64 | Biased: 64% chance of 1 |
Computed by squaring the amplitudes. The two rows with 0.707 give identical measurement probabilities, yet they are different states.
The fourth row is the important one. (0.707, 0.707) and (0.707, −0.707) look the same if you measure them straight away, because squaring removes the sign. But they behave differently in what follows, because signs decide whether amplitudes reinforce or cancel when they are added. That hidden sign, which you cannot see by measuring directly, is the raw material of quantum computing.
Common misunderstanding
A qubit in an equal superposition is not secretly 0 or 1 with you not knowing which. An experiment on the earlier Level 8 pages (the ‘X-basis test’ in the cat lesson) shows the difference: a superposition passes a test that a coin-flip mixture fails.
Measurement gives one bit, not the whole list
A qubit carries two numbers, but reading it out gives only one bit. The measurement picks 0 or 1 at random with the squared-amplitude probabilities, and afterwards the qubit is definitely in the state you saw. The other amplitude is gone.
This is why a quantum computer is not a machine for storing huge amounts of data in qubits. You cannot read the amplitudes back. What you can do is arrange the computation so that, at the end, the amplitude is concentrated on the answer you want. Then one measurement hands it to you with high probability.
Gates: operations on amplitudes
A quantum gate is a rule that turns one list of amplitudes into another. The most important one is the Hadamard gate, H. On a qubit it does this: (1, 0) becomes (0.707, 0.707), and (0, 1) becomes (0.707, −0.707). In words, H turns a definite value into an equal superposition, and it does the same turn in reverse.
Worked example
Hadamard on three qubits
- Start with three qubits all at 0, which is the state 000 with amplitude 1.
- Apply H to each qubit. Each qubit becomes (0.707, 0.707), and the amplitude of any three-bit pattern is the product of three amplitudes: 0.707 × 0.707 × 0.707 = 0.354.
- There are 8 patterns, and each now has amplitude 0.354, so each has probability 0.354² = 0.125 = 1/8.
- So three gates have spread the machine across all eight patterns with equal weight, a list of 8 numbers, all equal to 0.354.
With n qubits the same trick gives 2ⁿ amplitudes, each equal to 1/√(2ⁿ). That is what people mean by ‘a quantum computer works on all the possibilities at once’, and it is only half of the story. Having all the patterns present with equal weight is not useful by itself: if you measured now, you would get a random pattern, no better than flipping coins.
The engine: interference
The useful part comes from the next step. Amplitudes can be negative, and when two routes lead to the same outcome, their amplitudes add. If both are positive they reinforce. If one is positive and one is negative they cancel. Quantum algorithms are cleverly designed sequences of gates that make the amplitudes of wrong answers cancel and the amplitude of the right answer pile up.
The smallest example is the circuit H, then a phase flip, then H, which is the same circuit as the Mach–Zehnder interferometer in the Level 8 double-slit lesson. Start with a qubit at 0. After the first H it is (0.707, 0.707). A phase gate multiplies the second amplitude by a sign or a phase. The second H then combines the two amplitudes again.
| Phase applied | State before the second H | Final P(0) | Final P(1) |
|---|---|---|---|
| None (+) | (0.707, +0.707) | 1.00 | 0.00 |
| A minus sign (−) | (0.707, −0.707) | 0.00 | 1.00 |
Computed with 2×2 matrices. The same two probabilities before the last H (0.5, 0.5) become certainties after it, depending only on a sign you could not see.
This is the whole idea in miniature. A single minus sign, invisible to a direct measurement, is converted into a certain answer by the second H. A real algorithm does the same with a vast number of amplitudes: it encodes information about the problem in signs and phases, then uses a carefully chosen sequence of gates to convert that hidden information into probabilities that can be read.
What this is not
It is not ‘trying every answer in parallel and picking the best’. A measurement gives you only one random pattern. The speed-up, when there is one, comes entirely from engineering the cancellations so that the answer you want is the one that survives.
Entanglement: qubits that cannot be described separately
With two qubits there are four patterns (00, 01, 10, 11), so the state is a list of four amplitudes. Some lists can be split into ‘qubit one does this, qubit two does that’. Others cannot. The classic example uses an H gate on the first qubit followed by a CNOT gate (which flips the second qubit if the first is 1).
| Pattern | Amplitude after H then CNOT | Probability |
|---|---|---|
| 00 | 0.707 | 0.5 |
| 01 | 0 | 0 |
| 10 | 0 | 0 |
| 11 | 0.707 | 0.5 |
Computed with 4×4 matrices. This is the Bell state, (|00⟩ + |11⟩)/√2.
Look at the probabilities. Measured together, the two qubits give 00 or 11, each half the time, and never 01 or 10. Each qubit alone looks like a fair coin, but the two coins always agree. There is no way to describe this by giving each qubit its own pair of amplitudes, because the pattern lives in the relationship between them.
This is entanglement. It is the resource that lets n qubits carry an amount of structure that grows far faster than n, which is what the next table is about. It is also what makes quantum states fragile: any stray interaction with the environment that touches one qubit also disturbs the relationship, a problem described in the cat lesson on decoherence.
Why a classical computer struggles to keep up
To describe n qubits in general, you need 2ⁿ amplitudes. A classical simulator that stores them naively needs 2ⁿ complex numbers. At 16 bytes per complex number, the memory required is shown below.
| Qubits n | Amplitudes 2ⁿ | Memory at 16 bytes each |
|---|---|---|
| 10 | 1,024 | 16 kilobytes |
| 20 | 1.05 million | 16.8 megabytes |
| 30 | 1.07 billion | 17.2 gigabytes |
| 40 | 1.10 × 10¹² | 17.6 terabytes |
| 50 | 1.13 × 10¹⁵ | 18 petabytes |
| 300 | 2.0 × 10⁹⁰ | about 3 × 10⁷⁶ petabytes |
Computed. This is the memory for a brute-force full description, not what the best simulators need for every circuit (background: simulators that exploit structure can handle some larger circuits).
Each extra qubit doubles the memory. A laptop can simulate about thirty qubits this way, a large supercomputer a few dozen more, and a few hundred qubits would need more numbers than there are atoms in the observable universe (a number I give as background, roughly 10⁸⁰). That is the basic reason why it is interesting to build a machine in which nature itself holds the amplitudes.
But note the limit. A quantum computer holds these amplitudes without letting you read them all. You can only get one pattern per run. The art is to arrange the problem so that the single pattern you read is the useful one.
A complete example: finding one item among four
Here is a whole algorithm, small enough to follow. There are four boxes, labelled 00, 01, 10, 11, and exactly one holds a prize. You have a ‘checker’ that can tell you whether a given label is the prize, but only by trying it. A classical search needs up to three checks in the worst case. The quantum version uses one.
- Prepare two qubits and apply H to both. All four patterns have amplitude 0.5, so each has probability 0.25.
- Apply the ‘oracle’, a gate that flips the sign of the prize pattern only. Say the prize is 10. The amplitudes are now (0.5, 0.5, −0.5, 0.5). The probabilities are still 0.25 each, so nothing visible has changed.
- Apply the ‘diffusion’ step: reflect every amplitude about the average. The average of the four is 0.25. Each amplitude x becomes 2 × 0.25 − x. So 0.5 becomes 0, and −0.5 becomes 1.0.
- The amplitudes are now (0, 0, 1.0, 0). Measuring gives 10 with probability 1.
| Step | Amplitudes of 00, 01, 10, 11 | Probability of the prize (10) |
|---|---|---|
| After the two Hadamards | 0.5, 0.5, 0.5, 0.5 | 0.25 |
| After the oracle flips the sign of 10 | 0.5, 0.5, −0.5, 0.5 | 0.25 |
| After reflecting about the average | 0, 0, 1.0, 0 | 1.00 |
Computed by hand and confirmed with the formula sin²((2k+1)θ), θ = arcsin(1/√N) with N = 4 and k = 1, which gives exactly 1.0.
Notice that the oracle’s sign flip did not change any probability, but it set up the cancellation: when the average is subtracted, the three wrong amplitudes lose their weight and the marked one gains it. This is the amplitude-amplification idea that underlies Grover’s algorithm, treated in its own lesson.
For larger lists the one-step success is no longer certain, but the method scales. For N items, about (π/4)√N repeats are needed. For one million items that is about 785 steps, compared with an average of 500,000 checks for a classical search; for a billion items, about 24,800 versus 500 million (my arithmetic from that formula). It is a square-root speed-up, not an exponential one, and I come back to why that distinction matters on the next page.
A second complete example: one question instead of two
The four-box search used a sign flip to mark an answer. Here is another small algorithm in the same spirit, named after Deutsch (a name I give as background). A function takes a single bit (0 or 1) and returns a single bit. There are four such functions: always 0, always 1, ‘same as the input’, and ‘opposite of the input’. The first two are called constant, since the output never changes, and the last two are balanced. The question is: constant or balanced?
Classically you must evaluate the function twice, at 0 and at 1, and compare. The quantum version asks once. The ‘oracle’ is set up to multiply the amplitude of input x by (−1) raised to f(x), which is a sign flip whenever f(x) = 1.
- Start the qubit at 0 and apply H. The amplitudes for inputs 0 and 1 are (0.707, 0.707).
- Apply the oracle once. Each amplitude is multiplied by +1 or −1 depending on f.
- Apply H again and measure.
| Function | Amplitudes after the oracle | Final probability of reading 0 | Final probability of reading 1 | Verdict |
|---|---|---|---|---|
| Always 0 | (+0.707, +0.707) | 1 | 0 | Constant |
| Always 1 | (−0.707, −0.707) | 1 | 0 | Constant |
| Same as input | (+0.707, −0.707) | 0 | 1 | Balanced |
| Opposite of input | (−0.707, +0.707) | 0 | 1 | Balanced |
Computed with 2×2 matrices. A single call to the oracle decides between constant and balanced with certainty: reading 0 means constant, reading 1 means balanced.
Look at the second row: the overall minus sign on both amplitudes does not matter, because only the relative sign counts, and the final answer is still ‘constant’. This is a good example of the hidden-sign idea from the interference section: the answer is encoded in whether the two amplitudes have the same sign or opposite signs, which a direct measurement would not reveal, and the last H converts it into a certain outcome.
How big is the saving?
One query instead of two is a small gain, and for this tiny problem it does not matter. The importance of the example is the pattern: encode the property you care about in a sign, and use interference to read it out. The same pattern, with n bits instead of one, is how the Deutsch–Jozsa algorithm separates constant from balanced functions with one query where a classical method needs more than half of 2ⁿ (background).
Following a three-qubit circuit step by step
To get a feel for how a circuit builds up structure, follow a three-qubit example: H on the first qubit, then a CNOT from qubit 1 to qubit 2, then a CNOT from qubit 2 to qubit 3. I ran it with 8×8 matrices, and the amplitudes at each step are below. Patterns are written as three bits, first qubit on the left.
| After step | Non-zero amplitudes |
|---|---|
| Start | 000 with amplitude 1 |
| H on qubit 1 | 000: 0.707 and 100: 0.707 |
| CNOT from qubit 1 to 2 | 000: 0.707 and 110: 0.707 |
| CNOT from qubit 2 to 3 | 000: 0.707 and 111: 0.707 |
Computed. The final state, (|000⟩ + |111⟩)/√2, is the three-qubit GHZ (‘cat’) state, the one used in the cat lesson.
Each gate does something simple and local, but together they produce a state that cannot be described qubit by qubit. Measuring the three qubits gives 000 or 111 with probability 0.5 each, and never any of the six mixed patterns (the probabilities of those are exactly 0). Measuring just one qubit, say the first, tells you what the other two will give: they always agree.
This is the pattern of every quantum circuit: a few kinds of gates, repeated, create and shuffle the amplitudes of a list that doubles in length with each qubit. A circuit with a hundred qubits and a few thousand gates is like this example, with 2¹⁰⁰ amplitudes instead of 8.
Reading the answer: shots and statistics
A single run of a circuit gives one random pattern. To learn the probabilities, you run the same circuit many times, called shots, and count. How many shots do you need? For a probability near 0.5, the typical error in the measured fraction after n shots is √(0.25/n).
| Shots n | Typical error in the fraction | Example: simulated heads count for a true 0.5 |
|---|---|---|
| 100 | 0.050 | 61 and 39 (seed 4) |
| 1,000 | 0.016 | 552 and 448 |
| 10,000 | 0.005 | 5,047 and 4,953 |
Computed from √(0.25/n), with simulated counts from a seeded random generator. The first example is a little more than two typical errors from 50, which happens by chance in about one run in twenty.
The practical rule: to cut the error by a factor of ten, you need a hundred times as many shots. That cost is part of why quantum computations take many repetitions, and why cloud time is billed by processor time, as the cost page explains. It is also a reason that results from real devices are reported as histograms (bar charts of counts) and not as single outcomes.
Run the whole story in your browser
This lesson has told you what qubits, gates and measurement do. Here are five circuits that put it together, from the simplest to the most interesting. Each widget runs a real simulator in your browser. Predict first, then run, and read the explanation. Results show the bit strings in Qiskit's order, with qubit 0 on the right.
1. Superposition and measurement
Run this circuit
One Hadamard: a fair quantum coin
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
2. Interference: two flips cancel
Run this circuit
H then H: interference undoes the superposition
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
3. Entanglement: a Bell pair
Run this circuit
Bell pair: H then CNOT
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
4. A search: Grover on four items
Run this circuit
Grover on two qubits: one iteration is exact
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
5. A promise problem: Deutsch–Jozsa with a balanced function
Run this circuit
Deutsch–Jozsa, balanced f(x) = x₀ ⊕ x₁
Bit order: q0 is the rightmost digit of each result, as in Qiskit. All qubits start in |0⟩ unless marked. This is an ideal simulator with no hardware noise.
Press Run to simulate. Results appear here with a short explanation.
These five circuits are small versions of the five ideas that carry the rest of the subject: measurement gives probabilities, interference makes some outcomes vanish, entanglement links qubits, search uses interference to find an answer, and promise problems show where a single query can beat many. Nearly every algorithm lesson on this site is a larger combination of these building blocks.
What the counts tell you
Each run shows counts out of a number of shots. If a probability is 0.5 and you run 1,000 shots, the typical spread is about ±16 around 500. So 480 or 520 are normal, while 400 would be a surprise. This is the same shot noise that limits real hardware, and it is why a single run of a circuit is never the answer: the answer is the pattern across many runs.
What the machine has to do
Whatever the hardware, a quantum computer needs five things. This list is a standard way of stating the requirements (usually attributed to DiVincenzo, a name I give as background): a set of well-defined qubits, a way to start them in a known state, coherence times long compared with the gate time, a universal set of gates, and a way to measure.
| Approach | What carries the qubit | Main idea |
|---|---|---|
| Superconducting circuits | A tiny electrical circuit cooled to near absolute zero | Microwave pulses act as gates; made with chip-fabrication methods |
| Trapped ions | Single charged atoms held in electric fields | Laser pulses act as gates; the atoms are identical by nature |
| Neutral atoms | Atoms held by focused laser beams | Arrays of many atoms; gates from laser excitation |
| Photons | Particles of light | Gates by optical components; light is not easily disturbed but hard to make interact |
| Spins in solids | Electron or nuclear spins in semiconductors or diamond | Magnetic resonance gates, as in the Level 8 spin lesson |
A compact comparison. These are general descriptions of well-known approaches (background); specific numbers for each are on the hardware pages of this site.
The Level 8 lessons explain the physics that each of these rests on: tunnelling in superconducting junctions, spin resonance for spin qubits, atomic transitions for ions and neutral atoms, and photons for light-based qubits.
Why errors are the central problem
Real qubits are noisy. Gates are imperfect, and stray interactions with the surroundings destroy the delicate cancellations on which everything depends. In the cat lesson, a toy model showed that the coherence of a large entangled state falls off as the number of qubits grows. This is the reason quantum computing is hard, and it is more than a minor engineering detail.
The standard answer is error correction. Many physical qubits are combined to protect one logical qubit, and the machine repeatedly checks for errors without looking at the encoded information. The cost is large. As an example, Craig Gidney’s 2025 paper, whose abstract I opened, estimates that factoring a 2048-bit RSA number would need fewer than a million noisy qubits running for less than a week, down from his 2019 estimate of 20 million qubits and eight hours. The assumptions were a square grid of qubits with nearest-neighbour connections, a uniform gate error of 0.1%, a surface-code cycle time of 1 microsecond and a control reaction time of 10 microseconds.
| Estimate for factoring RSA-2048 | Noisy qubits | Runtime |
|---|---|---|
| Gidney, 2019 (as stated in the 2025 abstract) | 20 million | 8 hours |
| Gidney, 2025 | less than 1 million | less than a week |
From the abstract of arXiv:2505.15917, which I opened. These are estimates under stated assumptions, not a description of a machine that exists.
A million physical qubits to run one algorithm gives a sense of the distance between today’s machines and the large fault-tolerant ones. I do not quote the sizes of current machines on this page, since they change quickly and the hardware pages track them.
What programming one looks like
In practice a programmer writes a circuit, a list of gates, in a library such as Qiskit, and a classical computer sends the instructions to the quantum device, which runs the circuit many times (called shots) and returns counts of the patterns it measured. The program below builds the Bell state from the entanglement section. It is from memory and has not been run here, because I could not install the library, so treat it as a sketch of the style and check it against the current Qiskit documentation.
from qiskit import QuantumCircuit qc = QuantumCircuit(2, 2) qc.h(0) # put qubit 0 in an equal superposition qc.cx(0, 1) # entangle: flip qubit 1 if qubit 0 is 1 qc.measure([0, 1], [0, 1]) # Run this many times: about half the shots give '00' and half give '11'.
Because each run gives a random result, the answer is read from many runs. For the Bell state you expect the counts of 00 and 11 to be near half each, and counts of 01 or 10 to appear only because of noise on a real device.
What a quantum computer cannot do
- It does not run your ordinary programs faster. For most tasks a classical computer is faster, cheaper and far more reliable.
- It does not try all answers and hand you the best. A measurement returns one random pattern, and only a carefully designed interference pattern makes that pattern useful.
- It does not give unlimited speed-ups. The search example gives a square-root improvement, and for many problems no large speed-up is known.
- It cannot copy an unknown quantum state, and it cannot send information faster than light by entanglement (both well-known results, background).
The next page explains which problems do appear to benefit, and why.
Putting the whole picture in order
The lesson moved from bits to qubits, gates, interference, entanglement, algorithms, hardware and errors. Here is the chain in one place, with the key number for each link, so that you can retell it from memory.
- A bit is 0 or 1. A qubit has two amplitudes, and its measurement probabilities are their squared magnitudes.
- n qubits have 2ⁿ amplitudes: 1,024 for 10 qubits and over a billion for 30.
- Gates change amplitudes. A Hadamard on |0⟩ gives probabilities 0.5 and 0.5, and a second Hadamard returns to 0, the signature of interference.
- Entanglement links qubits: the Bell pair gives 00 or 11 and never 01 or 10.
- An algorithm arranges interference so that wrong answers cancel. Grover on four items succeeds with probability 1 after one iteration.
- Measurement returns one outcome per shot, so an answer is read from a distribution over many shots, with precision improving as the square root of the shots.
- Hardware is noisy. A circuit of 1,000 gates at 0.1% error each runs error-free only 37% of the time, and error correction is the remedy.
If you can retell the seven steps and name the number in each, you have the skeleton of the subject. Every other lesson on this site hangs more detail on one of these steps.
Summary
| Concept | In one line |
|---|---|
| Qubit | A pair of amplitudes (a, b), measured as 0 with probability a² and 1 with probability b² |
| Superposition | Several patterns present with amplitudes, e.g. 8 equal amplitudes of 0.354 for 3 qubits |
| Gate | A rule that turns one list of amplitudes into another |
| Interference | Amplitudes add with signs, so wrong answers can cancel |
| Entanglement | A joint state not describable qubit by qubit, e.g. the Bell state |
| Measurement | Returns one random pattern and destroys the rest |
| Grover on 4 items | One step, certainty |
| Naive simulation memory | 16 bytes × 2ⁿ: 18 petabytes at 50 qubits |
The page in one table.
Questions people ask
Is a qubit both 0 and 1 at once?
It is a state in which both outcomes have non-zero amplitudes. That is not the same as being ‘a bit of each’ in the sense of a half-and-half mixture, which is why the earlier test with a different measurement basis tells the two apart.
Why do we need so many physical qubits for one useful one?
Because physical qubits make errors, and protecting a logical qubit takes many of them. The 2025 factoring estimate above shows the scale.
Can I run a quantum computer at home?
You can simulate small circuits on any laptop, up to roughly thirty qubits with the naive method in the table. Access to real devices is available through cloud services; the cost page explains the pricing I found.
Is a quantum computer a threat to my passwords today?
The factoring estimate refers to a very large machine that does not exist yet. The cryptography lesson covers what is at stake and the standards that respond to it.
Extra practice: how it works
Questions that use the widgets above. All values were computed.
Check yourself
H1. After one H on a qubit starting in |0⟩, what is P(1)? After two H gates?
0.5 after one, and 0 after two. The second H undoes the first.
H2. In the Bell widget, what counts do you expect from 1,000 shots?
About 500 of '00' and 500 of '11', with a spread of about ±16, and none of '01' or '10' on an ideal simulator.
H3. Grover on four items: how many oracle calls, and what is the success probability?
One oracle call, success probability 1.0 on an ideal simulator.
H4. Why is a single run of a circuit never the answer?
Each shot gives one random string. The answer is the distribution over many shots, and its precision improves with the square root of the number of shots.
H5. How many numbers describe a 10-qubit state, and a 30-qubit state?
2¹⁰ = 1,024 and 2³⁰ = 1,073,741,824 amplitudes.
Practice problems
Check yourself
A qubit has amplitudes (0.8, 0.6). What are P(0) and P(1)?
0.64 and 0.36.
After H on four qubits starting at 0000, what is the amplitude of each of the 16 patterns?
1/√16 = 0.25, with probability 1/16 each.
Why can (0.707, 0.707) and (0.707, −0.707) behave differently if they give the same measurement probabilities?
The sign affects how amplitudes combine in later gates.
In the four-item search, what are the amplitudes after the oracle if the prize is 01?
(0.5, −0.5, 0.5, 0.5).
How many bytes does a naive simulation of 32 qubits need at 16 bytes per amplitude?
2³² × 16 = 6.9 × 10¹⁰ bytes, about 69 GB.
For a search over 10,000 items, about how many Grover steps?
(π/4)√10,000 = 78.5, so about 78 steps.
What does the Bell state tell you when both qubits are measured?
They always agree: 00 or 11, each with probability ½.
References and further reading
All the small calculations (the amplitude lists, the Bell state, the search example, the memory table) are my own, done with numpy. The estimate of resources for factoring is from the abstract of Craig Gidney’s 2025 paper, which I opened. Statements about how the different hardware approaches work are general background that I did not look up for this page, and the text says so.
- How to factor 2048 bit RSA integers with less than a million noisy qubits (Craig Gidney (arXiv:2505.15917, 2025)) Abstract opened. Less than a million noisy qubits, less than a week, versus 20 million qubits and 8 hours in 2019, under the assumptions listed.