πŸŽ‰ 75% of content is free forever β€” Unlock Premium from $10/mo β†’
CW
NEWSLIVESearch All Content
πŸ’Ό Servicesℹ️ Aboutβœ‰οΈ ContactView Pricing Plansfrom $10

Quantum Complexity Theory

Quantum ComputingComplexity Theory🟒 Free Lesson

Complexity Classes

P: problems solvable in polynomial time classically. NP: problems verifiable in polynomial time classically. BQP: problems solvable by a quantum computer in polynomial time with bounded error. QMA: problems verifiable by a quantum computer in polynomial time (quantum analogue of NP).

The definitions share a template β€” resources available to the decider, error tolerance, input size β€” and every interesting question in the field is a containment or separation between two cells of that template. Two clarifications prevent common misreadings. Bounded error means the machine accepts with probability at least 2/3 on yes-instances and at most 1/3 on no-instances; amplification by independent repetition pushes both bounds to at polynomial cost, so the specific constants are irrelevant. And P versus NP is a statement about deterministic classical time, while BQP is a statement about quantum time β€” proving BQP differs from P would prove as a corollary, which is one reason quantum complexity theorists expect the separation to be extremely hard to establish.

BQP

BQP (Bounded-Error Quantum Polynomial Time) is the class of decision problems solvable by a quantum computer in polynomial time with error probability .

Known:

It is believed that and β€” quantum computers are powerful but not for all NP problems.

Complete problems: integer factoring (Shor's), discrete logarithm, simulation of quantum systems.

Factoring's status deserves precision because it is constantly misquoted. Factoring is in BQP β€” Shor's algorithm runs in polynomial time β€” and it is in NP ∩ coNP, but it is not known to be NP-complete, and most complexity theorists believe it is not. That belief has teeth: if factoring were NP-complete, then NP would sit inside BQP, and that containment would collapse the polynomial hierarchy by the Babai–Fortnow argument sketched below. The simulation side is different in kind. Simulating a local quantum Hamiltonian for polynomial time is BQP-complete, which means the class of problems a quantum computer handles efficiently is exactly characterized by its ability to simulate quantum physics β€” a circularity of definitions that turns out to be the most useful theorem in the area, because it converts algorithm design questions into Hamiltonian simulation questions and back.

QMA

QMA (Quantum Merlin-Arthur) is the quantum analogue of NP:

  • Merlin (prover) sends a quantum proof state
  • Arthur (verifier) performs polynomial-time quantum computation
  • Acceptance probability: if true, if false

QMA-complete problems:

  • Local Hamiltonian problem: find the ground state energy of a local Hamiltonian
  • QSAT: satisfiability of quantum constraint satisfaction problems

The local Hamiltonian problem is the foundation of the Adiabatic Theorem. The completeness proof is the workhorse of quantum complexity: given any QMA verifier circuit, construct a local Hamiltonian whose ground state energy encodes the verifier's acceptance probability, with extensive terms that penalize illegal computations and local terms that enforce the circuit's gate-by-gate evolution. The construction needs locality β€” each term touches only a constant number of qubits β€” and it is exactly that locality constraint that makes the problem both QMA-hard and physically meaningful. The known containments are , and whether any of those arrows is reversible is open; the consensus is that quantum proofs are genuinely more powerful, just as quantum computers are believed to be.

Quantum Supremacy

Quantum supremacy (advantage) demonstrates that quantum computers can solve problems that classical computers cannot efficiently solve.

The strongest evidence: random circuit sampling (Google Sycamore) and boson sampling.

However, classical simulation algorithms continue to improve, and the practical utility of supremacy tasks remains debated. The methodological lesson of the last several supremacy milestones is that each claim was stated relative to a classical baseline available at publication time, and that baseline has moved every time: tensor-network contraction methods, ranking-and-peaking heuristics, and GPU clusters have repeatedly cut the estimated classical runtime of instances originally quoted as out of reach. A supremacy claim is therefore a time-stamped statement about the gap between two frontiers, not a permanent theorem. What has held up is the underlying complexity-theoretic picture β€” sampling from random circuit outputs is believed classically hard on average, and that belief now rests on average-case hardness conjectures rather than on any single experiment.

Complexity-Theoretic Implications

If , then quantum computers can solve all NP problems efficiently, including breaking RSA and elliptic curve cryptography.

Current belief: , but BQP contains problems outside P.

The relationship between BQP and NP is one of the open questions in complexity theory. The cryptographic stakes are narrower than the slogan suggests. RSA and elliptic-curve schemes rest on structured problems β€” factoring and discrete logarithm β€” that already sit inside BQP, so Shor's algorithm breaks them without any collapse of NP into BQP. Post-quantum cryptography is the engineering response to the containment that is already known, not to the one that is conjectured. The conjectured non-containment, meanwhile, protects nothing by itself: no proof is needed for lattice-based schemes to be safe, and no disproof would make them unsafe β€” their security arguments are reductions to hard lattice problems, which are believed outside both BQP and NP.

The remaining open questions between the major classes:

  • Is ?
  • Is ?
  • Is , or does quantum verification help?
  • Is , or are there NP problems quantum computers solve but classical ones provably cannot?

Python: Complexity Demonstration

python
import numpy as np

def factoring_complexity(n_bits):
    # Compare classical and quantum factoring complexity.
    N = 2**n_bits
    classical = np.exp(1.9 * (n_bits * np.log(2))**(1/3) * (np.log(np.log(N)))**(2/3))
    quantum = n_bits**3
    return classical, quantum

for n in [16, 64, 128, 256, 512, 1024, 2048]:
    c, q = factoring_complexity(n)
    print(f"{n}-bit: classical={c:.1e}, quantum={q:.1e}, speedup={c/q:.1e}")

The classical formula is the subexponential number-field sieve growth rate, which is why RSA-2048 was safe before quantum computers existed and why key lengths above 3072 bits are recommended against it: the classical cost grows faster than any polynomial but slower than any exponential, and the quantum column is plain cubic. Extending the table to 4096 bits keeps the quantum column trivial while the classical column keeps climbing β€” that asymmetry, not any claim about NP-completeness, is the concrete daily impact of quantum complexity theory.

The second demonstration makes the oracle-separation intuition concrete with Bernstein–Vazirani. Classically, recovering an -bit hidden string from queries to costs at least queries β€” one per hidden bit, since no query outcome reveals two bits at once β€” while the quantum circuit returns all of in exactly one:

python
import numpy as np

def hadamard_matrix(n):
    dim = 2 ** n
    H = np.zeros((dim, dim))
    for i in range(dim):
        for j in range(dim):
            parity = bin(i & j).count("1") % 2
            H[i, j] = (-1) ** parity / np.sqrt(dim)
    return H

def bv_quantum(n, s):
    dim = 2 ** n
    x = np.arange(dim)
    bits = (x[:, None] >> np.arange(n - 1, -1, -1)) & 1
    oracle_phase = (-1.0) ** ((bits @ np.array(s)) % 2)
    state = np.ones(dim) / np.sqrt(dim)
    state = hadamard_matrix(n) @ state           # H layer
    state = oracle_phase * state                 # phase oracle
    state = hadamard_matrix(n) @ state           # H layer
    return int(np.argmax(np.abs(state) ** 2))

def bv_classical_unit_queries(n, s):
    # Any classical strategy reads one hidden bit per query.
    hidden = 0
    for i in range(n):
        e_i = 1 << (n - 1 - i)
        hidden ^= (bin(e_i & int("".join(map(str, s)), 2)).count("1") % 2) << (n - 1 - i)
    return hidden, n

s = [1, 0, 1, 1, 0]
found = bv_quantum(len(s), s)
expected = int("".join(map(str, s)), 2)
print(f"Quantum circuit recovered s = {found:0{n}b} (expected {expected:0{n}b}) in 1 query")
classical_s, queries = bv_classical_unit_queries(len(s), s)
print(f"Classical unit-vector strategy needs {queries} queries to recover {classical_s:0{len(s)}b}")

Relative to this oracle, BQP separates from BPP in query count β€” one problem, two different query complexities β€” and Simon's problem strengthens the gap to exponential ( quantum queries versus classical), which is the seed of Shor's algorithm. Relativized separations do not automatically carry to the real world (there are oracles relativizing each possible answer to P versus NP), but they are the cleanest evidence that the quantum query model is a genuinely different resource.

Quantum Advantage Criteria

For quantum advantage to be practical:

  1. Speedup: quantum algorithm must be faster than best classical
  2. Problem relevance: the problem must be practically useful
  3. Hardware feasibility: the algorithm must be implementable
  4. Error tolerance: the algorithm must work with realistic noise

Current quantum advantage claims are primarily for artificial problems with no practical application. The gap between complexity-theoretic advantage and economic advantage is the defining tension of the field: random circuit sampling satisfies criterion 1 in a defensible sense and fails criterion 2, while pharmaceutical simulation and materials design satisfy 2 and currently fail 1 and 3. Error-mitigated simulations of small chemistry instances are the leading candidates to satisfy all four simultaneously in the near term, which is why quantum chemistry appears in nearly every hardware company's utility roadmap.

Quantum PCP Conjecture

The quantum PCP conjecture is the quantum analogue of the classical PCP theorem:

If true, it would imply that estimating the ground state energy of local Hamiltonians is QMA-hard, even with constant approximation ratio.

The classical PCP theorem states that checking satisfiability of Boolean formulas is NP-hard even with constant approximation β€” the proof that every NP problem has a probabilistically checkable witness with constant query complexity. The quantum version would say that a quantum verifier who only inspects a constant number of qubits of Merlin's proof can still enforce a constant-factor approximation to the ground state energy. Partial progress includes hardness of approximation within polylogarithmic factors and constant-factor hardness under various restricted qubit-geometry assumptions, but the constant-factor statement in full generality remains open β€” which also blocks progress on classifying the practical versions of quantum chemistry simulation that ask only for approximate energies.

Common Mistakes

Assuming BQP contains NP, or that quantum computers solve all NP-hard problems efficiently.

Fix: The believed picture is NP not contained in BQP. Shor's algorithm breaks RSA because factoring sits in BQP ∩ NP, not because NP-hard problems became easy; generic NP-hard optimization remains hard on quantum hardware.

Reading a supremacy experiment as proof that useful problems are now beyond classical reach.

Fix: Supremacy tasks are sampling problems chosen for classical hardness, and classical baselines for them have improved after every claim. For your actual workload, benchmark against the best current classical algorithm on the same instance sizes.

Treating complexity containments as engineering forecasts with dates attached.

Fix: Containments say nothing about constants, overheads, or problem sizes. Factoring is in BQP and yet RSA-2048 remains safe today because no device runs Shor's algorithm at that scale; plan against demonstrated resources, not class memberships.

Key Takeaways

  • BQP is the class of problems a bounded-error quantum computer solves in polynomial time; it contains P and factoring, sits inside PSPACE, and is widely believed to neither contain NP nor be contained in it.
  • QMA is the quantum analogue of NP with a quantum proof; the local Hamiltonian problem is its canonical complete problem, linking verification complexity directly to adiabatic computation.
  • Supremacy claims are time-stamped gaps between quantum experiments and moving classical baselines, which is why each one has been partially narrowed by better simulators.
  • The quantum PCP conjecture would make constant-factor ground-state energy estimation QMA-hard and remains open, limiting what can be said about provably hard approximate quantum chemistry.
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-16

β€”
β˜†β˜†β˜†β˜†β˜†
0 ratings

Rate & Feedback

Need Expert Quantum Computing Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement