The Complexity Class BQP
Every claim that a quantum computer is "faster" is, underneath, a claim about a single complexity class: BQP, bounded-error quantum polynomial time. It is the quantum sibling of the classical class BPP, and it answers a deceptively simple question — which yes/no problems can a quantum machine settle in a polynomial number of elementary gates, tolerating a small, controllable chance of error? A language is in BQP if some uniform family of poly-size quantum circuits outputs the correct membership bit with probability at least . That is the whole definition, and almost every subtlety of the theory is an argument that it is robust: the class does not secretly depend on the arbitrary constant , on which universal gate set you build from, or on the fine detail of the machine model. This article is the flagship of the complexity head. It takes the definition apart into its two load-bearing pillars — uniformity (a classical polynomial-time Turing machine must be able to print the circuit's blueprint) and gate-set independence (the Solovay-Kitaev theorem) — and shows why each is non-negotiable. It then locates BQP by proving the chain , so that quantum speed buys at most a polynomial in space. The relation of BQP to NP is left where the field leaves it: open, conjecturally incomparable, probed only through oracles. The interference view, the amplification theorem, and the path-integral simulation are all developed below; the algorithms that populate the class — Shor, Grover, quantum simulation — are recalled by name.
- BQP is the class of decision problems solved by a uniform family of polynomial-size quantum circuits that output the right answer with probability at least — the quantum analogue of classical BPP.
- The constant is arbitrary: any gap amplifies to error by running independent copies and taking the majority (Chernoff bound).
- Two pillars make the class well-defined: uniformity (a poly-time Turing machine prints each circuit) and gate-set independence (Solovay-Kitaev compiles between universal sets with only polylog overhead).
- BQP is sandwiched: , so a quantum computer needs at most polynomial space; its relation to NP is unknown and believed incomparable.
- Flagship evidence that BQP exceeds BPP is Shor's algorithm, which puts integer factoring and discrete log in BQP though neither is known to be classically easy.
- Key idea: BQP = languages decided by uniform poly-size quantum circuits with error ; the cutoff is irrelevant because the success gap amplifies exponentially and the gate set is irrelevant by Solovay-Kitaev, and the class sits .
BQP is the set of languages decided by a uniform family of polynomial-size quantum circuits with two-sided error at most ; the exact threshold is irrelevant because any inverse-polynomial advantage amplifies to exponentially small error, the universal gate set is irrelevant by Solovay-Kitaev, and the class is provably sandwiched .
Where this lives today
BQP is the fixed reference against which every claim of quantum advantage is calibrated. The headline experiments of the past decade — Google's 2019 random-circuit-sampling result and the Jiuzhang and Zuchongzhi follow-ups — are sampling rather than decision tasks, but their hardness arguments lean on BQP-adjacent structure: they assume and invoke non-collapse of the polynomial hierarchy to argue no efficient classical algorithm reproduces the output distribution. The membership of factoring and discrete log in BQP (Shor) drives the global migration to post-quantum cryptography: NIST's 2024 standardization of lattice-based schemes is, in effect, a policy response to a fact about BQP. The class also anchors open questions probed through oracles — the 2018 Raz-Tal separation of BQP from the polynomial hierarchy, and whether BQP-complete problems such as approximating the Jones polynomial or simulating local Hamiltonian dynamics admit any classical shortcut.
The physical picture
A BQP computation is best pictured as one enormous, carefully engineered interference experiment. The circuit prepares qubits, applies a polynomial-length sequence of one- and two-qubit gates that spreads amplitude across the basis strings, and measures a single output qubit. Whether that qubit reads ("accept") is decided by the Born rule: the squared modulus of the amplitude that constructive interference has piled onto the accepting branches while destructive interference cancels the rest. The art of every quantum algorithm is to arrange the gates so that wrong answers interfere away. BQP is the collection of decision problems for which such an interference pattern can be built with polynomially many gates and read out reliably. The first figure fixes where this class sits among its classical neighbours — not a wild card, but pinned between two well-understood classes by theorems proved in the 1990s.
The second lever is that the defining threshold is a fiction of convenience. A circuit right with probability has an advantage of only over a coin flip — but confidence compounds. Run it many times on the same input and take the majority vote, and the probability the majority is wrong falls off exponentially in the number of runs. The second figure makes this quantitative: it is why we may write , or , or and get exactly the same class.
The core equations
The definition is a promise problem with a completeness case and a soundness case: a language is in BQP exactly when some uniform, polynomial-size circuit family accepts yes-instances with high probability and no-instances with low probability. Everything downstream argues the two thresholds may be loosened without cost.
where: — the language (decision problem), a set of binary strings; — a uniform family of quantum circuits, one per input length ; — the number of gates in , required to be ; — the bit read from the output qubit when runs on ; — completeness and soundness thresholds, and any constant gap is equivalent. Reading it: there is an efficiently printable circuit that is right at least two times out of three. The acceptance probability is a concrete Born-rule expression in the circuit's unitary — the bridge from the abstract class to the physics of measurement.
where: — the unitary the circuit implements on input ; — input padded with ancilla qubits set to ; — projection onto of the designated output qubit; — identity on other qubits. Reading it: acceptance is the squared length of the accepting component of the final state. The threshold can be replaced by any inverse-polynomial advantage because of the Chernoff (Hoeffding) bound applied to a majority vote — the single inequality that makes BQP a robust, machine-independent object rather than an artifact of a chosen constant.
where: — number of independent repetitions; — advantage over a fair coin, here for the convention. Reading it: the error decays exponentially in the runs, so repetitions push it below . Independence from the gate set is the Solovay-Kitaev theorem: any target gate is reachable from a fixed universal set to accuracy using only polylogarithmically many gates, so recompiling keeps a poly-size circuit poly-size.
where: — an arbitrary target one- or two-qubit unitary; — operator-norm approximation error; — length of the approximating word over the fixed universal set; — a small exponent (the classic proof gives , refined toward ). Reading it: doubling the digits of precision costs only a constant-factor blow-up in gate count. The proven inclusions fix BQP's address in the complexity zoo and cap the resource a quantum computer can extract.
where: — bounded-error probabilistic poly-time (classical randomized computation); — probabilistic poly-time with unbounded error (accept iff more than half of the computation paths accept); — problems solvable in polynomial space. Reading it: quantum computing contains all efficient randomized classical computation and is contained in polynomial space. The upper bounds flow from one identity: the acceptance amplitude is a Feynman sum over computational-basis paths through the circuit. A classical machine can evaluate that sum one path at a time, placing BQP inside PSPACE (and, sharpened, inside PP).
where: — the fixed endpoints; the intermediate range over all basis strings; — the gate applied at step ; — the number of gates. Reading it: each path contributes a product of gate entries, and though there are exponentially many paths, each is described in polynomial space and summed one at a time.
The goal is to prove that the constants and in the definition of BQP carry no content: any circuit whose correct-answer probability beats a coin flip by an inverse-polynomial margin can be upgraded, at only polynomial cost, into one that errs with probability below for any target . This is the theorem that turns BQP from a definition contingent on an arbitrary number into a stable, machine-model-independent class — the exact quantum echo of the amplification that makes BPP robust.
Step 1. Suppose a circuit decides with , where the advantage may be as small as one over a polynomial. Build a new circuit that runs independent copies of on the same input — each with its own fresh ancillas — and outputs the majority of the answer bits. Why: independence is what lets us treat the outcomes as i.i.d. Bernoulli trials, unlocking a concentration inequality.
Step 2. Let indicate that copy is correct, so and . The majority is wrong exactly when , i.e. when falls at least below its mean. Why: framing the failure event as a large deviation of a bounded sum is precisely the hypothesis of the Hoeffding bound.
Step 3. Hoeffding's inequality for a sum of independent variables gives . Why: this is the engine — the error shrinks exponentially in while the gap enters only quadratically, so even a tiny advantage is enough given enough repetitions.
Step 4. Demand error at most : solve to get . Since is polynomial, is polynomial, so is still a poly-size uniform circuit. Why: keeping polynomial is the whole point — amplification must not push the circuit out of the class it defines.
Step 5. Conclude that the thresholds may be replaced by any , or boosted to , all defining the same BQP. Why: this is exactly the robustness claim — the class is an invariant of the computation, not of the reporting convention. *Verified: Bernstein-Vazirani (1997); Nielsen & Chuang §3.2.5. A verifier should reproduce and, with , that gives error .*
Go deeper · Derivation B · 2 minQuantum machines simulate classical randomized ones
The goal is to establish the lower inclusion — that anything a classical randomized polynomial-time algorithm can do, a quantum circuit can do too — so the sandwich of equation (5) has a floor and BQP is at least as powerful as feasible classical computation. The construction is elementary but conceptually important: randomness and reversibility, the two things a quantum circuit seems to lack relative to a randomized program, are both recovered for free.
Step 1. A BPP algorithm is a deterministic Boolean circuit that reads the input together with uniformly random bits and outputs an accept/reject bit, correct with probability at least . Generate each random bit quantumly by applying a Hadamard to an ancilla in , giving , whose measurement is a fair coin. Why: manufactures exactly the uniform randomness the classical algorithm assumes, with no external randomness source.
Step 2. The circuit is generally irreversible, but any Boolean circuit is converted to a reversible one using Toffoli gates with only polynomial overhead in gates and ancillas (Bennett), realizing a permutation unitary on computational-basis states. Why: unitaries must be reversible, so classical logic has to be repackaged as a permutation before a quantum circuit can host it.
Step 3. Compose the pieces into , acting on the input register, the randomness ancillas, and workspace, with the decision written to a designated output qubit. Why: this single unitary reproduces, branch by branch, the classical algorithm's behaviour on every setting of its random tape, with amplitudes that square to the correct uniform weights.
Step 4. Measuring the output qubit yields with exactly the probability that accepts averaged over its random bits — at least on yes-instances and at most on no-instances. Since is uniform and poly-size, . Why: matching the acceptance probability is all that BQP membership requires, so the simulation is complete. *Verified: Nielsen & Chuang §3.2; Preskill ch. 6. A verifier should confirm Toffoli universality for reversible logic and that produces uniform measurement statistics.*
Go deeper · Derivation C · 2 minCounting signed paths places BQP inside PP
The goal is the sharp upper bound of Adleman, DeMarrais and Huang, which immediately implies and shows a quantum computer offers no super-polynomial saving in space. The idea is to expand the acceptance amplitude as a Feynman sum over basis paths, observe that with a discretized universal gate set every path contributes a rational sign, and recognize the resulting signed count as a GapP function whose sign test is exactly what a PP machine decides.
Step 1. Fix the universal set Toffoli + Hadamard, whose matrix entries lie in . Expanding with complete basis resolutions between gates writes each amplitude as a sum over basis paths, each contributing where is the number of Hadamards it crosses. Why: discretizing the entries makes every path amplitude an integer multiple of a fixed power of , converting an analytic sum into a combinatorial count.
Step 2. Group paths by sign: , where and count the positive and negative paths. The difference is a GapP function — the gap between accepting and rejecting paths of a nondeterministic poly-time machine, equivalently a difference of two counting functions. Why: GapP is the algebraic closure of under subtraction and is exactly expressive enough to hold a signed amplitude.
Step 3. The acceptance probability is , a sum of squares of GapP quantities, hence itself GapP (GapP is closed under products and polynomial sums). Deciding whether this quantity is or is a threshold test on the sign of a GapP function. Why: squaring and summing keeps us inside GapP, so the entire acceptance criterion is one signed count compared to a threshold.
Step 4. By the standard characterization, a language whose acceptance is the sign of a GapP function lies in PP. Therefore , and since (a PP predicate is evaluable in polynomial space by iterating over paths), both upper bounds of equation (5) follow. Why: this pins BQP's ceiling — quantum computation is no harder than counting, and counting fits in polynomial space. *Verified: Adleman, DeMarrais & Huang, SIAM J. Comput. 26 (1997); Fortnow-Rogers for the GapP framing. A verifier should confirm Toffoli+Hadamard is universal, , and the -sign characterization.*
Limiting cases
The character of BQP is best seen by pushing its defining parameters to their extremes.
| Case | Result | Meaning |
|---|---|---|
| Gap | still BQP — amplifiable to with repetitions; the threshold is a convention | |
| Gap (negligible) | not BQP — a negligible advantage cannot be amplified efficiently; this is PP-type, unbounded-error computation | |
| Gate precision | Solovay-Kitaev: each ideal gate costs only polylog overhead, so every finite universal set yields the same BQP | |
| Perfect (zero-error) acceptance | class (exact QP) | demanding probability exactly gives a smaller, gate-set-sensitive class — bounded error is essential to robustness |
| Classical / non-interfering gates | Clifford-only (Gottesman-Knill) or matchgate circuits are classically simulable; advantage needs genuinely universal gates |
Worked examples
1 · How many repetitions to make a quantum circuit reliable (fully worked)
A circuit for a language accepts yes-instances with probability exactly and no-instances with probability exactly . You need the answer wrong with probability at most . How many independent runs, majority-voted, suffice — and does the amplified circuit stay polynomial?
Step 1. Identify the advantage. The circuit beats a coin flip by , so and the majority-error bound of equation (3) is .
Step 2. Solve for the target. Require . Taking logs, , so , giving runs.
Step 3. Check the bound is met. With , , which is below . The vote works.
Step 4. Confirm it stays in the class. Amplification multiplies the circuit size by a constant factor of , independent of , so a circuit stays ; more generally error costs runs, linear in . Result: 125 repetitions give error , and the class is unchanged.
2 · The Solovay-Kitaev compilation overhead is polynomial (fully worked)
You designed an algorithm as an ideal circuit of arbitrary one- and two-qubit gates, wanting total error , but your hardware implements only a fixed finite universal set. Roughly how many physical gates does compilation cost, and does the algorithm stay efficient?
Step 1. Budget the error per gate. Errors add at most linearly in operator norm, so to keep the total below across gates, each must be approximated to .
Step 2. Apply Solovay-Kitaev. Each gate compiles to physical gates. Using the classic exponent as an illustration, , so physical gates per ideal gate.
Step 3. Total the cost: physical gates — under a billion, feasible in principle.
Step 4. Read off the scaling. The overhead is polylogarithmic, so a poly-size circuit stays poly-size across any finite universal set. Result: ~9×10⁸ physical gates, a polylog blow-up — BQP is gate-set independent.
Physics of the portrait
BQP did not emerge from a laboratory but from a doctoral thesis: its rigorous definition, and the proof that quantum computers deserve a complexity class of their own, belong to a 1993 paper by a Berkeley graduate student and his advisor.
Origins · 1 minEthan Bernstein and how this was discovered
Ethan Bernstein, as Umesh Vazirani's PhD student at UC Berkeley, is the co-author of "Quantum Complexity Theory," presented at STOC 1993 and expanded in SIAM J. Comput. 26 (1997) — the paper that gave quantum computing its complexity-theoretic foundation. Before it, David Deutsch (1985) had defined a quantum Turing machine and Deutsch and Jozsa had shown a toy speedup, but there was no robust, machine-model-independent notion of "efficient quantum computation." Bernstein and Vazirani supplied exactly that. They built a genuinely universal quantum Turing machine that simulates any other with only polynomial slowdown — delicate, because naively composing quantum machines corrupts amplitudes. They defined BQP and proved it robust to the amplification threshold and to reasonable model choices. And they introduced the Recursive Fourier Sampling problem, giving the first evidence — a super-polynomial oracle separation — that quantum computers can outrun classical ones on a structured task, later sharpened by Simon and, in 2018, by Raz and Tal into an oracle separating BQP from the whole polynomial hierarchy. The flat Bernstein-Vazirani algorithm, a single-query Hadamard sandwich, is a famous corollary, but the deep contribution was architectural: a stable class against which every later quantum algorithm — Shor's factoring the very next year included — could be measured.
Going further
Texts. Nielsen & Chuang, Quantum Computation and Quantum Information, ch. 4 & 6 · Preskill, Lecture Notes on Quantum Computation, ch. 6 · Watrous, Quantum Computational Complexity (2008 survey) · Kitaev, Shen & Vyalyi, Classical and Quantum Computation · Arora & Barak, Computational Complexity, ch. 10 · Aaronson, Quantum Computing Since Democritus.
Provenance. The definition and robustness of BQP follow Bernstein & Vazirani, SIAM J. Comput. 26 (1997); the upper bound follows Adleman, DeMarrais & Huang, SIAM J. Comput. 26 (1997), with the GapP framing from Fortnow & Rogers; the oracle separation from the polynomial hierarchy is Raz & Tal, STOC 2018. A verifier should recompute: (1) the Chernoff/Hoeffding bound and, with , that gives error ; (2) the Solovay-Kitaev overhead and the worked gates; (3) the GapP characterization giving ; (4) the simulation via Hadamard randomness and Toffoli reversibility. All constants (, , , ) are standard textbook values.
Prerequisites. Universal Quantum Gates and Solovay-Kitaev · Quantum Circuits and Measurement · Probability and the Chernoff Bound · Classical Complexity Classes (P, BPP, PP, PSPACE). Leads to. BQP versus P, NP, and PSPACE · BQP is Contained in PP and PSPACE · Quantum Merlin-Arthur (QMA) · Quantum Query Complexity.
Ask the tutor: Ask me to walk through why the threshold is arbitrary, to trace the Feynman-path argument for , or to explain what the oracle separations really do and don't tell us about BQP versus NP.
Is BQP the same thing as "problems a quantum computer can solve"?
Almost, with two words of care. BQP is the set of decision problems — yes/no questions — a quantum computer solves in polynomial time with bounded error. It deliberately excludes problems that need exponential time even quantumly, and it is phrased for decision problems, though function and sampling versions (FBQP, SampBQP) extend it. So "a quantum computer can solve it" should be read as "efficiently, reliably, and as a yes/no question." Problems outside BQP are not necessarily impossible for a quantum machine; they simply are not known to be solvable quickly. The class is a statement about efficiency, not about ultimate solvability.
Why insist on uniformity — what breaks without it?
Uniformity requires that a deterministic polynomial-time Turing machine can print the description of the circuit given the input length in unary. Drop it, and you allow a different, unrelated circuit for every input size with no computable rule connecting them. Such non-uniform families are absurdly powerful: you can hard-wire into the circuit for length the answer to an uncomputable question about — for instance, whether the -th Turing machine halts. A non-uniform "BQP" would then decide undecidable languages, making it useless as a model of feasible computation. Uniformity is what ties the abstract circuit family back to a real algorithm you could actually program and run.
Does BQP ⊆ PSPACE mean quantum computers are useless?
No — it means their advantage, if real, is in time, not space. The inclusion says any BQP computation can be reproduced by a classical machine using only polynomial memory, by summing the Feynman path integral one path at a time. But that simulation takes exponential time: there are exponentially many paths. So rules out an exponential space advantage while leaving wide open an exponential time advantage, which is exactly what Shor's algorithm is conjectured to deliver. The bound is a ceiling on one resource, not a dismissal of the model.
How is BQP related to NP — can it solve NP-complete problems fast?
The honest answer is that nobody knows, and the consensus guess is no. It is not proven that , nor that ; the two classes are believed incomparable. For the unstructured NP-complete problem of searching for a satisfying assignment, Grover's algorithm gives only a quadratic speedup — turning into , still exponential — and this is provably optimal in the query model. Quantum computers exploit structure, like the periodicity Shor's algorithm finds in factoring, not the brute-force search that NP-completeness embodies. Relative to a random oracle, NP is not contained in BQP, which is strong evidence the containment fails in the real world too.
What is the difference between BQP and BPP, concretely?
BPP is classical randomized polynomial time: a poly-time algorithm with fair coin flips, correct with bounded error. BQP replaces the coin flips with the full apparatus of quantum gates — superposition, entanglement, and interference — keeping the same poly-time, bounded-error framing. Every BPP computation is a BQP computation (a circuit simulates coins with Hadamards and classical logic with Toffoli gates), so . The important open question is whether the containment is strict. Shor's algorithm, which factors in BQP but has no known BPP algorithm, is the central evidence that it is — that interference is a strictly more powerful resource than randomness alone.
Why is acceptance a squared amplitude, and does it matter for the class?
Acceptance is squared because measurement obeys the Born rule: the chance of reading the output qubit as is the squared modulus of the amplitude on the accepting component of the final state. This matters more than it looks. The squaring is what lets negative and complex amplitudes on wrong answers cancel before measurement — the interference that gives quantum algorithms their power. It is also the technical hinge of the PP upper bound: the amplitude is a signed GapP count, and squaring-then-summing keeps the acceptance probability inside GapP, which is exactly what a PP machine can decide.