Library · |world⟩ Quantum foundations

Quantum computing, explained without the hype

Qubits, superposition, entanglement, interference and measurement, and why a quantum computer is not simply a faster computer.

Most descriptions of quantum computing say that a qubit is "both 0 and 1 at once" and that a quantum computer "tries every answer at the same time". Both statements are loose enough to mislead. A security architect who repeats them will either overestimate the technology (it will break everything) or underestimate it (it is science fiction). Neither view helps a migration plan.

This article gives the working picture that physicists and algorithm designers use. It needs only school arithmetic. By the end you should be able to explain why Shor's algorithm threatens RSA and elliptic curves, why Grover's algorithm barely troubles AES-256, and why a quantum computer will not speed up your core banking batch run.

Bits and qubits

A classical bit is 0 or 1. A register of 3 bits holds one of 8 patterns, from 000 to 111, at any moment. To describe the register you write down which pattern it holds.

A qubit is described differently. Its state is a pair of numbers called amplitudes, one attached to the outcome 0 and one to the outcome 1. Physicists write the state as ψ = α|0⟩ + β|1⟩, where α and β are the amplitudes. The symbols |0⟩ and |1⟩ (read "ket 0" and "ket 1") label the two outcomes. The only rule is that the squares of the sizes of the amplitudes add up to 1.

|α|² + |β|² = 1

Amplitudes are not probabilities. They can be negative, and in general they are complex numbers, which means each has a size and a direction (a phase). The sign and phase matter because amplitudes add before they are squared. That one fact is the source of nearly everything distinctive about quantum computing.[1]

A register of n qubits has one amplitude for each of the 2ⁿ possible bit patterns. Three qubits carry 8 amplitudes. Ten qubits carry 1,024. Fifty qubits carry about 10¹⁵. Three hundred qubits would need more amplitudes than there are atoms in the observable universe, which is why a laptop cannot simulate a large quantum computer by brute force. The next demo lets you move the slider and watch the number grow.

Every extra qubit doubles the number of amplitudes the machine works with at once.

amplitudes = 2n

≈ 9.01 × 10¹⁵

No computer on Earth could store this state as a list of numbers. A quantum computer simply holds it.

Try it: add qubits and watch the number of amplitudes double with each one.

Superposition

When both amplitudes are non-zero, the qubit is in a superposition of 0 and 1. The word is accurate, but it invites a wrong picture. The qubit is not secretly one of the two values while the experimenter is unaware which. Interference experiments, described below, rule that out. The qubit has a definite state, the pair (α, β), and that state is simply different from a bit.

A helpful picture is a compass needle. A classical bit points only up or down. A qubit's state is any direction on a sphere (the Bloch sphere), with 0 at the north pole and 1 at the south pole. A state on the equator gives equal weight to 0 and 1. A state close to the north pole is mostly 0. Gates, described below, rotate the needle. A single qubit therefore has a continuous set of states, but you can read only one bit out of it.[1]

|ψ⟩ = 0.87|0⟩ + (0.43 + 0.25i)|1⟩

got 00got 10

Expected from the amplitudes: 75% zeros, 25% ones. Measured so far: 0 runs.

Try it: steer one qubit around the Bloch sphere, then measure it 100 times and compare the counts with the predicted probabilities.

Measurement

When you measure a qubit, you get a single ordinary bit. You get 0 with probability |α|² and 1 with probability |β|². Afterwards the qubit is left in the state you saw, so the amplitudes you started with are gone. Measure again and you get the same answer.

Take a qubit with α = β = 1/√2. Each outcome has probability (1/√2)² = ½, like a fair coin. Take a qubit with α = 0.6 and β = 0.8. The probabilities are 0.36 and 0.64, which sum to 1.

Measurement is the reason a quantum computer cannot be used as a vast parallel database. A register of 50 qubits holds about 10¹⁵ amplitudes, but a measurement returns only 50 bits. The designer of a quantum algorithm has to arrange the amplitudes so that the single answer you can read out is the useful one.[1]

Interference

Interference is the mechanism that makes quantum algorithms work. Amplitudes for the same outcome add. If one route to an outcome carries amplitude +½ and another carries −½, the outcome ends with amplitude 0 and never happens. If both carry +½, the outcome ends with amplitude 1 and always happens.

A small example uses the Hadamard gate (written H), the standard gate for creating a superposition. Applied to |0⟩ it gives amplitudes 1/√2 and 1/√2, an even superposition. Applied to |1⟩ it gives 1/√2 and −1/√2. Now apply H twice to |0⟩. After the first H the amplitudes are 1/√2 and 1/√2. The second H gives the outcome 0 an amplitude of ½ + ½ = 1, and gives the outcome 1 an amplitude of ½ − ½ = 0. The qubit is back at |0⟩ with certainty. The apparent randomness of the middle step was not randomness at all, because the two routes to outcome 1 cancelled.

H · H |0⟩ = |0⟩, because the two routes to |1⟩ carry +½ and −½ and cancel

If the middle step had been a real coin flip, the second H would have left a 50/50 outcome. The 100% result is the experimental signature of a quantum state, and it is why superposition cannot be dismissed as ignorance about a hidden value. The double-slit experiment shows the same effect with particles, and shows that looking at which slit a particle uses destroys the pattern.

Unobserved: interference stripes build up.

Try it: fire particles one at a time and watch the interference pattern build. Switch on observation and the pattern disappears.

An algorithm is a recipe for choreographing interference. It prepares a superposition, applies operations that give each possible answer a phase, and then mixes the amplitudes so that wrong answers cancel and the right answer reinforces. Designing such a recipe is hard, and that is why only a small number of useful quantum algorithms exist.

Entanglement

With two or more qubits, the amplitudes can be arranged so that the state cannot be described qubit by qubit. The standard example is the Bell state with amplitude 1/√2 on 00 and 1/√2 on 11, and none on 01 or 10. Measure the first qubit and you get 0 or 1 with equal chance. Whatever you get, the second qubit then gives the same result. The two qubits are entangled. The pair has a definite joint state, while neither qubit has a state of its own.

Entanglement does not allow messages to travel faster than light. Each side sees only random bits, and the correlation appears only when the two lists are compared over an ordinary channel. What entanglement gives a computer is the ability to build states of n qubits that cannot be written as n separate qubit states. Those are the states in which interference can act on many bit patterns together.[1]

α|0⟩ + β|1⟩

Superposition

A bit is 0 or 1. A qubit carries an amplitude for each at once, and keeps both until it is measured.

(|01⟩ + |10⟩) / √2

Entanglement

Two qubits can share one state. Measure one and you know the other, however far apart they are.

ψ₁ + ψ₂

Interference

Amplitudes add like waves. An algorithm lines them up so wrong answers cancel and the right one grows.

|⟨x|ψ⟩|²

Measurement

Reading a qubit collapses it to one value, with a probability set by its amplitude. You get one answer per run.

Try it: four short cards covering superposition, entanglement, interference and measurement.

Gates and circuits

A quantum program is a circuit: a sequence of gates applied to a register, followed by a measurement. A gate is a reversible operation on the amplitudes. Reversible means no information is thrown away, so a gate can always be undone by applying its inverse. A classical AND gate discards information (two inputs, one output), so it has no direct quantum counterpart. Quantum circuits get the same effect by using extra qubits.

The gates you will meet most often
GateActs onWhat it does
X (NOT)1 qubitSwaps the amplitudes of 0 and 1.
Hadamard (H)1 qubitTurns |0⟩ into an even superposition, and mixes amplitudes so that interference can happen.
Phase gates (Z, S, T)1 qubitChange the sign or phase of the amplitude on |1⟩. Invisible if you measure at once, decisive after a later H.
CNOT2 qubitsFlips the second qubit if the first is 1. Together with H it creates entanglement.
Toffoli3 qubitsFlips the third qubit if both of the first two are 1. It lets a quantum circuit run any classical computation.

A small set of gates is enough to build any quantum computation to any desired accuracy.[1] That is useful for theory. In practice the number of gates matters a great deal, because real gates are imperfect and every error can spoil the interference. Large algorithms need millions or billions of gates, far more than unprotected hardware can run without failing. Inside a quantum computer explains how error correction addresses that.

Why it does not try every answer at once

The myth runs like this. A register of n qubits holds 2ⁿ values at once, so a quantum computer evaluates a function on all of them in a single step and picks the best. The first half is nearly true. A circuit can put a register into an even superposition over all 2ⁿ inputs and then apply a function to that superposition. The output holds the function values for every input, each with its own amplitude.

The second half fails. If you measure now, you get one input and its output, chosen at random. That is no better than evaluating the function once on a classical computer. To gain anything, the algorithm must go on to make the amplitudes interfere so that a useful property of the whole function shows up in the measurement. That works only when the problem has structure that interference can exploit.

Bennett, Bernstein, Brassard and Vazirani showed in 1997 that for unstructured search no quantum algorithm can beat about √N steps for N items. Their result shows that trying everything at once cannot work in general.[2] Grover's algorithm reaches that √N bound, which is a real but modest gain. A search over a 256-bit key space takes about 2¹²⁸ steps instead of 2²⁵⁶.[4]

What quantum computers are and are not good at

The list of problems with a proven or strongly suspected large quantum speed-up is short. Simulating quantum systems such as molecules and materials was the original motivation and is the most natural fit. Factoring integers and computing discrete logarithms, through Shor's algorithm, is the case with the largest known speed-up.[3] Unstructured search gets Grover's quadratic gain. A few linear-algebra and optimisation methods have speed-ups that depend on assumptions about loading data and remain debated.

Where a quantum computer helps and where it does not
TaskQuantum advantage?Notes
Factoring (RSA)Very large, super-polynomialShor's algorithm. Breaks RSA at any key size once a large enough machine exists.
Discrete logarithms (DH, ECDH, ECDSA, EdDSA)Very large, super-polynomialSame algorithm family. Elliptic curves need fewer qubits than RSA of similar classical strength.
Brute-force key search (AES, hash preimages)Quadratic onlyGrover. The iterations run in sequence, so parallel machines give only a square-root gain.
Simulating molecules and materialsLarge, for suitable problemsThe original application. Not a security issue.
Databases, web serving, payments processingNone expectedData-heavy and unstructured. Loading the data would cost more than any speed-up.
Sorting, spreadsheets, general batch workNoneA classical computer is faster and far cheaper.

The first two rows matter for this website. Shor's algorithm turns factoring, which is infeasible for the best classical method at 2048 bits, into a polynomial-time problem on a large, error-corrected quantum computer. It was published in 1994.[3] It has stood for three decades, and the argument for why it works is mathematical, not experimental.

Why this matters for cryptography

Public-key cryptography rests on problems that are easy in one direction and hard in the other. Multiplying two large primes is easy. Recovering them from the product is very hard for classical computers, and RSA depends on that. Diffie–Hellman, elliptic-curve Diffie–Hellman (ECDH) and the signature schemes DSA, ECDSA and EdDSA depend on the discrete logarithm problem, which is hard on classical computers for a similar reason.

Both problems have a hidden periodic structure. Shor's insight was that a quantum computer can find a period with interference. It prepares a superposition, applies the function, and uses a quantum Fourier transform to make the amplitudes cancel everywhere except near multiples of the inverse period. Measurement returns a value from which the period follows, and the period gives the factors or the logarithm.[3] The details are the subject of How Shor's algorithm breaks RSA.

Symmetric ciphers such as AES have no such structure to exploit. The best known generic quantum attack is Grover's search, which roughly halves the effective key length in bits. AES-128 would offer about 64 bits of quantum security in theory, and AES-256 about 128. The sequential iterations make even the AES-128 case very expensive in practice, which is why 256-bit keys are the comfortable choice.[4] The article Grover's algorithm and symmetric cryptography covers this.

How big a machine would Shor's algorithm need? Estimates are given in logical qubits, which are error-corrected qubits. For an elliptic curve over an n-bit prime field, Roetteler and colleagues estimated at most 9n + 2⌈log₂ n⌉ + 10 logical qubits, about 2,330 for P-256.[6] For RSA-2048, Craig Gidney's 2025 estimate is under a week with fewer than one million noisy physical qubits, assuming a 0.1% gate error rate, a 1 microsecond surface-code cycle and a 10 microsecond control reaction time.[7] Today's machines have hundreds to a little over a thousand physical qubits and no error-corrected machine of that scale. Laboratory factoring demonstrations remain at toy numbers, starting with 15 in 2001 on a seven-qubit NMR machine.[5]

What to do now

You do not need to follow the physics to act on it. You need an inventory of where your organisation uses the algorithms that Shor's algorithm breaks, and a plan to replace them in order of risk.

  • Find the vulnerable algorithms. Run qsc scan over source, configuration, infrastructure code, certificates and live endpoints. It lists RSA, ECDSA, ECDH, DH and similar use, and can write a CBOM (a cryptographic bill of materials) in CycloneDX 1.6 format.
  • Separate the two threats. Public-key algorithms (RSA, DH, elliptic curves) need replacing. Symmetric algorithms (AES, SHA-2) need checking for key length. AES-256 and SHA-384 or above are the usual targets.
  • Rank by data lifetime. Data that must stay confidential for many years and travels over a channel an adversary could record belongs at the top of the list.
  • Track progress. Use qsc scan --baseline to record the starting point, then re-scan to show what has changed.
  • Read headlines with care. A new qubit record says little about cryptography by itself. The useful question is how many error-corrected qubits can run how many gates, and the next article explains how to read those claims.

Continue with Inside a quantum computer for the hardware and error correction, How Shor's algorithm breaks RSA for the algorithm itself, and Harvest now, decrypt later for why recorded data is at risk before such a machine exists. The quantum world page has more interactive material.

Sources

  1. Michael A. Nielsen and Isaac L. Chuang, Cambridge University Press. Quantum Computation and Quantum Information. 2000 (10th anniversary edition 2010).
  2. Bennett, Bernstein, Brassard and Vazirani, SIAM Journal on Computing 26(5). Strengths and weaknesses of quantum computing. 1997.
  3. Peter Shor (FOCS 1994; SIAM Journal on Computing 26(5), 1997). Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer. 1997. https://arxiv.org/abs/quant-ph/9508027
  4. Lov Grover (STOC 1996). A fast quantum mechanical algorithm for database search. 1996. https://arxiv.org/abs/quant-ph/9605043
  5. Vandersypen et al., Nature 414, 883–887. Experimental realization of Shor's quantum factoring algorithm using nuclear magnetic resonance. 2001.
  6. Roetteler, Naehrig, Svore and Lauter (ASIACRYPT 2017). Quantum resource estimates for computing elliptic curve discrete logarithms. 2017. https://arxiv.org/abs/1706.06752
  7. Craig Gidney, Google Quantum AI. How to factor 2048 bit RSA integers with less than a million noisy qubits. May 2025. https://arxiv.org/abs/2505.15917
  8. NIST. Post-Quantum Cryptography project. https://csrc.nist.gov/projects/post-quantum-cryptography