Deutsch, Deutsch–Jozsa, Bernstein–Vazirani, Grover. Each answers a question about a black box in fewer queries than any classical method, each can be simulated exactly on a laptop, and each has a precise condition under which the speedup exists. The chapter checks the conditions as well as the speedups.
David Deutsch's 1985 paper, Quantum theory, the Church–Turing principle and the universal quantum computer, is the one that asked what quantum mechanics does to the Church–Turing thesis, and it contained the first problem a quantum computer solves in fewer queries than a classical one. Take a box computing f : {0,1} → {0,1}. The question is whether f(0) = f(1), that is, whether f is constant or balanced. Classically that takes two queries. Quantumly it takes one: query the box in superposition, interfere, and measure. The form taught today, which answers with certainty, is a later refinement of the original.
Deutsch and Jozsa (1992) extended it to n bits under a promise: the box computes f : {0,1}n → {0,1}, and f is promised to be either constant or balanced (equal to 1 on exactly half the inputs). A deterministic classical algorithm needs 2n−1 + 1 queries in the worst case, and a quantum one needs a constant number. Who got it to one query, with certainty, is a matter of record worth getting right. Deutsch's original algorithm worked only probabilistically; Deutsch and Jozsa made it deterministic, but their method used two function evaluations; the one-evaluation version taught today is due to Cleve, Ekert, Macchiavello and Mosca (1998), and independently to Tapp in unpublished work. The circuit simulated below is that improved one. The names Deutsch and Deutsch–Jozsa stay on it, as Nielsen and Chuang put it, for the first demonstration that a quantum computer could do something faster, and for the first gap in how the time scales.
The part of the story that usually gets dropped. Nielsen and Chuang say it themselves: the problem is of little practical interest, and a classical computer allowed to guess does very well. That separation is against the exact deterministic classical algorithm only. A classical algorithm allowed to flip coins asks k random points and says “constant” if they all agree; it errs with probability at most 21−k, whatever n is. At n = 8 and k = 5 the error is 775/12903, about 6%. Deutsch–Jozsa is an exponential gap between quantum and exact deterministic classical computation, and not between quantum and classical computation as such.
Ethan Bernstein and Umesh Vazirani's 1993 paper, Quantum complexity theory, gives the next problem. A box computes f(x) = s·x mod 2 for a hidden string s of n bits, and the task is to find s. Each classical query returns one bit about s, so n queries are needed and n suffice. The quantum algorithm, in the one-query form Cleve, Ekert, Macchiavello and Mosca gave, is the Deutsch–Jozsa circuit unchanged: Hadamards, one phase query (−1)s·x, Hadamards. (Bernstein and Vazirani's own version used two evaluations, as Deutsch and Jozsa's did; Cleve et al. note that one network solves both problems.) The state that comes out is |s〉 exactly, and measuring it gives s with certainty. That is n against 1, a linear gap, and the chapter does not call it more. The same paper's recursive version of the problem is where the structure gives a super-polynomial separation, relative to an oracle. The speedup lives in the promise that f is linear.
Take N = 2n items, M of them marked, and a box that says whether a given item is marked. Classically, finding one costs about N/2 queries on average. Grover's algorithm starts in the uniform superposition and repeats two steps: flip the sign of the marked amplitudes (the oracle), then reflect every amplitude about the mean (diffusion). Each pair rotates the state by 2θ in the plane spanned by “marked” and “unmarked”, where θ = arcsin√(M/N), so after k iterations the chance of measuring a marked item is
P(k) = sin^2( (2k + 1) theta )
The optimal k is about (π/4)√(N/M): a quadratic speedup, not an exponential one. For N = 4 with one marked item it is exact after one iteration. The case of more than one marked item is Boyer, Brassard, Høyer and Tapp's (1998), and the one the M = 2, 3 runs below test.
The optimality, which this page cites and does not check. No quantum algorithm can search an unstructured space with fewer than order √N queries. Bennett, Bernstein, Brassard and Vazirani proved the lower bound in 1997, and Zalka showed in 1999 that Grover's algorithm is optimal down to the constant. Grover's speedup is the whole of what a quantum computer offers for unstructured search.
ch-quantum-oracles-verify.py does not use closed forms to produce its numbers.
It builds the amplitude vector and applies the operations.
Deutsch all 4 functions {0,1}->{0,1}: one query separates constant
from balanced with certainty
Deutsch-Jozsa n = 1..4: every constant and every balanced function enumerated
(2 + C(2^n, 2^(n-1)): 4, 8, 72, 12872 functions);
P(0...0) is exactly 1 for constant, exactly 0 for balanced
classical, against every promise function as a truth table (n = 2, 3):
2^(n-1) queries cannot decide (76 query sets),
2^(n-1)+1 always can (60 query sets)
random classical: error <= 2^(1-k), exact, n = 3, 5, 8
Bernstein- all 510 secrets, n = 1..8: P(measure s) = 1 after one query
Vazirani any q < n classical queries leave >= 2 consistent strings:
exhaustive over 37,062 query sets, n = 2..5
Grover 604 cases (n=2..11, M=1,2,3, every k over a full period):
largest |simulation - sin^2((2k+1)theta)| = 4e-13
N=4: P(1) = 1; P >= 1 - 1/N at k_opt, n = 2..11
n=24: k_opt = 3216 (classical mean 8,388,608); log2(k)/n = 0.485 -> 1/2
n=10: P(k_opt = 25) = 0.9995; P(2 k_opt) = 0.0002 (overshoot)
The overshoot line is worth reading twice: Grover is not “run it longer for a better answer”. At twice the optimal count the success probability is two in ten thousand, because the state has rotated past the target.
The controls each have to fail, and do. Without the oracle sign flip, without the diffusion reflection, and with the wrong formula sin2(kθ), Grover misses the simulation by more than 0.01. An oracle for a non-linear function (the AND of two bits) does not return a single basis state in Bernstein–Vazirani. A function that breaks the Deutsch–Jozsa promise gives P(0…0) = 0.25, strictly between 0 and 1, so the promise is doing real work; and without the final Hadamards a balanced function does not read out as 0.
What this does not show. It does not check the √N lower bound, which is cited. It is a simulation on a classical machine, so it shows that the formulas describe the algorithms, not that hardware achieves them. Nothing here concerns noise, error correction, or the cost of the oracle itself; counting queries counts a resource the problem hands over free, and in most real searches the oracle is the expensive part. Three of the four are speedups under a promise about the box, not speedups for a problem anyone had before the algorithm. None of them is the exponential speedup associated with Shor's factoring, which this chapter does not treat.
The corpus has no other quantum-computing chapter, and the only quantum-computing claim in its research register is that braiding is universal for topological quantum computation, which nothing here touches. WP-50 says every model of computation proposed is equivalent to or weaker than a Turing machine, quantum computers included. That is a statement about what is computable, and it stands: a quantum computer computes no function a Turing machine cannot. These four algorithms are statements about how many queries it takes, a different question, and the two do not conflict. Deutsch's 1985 paper is where the two questions first met, in its own title. This chapter keeps them apart in print.
Nielsen & Chuang, Quantum Computation and Quantum Information, 10th Anniversary
Edition, Cambridge University Press, 2010 (first published 2000): the history notes to chapters 1
and 6, and the bibliography entries for every paper below except Grover's. ·
Deutsch, Quantum theory, the Church–Turing principle and the universal quantum
computer, Proceedings of the Royal Society A 400:97, 1985. · Deutsch & Jozsa,
Rapid solution of problems by quantum computation, Proceedings of the Royal Society A
439:553, 1992. · Cleve, Ekert, Macchiavello & Mosca, Quantum algorithms revisited,
Proc. R. Soc. London A 454(1969):339–354, 1998 (arXiv quant-ph/9708016): the source for which
versions used one query and which two. · Bernstein & Vazirani, Quantum complexity theory, Proc. 25th ACM STOC 1993 and SIAM
Journal on Computing 26(5):1411–1473, 1997. · Grover, A fast quantum mechanical algorithm for
database search, STOC 1996 (the paper and its arXiv version quant-ph/9605043 are confirmed
to exist as cited; the STOC '96 venue, the AT&T Bell Labs affiliation and the remark that the O(√N) bound is within a constant factor of the fastest possible are confirmed in the paper's own PDF, block 14c of the script). Bernstein & Vazirani's preliminary version, as held in the PDF in Downloads, confirms the oracle separation from EQP and the Fourier-sampling problem behind it, block 14d. · Bennett, Bernstein, Brassard & Vazirani, Strengths and
weaknesses of quantum computing, SIAM Journal on Computing 26(5):1510–1523, 1997. · Zalka,
Grover's quantum searching algorithm is optimal, Physical Review A 60(4):2746–2751, 1999. · Boyer, Brassard, Høyer & Tapp, Tight bounds on quantum searching, Fortschritte der Physik, 1998 (multiple solutions). ·
Checks: book7/ch-quantum-oracles-verify.py.
This chapter makes no claim about any author's biography or present circumstances.