In Chapters 7 and 9, we saw quantum algorithms that solve problems using fewer oracle queries than any classical procedure. When does a reduction in queries justify claiming that quantum computers are more powerful than classical ones?
We first fix how computational resources and problem difficulty are measured and compared. We then prove that the \(\sqrt{N}\) query count for unstructured search cannot be improved, and examine the scope and limits of quantum advantage.
What would justify saying that one model of computation is more powerful than another?
Constructing a fast algorithm shows what can be done within a given model; proving a genuine advantage also requires showing what no competing algorithm can do with fewer resources.
For example, in Chapter 9 we saw a quantum search algorithm that finds a marked item among \(N\) candidates using about \(\frac{\pi}{4}\sqrt{N}\) queries. Does that mean no quantum algorithm could ever find the marked item in far fewer queries—say, \(\log_2 N\)—or is \(\sqrt{N}\) a fundamental limit? Answering such questions requires a precise way to measure costs and prove limits on all possible algorithms.
Reading guide · preparation, aims, and assumptions
Evaluate a quantum advantage claim by fixing the task, model, error allowance, and counted resources.
Before you begin
Recall the query count of amplitude amplification and the gate costs of circuits.
What you should be able to do
Distinguish upper bounds from lower bounds.
Relate input length to numeric magnitude.
State the scope of the quantum search advantage.
The example to follow
Revisit four-item search as a member of a problem family, then count how queries scale with the number of items.
Scope and assumptions
Query lower bounds apply to the stated access model. An absence of known efficient classical algorithms is not a general classical lower bound.
10.1
Resource Bounds
A quantum algorithm that uses fewer queries than any known classical procedure looks faster, but turning that impression into a rigorous claim requires fixing the rules of comparison. We must specify how the input is encoded and measured in size, how costs are compared as the input grows, and which resource—oracle calls, elementary gates, or memory qubits—is being counted. Changing any one of these choices can alter or even reverse the conclusion.
When can we say with precision that one algorithm is faster than another? Only when both solve the exact same computational problem under the same rules: the same encoding of inputs, the same measure of input size, the same data-access interface, and the same standard of success.
Why does the input encoding matter so much? Because efficiency is measured relative to the length \(n\) of the input description, not the numerical magnitude of the object it represents. An integer \(N\) written in binary requires about \(n \approx \log_2 N\) bits, whereas writing \(N\) in unary as \(N\) tally marks takes \(N\) symbols. A factoring procedure that tests up to \(\sqrt{N}\) trial divisors takes \(\sqrt{N} = 2^{n/2}\) steps: polynomial in the value \(N\), yet exponential in the binary input length \(n\).
We must also state how cost and success are aggregated across inputs and runs. By default, complexity theory reports the worst case cost—the maximum resource used over all inputs of length \(n\)—rather than the average cost over a particular distribution of inputs. Similarly, a deterministic guarantee (succeeding with probability \(1\)), a bounded-error guarantee (succeeding with probability at least \(2/3\) on every input), and an expected-time guarantee are all legitimate standards, but comparing two algorithms requires holding them to the same standard and the same oracle interface.
Cn is the complete circuit selected by the input length n. The bundled wire includes input and initialized workspace; the measured output is interpreted according to the stated task.Problems
How many bits does \(N=10^9\) have in binary? A procedure takes about \(\sqrt N\) steps. Is that polynomial in the input length?
Show solutionHide solution
\(2^{29}\lt10^9\lt2^{30}\), so \(N\) has \(30\) bits. With \(n\) bits, \(\sqrt N\approx2^{n/2}\), which is exponential in \(n\), not polynomial.
An algorithm takes \(5\) steps on half of the \(n\)-bit inputs and \(2^n\) steps on the other half. Give its worst-case cost and its average cost over uniformly random inputs.
Show solutionHide solution
Worst case: \(2^n\). Average: \(\tfrac12\cdot5+\tfrac12\cdot2^n=(5+2^n)/2\), still exponential. A good average needs most inputs, weighted by their probability, to be cheap.
Trial division finds a factor of \(N\) by testing the divisors \(2,3,\dots,\lfloor\sqrt N\rfloor\). Express its worst-case number of divisions in terms of the input length \(n=\log_2N\). Is it polynomial-time?
Show solutionHide solution
In the worst case, when \(N\) is prime or a product of two close primes, it tests about \(\sqrt N=2^{n/2}\) divisors. That is exponential in \(n\): trial division is not polynomial-time, although its cost is polynomial in the value \(N\).
Exact step counts depend on minor implementation choices, so we compare how costs scale with input size \(n\) using asymptotic notation. For non-negative functions \(T(n)\) and \(g(n)\), we write \(T(n) = O(g(n))\) (using the upper-bound notation \(O(g(n))\)) when there exist constants \(C > 0\) and \(n_0\) such that \(T(n) \leq C g(n)\) for all \(n \geq n_0\). We write \(\Omega\)—specifically \(T(n) = \Omega(g(n))\)—when there exist \(c > 0\) and \(n_0\) such that \(T(n) \geq c g(n)\) for all \(n \geq n_0\), and we write \(\Theta\)—specifically \(T(n) = \Theta(g(n))\)—when both \(O(g(n))\) and \(\Omega(g(n))\) hold simultaneously.
For example, suppose a circuit uses \(T(n) = 3n^2 + 7n + 2\) gates. For all \(n \geq 1\),
\[3n^2 \leq 3n^2 + 7n + 2 \leq 12n^2.\]
The gate count of this circuit therefore satisfies \(T(n) = \Theta(n^2)\). Notice what this statement means: it characterizes the growth rate of this specific circuit’s cost expression, not whether some other, cleverer algorithm for the same task could use fewer gates.
Because asymptotic notation suppresses constant factors, lower-order terms, and small-\(n\) crossover behavior, it must be interpreted with care. Every fixed polynomial \(n^k\) eventually grows more slowly than any exponential \(2^{\epsilon n}\) with \(\epsilon > 0\), which is why polynomial-time scaling is the benchmark for tractability. Yet “eventually” matters in practice: a large constant factor or high polynomial degree—for instance, from fault-tolerant error-correction overhead—can keep an asymptotically faster algorithm more expensive than a classical method across all moderate input sizes.
An abstract Cn box stands for a full circuit whose cost has been counted separately. The growth estimate describes that construction, not a lower bound on every algorithm.Problems
Is \(100n=O(n^2)\)? Is \(n^2=O(100n)\)? Give constants, or explain why none exist.
Show solutionHide solution
Yes: \(100n\leq100n^2\) for \(n\geq1\), so \(C=100\) works. No: \(n^2\leq C\cdot100n\) fails as soon as \(n\gt 100C\), whatever \(C\) is.
Two algorithms take exactly \(1000n\) and \(n^2\) steps. Which is faster at \(n=100\), \(n=1000\), and \(n=10{,}000\)? Which scales better? Explain why these are different questions.
Show solutionHide solution
At \(n=100\), the costs are \(100{,}000\) and \(10{,}000\), so the quadratic algorithm wins. At \(n=1000\), both cost \(10^6\). At \(n=10{,}000\), the costs are \(10^7\) and \(10^8\), so the linear algorithm wins. Linear growth is eventually better, but the constant moves the crossover to \(1000\). A scaling claim needs the input size and actual costs before it becomes a practical recommendation.
For which input lengths \(n\geq2\) is an algorithm costing \(n^{10}\) steps faster than one costing \(2^n\) steps? What does this show about asymptotic comparisons?
Show solutionHide solution
Comparing the two, \(n^{10}\gt 2^n\) for every \(n\) from \(2\) to \(58\), and \(n^{10}\lt2^n\) from \(n=59\) on. The polynomial algorithm wins only for inputs of at least \(59\) bits, where both costs exceed \(10^{17}\). Asymptotic statements describe eventual growth; at practical sizes, constants and exponents can decide the comparison.
Even after fixing the input size and asymptotic notation, we must specify which resource is being counted. Throughout this book we have tracked three distinct measures: the number of oracle calls (query complexity), the number of elementary operations or circuit layers (gate complexity and circuit depth), and the number of qubits or workspace bits required (space complexity). Actual wall-clock running time on hardware depends further on qubit connectivity, gate durations, measurement latency, and fault-tolerant error correction.
Does an advantage in one resource automatically carry over to another? Not necessarily. In the query model, an oracle call \(U_f\) is counted as a single step regardless of how many elementary gates are needed to build \(U_f\). When \(U_f\) is instantiated by an explicit arithmetic or logical circuit of polynomial size, each query costs \(\mathrm{poly}(n)\) gates and a query speedup translates into a gate speedup. If, however, implementing the oracle requires scanning an unindexed classical memory of size \(N = 2^n\), each query may cost \(\Omega(N)\) hardware operations unless specialized quantum random-access hardware is assumed.
Keeping these measures distinct prevents overclaiming. For unstructured search over \(N = 2^n\) candidates, the reduction from \(\Theta(N)\) classical queries to \(\Theta(\sqrt{N})\) quantum queries is an unconditional theorem about query complexity, and when the predicate \(f(x)\) is computed on the fly by a small reversible circuit, it yields a genuine \(\Theta(\sqrt{N} \operatorname{poly}(n))\) gate-complexity speedup as well.
This illustrative schedule uses two queries. U0, U1, U2 and the oracle implementations may each contain many elementary gates; the bundled wire includes workspace.Problems
A Grover search over \(N=10^6\) items uses about \((\pi/4)\sqrt N\) queries. If each query costs \(1000\) gates and each reflection \(50\) gates, estimate the total gate count.
Show solutionHide solution
\((\pi/4)\times1000\approx785\) iterations of \(1050\) gates each: about \(8.2\times10^5\) gates.
A classical scan costs one operation per item. For \(N=10^6\), below which cost \(c\) per query does a Grover search, costing about \((\pi/4)\sqrt N\cdot c\) gates, beat the scan?
Show solutionHide solution
We need \(785c\lt10^6\), so \(c\lt1273\) gates per query. A more expensive oracle erases the quadratic advantage at this size.
Algorithm A uses \(n^2\) queries and \(n^3\) other gates; algorithm B uses \(n\) queries and \(n^4\) other gates. If each query costs \(n^k\) gates, which algorithm has the smaller total gate count, depending on \(k\)?
Show solutionHide solution
A costs \(n^{2+k}+n^3\), and B costs \(n^{1+k}+n^4\). For \(k\lt2\), A grows like \(n^3\) and B like \(n^4\): A wins. For \(k=2\), both grow like \(n^4\). For \(k\gt 2\), A grows like \(n^{2+k}\) and B like \(n^{1+k}\): B wins. Fewer queries help only when queries dominate the cost.
10.2
Complexity Classes
Analyzing a single algorithm gives an upper bound on the cost of solving a problem; asking for the cheapest possible algorithm turns the question into a property of the problem itself. Complexity classes group computational problems according to the resources required to solve or verify them—deterministically, with a verifiable certificate, with classical randomness, or with a quantum circuit—and clarify what is proved and what remains open about quantum speedups.
decision problem · P · NP · certificate · polynomial-time reduction
Checking a proposed solution and finding one from scratch often feel like completely different tasks. To compare problems on a common footing, complexity theory formulates each task as a yes-or-no question about an input string—a decision problem. Instead of asking “What are the prime factors of \(N\)?”, we ask the decision question: “Does the integer \(N\) have a nontrivial factor less than or equal to \(k\)?” By binary search on \(k\), an efficient solver for the decision version immediately yields an efficient algorithm to find a factor.
Efficiency is measured against the bit length \(n\) of the input. An algorithm runs in polynomial time if there is a fixed constant \(c\) such that it halts within \(O(n^c)\) elementary steps on every input of length \(n\). The complexity class P consists of all decision problems that can be solved by a deterministic classical algorithm in polynomial time.
What if we do not know how to find the answer quickly, but can easily check a proof when someone hands it to us? For the factoring decision problem, if the answer is yes, a factor \(d \leq k\) that divides \(N\) serves as a short, easily verified proof: a single long division checks in \(O(n^2)\) steps that \(d\) divides \(N\). Such a witness string is called a certificate. The class NP (nondeterministic polynomial time) consists of all decision problems whose yes-instances possess polynomial-length certificates that can be checked by a deterministic algorithm in polynomial time. Note that NP does not stand for “non-polynomial”; every problem in P is also in NP, because a solver in P can decide the input by itself without even looking at a certificate.
To compare the relative difficulty of two decision problems \(A\) and \(B\), we use a polynomial-time reduction: a polynomial-time computable transformation that maps every instance \(x\) of \(A\) to an instance \(R(x)\) of \(B\) having the exact same yes/no answer. If such a reduction exists and \(B\) can be solved in polynomial time, then \(A\) can be solved in polynomial time too—so \(B\) is at least as hard as \(A\). A problem in NP to which every problem in NP reduces in polynomial time (such as Boolean satisfiability, SAT) is called NP-complete. Whether P equals NP—whether every problem whose solutions are easy to check is also easy to solve—remains the central open question of computer science.
The reversible implementation of a classical verifier preserves x and certificate w and writes V(x,w) into a blank bit. This checks a supplied certificate; it does not find one. Internal workspace is suppressed.Problems
Which of these are decision problems: (a) is \(N\) prime? (b) find a factor of \(N\); (c) does a graph \(G\) contain a path from \(u\) to \(v\)?
Show solutionHide solution
(a) and (c): their answers are yes or no. (b) asks for a number; it can be turned into decision problems, such as “does \(N\) have a factor below \(k\)?”
For the problem “does \(N\) have a factor \(d\) with \(1\lt d\lt k\)?”, give a witness for \(N=91\) and \(k=10\), and explain how a witness is checked in polynomial time.
Show solutionHide solution
\(d=7\): it satisfies \(1\lt7\lt10\), and \(91=7\times13\). Checking a proposed \(d\) means comparing it with \(1\) and \(k\) and dividing \(N\) by \(d\), which takes time polynomial in the number of digits. The problem is in NP.
Prove that if \(A\) reduces to \(B\) in polynomial time and \(B\) is in P, then \(A\) is in P. Why must the reduction itself run in polynomial time?
Show solutionHide solution
Let the reduction run in time \(p(n)\) on inputs of length \(n\); its output then has length at most \(p(n)\). Solving that instance of \(B\) takes time \(q(p(n))\) for the polynomial \(q\) bounding \(B\)’s algorithm. The total, \(p(n)+q(p(n))\), is a polynomial in \(n\), so \(A\) is in P. If the reduction were slow, or produced an exponentially long instance, the composition would not be polynomial.
Deterministic algorithms are not the only realistic model of computation; both classical randomized algorithms and quantum circuits produce probabilistic outcomes. The class BPP (bounded-error probabilistic polynomial time) consists of all decision problems solved in polynomial time by a classical randomized algorithm that answers correctly with probability at least \(2/3\) on every input. The constant \(2/3\) is conventional: any fixed success probability \(1/2 + \delta\) with \(\delta > 0\) defines the exact same class, because running the algorithm \(k\) independent times and taking the majority vote drives the error probability down exponentially in \(k\).
The quantum counterpart is BQP (bounded-error quantum polynomial time): the class of decision problems solved with error probability at most \(1/3\) on every input by a uniform family of polynomial-size quantum circuits (meaning that a classical polynomial-time algorithm can generate the circuit description for each input length \(n\)). Just as for BPP, independent repetitions and majority voting amplify any constant success margin above \(1/2\) to near-certainty at polynomial cost.
How does BQP fit among the classical complexity classes? Every deterministic or randomized polynomial-time computation can be simulated efficiently by a quantum circuit: deterministic Boolean gates are made reversible using Toffoli gates and clean ancillas at polynomial overhead (Chapter 2), and each fair coin toss can be generated by applying \(H\) to \(\ket{0}\) and measuring in the computational basis. Consequently, we have the proven inclusions
At the upper end, summing amplitudes over computation paths allows a classical machine with polynomial workspace to compute final measurement probabilities, placing BQP inside PSPACE (the class of problems solvable using polynomial memory). Whether \(\mathrm{BPP} \neq \mathrm{BQP}\) is not yet proved unconditionally, because separating them would simultaneously separate P from PSPACE. Nor is it known how BQP relates to NP: quantum computers are not believed to solve NP-complete problems in polynomial time (\(\mathrm{NP} \not\subseteq \mathrm{BQP}\) under standard conjectures).
A BQP circuit family must be uniformly generated with polynomial gate count and workspace. Each run yields a decision bit; repeated fresh runs can reduce its error.Problems
An algorithm errs with probability at most \(1/3\). Run it three times independently and take the majority answer. What is the error probability?
Show solutionHide solution
The majority is wrong when at least two runs are wrong: \(3\cdot(1/3)^2\cdot(2/3)+(1/3)^3=6/27+1/27=7/27\approx0.26\), less than \(1/3\).
How many independent runs, with a majority vote, bring the error below \(0.01\) when each run errs with probability \(1/3\)?
Show solutionHide solution
Summing the probability that at least half the runs are wrong, an odd number \(k\) of runs gives error below \(0.01\) first at \(k=47\), where it is about \(0.009\). The error falls exponentially in \(k\), so this kind of repetition is cheap.
Show that an algorithm that ignores its input and answers by flipping a fair coin has error \(1/2\) on every input, and that majority voting over repeated runs never improves it. Why is the condition “error at most \(1/3\)” essential?
Show solutionHide solution
Each run is right with probability \(1/2\), whatever the input. With \(k\) independent fair coins, the majority is a fair coin by symmetry, so its error is still \(1/2\). Majority voting helps only when each run is right with probability bounded above \(1/2\); the gap, here at least \(1/3\) versus \(2/3\), is what repetition amplifies.
With these classes in view, we can compare the two flagship examples of quantum speedup—integer factoring and unstructured search—and see why they rest on two different kinds of evidence.
Integer factoring can be reduced by elementary number theory to period finding: determining the period \(r\) of the modular exponential function \(f(x) = a^x \bmod N\). Shor’s quantum algorithm solves period finding—and hence factors an \(n\)-bit integer \(N\)—in \(O(n^3)\) gate complexity, placing the decision version of factoring in BQP. By contrast, the fastest known classical factoring algorithms run in sub-exponential but super-polynomial time, \(\exp\bigl(O(n^{1/3}(\log n)^{2/3})\bigr)\). This gives an exponential speedup over all known classical algorithms, though because no unconditional super-polynomial classical lower bound for factoring has been proved, it remains a conditional separation relative to our current knowledge of P and BPP.
Unstructured search over \(N = 2^n\) bit strings presents the opposite profile. Here Grover’s algorithm takes \(\Theta(2^{n/2})\) queries—exponential in \(n\), though with the exponent cut in half compared to the classical \(\Theta(2^n)\). For NP-complete problems such as \(n\)-variable SAT, replacing brute-force search over \(2^n\) assignments with amplitude amplification reduces the time from \(O(2^n \operatorname{poly}(n))\) to \(O(2^{n/2} \operatorname{poly}(n))\): a substantial quadratic speedup in the search space size \(N = 2^n\), not a polynomial-time solution in \(n\). Unlike factoring, however, the quadratic query speedup for unstructured search is backed by an unconditional lower bound showing that no classical or quantum query algorithm can do better.
The search circuit has a proved quadratic query advantage. This does not establish a general computational-class separation or give a factoring construction.Problems
Trial division of a \(2048\)-bit number may test up to \(\sqrt N\approx2^{1024}\) divisors. Write this roughly as a power of ten.
Show solutionHide solution
\(2^{1024}=10^{1024\log_{10}2}\approx10^{308}\).
A rough estimate for Shor’s factoring algorithm is \(n^3\) operations for an \(n\)-bit number. Compare \(n^3\) with \(2^{n/2}\) for \(n=2048\).
Show solutionHide solution
\(2048^3\approx8.6\times10^9\), against about \(10^{308}\). The polynomial is astronomically smaller, which is why factoring is the standard example of a possible exponential quantum advantage.
The best known classical factoring method, the number field sieve, takes time roughly \(\exp\bigl(1.92(\ln N)^{1/3}(\ln\ln N)^{2/3}\bigr)\). Evaluate it for a \(2048\)-bit \(N\), and explain why this comparison does not prove that quantum computers are exponentially more powerful.
Show solutionHide solution
\(\ln N=2048\ln2\approx1420\), so \((\ln N)^{1/3}\approx11.2\) and \((\ln\ln N)^{2/3}\approx3.75\). The exponent is about \(81\), giving \(e^{81}\approx10^{35}\) steps: far better than trial division, still far worse than \(10^{10}\). The comparison is with the best known classical method. No one has proved that a faster classical algorithm cannot exist, so the gap is not a proven separation.
10.3
Query Lower Bounds
The strongest possible justification for a computational advantage—or for the optimality of an algorithm—is a lower bound proving what no algorithm in a given model can accomplish with fewer resources. While unconditional lower bounds on general circuit size remain out of reach, the oracle query model makes rigorous lower bounds provable. We now prove that Grover’s \(\Theta(\sqrt{N})\) query count is optimal for unstructured search, first by tracking state-vector divergence one query at a time, and then through the degree of acceptance polynomials.
Why is proving a lower bound so much harder than proving an upper bound? An upper bound is constructive: to show that a problem can be solved in at most \(T(n)\) steps, we only have to exhibit a single algorithm and analyze its cost. A lower bound is universal: to show that a problem requires at least \(L(n)\) steps, we must reason simultaneously about every possible algorithm permitted by the model, including designs no one has yet imagined. Failing to find a faster algorithm after years of effort is not a proof of a lower bound.
Query models make universal lower bounds tractable by isolating how information about the input enters the computation. In a quantum query algorithm, the circuit alternates arbitrary input-independent unitaries \(U_0, U_1, \dots, U_T\) with calls to the input oracle \(O_f\):
Because the intermediate unitaries \(U_t\) may be arbitrarily complex and use unlimited workspace qubits, any limit we prove on the number of queries \(T\) cannot depend on gate-level details. It must follow purely from how fast \(T\) applications of \(O_f\) can make the final states \(\ket{\psi_T^f}\) distinguishable across different hidden functions \(f\).
A query algorithm alternates oracle calls with operations independent of the hidden input. The two-query drawing is one instance of this general form; a lower bound must cover every allowed sequence.Problems
Which of these establishes a lower bound on query complexity: (a) an algorithm using \(\sqrt N\) queries; (b) a proof that every algorithm needs at least \(\sqrt N\) queries; (c) many failed attempts to find an algorithm with fewer queries?
Show solutionHide solution
Only (b). An algorithm gives an upper bound, and failed attempts give no bound at all.
Using the fact that \(k\) classical queries find a single marked item among \(N\) with probability at most \(k/N\), show that success probability \(1/2\) needs at least \(N/2\) queries.
Show solutionHide solution
\(k/N\geq1/2\) requires \(k\geq N/2\). So classical search needs \(\Omega(N)\) queries for constant success.
In the query model, an algorithm may compute without limit between queries. Explain why a query lower bound still applies to algorithms with limited computation, but a query upper bound need not give a fast algorithm.
Show solutionHide solution
Algorithms with limited computation between queries are among those the model allows, so a bound that holds for every allowed algorithm holds for them. An upper bound is witnessed by one algorithm, which may perform huge computations between queries, or use queries that are expensive to implement; its query count says nothing about those costs.
Could some clever choice of the intermediate unitaries \(U_t\)—perhaps avoiding planes and reflections altogether—find a marked item among \(N\) candidates in \(o(\sqrt{N})\) queries, or even \(O(\log N)\) queries? Suppose a quantum query algorithm makes \(T\) queries and, for every possible marked item \(w \in \{0, \dots, N-1\}\), outputs \(w\) with probability at least \(2/3\). We now prove the Bennett–Bernstein–Brassard–Vazirani (BBBV) theorem: \(T\) must be \(\Omega(\sqrt{N})\).
The key idea is to compare the run on the marked oracle \(O_w\) against a reference run on the empty oracle \(I\) (where nothing is marked), one query at a time. Let \(\ket{\psi_t}\) be the state of the algorithm after \(t\) queries when the oracle is \(I\), and let \(\ket{\psi_t^w}\) be the state after \(t\) queries when the oracle is \(O_w\) (which flips the phase of every basis state whose query register holds \(w\)). Write \(a_w(t) = \|\Pi_w \ket{\psi_t}\|\) for the Euclidean norm of the component of \(\ket{\psi_t}\) in which the query register holds \(w\). Because the subspaces for distinct labels \(w\) are mutually orthogonal, \(\sum_{w=0}^{N-1} a_w(t)^2 = \|\ket{\psi_t}\|^2 = 1\) at every step \(t\).
How much can a single query increase the Euclidean distance between the marked run \(\ket{\psi_t^w}\) and the unmarked reference run \(\ket{\psi_t}\)? Passing from step \(t\) to step \(t+1\) applies one oracle call followed by the fixed unitary \(U_{t+1}\). Before \(U_{t+1}\) is applied, we can decompose the difference vector as
Since \(U_{t+1}\) and \(O_w\) are unitary, they preserve Euclidean norms. Moreover, \((O_w - I)\ket{\psi_t} = -2\Pi_w\ket{\psi_t}\), which has norm \(2a_w(t)\). By the triangle inequality, the distance \(g_w(t) = \|\ket{\psi_t^w} - \ket{\psi_t}\|\) grows by at most \(2a_w(t)\) at step \(t\), so after \(T\) queries the final distance \(g_w = \|\ket{\psi_T^w} - \ket{\psi_T}\|\) satisfies \(g_w \leq 2\sum_{t=0}^{T-1} a_w(t)\). Summing over all \(N\) possible targets \(w\) and applying the Cauchy–Schwarz inequality \(\sum_{w=0}^{N-1} a_w(t) \leq \sqrt{N}\sqrt{\sum_{w=0}^{N-1} a_w(t)^2} = \sqrt{N}\) yields
On the other hand, how large must \(g_w\) be for the final measurement to identify \(w\) with probability at least \(2/3\)? For any projection \(P_w\) onto the outcome reporting \(w\), the probabilities in the two runs differ by
In the unmarked reference run, the outcome probabilities \(p_w = \|P_w\ket{\psi_T}\|^2\) sum to \(\sum_w p_w \leq 1\), whereas in the marked run \(\|P_w\ket{\psi_T^w}\|^2 \geq 2/3\). Thus \(2g_w \geq 2/3 - p_w\), and summing over all \(N\) targets gives \(2\sum_{w=0}^{N-1} g_w \geq \frac{2}{3}N - 1\). Combining our upper and lower bounds on \(\sum_w g_w\) gives
Thus every bounded-error quantum search algorithm requires \(T = \Omega(\sqrt{N})\) queries. Because Grover’s algorithm succeeds in \(O(\sqrt{N})\) queries, the quantum query complexity of unstructured search is \(\Theta(\sqrt{N})\). This technique of interpolating between two runs one query at a time to bound the accumulated state distance is known as the hybrid argument.
Notice the physical insight behind the proof: at each step \(t\), the reference state \(\ket{\psi_t}\) must spread its unit norm across all \(N\) possible query strings, so the average query magnitude \(a_w(t)\) is at most \(1/\sqrt{N}\). Because amplitudes add linearly before they are squared into probabilities, \(T\) coherent steps can accumulate a total separation of order \(T/\sqrt{N}\), which reaches \(\Theta(1)\) only when \(T = \Omega(\sqrt{N})\).
The two circuits use identical intervening gates and differ only in the oracle. The lower-bound argument compares their final states; the diagram itself is not a proof of the bound.Problems
For \(N=10^6\), compare Grover’s query count, about \((\pi/4)\sqrt N\), with the classical average \(N/2\).
Show solutionHide solution
About \(785\) queries against \(500{,}000\).
If some quantum algorithm searched with only \(N^{1/3}\) queries, how many would it use for \(N=10^6\)? Which result rules this out?
Show solutionHide solution
\(N^{1/3}=100\). The lower bound of \(\Omega(\sqrt N)\) queries for unstructured search rules it out: no quantum algorithm searches an unstructured space substantially faster than Grover’s.
Use the lower bound to show that no quantum algorithm finds a marked item among \(N=2^n\) with a number of queries polynomial in \(n\). What does this imply for solving NP problems by unstructured search?
Show solutionHide solution
Any algorithm needs \(\Omega(\sqrt N)=\Omega(2^{n/2})\) queries, which is exponential in \(n\). Treating an NP problem as a search over all \(2^n\) candidate witnesses, with a verifier as the oracle, therefore takes exponential time even on a quantum computer. An efficient quantum method would have to exploit the problem’s structure.
10.3.3 Acceptance polynomials and approximate degree (optional)§
approximate degree
Optional derivation · polynomial lower bounds
A second, complementary method for proving quantum query lower bounds translates query circuits into multivariate polynomials. Represent the hidden oracle table as \(N\) Boolean variables \(z = (z_0, \dots, z_{N-1}) \in \{0,1\}^N\). Whenever a phase oracle queries index \(i\), it multiplies the corresponding amplitude by \((-1)^{z_i} = 1 - 2z_i\), which is a linear polynomial of degree \(1\) in \(z_i\). Between queries, the fixed unitaries \(U_t\) take linear combinations of amplitudes without increasing their degree in \(z\). By induction, after \(T\) queries every amplitude of the final state \(\ket{\psi_T^z}\) is a multivariate polynomial in \(z_0, \dots, z_{N-1}\) of total degree at most \(T\).
When the final state is measured, the probability of any outcome is a sum of squared magnitudes \(|\alpha(z)|^2 = \alpha(z)\overline{\alpha(z)}\) of those amplitudes. Consequently, the overall acceptance probability \(P(z)\) of a \(T\)-query quantum algorithm is a real multivariate polynomial in \(z_0, \dots, z_{N-1}\) of degree at most \(2T\).
Suppose the algorithm computes a Boolean function \(F \colon \{0,1\}^N \to \{0,1\}\) with bounded error at most \(1/3\), meaning \(P(z) \in [0, 1/3]\) whenever \(F(z) = 0\) and \(P(z) \in [2/3, 1]\) whenever \(F(z) = 1\). The minimum degree of any real polynomial \(P\) satisfying this condition on all \(z \in \{0,1\}^N\) is called the approximate degree of \(F\), denoted \(\widetilde{\deg}(F)\). Because a \(T\)-query quantum algorithm produces such a polynomial of degree at most \(2T\), we immediately obtain the general lower bound
\[T \geq \frac{1}{2}\,\widetilde{\deg}(F).\]
For the \(N\)-bit \(\mathrm{OR}\) function (which decides whether at least one item is marked), a theorem of Nisan and Szegedy shows that \(\widetilde{\deg}(\mathrm{OR}_N) = \Theta(\sqrt{N})\). Dividing by \(2\) gives an independent proof that deciding whether a marked item exists requires \(\Omega(\sqrt{N})\) quantum queries. Appendix E works through this polynomial degree method in detail.
The two-query example gives amplitudes of degree at most two in the hidden Boolean bits and acceptance probabilities of degree at most four. The text generalizes this to T queries.Problems
After \(T=3\) queries, what is the largest possible degree of an amplitude, and of an acceptance probability?
Show solutionHide solution
An amplitude has degree at most \(3\), and an acceptance probability, a sum of squared magnitudes, at most \(6\).
The approximate degree of OR on \(N\) bits grows like \(\sqrt N\). For \(N=10^4\), what lower bound on queries does \(T\geq d/2\) give, up to a constant factor?
Show solutionHide solution
\(\sqrt N=100\), so \(T\) must be at least about \(50\) times a constant: of order \(\sqrt N\), matching Grover’s algorithm.
Show that the exact degree of OR on \(N\) bits is \(N\), by writing \(\mathrm{OR}(z)=1-\prod_i(1-z_i)\). What does this imply for algorithms that must be correct with certainty?
Show solutionHide solution
\(\mathrm{OR}(z)=0\) exactly when every \(z_i=0\), which is when \(\prod_i(1-z_i)=1\). Expanding the product gives the term \((-1)^{N+1}z_1z_2\cdots z_N\) with a nonzero coefficient, and a multilinear polynomial representing a Boolean function is unique, so the degree is \(N\). An exact algorithm yields an acceptance probability of degree at most \(2T\) equal to OR, so \(2T\geq N\): it needs at least \(N/2\) queries.
10.4
Scope of Quantum Advantage
Having traced quantum computation from classical logic and reversible gates to interference, entanglement, universal circuits, amplitude amplification, and query lower bounds, we can now take stock of the subject as a whole. We summarize the common mechanism behind quantum algorithms and the assumptions their speedups require, clarify the fundamental computability and readout limits that quantum computers still obey, and point toward two major frontiers—period finding and quantum error correction—where the principles developed in this book continue.
What unifying mechanism connects the quantum algorithms we have studied? None of them works by evaluating a function on all \(2^n\) inputs in superposition and simply reading out the full list of answers. Instead, each algorithm uses phase kickback to encode a global or relational property of the problem into relative phases across a superposition, and then applies basis changes and reflections so that wrong computational paths cancel by destructive interference while paths encoding the desired answer reinforce constructively.
Every valid claim of quantum speedup rests on explicit structural and operational assumptions:
Coherent oracle or circuit access: The function \(f\) must be evaluable coherently in superposition by a reversible circuit \(U_f\) (and often its inverse \(U_f^\dagger\)) without leaking which-path information to the environment.
Efficient state preparation and uncomputation: Preparing the initial state and uncomputing scratch registers must not hide an exponential gate cost of their own.
Informative readout: Because measurement returns only a single \(n\)-bit sample drawn from the output distribution, the target answer must be concentrated into a small number of high-probability outcomes or verifiable efficiently once sampled.
The \(2^n\)-dimensional state space provides the room in which interference operates, but dimensionality alone never explains an algorithm: a speedup exists only when the circuit geometry steers amplitude onto the answer in fewer steps than any classical procedure.
The preparation A and its associated reflection must be implemented coherently. The success reflection changes phase; the prepared-state reflection converts that phase change into a change in success probability.Problems
For Deutsch’s algorithm and for Grover search, name the property that is encoded in phases, and the operation that turns it into probability.
Show solutionHide solution
Deutsch: whether \(f(0)=f(1)\), encoded as a relative sign by phase kickback and converted by the final \(H\). Grover: whether a label is marked, encoded as a sign by the oracle and converted by the reflection about the mean, repeated the right number of times.
For each of the two algorithms, list costs that its query count does not include.
Show solutionHide solution
Both leave out preparing the initial state, the Hadamard gates, building the oracle from a description of \(f\), and measurement. Grover search also leaves out the reflections, choosing the number of iterations, and verifying the answer.
An algorithm prepares the uniform superposition of \(n\) qubits, applies an oracle once, and measures immediately. Show that it does no better than one classical query, whether the oracle is a phase oracle or the reversible \(U_f\).
Show solutionHide solution
A phase oracle only changes signs, so every label is still measured with probability \(2^{-n}\): a uniformly random label, which a classical algorithm can produce without any query. With \(U_f\) and a clean target, the result is a uniformly random \(x\) together with \(f(x)\), exactly what one classical query of a random input gives. Without further operations that make amplitudes interfere, there is no advantage.
Quantum mechanics alters the complexity of certain computational tasks, but it does not alter what is computable in principle. Any finite quantum circuit built from a standard gate set with computable entries can be simulated to arbitrary accuracy by a classical Turing machine—simply by tracking the \(2^n\) complex amplitudes in memory, or by summing over Feynman paths in polynomial space. Although that simulation takes exponential time, it always terminates. Consequently, quantum computers obey the Church–Turing thesis: they cannot solve the halting problem or decide any uncomputable function from Chapter 1.
Within the realm of computable tasks, quantum mechanics also imposes intrinsic operational limits of its own:
No universal cloning: By linearity, unknown quantum states cannot be copied or broadcast freely the way classical bit strings can (Chapter 6).
Single-sample readout (Holevo’s bound): Measuring an \(n\)-qubit state yields at most \(n\) bits of classical information about the prepared state, destroying the remaining superposition unless the state was already an eigenstate of the measurement.
Unstructured lower bounds: Without algebraic or periodic structure in the oracle, quantum query speedups for total Boolean functions are bounded by polynomial relations—such as the \(\Omega(\sqrt{N})\) limit for unstructured search.
Recognizing these boundaries does not diminish quantum computing; rather, it focuses attention on the structured problems where interference can achieve large separations.
A computably described finite circuit can be simulated classically, potentially at enormous cost. Its measurement returns a sample, not its complete amplitude list or a general halting decision.Problems
Can a quantum computer decide the halting problem? Why not?
Show solutionHide solution
No, in the usual effective model of quantum computation. Its gates and probabilities can be approximated by a classical algorithm. A bounded-error quantum decider can therefore be simulated to enough accuracy to distinguish its acceptance cases, however inefficiently. A halting decider in that model would give a classical halting decider, which is impossible. This assumes effectively specified operations, not a device supplied with an uncomputable real number as an oracle.
A classical simulation of an \(n\)-qubit circuit stores all \(2^n\) amplitudes. How does its memory grow, and why does the simulation nevertheless show that quantum computers compute nothing beyond Turing machines?
Show solutionHide solution
The memory used by this direct simulation is proportional to \(2^n\) times the precision stored per amplitude. For any finite, effectively specified circuit, those amplitudes and its outcome probabilities can be approximated classically. With a promised acceptance gap, sufficient precision lets a classical algorithm make the same decision. The cost can be enormous; computability asks whether an algorithm exists at all, not whether it is practical.
A source promises to prepare either \(\ket0\) on every run or \(\ket+\) on every run. After obtaining \(k\) copies, the alternatives are \(\ket0^{\otimes k}\) and \(\ket+^{\otimes k}\). Compute their overlap. Can any finite number of copies guarantee perfect discrimination? How does that differ from making the error very small?
Show solutionHide solution
Inner products multiply under tensor products, so the overlap is \((\braket0+)^k=2^{-k/2}\), which is nonzero for every finite \(k\). The nonorthogonal-state discrimination result therefore rules out a measurement that is always correct. Nevertheless, measuring every copy in the computational basis gives a simple approximate method: report \(\ket+\) if any result is \(1\), and \(\ket0\) otherwise. It never errs on \(\ket0\), and errs with probability \(2^{-k}\) on \(\ket+\). An arbitrarily small error is achievable; zero error with a fixed finite supply is not.
10.4.3 Period finding and error correction: further topics§
quantum Fourier transform
Two major pillars of quantum information science build directly on the foundations developed in this book and form the natural next steps for further study.
The first is algebraic and periodic quantum algorithms, led by Shor’s period-finding and factoring algorithm and quantum phase estimation. Instead of searching an unstructured set one reflection at a time, period finding evaluates a periodic function \(f(x) = f(x+r)\) in superposition and applies the quantum Fourier transform—a structured \(O(n^2)\)-gate generalization of the Hadamard transform—to convert hidden periodic spacing in the computational basis into sharp interference peaks at multiples of \(1/r\) in the frequency basis. Because the circuit exploits global group structure, it extracts the period in \(O(\operatorname{poly}(n))\) gates rather than \(\Theta(2^{n/2})\) steps.
The second is quantum error correction and fault tolerance. Physical qubits inevitably interact with their environment, suffering continuous phase drift, bit flips, and decoherence. Although unknown quantum states cannot be cloned, an \(n\)-qubit logical state can be encoded into an entangled subspace of a larger register so that parity-check measurements (generalizing the joint parity measurements of Chapter 6) reveal which error occurred—the error syndrome—without measuring or disturbing the encoded logical superposition itself. The threshold theorem shows that once physical gate error rates fall below a fixed threshold, arbitrarily long quantum computations can be executed reliably at polylogarithmic overhead.
Whenever you encounter a new quantum algorithm or protocol beyond this book, ask three guiding questions: What global property of the problem is encoded into relative phases or entangled subspaces? Which unitary basis change makes that property visible as constructive and destructive interference? And what is the full cost of preparing, querying, and protecting the state? With those questions in hand, even the largest quantum circuit becomes a transparent chain of physical and mathematical steps.
This repetition encoding is a concrete continuation toward error correction. It creates one encoded joint state, not three clones. Syndrome extraction and recovery still need further circuits; period finding is a separate continuation.Problems
What is the period of \(f(x)=2^x\bmod15\)?
Show solutionHide solution
The values for \(x=0,1,2,3,4\) are \(1,2,4,8,1\), so the period is \(4\).
Use the period \(r=4\) of \(2^x\bmod15\) to factor \(15\), by computing \(\gcd(2^{r/2}-1,15)\) and \(\gcd(2^{r/2}+1,15)\).
Show solutionHide solution
\(2^{r/2}=4\). \(\gcd(3,15)=3\) and \(\gcd(5,15)=5\), so \(15=3\times5\).
Let \(a^x\bmod N\) have even period \(r\), with \(a^{r/2}\not\equiv-1\pmod N\). Show that \(\gcd(a^{r/2}-1,N)\) is a factor of \(N\) other than \(1\) and \(N\).
Show solutionHide solution
\(a^r\equiv1\), so \(N\) divides \(a^r-1=(a^{r/2}-1)(a^{r/2}+1)\). \(N\) does not divide \(a^{r/2}-1\), since that would make \(r/2\) a smaller period, and it does not divide \(a^{r/2}+1\), by assumption. So \(N\) shares a nontrivial factor with each of the two numbers, and the greatest common divisor finds it. Period finding is the step a quantum computer performs efficiently.
Compare like with like. A speed claim needs the same task, input encoding, size measure, access model and success criterion on both sides. An integer \(N\) has about \(\log_2N\) input bits, so \(N\) steps is exponential in the input length.
Asymptotic notation. \(O\), \(\Omega\) and \(\Theta\) describe growth up to constant factors. They hide constants and crossover sizes, and they do not specify the model of computation.
Resources differ. Query, gate and space complexity count different things. A query advantage may or may not survive once each query and the input preparation are implemented.
Complexity classes. P, NP, BPP and BQP classify decision problems by the resources needed to solve them. \(\mathrm{BPP}\subseteq\mathrm{BQP}\), but whether BQP is larger, or contains NP, is unknown. Fast quantum factoring is an advantage over known classical methods, not a proven separation.
Upper versus lower bounds. An upper bound exhibits one algorithm; a lower bound covers every algorithm in the model. Unstructured search needs \(\Omega(\sqrt N)\) queries, so Grover’s algorithm is optimal at \(\Theta(\sqrt N)\). The polynomial method gives a second proof: after \(T\) queries, acceptance probabilities are polynomials of degree at most \(2T\).
The scope of quantum advantage. Quantum computers compute no uncomputable functions, and they face their own limits: no-cloning, sampled readout, and the costs of preparation, oracles and noise. A convincing claim states the task, the access model, an observable answer with a success guarantee, and the full cost.
Questions and worked problems
Attempt each question before opening a hint. Explain your reasoning, then compare it with the solution.
Which of these costs are \(O(n^2)\)? (a) \(5n\log_2n\); (b) \(n^2/1000+10^6n\); (c) \(n^{2.01}\); (d) \((\log_2n)^5\); (e) \(2^{\log_2n}\). For any that is not, explain why no constant works.
Hint 1
Compare each with \(n^2\) for large \(n\): does the ratio stay bounded?
Hint 2
\(n^{2.01}/n^2=n^{0.01}\).
Worked solution
(a), (b), (d), and (e) are \(O(n^2)\). For (a), \(n\log n\le n^2\) for \(n\ge1\). For (b), the ratio to \(n^2\) tends to \(1/1000\). For (d), every power of \(\log n\) grows more slowly than any power of \(n\). For (e), \(2^{\log_2n}=n\). (c) is not: \(n^{2.01}/n^2=n^{0.01}\) grows without bound, so no constant \(C\) satisfies \(n^{2.01}\le Cn^2\) for all large \(n\), although it exceeds \(10\) only when \(n>10^{100}\). Asymptotic classes can disagree with practical experience over every input we will ever use.
Classify each statement as proved, open, or false according to what is proved and what remains open about these classes: (a) \(\mathrm P\subseteq\mathrm{NP}\); (b) \(\mathrm{BPP}\subseteq\mathrm{BQP}\); (c) \(\mathrm{NP}\subseteq\mathrm{BQP}\); (d) a quantum algorithm factors in time polynomial in the number of digits; (e) no classical algorithm factors in polynomial time.
Hint 1
A problem solvable in polynomial time has a certificate that is checked by solving it.
Hint 2
Distinguish “no algorithm is known” from “no algorithm exists.”
Worked solution
(a) Proved: a polynomial-time solver can serve as its own checker, ignoring the certificate. (b) Proved: quantum circuits can simulate randomized classical computation. (c) Open: no one knows whether quantum computers solve every NP problem efficiently, and the search lower bound shows that brute-force search will not do it. (d) Proved: Shor’s algorithm, cited but not derived here. (e) Open: no polynomial-time classical factoring algorithm is known, but none has been ruled out. The evidence for a quantum advantage in factoring rests on (d) together with the absence of a known classical method, not on a proof of (e).
One algorithm uses at most \(3n^2+7n+2\) operations, and at least \(n^2\). Give constants showing that its cost is \(\Theta(n^2)\). Does this prove that every algorithm for the task needs quadratic time?
Hint 1
For \(n\geq1\), compare each term with \(n^2\).
Hint 2
An upper bound for one algorithm is not a lower bound for the task.
Worked solution
For \(n\geq1\), \(n^2\leq3n^2+7n+2\leq3n^2+7n^2+2n^2=12n^2\), so the cost is \(\Theta(n^2)\) with constants \(1\) and \(12\). This describes one algorithm. A lower bound for the task would have to hold for every algorithm, which needs a separate argument.
Let \(D(N,k)\) be the decision problem “does \(N\) have a factor \(d\) with \(1<d<k\)?” Show how an algorithm that answers \(D\) can find the smallest nontrivial factor of \(N\) using about \(\log_2N\) calls. Carry out the search for \(N=91\). Why does this show that the decision version captures the difficulty of finding a factor?
Hint 1
\(D(N,k)\) is false for small \(k\) and true for large \(k\), switching at the smallest factor.
Hint 2
Use binary search on \(k\) between \(2\) and \(N\).
Worked solution
As \(k\) increases, \(D(N,k)\) changes from false to true exactly when \(k\) passes the smallest factor \(d\), so the smallest \(k\) with \(D(N,k)\) true is \(d+1\). Binary search over \(k\in[2,N]\) finds that threshold in about \(\log_2N=n\) calls. For \(N=91\): \(D(91,47)\), \(D(91,24)\), and \(D(91,13)\) are true; \(D(91,7)\) is false, since none of \(2,\dots,6\) divides \(91\); then \(D(91,10)\) and \(D(91,8)\) are true. The threshold is \(k=8\), so \(d=7\). Dividing, \(91=7\times13\). Repeating on the cofactor finds every prime factor. A polynomial-time algorithm for \(D\) would therefore give a polynomial-time factoring algorithm, so stating complexity results for decision problems loses nothing essential here.
Compute the acceptance probability of Deutsch’s algorithm as a polynomial in the hidden bits \(z_0=f(0)\) and \(z_1=f(1)\), using \(s_x=1-2z_x\). Check that its degree is at most \(2T\) with \(T=1\), and identify the function it computes exactly.
Hint 1
The probability of outcome \(1\) is \(\big((s_0-s_1)/2\big)^2\).
Hint 2
\(s_0-s_1=2(z_1-z_0)\) and \(z_x^2=z_x\) for bits.
Worked solution
The probability of outcome \(1\) is \(\big(\frac{s_0-s_1}{2}\big)^2=(z_1-z_0)^2=z_0+z_1-2z_0z_1\), using \(z^2=z\) for a bit. This has degree \(2=2T\), the maximum the polynomial method allows for one query. On the four inputs it takes the values \(0,1,1,0\), so it equals \(z_0\oplus z_1\) exactly: the algorithm computes parity with certainty. The polynomial view explains why one query is enough here: the exact degree of two-bit parity is \(2\), which one query can reach. For OR on many bits the approximate degree grows like \(\sqrt N\), which forces many queries.
A satisfiability instance has \(n=100\) variables, and Grover search is run over all \(2^{100}\) assignments with one satisfying assignment. (a) About how many Grover iterations are needed? (b) At an optimistic \(10^6\) iterations per second, how long does it take? (c) Express the query counts of brute-force classical search and Grover search in terms of the input length, and say what the quadratic speedup does and does not change.
Hint 1
\(\sqrt{2^{100}}=2^{50}\approx1.1\times10^{15}\).
Hint 2
A year is about \(3.2\times10^7\) seconds.
Worked solution
(a) About \(\frac\pi4\cdot2^{50}\approx8.8\times10^{14}\) iterations. (b) At \(10^6\) per second that is about \(8.8\times10^8\) seconds, roughly \(28\) years, before counting the gates inside each iteration or error correction. (c) Classical brute force needs order \(2^n\) evaluations and Grover search order \(2^{n/2}\). Both are exponential in \(n\): the quadratic speedup halves the exponent, which is valuable, but it does not make brute-force search polynomial. The lower bound of Section 10.3.2 shows that no unstructured quantum search does better, and practical classical solvers exploit the structure of satisfiability instances, so they must be part of the comparison.
A student argues: “Searching needs \(\Omega(\sqrt N)\) quantum queries, so no algorithm, quantum or classical, can find an item in a list of \(N\) faster than \(\sqrt N\).” Give a counterexample using a sorted list and binary search, count its queries for \(N=10^6\), and state precisely what the lower bound covers.
Hint 1
In a sorted list a query to position \(i\) also tells you which side of \(i\) the target lies on.
Hint 2
\(\log_2(10^6)\approx20\).
Worked solution
If the list is sorted and a query at position \(i\) returns the stored value, a classical binary search compares the target with the middle entry and halves the candidate range each time. It finds the item in about \(\log_2N\approx20\) queries for \(N=10^6\), far below \(\sqrt N=1000\). There is no contradiction: the \(\Omega(\sqrt N)\) bound concerns unstructured search, where the oracle reports only whether a label is marked and reveals nothing about where else to look. A lower bound is a statement about a model. When an interface reveals structure, a different problem results, and both classical and quantum algorithms can exploit it.
A quantum search uses \(\Theta(\sqrt N)\) queries, but each query requires \(\Theta(N)\) gates in a chosen implementation. What do the query and gate counts say about this implementation, and about the task?
Hint 1
Multiply the number of calls by the cost of each call.
Hint 2
Keep the implementation separate from the best possible gate count for the task.
Worked solution
The queries alone contribute \(\Theta(N^{3/2})\) gates, worse than a classical scan of \(N\) items. The quadratic query advantage is still a true statement about oracle access. It does not show that this implementation beats a classical method, and a cheaper oracle implementation could change the comparison.
Section 10.4.2 says a classical computer can simulate any quantum circuit, at enormous cost. Compare two strategies for a circuit on \(n=50\) qubits with \(h=100\) Hadamard gates. (a) Store the state vector, with \(16\) bytes per amplitude: how much memory is needed? (b) Use the path sums of Chapter 3: each Hadamard splits every path in two, so how many paths contribute to one output amplitude, and how much memory does following one path need? (c) What does the trade-off suggest about the source of the cost?
Hint 1
\(2^{50}\approx1.1\times10^{15}\).
Hint 2
A single path is one sequence of basis configurations, stored one at a time.
Worked solution
(a) \(2^{50}\times16\approx1.8\times10^{16}\) bytes, about \(18\) petabytes. (b) A final amplitude is a sum over up to \(2^{100}\approx1.3\times10^{30}\) paths. Each path is evaluated by following one basis configuration through the circuit and multiplying the weights, which needs only enough memory for \(n\) bits and a running product; the sum can be accumulated one path at a time. (c) One method trades exponential memory for less time, the other uses little memory but exponential time. Neither removes the exponential cost; it moves it between resources. Both show that quantum circuits compute nothing beyond what Turing machines can, while leaving open whether some quantum computations are inherently expensive to simulate, which is the question behind BQP and BPP.