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 L⊆{0,1}∗L\subseteq\{0,1\}^* is in BQP if some uniform family of poly-size quantum circuits {Qn}\{Q_n\} outputs the correct membership bit with probability at least 2/32/3. 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 2/32/3, 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 P⊆BPP⊆BQP⊆PP⊆PSPACE\mathsf{P}\subseteq\mathsf{BPP}\subseteq\mathsf{BQP}\subseteq\mathsf{PP}\subseteq\mathsf{PSPACE}, 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.

Key takeaways
  • 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 2/32/3 — the quantum analogue of classical BPP.
  • The constant 2/32/3 is arbitrary: any gap 1/2+1/poly(n)1/2+1/\mathrm{poly}(n) amplifies to error 2−m2^{-m} by running O(m⋅poly)O(m\cdot\mathrm{poly}) 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: BPP⊆BQP⊆PP⊆PSPACE\mathsf{BPP}\subseteq\mathsf{BQP}\subseteq\mathsf{PP}\subseteq\mathsf{PSPACE}, 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 ≤1/3\le 1/3; the cutoff is irrelevant because the success gap amplifies exponentially and the gate set is irrelevant by Solovay-Kitaev, and the class sits BPP⊆BQP⊆PP⊆PSPACE\mathsf{BPP}\subseteq\mathsf{BQP}\subseteq\mathsf{PP}\subseteq\mathsf{PSPACE}.
The core insight

BQP is the set of languages decided by a uniform family of polynomial-size quantum circuits with two-sided error at most 1/31/3; 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 BPP⊆BQP⊆PP⊆PSPACE\mathsf{BPP}\subseteq\mathsf{BQP}\subseteq\mathsf{PP}\subseteq\mathsf{PSPACE}.

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 BQP⊈BPP\mathsf{BQP}\not\subseteq\mathsf{BPP} 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 poly(n)\mathrm{poly}(n) qubits, applies a polynomial-length sequence of one- and two-qubit gates that spreads amplitude across the 2n2^n basis strings, and measures a single output qubit. Whether that qubit reads 11 ("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.

Figure
The complexity landscape as nested classes: P ⊆ BPP ⊆ BQP ⊆ PP ⊆ PSPACE, so a quantum computer costs at most polynomial space. NP sits inside PP but its relation to BQP is open — neither is known to contain the other.
BQP is sandwiched: P ⊆ BPP ⊆ BQP ⊆ PP ⊆ PSPACE — quantum speed costs at most poly space PSPACE (polynomial space) PP (unbounded-error prob. poly-time) BQP BPP P deterministic NP relation to BQP open Shor puts factoring here

The second lever is that the defining threshold is a fiction of convenience. A circuit right with probability 2/32/3 has an advantage of only δ=1/6\delta=1/6 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 2/32/3, or 0.510.51, or 1/2+1/n101/2+1/n^{10} and get exactly the same class.

Figure
Error amplification: a circuit with success 2/3 has advantage δ = 2/3 − 1/2 = 1/6, and majority vote over k runs drives the error below e^(−2kδ²) = e^(−k/18) — k = 90 gives ε ≈ 6.7×10⁻³ and k = 180 gives ε ≈ 4.5×10⁻⁵.
Majority vote crushes the error: ε ≤ e^(−2kδ²) with δ = 1/6, so ε ≤ e^(−k/18) 10⁰ 10⁻³ 10⁻⁶ 10⁻⁹ 0 90 180 270 360 number of repetitions k majority-error ε k = 90 → ε ≈ 6.7×10⁻³ k = 180 → ε ≈ 4.5×10⁻⁵ only ~12.5 m runs give ε ≤ 2⁻ᵐ

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.

L∈BQP  ⟺  ∃ {Qn} uniform, ∣Qn∣=poly(n), {x∈L⇒Pr⁡[Q∣x∣(x)=1]≥23x∉L⇒Pr⁡[Q∣x∣(x)=1]≤13(1)L \in \mathsf{BQP} \iff \exists\,\{Q_n\}\ \text{uniform},\ |Q_n|=\mathrm{poly}(n),\ \begin{cases} x\in L \Rightarrow \Pr[Q_{|x|}(x)=1]\ge \tfrac{2}{3}\\ x\notin L \Rightarrow \Pr[Q_{|x|}(x)=1]\le \tfrac{1}{3}\end{cases} \qquad (1)

where: LL — the language (decision problem), a set of binary strings; {Qn}\{Q_n\} — a uniform family of quantum circuits, one per input length nn; ∣Qn∣|Q_n| — the number of gates in QnQ_n, required to be poly(n)\mathrm{poly}(n); Q∣x∣(x)Q_{|x|}(x) — the bit read from the output qubit when Q∣x∣Q_{|x|} runs on xx; 23,13\tfrac{2}{3},\tfrac{1}{3} — 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.

Pr⁡[Q(x)=1]=∥(⟨1∣out⊗I) Ux ∣x,0m⟩∥2(2)\Pr[Q(x)=1] = \big\| \big(\langle 1|_{\text{out}}\otimes I\big)\, U_x\, |x,0^{m}\rangle \big\|^2 \qquad (2)

where: UxU_x — the unitary the circuit implements on input xx; ∣x,0m⟩|x,0^{m}\rangle — input xx padded with m=poly(n)m=\mathrm{poly}(n) ancilla qubits set to 00; ⟨1∣out\langle 1|_{\text{out}} — projection onto ∣1⟩|1\rangle of the designated output qubit; II — identity on other qubits. Reading it: acceptance is the squared length of the accepting component of the final state. The threshold 2/32/3 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.

Pr⁡[majority of k runs wrong]  ≤  exp⁡ ⁣(−2k δ2),δ=23−12=16(3)\Pr[\text{majority of } k \text{ runs wrong}] \;\le\; \exp\!\big(-2k\,\delta^2\big),\qquad \delta=\tfrac{2}{3}-\tfrac{1}{2}=\tfrac{1}{6} \qquad (3)

where: kk — number of independent repetitions; δ\delta — advantage over a fair coin, here 1/61/6 for the 2/32/3 convention. Reading it: the error decays exponentially in the runs, so k=O(m/δ2)k=O(m/\delta^2) repetitions push it below 2−m2^{-m}. Independence from the gate set is the Solovay-Kitaev theorem: any target gate is reachable from a fixed universal set to accuracy ε\varepsilon using only polylogarithmically many gates, so recompiling keeps a poly-size circuit poly-size.

approximate any U to error ε:N=O ⁣(log⁡c(1/ε)),c≲2(4)\text{approximate any } U \text{ to error } \varepsilon:\quad N = O\!\big(\log^{c}(1/\varepsilon)\big),\quad c\lesssim 2 \qquad (4)

where: UU — an arbitrary target one- or two-qubit unitary; ε\varepsilon — operator-norm approximation error; NN — length of the approximating word over the fixed universal set; cc — a small exponent (the classic proof gives c≈3.97c\approx 3.97, refined toward 11). 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.

P⊆BPP⊆BQP⊆PP⊆PSPACE(5)\mathsf{P}\subseteq\mathsf{BPP}\subseteq\mathsf{BQP}\subseteq\mathsf{PP}\subseteq\mathsf{PSPACE} \qquad (5)

where: BPP\mathsf{BPP} — bounded-error probabilistic poly-time (classical randomized computation); PP\mathsf{PP} — probabilistic poly-time with unbounded error (accept iff more than half of the computation paths accept); PSPACE\mathsf{PSPACE} — 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).

⟨z∣ Ux ∣x⟩=∑b1,…,bT−1∏t=1T⟨bt+1∣ gt ∣bt⟩(6)\langle z|\,U_x\,|x\rangle = \sum_{b_1,\dots,b_{T-1}} \prod_{t=1}^{T} \langle b_{t+1}|\,g_t\,|b_t\rangle \qquad (6)

where: b0=x, bT=zb_0=x,\,b_T=z — the fixed endpoints; the intermediate btb_t range over all basis strings; gtg_t — the gate applied at step tt; T=poly(n)T=\mathrm{poly}(n) — the number of gates. Reading it: each path contributes a product of TT gate entries, and though there are exponentially many paths, each is described in polynomial space and summed one at a time.

Derivation AError amplification makes the two-thirds threshold arbitrary

The goal is to prove that the constants 2/32/3 and 1/31/3 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 2−m2^{-m} for any target mm. 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 QQ decides LL with Pr⁡[correct]≥12+δ\Pr[\text{correct}]\ge \tfrac12+\delta, where the advantage δ=1/p(n)\delta=1/p(n) may be as small as one over a polynomial. Build a new circuit Q′Q' that runs kk independent copies of QQ on the same input xx — each with its own fresh ancillas — and outputs the majority of the kk answer bits. Why: independence is what lets us treat the kk outcomes as i.i.d. Bernoulli trials, unlocking a concentration inequality.

Step 2. Let Xi∈{0,1}X_i\in\{0,1\} indicate that copy ii is correct, so E[Xi]≥12+δ\mathbb{E}[X_i]\ge\tfrac12+\delta and S=∑iXiS=\sum_i X_i. The majority is wrong exactly when S<k/2S<k/2, i.e. when SS falls at least δk\delta k 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 [0,1][0,1] variables gives Pr⁡[S<k/2]≤exp⁡(−2kδ2)\Pr[S<k/2]\le \exp(-2k\delta^2). Why: this is the engine — the error shrinks exponentially in kk while the gap δ\delta enters only quadratically, so even a tiny advantage is enough given enough repetitions.

Step 4. Demand error at most 2−m2^{-m}: solve exp⁡(−2kδ2)≤2−m\exp(-2k\delta^2)\le 2^{-m} to get k≥mln⁡22δ2=O(p(n)2 m)k\ge \tfrac{m\ln 2}{2\delta^2}=O(p(n)^2\,m). Since p(n)p(n) is polynomial, kk is polynomial, so Q′Q' is still a poly-size uniform circuit. Why: keeping kk polynomial is the whole point — amplification must not push the circuit out of the class it defines.

Step 5. Conclude that the thresholds (23,13)(\tfrac23,\tfrac13) may be replaced by any (12+1p, 12−1p)(\tfrac12+\tfrac1p,\ \tfrac12-\tfrac1p), or boosted to (1−2−m, 2−m)(1-2^{-m},\ 2^{-m}), 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 Pr⁡[S<k/2]≤e−2kδ2\Pr[S<k/2]\le e^{-2k\delta^2} and, with δ=1/6, m=10\delta=1/6,\ m=10, that k=125k=125 gives error e−6.94=9.66×10−4≤2−10e^{-6.94}=9.66\times10^{-4}\le 2^{-10}.*

Go deeper · Derivation B · 2 minQuantum machines simulate classical randomized ones
Derivation BQuantum machines simulate classical randomized ones

The goal is to establish the lower inclusion BPP⊆BQP\mathsf{BPP}\subseteq\mathsf{BQP} — 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 CC that reads the input xx together with r=poly(n)r=\mathrm{poly}(n) uniformly random bits and outputs an accept/reject bit, correct with probability at least 2/32/3. Generate each random bit quantumly by applying a Hadamard to an ancilla in ∣0⟩|0\rangle, giving 12(∣0⟩+∣1⟩)\tfrac{1}{\sqrt2}(|0\rangle+|1\rangle), whose measurement is a fair coin. Why: H⊗rH^{\otimes r} manufactures exactly the uniform randomness the classical algorithm assumes, with no external randomness source.

Step 2. The circuit CC 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 UCU_C 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 U=UC (H⊗r⊗I)U=U_C\,(H^{\otimes r}\otimes I), acting on the input register, the rr 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 2−r/22^{-r/2} that square to the correct uniform weights.

Step 4. Measuring the output qubit yields 11 with exactly the probability that CC accepts averaged over its random bits — at least 2/32/3 on yes-instances and at most 1/31/3 on no-instances. Since UU is uniform and poly-size, L∈BQPL\in\mathsf{BQP}. 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 H⊗rH^{\otimes r} produces uniform measurement statistics.*

Go deeper · Derivation C · 2 minCounting signed paths places BQP inside PP
Derivation CCounting signed paths places BQP inside PP

The goal is the sharp upper bound BQP⊆PP\mathsf{BQP}\subseteq\mathsf{PP} of Adleman, DeMarrais and Huang, which immediately implies BQP⊆PSPACE\mathsf{BQP}\subseteq\mathsf{PSPACE} 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 {0,±1,±12}\{0,\pm1,\pm\tfrac{1}{\sqrt2}\}. Expanding Ux=gT⋯g1U_x=g_T\cdots g_1 with complete basis resolutions between gates writes each amplitude ⟨z∣Ux∣x⟩\langle z|U_x|x\rangle as a sum over basis paths, each contributing ±(1/2)s\pm(1/\sqrt2)^s where ss is the number of Hadamards it crosses. Why: discretizing the entries makes every path amplitude an integer multiple of a fixed power of 1/21/\sqrt2, converting an analytic sum into a combinatorial count.

Step 2. Group paths by sign: ⟨z∣Ux∣x⟩=2−s/2 (N+−N−)\langle z|U_x|x\rangle = 2^{-s/2}\,(N_+ - N_-), where N+N_+ and N−N_- count the positive and negative paths. The difference N+−N−N_+-N_- is a GapP function — the gap between accepting and rejecting paths of a nondeterministic poly-time machine, equivalently a difference of two #P\#\mathrm{P} counting functions. Why: GapP is the algebraic closure of #P\#\mathrm{P} under subtraction and is exactly expressive enough to hold a signed amplitude.

Step 3. The acceptance probability is ∑z ∈ accept∣⟨z∣Ux∣x⟩∣2\sum_{z\,\in\,\text{accept}}|\langle z|U_x|x\rangle|^2, a sum of squares of GapP quantities, hence itself GapP (GapP is closed under products and polynomial sums). Deciding whether this quantity is ≥23\ge \tfrac23 or ≤13\le\tfrac13 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 BQP⊆PP\mathsf{BQP}\subseteq\mathsf{PP}, and since PP⊆PSPACE\mathsf{PP}\subseteq\mathsf{PSPACE} (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, N+−N−∈GapPN_+-N_-\in\mathrm{GapP}, and the GapP\mathrm{GapP}-sign ⇒PP\Rightarrow \mathsf{PP} characterization.*

Limiting cases

The character of BQP is best seen by pushing its defining parameters to their extremes.

CaseResultMeaning
Gap δ=1/poly(n)\delta = 1/\mathrm{poly}(n)Pr⁡[accept]=12+1p(n)\Pr[\text{accept}]=\tfrac12+\tfrac{1}{p(n)}still BQP — amplifiable to 1−2−m1-2^{-m} with poly\mathrm{poly} repetitions; the threshold is a convention
Gap δ=2−n\delta = 2^{-n} (negligible)Pr⁡[accept]=12±2−n\Pr[\text{accept}]=\tfrac12\pm 2^{-n}not BQP — a negligible advantage cannot be amplified efficiently; this is PP-type, unbounded-error computation
Gate precision ε\varepsilonN=O(log⁡c(1/ε))N=O(\log^{c}(1/\varepsilon))Solovay-Kitaev: each ideal gate costs only polylog overhead, so every finite universal set yields the same BQP
Perfect (zero-error) acceptanceclass EQP\mathsf{EQP} (exact QP)demanding probability exactly 11 gives a smaller, gate-set-sensitive class — bounded error is essential to robustness
Classical / non-interfering gatesBQP→BPP\mathsf{BQP}\to\mathsf{BPP}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 LL accepts yes-instances with probability exactly 2/32/3 and no-instances with probability exactly 1/31/3. You need the answer wrong with probability at most 2−10≈10−32^{-10}\approx 10^{-3}. 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 δ=23−12=16\delta=\tfrac23-\tfrac12=\mathbf{\tfrac16}, so δ2=1/36\delta^2=1/36 and the majority-error bound of equation (3) is ε≤e−2kδ2=e−k/18\varepsilon\le e^{-2k\delta^2}=e^{-k/18}.

Step 2. Solve for the target. Require e−k/18≤2−10e^{-k/18}\le 2^{-10}. Taking logs, k18≥10ln⁡2=6.931\dfrac{k}{18}\ge 10\ln 2 = 6.931, so k≥124.8k\ge 124.8, giving k=125\mathbf{k=125} runs.

Step 3. Check the bound is met. With k=125k=125, ε≤e−125/18=e−6.944=9.66×10−4\varepsilon\le e^{-125/18}=e^{-6.944}=\mathbf{9.66\times10^{-4}}, which is below 2−10=9.77×10−42^{-10}=9.77\times10^{-4}. The vote works.

Step 4. Confirm it stays in the class. Amplification multiplies the circuit size by a constant factor of 125125, independent of nn, so a poly(n)\mathrm{poly}(n) circuit stays poly(n)\mathrm{poly}(n); more generally error 2−m2^{-m} costs k≈12.5 mk\approx 12.5\,m runs, linear in mm. Result: 125 repetitions give error 9.66×10−49.66\times10^{-4}, and the class is unchanged.

2 · The Solovay-Kitaev compilation overhead is polynomial (fully worked)

You designed an algorithm as an ideal circuit of G=106G=10^{6} arbitrary one- and two-qubit gates, wanting total error 10−310^{-3}, 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 10−310^{-3} across G=106G=10^{6} gates, each must be approximated to ε=10−3/106=10−9\varepsilon = 10^{-3}/10^{6}=\mathbf{10^{-9}}.

Step 2. Apply Solovay-Kitaev. Each gate compiles to N=O(log⁡c(1/ε))N=O(\log^{c}(1/\varepsilon)) physical gates. Using the classic exponent c≈2c\approx 2 as an illustration, log⁡2(1/ε)=log⁡2(109)≈29.9\log_2(1/\varepsilon)=\log_2(10^{9})\approx 29.9, so N≈302≈900N\approx 30^{2}\approx \mathbf{900} physical gates per ideal gate.

Step 3. Total the cost: G×N≈106×900=9×108G\times N \approx 10^{6}\times 900 = \mathbf{9\times10^{8}} physical gates — under a billion, feasible in principle.

Step 4. Read off the scaling. The overhead N=O(log⁡c(G/εtot))N=O(\log^{c}(G/\varepsilon_{\text{tot}})) 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
EB
Ethan Bernstein
quantum complexity theory · co-author of the 1993 paper that defined BQP and built the universal quantum Turing machine

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.

History
1985
— Deutsch defines the universal quantum Turing machine and quantum-computable functions
1993
— Bernstein and Vazirani define BQP, build a rigorous universal QTM, and prove robustness
1994
— Shor places integer factoring and discrete logarithm inside BQP
1997
— Adleman, DeMarrais and Huang prove BQP ⊆ PP, hence BQP ⊆ PSPACE
2018
— Raz and Tal show an oracle relative to which BQP ⊄ PH via the Forrelation problem

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 BQP⊆PP\mathsf{BQP}\subseteq\mathsf{PP} 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 Pr⁡[S<k/2]≤e−2kδ2\Pr[S<k/2]\le e^{-2k\delta^2} and, with δ=1/6, m=10\delta=1/6,\ m=10, that k=125k=125 gives error 9.66×10−4≤2−109.66\times10^{-4}\le 2^{-10}; (2) the Solovay-Kitaev overhead O(log⁡c(1/ε))O(\log^{c}(1/\varepsilon)) and the worked ε=10−9⇒∼9×108\varepsilon=10^{-9}\Rightarrow\sim9\times10^{8} gates; (3) the GapP characterization giving BQP⊆PP⊆PSPACE\mathsf{BQP}\subseteq\mathsf{PP}\subseteq\mathsf{PSPACE}; (4) the BPP⊆BQP\mathsf{BPP}\subseteq\mathsf{BQP} simulation via Hadamard randomness and Toffoli reversibility. All constants (2/32/3, 1/31/3, δ=1/6\delta=1/6, c≲2c\lesssim2) 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 2/32/3 threshold is arbitrary, to trace the Feynman-path argument for BQP⊆PSPACE\mathsf{BQP}\subseteq\mathsf{PSPACE}, 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 QnQ_n 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 nn the answer to an uncomputable question about nn — for instance, whether the nn-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 BQP⊆PSPACE\mathsf{BQP}\subseteq\mathsf{PSPACE} 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 NP⊆BQP\mathsf{NP}\subseteq\mathsf{BQP}, nor that BQP⊆NP\mathsf{BQP}\subseteq\mathsf{NP}; 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 2n2^n into 2n/22^{n/2}, 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 BPP⊆BQP\mathsf{BPP}\subseteq\mathsf{BQP}. 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 11 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.

Where this leads