Quantum Algorithms: Anatomy and the Classical-to-Quantum Pipeline
This document collects the structural facts about quantum algorithms: how a classical problem turns into a quantum circuit, where the problem-specific work actually lives, what the generic "wrapper" routines do, and how the major algorithm families differ in their use (or avoidance) of the oracle model. It is intended as a companion to:
- misc/deutsch-jozsa.md — a worked example in the query / oracle model,
- misc/quantum-complexity-theory.md — the complexity classes (, , …) and cost models,
- math/complexity-theory.md — classical complexity background.
For broader quantum-computing background and runnable code see the qcfront project.
1. The Two Things You Have to Build
For an oracle-style quantum algorithm (Deutsch–Jozsa, Bernstein–Vazirani, Simon, Grover, Shor's period-finding, phase estimation against a unitary, …), the input has two distinct pieces:
-
A classical specification of the problem — typically a Boolean function , given as a classical program, circuit, or mathematical description.
Algorithm Classical specification Deutsch–Jozsa , promised constant or balanced Bernstein–Vazirani for hidden Simon for hidden period Grover for SAT iff assignment satisfies Grover for unstructured search iff is a marked element Shor (factoring) for fixed Phase estimation a unitary given via implementations of -
A quantum implementation of the oracle unitary (or, for Shor, , etc.). This is what the algorithm actually queries.
The algorithm proper — Hadamards, Grover diffusion, inverse QFT, amplitude amplification — is generic and oracle-blind. Essentially all problem-specific engineering lives in building .
This separation is exactly the quantum analogue of using a classical decision-tree algorithm with a comparison oracle: the algorithm doesn't know what the elements are, only how to query them.
2. The Classical-to-Quantum Compilation Pipeline
The canonical recipe for turning a classical program / circuit for into a quantum oracle unitary :
classical algorithm for f
│
│ (Step A: Bennett / Toffoli compilation)
▼
reversible classical circuit on (x, anc, y)
│
│ (Step B: promote Toffoli/CNOT to quantum gates)
▼
quantum unitary on basis states
│
│ (Step C: uncompute the ancilla)
▼
oracle unitary U_f, clean on (x, y) with anc returned to |0⟩
2.1 Step A — Classical reversible circuit
A reversible circuit uses only gates whose truth tables are permutations: NOT, CNOT (controlled-NOT), Toffoli = (controlled-controlled-NOT). Toffoli alone is universal for classical reversible computation: any irreversible Boolean function can be embedded as a reversible map
where is an ancilla register that holds the intermediate scratch values of the underlying classical computation.
The cost of going from an irreversible circuit to a reversible one is given by Bennett's theorem (1973):
- Naive time-only conversion: gates and ancilla bits, where is the size of the original irreversible circuit.
- Time-space tradeoffs: time using space (Bennett 1989), via pebbling games on the computation DAG.
In practice tooling (e.g. open-source frameworks for quantum gate-level synthesis) does this compilation automatically.
2.2 Step B — Lift to quantum gates
A reversible classical gate is a unitary on the corresponding computational basis: , are unitary matrices acting on that happen to permute basis vectors. Promoting the reversible circuit to a quantum circuit therefore changes nothing about the action on basis states — it just additionally extends, by linearity, to superpositions:
This is quantum parallelism: one application of evaluates on every in the input superposition, but the answers are tangled with the inputs and ancillas.
2.3 Step C — Uncomputation
The ancilla register now depends on — the input and the scratch are entangled. If this entanglement is left in place, subsequent steps (Hadamards in Deutsch–Jozsa, the diffusion operator in Grover, inverse QFT in Shor) will not interfere correctly, because the "other half" of the state (the ancilla) carries which-path information that destroys the needed superposition.
The fix is Bennett uncomputation:
- Run forward, producing .
- Use a CNOT chain to copy onto a fresh answer register , producing .
- Run backward (i.e. the reversible circuit in reverse), resetting the ancilla to and the intermediate output register to .
Final state: . Drop the (now-disentangled) ancilla and output registers, and you have the clean oracle
Uncomputation roughly doubles the gate count and is what makes the ancillas reusable across queries. The pattern "compute → copy → uncompute" is ubiquitous in quantum algorithm design.
2.4 Cost summary
If the classical irreversible circuit for has size , the quantum oracle costs:
- Toffoli/CNOT gates (with the same ancillas, after Bennett),
- doubled by uncomputation,
- multiplied by a polylogarithmic factor if the universal gate set does not include Toffoli natively (Solovay–Kitaev, see misc/quantum-complexity-theory.md § 2.3).
End-to-end: the quantum circuit for the oracle is, up to constants and a overhead, the same size as the classical circuit for . Quantum speedup comes from the outer wrapper — the number of oracle calls — not from the cost-per-call.
3. Worked Examples of the Pipeline
3.1 Grover for SAT
Problem: given a 3-CNF formula on variables and clauses, find a satisfying assignment (or decide that none exists).
- Classical predicate: iff satisfies . As a classical circuit:
- For each clause , write a tiny sub-circuit computing the clause value into a clause-output bit.
- AND together all clause-output bits into the final answer.
- Size gates, scratch bits.
- Reversible compile: each clause becomes 1–3 Toffolis (using De Morgan to express OR as and writing to an ancilla). The big -input AND becomes a balanced tree of Toffolis with intermediate ancillas. Total: Toffolis on ancillas.
- Quantum oracle: promote to quantum gates, apply uncomputation. Result: implementable with Toffolis + CNOTs + ancillas, all of which return to after each oracle call.
- Plug into Grover. The Grover iteration is applications of (oracle + diffusion operator), each using one call and extra gates.
Total gate count: . The structure of shows up only inside ; the Grover wrapper is generic and oracle-blind. This is the famous Grover quadratic speedup over classical brute-force SAT.
The matching lower bound — Grover cannot be improved generically — is BBBV (Bennett–Bernstein–Brassard–Vazirani 1997): any quantum algorithm for unstructured search on items needs queries. So if SAT has a sub-exponential quantum algorithm, it must exploit the structure of the formula — opening the black box, not querying it.
3.2 Shor's algorithm — modular exponentiation
Problem: factor an -bit integer .
The quantum heart of Shor is period-finding for the function , where is a random integer coprime to . The period of (smallest with ) leaks the factorization of via .
- Classical algorithm for : square-and-multiply modular exponentiation — modular multiplications of -bit numbers. Total classical circuit size with schoolbook multiplication, or with fast algorithms.
- Reversible compile: modular addition, multiplication, and exponentiation each have textbook reversible constructions; Beauregard (2002) and Häner–Roetteler–Svore (2017) give Toffoli circuits using qubits. This is the workhorse of practical Shor implementations.
- Quantum oracle : gates total after uncomputation.
- Plug into period-finding:
- Prepare via Hadamards on the input register.
- Apply once: .
- Apply inverse QFT to the input register.
- Measure and post-process the result (continued fractions) classically to extract .
The QFT and the period-finding wrapper are short, generic, and entirely independent of the specific number being factored. All Shor-specific engineering is in step 2. A large fraction of physical-qubit budgets and fault-tolerant overhead estimates for factoring 2048-bit RSA reduces to "how big is the modular exponentiation circuit?".
3.3 Simon's algorithm
Problem: given promised to satisfy for some hidden , find .
- Classical specification: is supplied as an oracle or as a classical circuit.
- Reversible compile + lift to quantum: standard. uses Toffolis.
- Plug into Simon:
- Prepare .
- Apply : .
- Hadamard the input register and measure: yields a uniformly random orthogonal to ().
- Repeat times to collect linearly independent constraints; solve a linear system over classically to recover .
The classical post-processing here is non-trivial (Gaussian elimination over ) but polynomial. The quantum oracle is again the only problem-specific quantum work.
4. Generic Compilation: Any Classical Function as a Quantum Oracle
The pipeline of § 2 was illustrated on hand-crafted examples (SAT, modular exponentiation, Simon's promise). It is in fact fully generic and automatable: any classical function computable by a Turing machine can be compiled into a quantum oracle by a mechanical procedure, with no "quantum compilation gap" in the same sense there is between classical TMs and assembly. This subsection states the theorem and lists the four important caveats.
4.1 The cost-preservation theorem
Combining the steps of § 2 with the standard classical results below gives:
Theorem (folklore, "no-overhead theorem for classical-to-quantum compilation"). A classical Turing machine running in time and space admits a quantum oracle unitary implementable by a circuit of size on qubits, over any fixed universal gate set; the circuit is itself computable from the TM description in classical polynomial time.
The two classical-side inputs:
- Pippenger–Fischer (1979). Any TM running in time is simulable by a Boolean circuit family of size , uniformly constructible.
- Bennett reversibilization (1973, 1989). Any irreversible Boolean circuit of size has a reversible Toffoli/CNOT implementation, with several time–space tradeoffs:
| Variant | Gates | Ancillas |
|---|---|---|
| Naive (store every intermediate value) | ||
| Bennett pebbling, | ||
| Lange–McKenzie–Tapp (2000), near space-optimal |
The pebbling tradeoff is essentially tight: there exist explicit functions that cannot be reversibly computed in time and space.
This is why is trivial: every polynomial-time classical computation lifts to a polynomial-size quantum circuit by this pipeline. The same lift, with extra space-management bookkeeping, underlies and the upper bound from misc/quantum-complexity-theory.md § 3.2.
4.2 The four caveats
Genericity is real but not free. Four sharp points worth internalizing:
Ancilla blow-up vs. depth
Naive Bennett reversibilization uses ancillas — one per non-trivial intermediate value. For modular exponentiation in Shor on a 2048-bit RSA modulus the underlying classical computation has logical steps; the naive circuit would need ancilla qubits, well beyond any conceivable hardware. The pebbling tradeoff is what makes the problem tractable: trade to land near the space-optimal end of the curve.
Practical Shor implementations (Beauregard 2002; Häner–Roetteler–Svore 2017) use qubits with gates — the qubit count is dominated by modular-arithmetic ancillas, not by the bits of the number being factored. This is the dominant cost driver in fault-tolerant resource estimates.
No quantum advantage from compilation alone
Compiling a classical algorithm to a quantum circuit gives you a circuit of the same asymptotic size. There is no automatic speedup. If you have a polynomial-time classical solver for , the lifted quantum circuit is also polynomial — still polynomial, no better, no worse.
Quantum advantage comes from a wrapper (Grover, Shor's QFT, phase estimation, amplitude estimation) that calls the compiled oracle a small number of times. The compilation pipeline produces the oracle; the wrapper produces the speedup. Conflating these is a common source of bogus "polynomial-time quantum SAT" claims.
Input encoding is non-trivial
The pipeline assumes inputs are classical bit strings already in the data register. Some algorithms expect inputs of a different type:
- HHL (linear systems ): expects , a quantum state encoding the -entry vector . Loading this requires either a QRAM (quantum random-access memory; Giovannetti–Lloyd–Maccone 2008) — itself a non-trivial hardware primitive — or a structured admitting an efficient state-preparation circuit.
- Quantum machine learning kernels: input “data” are likewise expected as amplitude-encoded states, with all the same access-model caveats (Aaronson 2015, “Read the fine print”).
When comparing “exponential speedup” claims to classical baselines, the access model matters: an exponential algorithmic gain can hide an exponential cost in state preparation or readout, leaving no net advantage end-to-end.
Continuous / real-number functions
The pipeline is for . Real-valued computations (numerical analysis, optimization, ML) first need quantization: fix a -bit fixed-point or floating-point format, then compile the integer / bit-level arithmetic reversibly. Precision on a real-valued output costs bits per number, multiplied through the circuit. There is no "native" quantum real-number arithmetic.
4.3 Tools that implement the pipeline
Modern quantum-programming frameworks ship the entire pipeline as an end-to-end compile step, including automatic uncomputation and gate-set translation:
| Tool | Source language | Target |
|---|---|---|
| Microsoft Q# + QIR | Q# (classical-flavored functional code, with adjoint annotations) | LLVM-style IR → gate-level circuit |
| Quipper | Haskell embedded DSL with circuit monad | gate-level circuit |
Qiskit classical_function | Python with type-annotated Booleans | Toffoli/CNOT via the Tweedledum synthesizer |
| Cirq + Tweedledum | Python | reversible synthesis |
| silq (ETH Zürich, 2020) | high-level quantum DSL with type-checked automatic uncomputation | reversible quantum circuit |
| RevKit | reversible-circuit synthesis benchmarks | Toffoli circuits |
The state of the art on the synthesis side is silq (Bichsel–Baader–Gehr–Vechev 2020): the first language whose type system automatically inserts the compute–copy–uncompute pattern, so the programmer writes once as if it were ordinary classical code.
4.4 Summary table
| Question | Answer |
|---|---|
| Can any classical TM be turned into a quantum oracle? | Yes, by Pippenger–Fischer + Bennett + Toffoli/CNOT + uncomputation + Solovay–Kitaev. |
| Asymptotic overhead? | time blow-up; ancilla count tunable via pebbling between and . |
| Automated? | Yes — Q#, Quipper, Qiskit, Cirq + Tweedledum, silq, RevKit. |
| Does compilation alone give quantum speedup? | No. A compiled circuit has the same size as the classical algorithm. Speedup comes from quantum wrappers around the oracle. |
| Free in practice? | No — ancilla blow-up, uncomputation doubling, Solovay–Kitaev polylog, quantization for reals, QRAM for vector inputs. |
5. Beyond the Generic Pipeline: Oracle, Wrapper, and Compiler Optimizations
The generic compilation of § 4 is the -O0 baseline: it works for everything but is wildly suboptimal for almost any specific problem. Real quantum algorithm design improves on it at three orthogonal levels — oracle, wrapper, and compiler — with cumulative gains of – in qubit and gate budgets for problems like Shor and Grover-on-SAT.
This section traces the SAT example of § 3.1 through all three layers.
5.1 Oracle-level optimizations
Even within the "build a reversible circuit for " framing, the generic pipeline is far from tight.
Phase oracle vs. bit oracle
Many Grover-style algorithms only need the phase oracle
rather than the bit oracle . A single multi-controlled- at the end replaces the final AND-tree + CNOT-onto- + uncomputation, roughly halving the gate count for SAT-style oracles.
Custom Boolean-function synthesis
For a 3-CNF formula with clauses on variables, instead of a naive clause-by-clause Toffoli tree:
- ESOP (Exclusive-Sum-of-Products) synthesis exploits algebraic identities to merge clauses — the same tricks used in classical reversible-logic design (RevKit, Tweedledum).
- AND-of-OR decomposition with shared sub-clauses: if two clauses share literals, the corresponding Toffolis share sub-computations. Common-subexpression elimination cuts both gate and ancilla count.
Toffoli decomposition tricks
The textbook Nielsen–Chuang decomposition of one Toffoli into Clifford+T uses 7 gates. Better:
- Measurement-assisted Toffoli (Jones 2013): 4 gates + 1 ancilla + 1 measurement, using deferred measurement and adaptive Clifford correction.
- Multi-controlled Toffolis (): naive nesting gives Toffolis; Barenco et al. (1995) achieves Toffolis using "dirty" ancillas (ancillas not in ).
- Relative-phase Toffolis (Maslov 2016): if the Toffoli is going to be uncomputed later, implement it with just 3 gates by allowing a phase error that the uncomputation cancels. This roughly halves the -count of any compute–copy–uncompute pattern.
-count is the dominant fault-tolerant cost driver because the gate requires expensive magic-state distillation; halving -count halves the physical-qubit-second budget.
Ancilla recycling and hand-tuned pebbling
The generic Bennett pipeline uses naive ancillas (§ 4.1). For specific functions, hand-crafted pebbling strategies are dramatically tighter:
- Modular exponentiation for Shor: Beauregard's qubits versus the naive ancillas — three orders of magnitude reduction.
- Karatsuba / Toom–Cook multiplication, quantized: Gidney (2019) gives reversible Karatsuba in Toffolis using only ancillas, versus schoolbook.
- In-place arithmetic: addition and multiplication can be done in place (output overwrites input), saving an entire register.
5.2 Wrapper-level: smarter than Grover for structured problems
For SAT specifically, several quantum algorithms beat Grover's by exploiting structure that the black-box wrapper can't see.
Quantum backtracking (Montanaro 2018)
Classical SAT solvers (DPLL, CDCL) use backtracking with unit propagation, conflict-driven clause learning, etc. Montanaro showed:
A classical backtracking algorithm exploring nodes of a search tree can be quantumly simulated in time using a quantum walk on the tree.
For 3-SAT this becomes roughly versus the classical (Schöning) — a non-trivial improvement in the exponent on top of the generic speedup. The key: the wrapper inspects the recursion-tree structure, not just an opaque oracle.
Schöning-style amplitude amplification (Ambainis 2004)
Classical Schöning solves -SAT in randomized time. Ambainis lifts this to quantum:
For 3-SAT: instead of classical. The gain over generic Grover-on-Schöning composition comes from careful interference between the random-walk and amplification steps.
Quantum walks on structured graphs
The constraint graph or implication graph of a SAT instance has structure that MNRS quantum walks (Magniez–Nayak–Roland–Santha 2011) can exploit. For element distinctness and triangle finding, walk-based algorithms beat Grover by polynomial factors; for SAT-specific walks the savings are problem-dependent.
QAOA / variational approaches for MAX-SAT
For MAX-SAT and other optimization variants, QAOA with layers (see § 6.3) gives a Hamiltonian whose low-energy states encode good approximate answers. For on MAX-CUT, QAOA achieves a approximation ratio (Farhi–Goldstone–Gutmann 2014). The "circuit" is not a reversible compilation of a classical algorithm — it's a problem-Hamiltonian encoding alternated with a mixer, parameters tuned classically. Entirely different architecture from oracle + wrapper.
5.3 Compiler-level optimizations
Even after fixing the algorithm and the oracle decomposition, the gate-level circuit admits one more pass of optimization.
-count and -depth minimization
The dominant fault-tolerant cost metric. State-of-the-art tools:
feynman(Amy 2018): polynomial-time -count optimization for Clifford+T circuits via phase-polynomial analysis. Typically cuts -count by 30–70% on textbook circuits.pyzx(Kissinger–van de Wetering 2020): ZX-calculus-based rewriting; often finds even tighter -counts.- Catalytic computations: reuse leftover ancilla state to avoid redundant gates entirely.
Gidney–Ekerå (2021) applied this whole optimization stack to RSA-2048 factoring with Shor's algorithm and concluded million physical qubits and hours on a surface-code fault-tolerant architecture — compared to early-2010s estimates of physical qubits. Three orders of magnitude of cumulative oracle + compiler optimization on a single algorithm.
Qubit routing and SWAP minimization
Real hardware (heavy-hex on IBM, square grid on Google) does not have all-to-all connectivity, so 2-qubit gates between non-adjacent qubits require SWAP chains. SWAP routing is NP-hard in general, but heuristics (Qiskit's SABRE, tket's routing pass) typically come within 2–3 of optimal. Hand-crafted layouts for specific algorithms (QFT in a 1D chain, Shor's modular exponentiation on a grid) can save another factor of 2–5.
Pulse-level and gate-cancellation optimization
Below the gate level: , , CNOT-chains commute past single-qubit gates with phase corrections — all exploited by Qiskit / tket transpilers. Pulse-level compilation (collapse a gate sequence into a single optimal-control pulse) gives another 10–30% on real hardware.
5.4 End-to-end speedup over the generic baseline
For SAT specifically, the cumulative gap between the generic pipeline and the best-known hand-crafted quantum solver:
| Layer | Gain over generic |
|---|---|
| Bit oracle → phase oracle | |
| Naive Toffoli → measurement-assisted / relative-phase | – in -count |
| Naive Bennett ancillas → pebbling / in-place arithmetic | – in ancillas (problem-dependent) |
| Grover-on-generic-oracle → quantum backtracking (DPLL-style) | vs — exponential improvement in the exponent |
| Pre-2018 fault-tolerant Shor → Gidney–Ekerå pipeline | in physical qubits |
The biggest single lever is choosing the right wrapper for the problem structure. Grover over a generic SAT oracle is a poor fit; quantum backtracking over a structured DPLL recursion is a much better one. Compiler-level optimization buys factors of 2–10; oracle-level synthesis buys another 2–10; but moving from black-box search to structure-exploiting walks/backtracking changes the exponent, which dominates everything else at scale.
Rule of thumb. For a known problem, never deploy the generic pipeline naively. Treat it as the upper bound, then look for: (i) a phase-oracle reformulation, (ii) an algorithm-specific wrapper that opens the black box, (iii) hand-crafted ancilla management for any classical sub-algorithm, and (iv) a -count optimizer on the final circuit.
6. The Generic "Wrappers"
Across most oracle algorithms the same handful of subroutines appear as the outer wrapper. Knowing these by name is most of what's needed to read modern quantum-algorithms papers.
| Wrapper | What it does | Used in |
|---|---|---|
| Hadamard transform | — uniform superposition | Deutsch–Jozsa, BV, Simon, Grover |
| Quantum Fourier Transform (QFT) | Shor, phase estimation | |
| Phase kickback | use ancilla to convert 's value into a phase on | every algorithm above |
| Grover diffusion | reflect about the uniform-superposition vector | Grover, amplitude amplification |
| Phase estimation | given , estimate | Shor (it is phase estimation on a modular-exp unitary), HHL, ground-state energy |
| Amplitude amplification | generalize Grover to amplify any subspace defined by a quantum test | Brassard–Høyer–Mosca–Tapp; speed-up template for many search-flavored algorithms |
| Amplitude estimation | given a unitary that marks "good" outcomes with amplitude , estimate to in queries | Monte-Carlo speedups, machine-learning subroutines |
Algorithm design at the wrapper level reduces to picking which of these to combine, against an oracle that you are responsible for engineering. The strongest oracle-model quantum speedups so far — Simon, Shor, phase estimation — come from the QFT-based wrappers; Grover-flavored algorithms give at most quadratic gains.
7. Non-Oracle Algorithms
Not every quantum algorithm fits the "classical predicate + oracle + wrapper" mold. The major families that bypass it:
7.1 The QFT itself
The Quantum Fourier Transform is just a fixed unitary — no classical function as input, no oracle. It admits an -gate (or -gate with approximation) circuit (Coppersmith 1994). It is the foundational primitive, not an algorithm parameterized by a problem.
7.2 Hamiltonian simulation
Given a Hamiltonian (typically supplied as a sum of local terms — not a Boolean function), produce a circuit implementing on a quantum state. The input is physics data, not a classical predicate.
Approaches:
- Trotter–Suzuki (Lloyd 1996): for large . Easy to implement, polynomial overhead, dimension-dependent error.
- Qubitization / quantum signal processing (Low–Chuang 2017–19): optimal asymptotic scaling.
- Linear combinations of unitaries (LCU) (Childs–Wiebe 2012): randomized compilation.
Hamiltonian simulation is what physicists actually want from a quantum computer, and the reason quantum supremacy is plausible — classical simulation of takes time exponential in the system size.
7.3 Variational and hybrid algorithms
For NISQ-era hardware:
- VQE (variational quantum eigensolver, Peruzzo et al. 2014): parameterize a shallow circuit , classically minimize over .
- QAOA (quantum approximate optimization algorithm, Farhi–Goldstone–Gutmann 2014): a layered ansatz alternating problem-Hamiltonian and mixer-Hamiltonian evolutions; classically tune the angles.
Here the "specification" is again a Hamiltonian (often encoding a classical combinatorial problem via, e.g., ). The classical-to-quantum step is Hamiltonian encoding, not reversible-circuit compilation. There is no oracle and no Grover-style amplification.
7.4 Sampling algorithms
For supremacy-style tasks:
- Random Circuit Sampling (Google 2019): just apply a random sequence of two-qubit gates and sample the output distribution. No problem, no oracle, no answer to verify — only the distribution is the output.
- Boson Sampling (Aaronson–Arkhipov 2011): sample photon detection patterns at the output of a linear-optical interferometer. Hardness rests on -hardness of computing permanents.
- IQP (Bremner–Jozsa–Shepherd 2010): commuting-gate quantum circuits.
These exist to demonstrate quantum supremacy with the smallest possible quantum-circuit complexity, by giving up on solving a useful problem.
7.5 Adiabatic algorithms
Encode the answer as the ground state of a target Hamiltonian ; adiabatically interpolate from an easy to slowly enough that the spectral gap is preserved. No oracle, no circuit per se — the "program" is the choice of and the interpolation schedule. Polynomially equivalent to the circuit model.
8. Where the Quantum Advantage Actually Lives
A useful frame for evaluating any "speedup" claim:
- The size of the oracle / Hamiltonian circuit is comparable to the classical computation for — up to constants, ancilla doubling for uncomputation, and Solovay–Kitaev polylog factors. There is no quantum advantage per call.
- The number of calls can drop super-polynomially (Shor, Simon, phase estimation) or polynomially (Grover, amplitude amplification, walk-based algorithms). This is the speedup.
- For total Boolean functions (no promise) the speedup is at most polynomial: (Aaronson et al. 2021, see misc/quantum-complexity-theory.md § 4.3). Super-polynomial speedups require problem structure — a promise (Deutsch–Jozsa, Simon), algebraic structure (Shor's hidden-subgroup setting), or a continuous-input flavor (phase estimation).
- Constants matter for practice. Even Shor's becomes gates for 2048-bit RSA, and Grover's quadratic speedup over a classical SAT solver with billions of decisions per second is easily eaten by quantum gate times and error-correction overhead. The complexity-theoretic separation is the prerequisite for practical advantage, not the certificate of it.
The big-picture summary is:
What you do once classically — the oracle — you have to do reversibly and uncomputed on the quantum side. What you do many times classically — the search — can sometimes be replaced by a much smaller number of quantum calls. That replacement is the quantum advantage.
References
- C. Bennett, Logical reversibility of computation, IBM J. Res. Dev. 17, 525 (1973).
- C. Bennett, Time/space trade-offs for reversible computation, SIAM J. Comput. 18, 766 (1989).
- N. Pippenger and M. J. Fischer, Relations among complexity measures, J. ACM 26, 361 (1979) — TM-to-circuit simulation with overhead.
- K.-J. Lange, P. McKenzie, A. Tapp, Reversible space equals deterministic space, J. Comput. Syst. Sci. 60, 354 (2000) — near-space-optimal reversibilization.
- D. Beauregard, Circuit for Shor's algorithm using qubits, Quant. Inf. Comput. 3, 175 (2003); arXiv:quant-ph/0205095.
- T. Häner, M. Roetteler, K. Svore, Factoring using qubits with Toffoli based modular multiplication, Quant. Inf. Comput. 17, 673 (2017); arXiv:1611.07995.
- V. Giovannetti, S. Lloyd, L. Maccone, Quantum random access memory, Phys. Rev. Lett. 100, 160501 (2008) — QRAM definition and limits.
- S. Aaronson, Read the fine print, Nature Physics 11, 291 (2015) — HHL input/output-access caveats.
- B. Bichsel, M. Baader, T. Gehr, M. Vechev, Silq: A high-level quantum language with safe uncomputation and intuitive semantics, PLDI 2020 — type-checked automatic uncomputation.
- A. Barenco et al., Elementary gates for quantum computation, Phys. Rev. A 52, 3457 (1995) — multi-controlled gate decompositions and dirty-ancilla tricks.
- C. Jones, Low-overhead constructions for the fault-tolerant Toffoli gate, Phys. Rev. A 87, 022328 (2013) — measurement-assisted 4- Toffoli.
- D. Maslov, Advantages of using relative-phase Toffoli gates with an application to multiple control Toffoli optimization, Phys. Rev. A 93, 022311 (2016) — 3- relative-phase Toffolis for compute-uncompute patterns.
- A. Montanaro, Quantum speedup of branch-and-bound algorithms, Phys. Rev. Research 2, 013056 (2020); Quantum-walk speedup of backtracking algorithms, Theory of Computing 14, 1 (2018).
- A. Ambainis, Quantum search algorithms, SIGACT News 35, 22 (2004) — quantum Schöning for -SAT.
- F. Magniez, A. Nayak, J. Roland, M. Santha, Search via quantum walk, SIAM J. Comput. 40, 142 (2011) — MNRS quantum walks.
- M. Amy, Towards large-scale functional verification of universal quantum circuits, EPTCS 287 (2018) — the
feynman-count optimizer. - A. Kissinger, J. van de Wetering, Reducing the number of non-Clifford gates in quantum circuits, Phys. Rev. A 102, 022406 (2020) —
pyzxand ZX-calculus rewriting. - C. Gidney, Asymptotically efficient quantum Karatsuba multiplication, arXiv:1904.07356 (2019).
- C. Gidney, M. Ekerå, How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits, Quantum 5, 433 (2021) — end-to-end fault-tolerant Shor resource estimates.
- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information (Cambridge, 2010), §3.2.5 (reversible computation) and §6 (quantum search).
- A. Childs, Lecture Notes on Quantum Algorithms (https://www.cs.umd.edu/~amchilds/qa/) — the modern standard reference, with detailed coverage of Hamiltonian simulation, QSP/qubitization, and walk-based algorithms.