BQP versus P, NP, and PSPACE
The class — bounded-error quantum polynomial time — is the formal home of "what a quantum computer can efficiently do." Pinning down where it sits inside the classical complexity zoo is the central question of quantum computational power: it asks, in a language complexity theorists can argue about precisely, how much quantum mechanics buys us over classical computation. The honest answer is that we know surprisingly little for certain. What is proven is a short chain of containments; what is interesting — whether quantum computers crack -complete problems, whether they beat classical randomness — remains conjectural, and provably hard to settle. Two engines drive everything here. The first is the Feynman path-sum: a quantum amplitude for a polynomial-size circuit is a sum over exponentially many computational histories, and that single identity, read two ways, delivers the proven upper bounds — evaluate the sum in reusable memory for the space bound, read it as a signed count of paths for the counting bound. The second is quantum query complexity: the BBBV theorem shows that unstructured search — the abstraction of an -complete problem — costs quantum queries, only a quadratic saving over brute force. That is why nobody expects , and why Shor's factoring, which exploits hidden periodicity rather than brute search, is the exception rather than the rule. Every known separation between these classes is relativized — true relative to an oracle — so the real question lives beyond the reach of the very techniques that prove the containments.
- , the problems a quantum computer solves in polynomial time with bounded error, obeys the proven chain .
- The upper bounds come from one identity — the Feynman path-sum — evaluated in polynomial space (giving ) or read as a signed count (giving , the strongest known bound).
- No containment between and is known in either direction; there are oracles making each fail to contain the other, so any real resolution must be non-relativizing.
- Grover search is only quadratic: unstructured search costs quantum queries (BBBV lower bound), so -complete problems get no generic exponential speedup.
- Shor's algorithm puts factoring and discrete log in by exploiting algebraic periodicity, but those problems are not believed -complete, so they are no evidence for .
- Key idea: the quantum power that puts below is amplitude interference summed over exponentially many paths, while the barrier that keeps out is the query cost of unstructured search — two different axes, which is why quantum beats classical on structure but not on brute force.
The amplitude of a polynomial-size circuit is a Feynman sum over exponentially many paths; summing it in polynomial space gives and reading it as a signed count gives , whereas the -versus- frontier is governed not by amplitude-summing but by query lower bounds that forbid generic exponential speedups for unstructured search.
Where this lives today
The -versus-classical map is the load-bearing assumption under three live enterprises. Post-quantum cryptography is the largest: because Shor puts factoring and discrete log in , RSA, Diffie–Hellman and elliptic-curve schemes fall to a large fault-tolerant quantum computer, so standards bodies have moved to lattice- and code-based schemes tied to -hardness, precisely where no speedup beyond Grover's quadratic factor is known. Quantum-advantage experiments are the second: random-circuit sampling and BosonSampling are chosen because they live in -like sampling classes while being classically hard for reasons argued through and — the fine structure of is exactly what lets researchers claim a classical simulation would collapse the polynomial hierarchy. The third is the open problem itself: the 2018 Raz–Tal oracle separating from the polynomial hierarchy, and work on proofs of quantumness and -complete problems like Local Hamiltonian, are all attempts to prove unconditionally where quantum efficient computation really sits.
The physical picture
Picture a quantum computation as a branching tree of histories. A classical probabilistic machine follows one branch with some probability and you average; a quantum machine sends amplitude down every branch at once, and the branches interfere — amplitudes can add or cancel. All the power of quantum computing lives in that interference. To reproduce the answer classically you must, in the worst case, add up exponentially many branches — and a polynomial-space machine can do exactly that by walking them one at a time and reusing its memory, which is why sits inside . The first figure is the map this article is about: the proven nest of classes, with straddling because neither is known to contain the other.
Why doesn't quantum interference simply crack ? Because solving an -complete problem "from the outside" is finding a needle in an unstructured haystack of candidates, and interference only helps when the haystack has hidden structure the amplitudes can resonate with. For a featureless search the best a quantum computer can do is rotate amplitude toward the marked item a little at a time — Grover's geometric rotation — gaining a factor , never an exponential one. BBBV makes this a hard theorem, not a failure of imagination: no quantum algorithm beats queries. The second figure shows what that quadratic ceiling costs, with a concrete number.
Shor's algorithm looks like magic only because factoring secretly hides a period, and the quantum Fourier transform is exquisitely tuned to detect periodicity — that is structure, not brute force. The lesson the two figures teach together: beats classical computation exactly where algebraic structure is available, a different axis from the exhaustive-search axis along which -completeness lives.
The core equations
The proven skeleton is a chain of five classes. Each inclusion is a theorem; none of the strict separations is known — even is open, though widely believed. This is the map onto which every claim below must be placed.
where: — deterministic polynomial time; — bounded-error probabilistic polynomial time; — bounded-error quantum polynomial time; — probabilistic polynomial time with unbounded error (majority vote); — polynomial space. Reading: a quantum machine can run any randomized machine, so it sits above ; the path-sum puts it below , and is classical. Membership in is defined by a completeness/soundness gap, not by exact acceptance. The thresholds and look arbitrary, and they are — any inverse-polynomial gap defines the same class after amplification.
where: — the yes/no instances of a promise language ; — completeness and soundness thresholds. Reading: the gap of between the two cases is what makes repeated runs informative; Derivation two of the worked examples shows how any gap is boosted to . The single most important identity is the Feynman path-sum. The amplitude to end in basis state is a sum over all intermediate basis-state sequences, each contributing a product of one-gate transition amplitudes.
where: — the -th gate, a unitary on a poly-size register; — a computational-basis (path) state at time , with and ; — circuit size, polynomial in ; each — a one-gate amplitude computable to the needed precision. Reading: there are up to paths, so this sum is exponentially long but each term is a tiny product — the tension that makes it but not obviously . Squaring and summing the amplitudes over accepting outcomes gives the acceptance probability the class definition refers to.
where: — the basis states on which the final measurement accepts; — all length- histories ending at . Reading: the inner sum can have massive cancellation — the interference a classical simulator must reproduce. On the side the governing quantity is query complexity, and the BBBV theorem fixes it for unstructured search: the -bit OR needs quantum queries, matched above by Grover and below by an adversary argument.
where: — bounded-error quantum query complexity; — decide whether any of bits is set, the black-box form of an search; — the Grover iteration count, optimal up to the leading constant. Reading: quadratic, not exponential — this one bound is why is disbelieved. Every known separation is relativized: there are oracles making each of and fail to contain the other. Because the containment proofs relativize too, an unrelativized resolution must use non-relativizing techniques.
where: — suitably chosen oracles (hidden strings or relations); — some language in the relativized left class lies outside the relativized right class. Reading: the two oracles point opposite ways, so no relativizing argument can decide the unrelativized question. Finally, both classes embed in a common quantum proof system, , which is the natural arena for comparing quantum and classical verification.
where: — Quantum Merlin-Arthur, a quantum polynomial-time verifier given a quantum witness. Reading: embeds because a classical witness is a special quantum one; embeds because the verifier can ignore the witness and just compute.
The goal is to prove the workhorse upper bound directly from the path-sum, by exhibiting a polynomial-space machine that computes a circuit's acceptance probability without ever storing the exponentially large state vector. The trick: although the sum over paths is exponentially long, a machine can walk the paths one at a time, reuse a fixed-size accumulator, and never hold more than polynomially many bits alive at once — trading the quantum machine's exponential space for exponential time while keeping space polynomial.
Step 1. Fix a universal gate set with algebraic entries, for instance Hadamard plus Toffoli, so that every one-gate amplitude is a fixed dyadic number computable to bits in time . Why: exact algebraic entries mean the machine can compute each factor on demand rather than storing a table, and finite precision suffices because the class has a constant gap to resolve.
Step 2. Write the acceptance amplitude for a target as the path-sum , where each ranges over . Why: this converts a linear-algebra object — a product of exponential matrices — into a scalar sum whose terms are cheap and independent, the form a space-bounded machine can stream.
Step 3. Enumerate the path tuples with an -bit counter. For each tuple, multiply the one-gate amplitudes into a single running accumulator and add the product to a running total for , then move to the next tuple and overwrite the working registers. Why: only the counter, one product accumulator, and one total are ever alive, so the space stays even though the loop runs times.
Step 4. Recompute each on demand for every accepting outcome and accumulate , then compare it to the threshold . Why: the bounded-error gap of at least dwarfs the accumulated rounding error at precision, so a correct decision comes out; space used stays polynomial, which is the definition of .
Go deeper · Derivation B · 1 minBQP inside PP via signed path counting
The aim is to sharpen the space bound to the strongest containment known, , by recasting the same path-sum as a difference between two counting problems. With a real-amplitude gate set every path contributes a fixed-magnitude term carrying only a sign, so the acceptance amplitude becomes the number of positive paths minus the number of negative paths — a gap whose sign a probabilistic polynomial-time machine, accepting by majority of its branches, can test directly. Because , this result contains the previous one and is strictly more informative.
Step 1. Choose a real universal gate set (Hadamard and Toffoli), so every one-gate amplitude is for a fixed , and each path's product is a signed dyadic rational of fixed magnitude . Why: stripping the amplitudes down to a common magnitude times a sign turns amplitude-summing into sign-counting, the natural currency of counting classes.
Step 2. Write with , where the sign is the parity of minus signs along the path and is computable in polynomial time from the path description. Why: the amplitude is now literally up to a fixed scale, exposing a counting function — the difference of two counts.
Step 3. Express acceptance as , handling the square by running a doubled path register so the squared count is itself a single counting object over polynomially many bits. Why: probabilities are amplitude magnitudes squared, and the doubled register keeps the whole thing inside one counting problem rather than a product of two.
Step 4. Have a machine encode this signed count so that a majority of its computation branches accept exactly when ; the bounded-error gap guarantees the count lands strictly on one side. Why: is defined by majority acceptance, so a problem reducible to the sign of a function is in by definition — this is the Adleman–DeMarrais–Huang theorem.
Go deeper · Derivation C · 1 minThe BBBV bound and mutual oracle separation
The purpose here is to show why -complete problems resist quantum attack and why the -versus- question is oracle-ambiguous. The core is a hybrid argument bounding how much a quantum state can move when a single oracle bit is flipped: because the total "query weight" any algorithm can place grows only linearly in the number of queries, distinguishing single-marked inputs forces queries. That same fact, planted in an oracle, gives a language in outside , while a hidden-structure oracle gives the reverse.
Step 1. Run any -query algorithm and track the query magnitude it places on each index at each step; summing over steps gives . Why: each query is a unit-norm operation, so the total attention an algorithm can pay across all oracle positions is bounded by the number of queries — the key BBBV inventory.
Step 2. Flip the single marked bit at a low-weight index; the resulting change in the final state satisfies , so the state barely moves at indices the algorithm rarely queried. Why: if the algorithm did not "look hard" at position , it cannot tell whether the needle is there, which is what turns the weight budget into an indistinguishability statement.
Step 3. Average over the possible marked positions: since the total weight is only , most positions get weight , and detecting all of them with constant probability forces . Why: this is the matching lower bound to Grover's upper bound, closing the search problem at and ruling out an exponential quantum speedup for unstructured search.
Step 4. Deploy the bound as an oracle: a language asking whether an oracle string contains a marked item sits in (guess the position) but needs quantum queries, so it escapes ; conversely a recursive Fourier-sampling oracle yields a language in . Why: the two oracles point opposite ways, so both non-containments relativize and any unrelativized answer must avoid oracle-respecting arguments.
Limiting cases
The proven relationships, and the conjectured ones, arranged from the strongest facts to the deepest open questions.
| Case | Result | Meaning |
|---|---|---|
| Proven lower chain | a quantum computer simulates deterministic and randomized computation; both inclusions are unconditional | |
| Proven upper chain | from the path-sum; ADH 1997 gives , and is classical | |
| relationship | no containment proven in either direction; both fail relative to suitable oracles | |
| Unstructured search | quadratic, not exponential — no generic quantum speedup for the core | |
| Structured search | factoring, discrete log | hidden periodicity is detectable by the quantum Fourier transform (Shor), unlike unstructured |
| Common upper class | quantum proofs generalize both classical witnesses and quantum computation |
Worked examples
1 · Sizing Grover: why quadratic is not enough (fully worked)
A quantum computer searches an unstructured space of items for one marked entry. How many oracle queries does Grover use, and what does the same speedup do to a SAT instance on variables?
Step 1. Grover's iteration count is . With , , so the query count is queries, versus about on average classically. The quantum saving is real and large — a factor of roughly .
Step 2. Now take an -complete problem: Boolean satisfiability on variables, whose brute-force space is assignments. Grover treats "is there a satisfying assignment" as unstructured search, so it uses queries.
Step 3. Read the two numbers together. The quadratic speedup turns into about — from utterly impossible to merely astronomically impossible. At a billion oracle queries per second, queries is still over days per instance, and any real -hardness margin (larger ) blows past it immediately. A √N speedup halves the exponent; it never removes it, which is exactly why is disbelieved.
2 · Amplifying a weak BQP gap (fully worked)
A quantum circuit decides a language but with only an inverse-polynomial gap: it accepts yes-instances with probability and no-instances with , where and . How many independent repetitions, with a majority vote, drive the error below ?
Step 1. Running the circuit times and taking the majority fails only when the fraction of correct runs falls below ; a Chernoff/Hoeffding bound gives . Set this below the target .
Step 2. Solve , i.e. , giving . With this is .
Step 3. Plug in , : repetitions. That is still polynomial in — order — so a machine with any gap defines the same class as one with the – gap, which is why the thresholds in the definition of are arbitrary.
3 · The path-sum, counted
A quantum circuit uses qubits and gates. How many computational paths does its amplitude sum over, and how much memory does the simulation need?
Step 1. The number of paths is at most — about decimal digits, vastly more than the atoms in the observable universe. This is the sum the quantum machine performs "for free" by interference.
Step 2. The simulator never stores that sum. It holds a path counter of bits plus a few fixed-precision accumulators — working memory on the order of bits. The exponential lives in the running time (it walks all paths) while the space stays polynomial — the trade-off that places in rather than .
Physics of the portrait
The theory of quantum computational power is young, and one figure sits at the origin of almost every result above: the person who, with a student, first defined , bounded it inside , and helped prove the search lower bound that keeps out.
Origins · 1 minUmesh Vazirani and how this was discovered
Umesh Vazirani, a theoretical computer scientist at UC Berkeley and a student of Manuel Blum, built much of the scaffolding on which quantum complexity theory stands. In a 1993 paper with his student Ethan Bernstein — expanded in the 1997 SIAM Journal on Computing article the field still cites — he defined the quantum Turing machine rigorously, constructed a universal one, introduced the class , and proved the foundational upper bound by the path-integral simulation used in this article. The same paper introduced recursive Fourier sampling, the ancestor of the oracle that separates from . Vazirani then joined Charles Bennett, Ethan Bernstein and Gilles Brassard to prove the "BBBV" theorem — that unstructured search needs quantum queries — the result that makes Grover's algorithm optimal and forecloses a generic quantum attack on -complete problems. The Bernstein–Vazirani problem bears his name, and his framing of what quantum computers can and cannot do still sets the terms of the quantum-advantage debate.
Going further
Texts. Nielsen and Chuang, Quantum Computation and Quantum Information, Ch. 4 and 6 · Preskill, Lecture Notes on Quantum Computation, Ch. 6 · Watrous, Quantum Computational Complexity (survey) and The Theory of Quantum Information · Kitaev, Shen and Vyalyi, Classical and Quantum Computation · Wilde, Quantum Information Theory, complexity chapters · Arora and Barak, Computational Complexity, for the classical / background.
Provenance. The chain is from Bernstein and Vazirani (SIAM J. Comput. 26, 1997, 1411, for ) and Adleman, DeMarrais and Huang (SIAM J. Comput. 26, 1997, 1524, for ). The optimality and the mutual oracle non-containments are from Bennett, Bernstein, Brassard and Vazirani (SIAM J. Comput. 26, 1997, 1510); Grover's upper bound is from Grover (STOC 1996), shown exactly optimal by Zalka (1999). The oracle separating from the polynomial hierarchy is Raz and Tal (STOC 2019). A verifier should confirm: (1) the path-sum identity and its poly-space enumeration; (2) the Chernoff amplification giving threshold independence, and the figure; (3) the Grover counts and ; (4) that factoring is in and not known -complete.
Prerequisites. The Complexity Class BQP · BQP is Contained in PP and PSPACE · Quantum Query Complexity. Leads to. Quantum Merlin-Arthur (QMA) · QIP = PSPACE · The Polynomial Method for Quantum Lower Bounds.
Ask the tutor: ask me to walk through the path-sum simulation line by line, or to show exactly which oracle makes escape .
Is NP ⊆ BQP known, and what is the best evidence either way?
No — no containment is known between and in either direction, and the balance of evidence says neither contains the other. On one side, quantum computers solve structured problems like factoring that are not believed -complete, so they give no route to -hardness. On the other, the BBBV theorem shows the unstructured search at the core of -completeness costs quantum queries — only a quadratic speedup, provably optimal. There are oracles making fail to contain and others making fail to contain , so the question is wide open and any resolution must use non-relativizing techniques.
Why does the path-sum give BQP ⊆ PSPACE but not BQP ⊆ P?
Because the sum has exponentially many terms. Polynomial space is enough because the machine enumerates paths one at a time, reusing a fixed-size accumulator, so at any instant only polynomially many bits are alive — but walking every path takes exponential time. There is no known way to collapse the same sum into polynomial time, and doing so would require somehow shortcutting the interference among exponentially many amplitudes, which is precisely the resource that gives quantum computers their power. So the space bound is cheap and the time bound is the whole open question.
If Grover only gives a quadratic speedup, why is it a big deal?
It is useful but not transformative: halving the effective key length of a symmetric cipher means AES-128 offers only about bits of security against a quantum adversary, which is why standards recommend AES-256. But Grover turns a search into only , still exponential. Its real weight for complexity theory is the matching BBBV lower bound: because Grover is provably optimal, the quadratic ceiling is a theorem about the limits of quantum search, and the strongest single piece of evidence that quantum computers do not efficiently solve -complete problems.
Does Shor's algorithm mean factoring is NP-complete, or that BQP is huge?
Neither. Factoring lies in — you can certify both a factorization and its absence — and problems in that intersection are not believed to be -complete, because if one were, would equal , which almost nobody expects. Shor's algorithm works by reducing factoring to finding the period of a modular-exponentiation function and detecting that period with the quantum Fourier transform, a maneuver available only because the problem has hidden algebraic structure. It shows that very likely strictly contains , not that it swallows ; the structured-versus-unstructured distinction is the whole point.
What does it mean that every separation here is relativized?
An argument "relativizes" if it stays valid when every machine is given the same oracle — a free subroutine — to consult. Most of the basic simulation and diagonalization arguments in complexity theory relativize, and so do the containment proofs in this article. The trouble is that there are oracles and pointing in opposite directions: and . Because a relativizing proof would have to hold for every oracle, no such proof can settle the unrelativized question either way. Any real answer must therefore use a non-relativizing technique, of which complexity theory has only a handful.
Where do QMA and the Local Hamiltonian problem fit into this picture?
— Quantum Merlin-Arthur — is the quantum analogue of : a polynomial-time quantum verifier receives a quantum state as a witness and must accept valid claims and reject invalid ones with a gap. Both and sit inside it, so it is the smallest natural class containing the two we compare, the right arena for asking how quantum and classical proofs relate. Its complete problem — deciding the ground-state energy of a Local Hamiltonian — is the quantum echo of Boolean satisfiability, and understanding it is central to whether quantum computations can be efficiently verified.