# Lower Bounds for Quantum Search and Derandomization

## 1 Introduction

Suppose we have an unsorted list of $`N`$ items and we want to find an item with some specific property. For instance we want to find an item with a specific value at one of its fields. In the worst case, a classical deterministic or randomized computer will have to look at $`\mathrm{\Theta }(N)`$ items to have a high probability of finding such an item if there is one. On the other hand, Grover’s quantum search algorithm can perform look-ups or queries in superposition, and finds the desired item with high probability using only $`O(\sqrt{N})`$ queries. The following is known about the error probability $`\epsilon `$ in quantum search:

* $`\epsilon `$ can be made an arbitrarily small constant using $`O(\sqrt{N})`$ queries \[Gro96\] but not using $`o(\sqrt{N})`$ queries \[BBBV97, BBHT98, Zal97, BBC<sup>+</sup>98, Gro98a\].
* $`\epsilon `$ can be made $`1/2^{N^\alpha }`$ using $`O(N^{0.5+\alpha })`$ queries \[BCW98, Theorem 1.16\].
* If we want no error at all ($`\epsilon =0`$), then we need $`N`$ queries \[BBC<sup>+</sup>98, Corollary 6.2\].

Many applications of quantum computing will need to apply quantum search several times as a subroutine. We should avoid that the errors of each application add up to an overall error that is too big. Accordingly, we should make the error probability of each application as small as possible, if necessary by spending slightly more than $`O(\sqrt{N})`$ queries.

We give a detailed analysis of the trade-off between the error probability of a quantum search algorithm and the number of queries it uses. We obtain the following lower bound on $`\epsilon `$ in terms of the number $`T`$ of queries that the algorithm uses:

$$\epsilon \mathrm{\Omega }\left(e^{4bT^2/N8T/\sqrt{N}}\right),$$

where $`b`$ is some fixed constant and we assume $`T<N`$. Our proof first translates a quantum search algorithm with $`T`$ queries to a multivariate polynomial of degree $`d2T`$ that has certain properties, and then uses techniques from \[Pat92\] and \[CR92\] to prove a lower bound on $`\epsilon `$ in terms of $`d`$. This implies a lower bound in terms of $`T`$.<sup>1</sup><sup>1</sup>1Nayak and Wu \[NW98\] also use polynomial-techniques from \[BBC<sup>+</sup>98\] and \[Pat92\], in order to prove lower bounds for quantum computing the median and mean of a function. In particular, this bound implies that $`\epsilon `$ cannot be made $`o(1)`$ using only $`O(\sqrt{N})`$ queries. Also, $`\epsilon `$ can only be made $`1/2^N`$ using $`\mathrm{\Omega }(N)`$ queries.

In Section 5 we apply this bound to the derandomization of classical RP-machines (RP is the class of languages that can be recognized in polynomial time with one-sided error at most $`1/2`$). A classical computer can achieve error $`1/2^k`$ by running the RP-machine $`k`$ times and answering ‘yes’ iff at least one of those $`k`$ runs answered ‘yes’. Since this is basically a search among $`k`$ items, we would expect a quantum computer to be able to achieve error $`1/2^k`$ using roughly $`\sqrt{k}`$ applications of the RP-machine. Somewhat surprisingly, we show that a quantum computer cannot do much better than the classical computer: it would also need at least $`ck`$ applications of the machine to obtain error $`1/2^k`$ (when treating the machine as a black-box). Here $`c>0`$ does not depend on $`k`$. We interpret this as follows: general results on amplitude amplification \[BHT98, Gro98b, Mos98\] show that a quantum computer can achieve a square-root speed-up when amplifying a very small success probability to a constant one, but our result shows that it can achieve at most a linear speed-up when amplifying a constant success probability to a probability very close to 1.

Finally, in Section 6 we look at the problem of searching an ordered list of $`N`$ items (ordered according to some key field of the items). Since many databases in practice are ordered rather than unordered, we feel this problem merits as much attention as the unordered search has received so far in the quantum computing literature. Classically, we can search such an ordered list with only $`\mathrm{log}N`$ queries using binary search. It is unknown whether a quantum computer can improve on this. However, we show that it cannot improve much more than a square-root: we prove a lower bound of $`\mathrm{\Omega }(\sqrt{\mathrm{log}N}/\mathrm{log}\mathrm{log}N)`$ queries for bounded-error quantum search in this setting, using a novel kind of quantum reduction from the PARITY-problem.

To summarize:

* We prove a general lower bound on the error in quantum search of an unordered list.
* We apply this to show that a quantum computer can achieve at most a linear speed-up when amplifying an already-big success probability.
* We prove a lower bound of roughly $`\sqrt{\mathrm{log}N}`$ for quantum search of an ordered list of $`N`$ items.

## 2 Preliminaries

In this section we define the setting of quantum gate networks (which are equivalent to quantum Turing machines \[Yao93\]) and queries.

A qubit is a superposition $`\alpha _0|0+\alpha _1|1`$ of both values of a classical bit. Similarly, a register of $`m`$ qubits is a superposition $`|\varphi `$ of all $`2^m`$ classical bitstrings of $`m`$ bits, written

$$|\varphi =\underset{k\{0,1\}^m}{}\alpha _k|k.$$

Here $`\alpha _k`$ is a complex number, called the amplitude of state $`|k`$. If we observe $`|\varphi `$ we will see one and only one $`|k`$. The probability of seeing one specific $`|k`$ is given by $`|\alpha _k|^2`$. Hence we must have $`_{k\{0,1\}^m}|\alpha _k|^2=1`$. After observing $`|\varphi `$ and seeing $`|k`$, the superposition $`|\varphi `$ has collapsed to $`|k`$.

If we do not observe a state, quantum mechanics tells us that it will evolve unitarily. This means that the vector of amplitudes is transformed according to a linear operator that preserves norm (so the sum of the amplitudes squared remains 1). A unitary operator $`U`$ always has an inverse $`U^1`$, which equals its conjugate transpose $`U^{}`$. A quantum gate network working on $`m`$ qubits is like a classical circuit working on $`m`$ classical bits, except that instead of AND-, OR-, and NOT-gates we have quantum gates which operate unitarily on one or more qubits. A quantum gate network transforms an initial state into a final state much in the way a classical circuit transforms its input into one or more output bits. It is known that operations on one or two qubits at a time are sufficient to build any unitary transformation \[BBC<sup>+</sup>95\]. The most common measure of complexity of a quantum gate network is the number of elementary quantum gates it contains, but in this paper we will disregard this and only count the number of queries.

Making queries to a list $`X=(x_0,\mathrm{},x_{N1})`$ of $`N`$ bits is incorporated in the model as follows. Classically, making a query to $`X`$ means inputting some $`j\{0,\mathrm{},N1\}`$ into a black-box, and receiving the value $`x_j`$ as output. A query gate $`O`$ (for “oracle”) performs the corresponding mapping, which is our only way to access the bits $`x_j`$:

$$|j,0,\overline{0}|j,x_j,\overline{0},$$

where $`\overline{0}`$ is a string of zeroes. Because $`O`$ must be reversible, it also maps

$$|j,1,\overline{0}|j,\overline{x_j},\overline{0}.$$

We will look at quantum networks that contain both elementary gates and query gates, but only count the latter. The advantage of a quantum computer over a classical computer is its ability to make queries in superposition: applying $`O`$ once to the state $`\frac{1}{\sqrt{N}}_j|j,0,\overline{0}`$ results in $`\frac{1}{\sqrt{N}}_j|j,x_j,\overline{0}`$, which in some sense “contains” all the bits $`x_j`$.

In terms of linear algebra, a quantum gate network $`A`$ with $`T`$ queries can be viewed as follows: first $`A`$ applies some unitary operation $`U_0`$ to the initial state, then it applies $`O`$, then it applies another $`U_1`$, another $`O`$, and so on up till $`U_T`$. Thus $`A`$ corresponds to a big unitary transformation

$$A=U_TOU_{T1}O\mathrm{}OU_1OU_0.$$

The behavior of $`O`$ depends on $`X`$, but the $`U_i`$ are fixed unitary transformations independent of $`X`$. We fix the initial state to $`|\overline{0}`$, independent of $`X`$. The final state is then a superposition $`A|\overline{0}`$ which depends on $`X`$ only via the $`T`$ query gates.

One specific bit of the final state (the rightmost one, say) is considered the output bit. The output of the network is defined as the value we obtain if we observe this bit. Note that the output is a random variable. The acceptance probability of a quantum network on a specific black-box $`X`$ is defined to be the probability that the output is 1. The key lemma of \[BBC<sup>+</sup>98\] gives the following relation between a $`T`$-query network and a polynomial that expresses its acceptance probability as a function of $`X`$ (such a relation is also implicit in some of the proofs of \[FR98, FFKL93\]):

###### Lemma 1

The acceptance probability of a quantum network that makes $`T`$ queries to a black-box $`X`$, can be written as a real-valued multilinear $`N`$-variate polynomial $`P(X)`$ of degree at most $`2T`$.

Note that if we want to compute a Boolean function, then the acceptance probability $`P(X)`$ should be close to 1 if $`f(X)=1`$, and $`P(X)`$ should be close to 0 if $`f(X)=0`$. Since the degree of $`P`$ is $`2T`$, a lower bound on the degree of a polynomial with such properties implies a lower bound on $`T`$. See \[BBC<sup>+</sup>98\] for some of the lower bounds on quantum query complexity that can be obtained in this way.

An $`N`$-variate polynomial $`P`$ of degree $`d`$ can be reduced to a single-variate one in the following way (due to \[MP68\]). Let $`P^{sym}`$ be the polynomial that averages $`P`$ over all permutations of its input:

$$P^{sym}(X)=\frac{_{\pi S_N}P(\pi (X))}{N!}.$$

$`P^{sym}`$ is an $`N`$-variate polynomial of degree at most $`d`$. It can be shown that there is a single-variate polynomial $`Q`$ of degree at most $`d`$, such that $`P^{sym}(X)=Q(|X|)`$ for all $`X\{0,1\}^N`$. Here $`|X|`$ denotes the Hamming weight (number of 1s) of $`X`$.

## 3 Lower Bound on the Error in Quantum Search

In this section we establish a general lower bound on the error probability in quantum search. Consider an unordered list of $`N`$ items. We will abstract from the specific contents of the items, treating the list like a kind of black-box. A query at place $`j`$ of the list just returns one bit $`x_j`$, indicating whether the $`j`$th item on the list has the property we are looking for. A query gate performs the following mapping, which is our only access to the bits $`x_j`$:

$$|j,b,\overline{0}|j,bx_j,\overline{0},$$

where $`b`$ is a bit and $`\overline{0}`$ is a string of zeroes. The aim is to find a $`j`$ such that $`x_j=1`$ (if there is one), using as few queries as possible.

Rather than proving a lower bound on search directly, we will prove a lower bound on computing the OR-function (i.e. determining whether $`X`$ contains at least one 1). This clearly reduces to search. The main idea of our proof is the following. By the lemma of the previous section, the acceptance probability of a quantum computer with $`T`$ queries that computes the OR with error probability $`\epsilon `$ can be written as a multivariate polynomial of degree $`2T`$ of the $`N`$ bits in the list. This polynomial can be reduced to a single-variate polynomial $`s`$ of degree $`d2T`$ with the following properties:

> $`s(0)=0`$ <sup>2</sup><sup>2</sup>2Since we can always test whether we actually found a solution at the expense of one more query, we can assume the algorithm always gives the right answer ‘no’ if the list contains only 0s. Hence $`s(0)=0`$. However, our results remain unaffected if we allow a small error here also (i.e. $`0s(0)\epsilon `$).   
> $`1\epsilon s(x)1`$ for all integers $`x[1,N]`$

We will prove a lower bound on $`\epsilon `$ in terms of $`d`$, which implies a lower bound in terms of $`T`$. Because we can achieve $`\epsilon =0`$ iff $`T=N`$ \[BBC<sup>+</sup>98, Proposition 6.1\], we assume $`T<N`$ and hence $`\epsilon >0`$.

Define $`p(x)=1s(Nx)`$. Then $`p`$ has degree $`d`$ and

> $`0p(x)\epsilon `$ for all integers $`x[0,N1]`$   
> $`p(N)=1`$

Thus $`p`$ is “small” at integer points in $`[0,N1]`$ and “big” at $`N`$. Coppersmith and Rivlin \[CR92, p. 980\] prove the following theorem, which allows us to show that $`p`$ is also “small” at non-integer points in $`[0,N1]`$.

###### Theorem 1 (Coppersmith & Rivlin)

There exist positive constants $`a`$ and $`b`$ with the following property. For every polynomial $`p`$ of degree $`d`$ such that

$$|p(x)|1\text{ for all integers }x[0,n]$$

and any $`\delta >0`$ such that $`n\delta d^2`$, we have

$$|p(x)|<ae^{b/\delta }\text{ for all real }x[0,n].$$

Let $`\delta =(N1)/d^2`$. Applying Coppersmith and Rivlin’s theorem to $`p/\epsilon `$ (which is bounded by 1 at integer points) we obtain:

$$|p(x)|<\epsilon ae^{b/\delta }\text{ for all real }x[0,N1].$$

Now we rescale $`p`$ to $`q(x)=p((x+1)(N1)/2)`$ (i.e. the domain $`[0,N1]`$ is transformed to $`[1,1]`$), which has the following properties:

> $`|q(x)|<\epsilon ae^{b/\delta }\text{ for all real }x[1,1]`$   
> For $`\mu =2/(N1)`$ we have $`q(1+\mu )=p(N)=1`$

Thus $`q`$ is “small” on all $`x[1,1]`$ and “big” just outside this interval ($`q(1+\mu )=1`$).

Let $`T_d`$ denote the degree-$`d`$ Chebyshev polynomial \[Riv90\]:

$$T_d(x)=\frac{1}{2}\left(\left(x+\sqrt{x^21}\right)^d+\left(x\sqrt{x^21}\right)^d\right).$$

The following is known:

* If $`q`$ is a polynomial of degree $`d`$ such that $`|q(x)|c`$ for all $`x[1,1]`$ then $`|q(x)|c|T_d(x)|`$ for all $`|x|1`$ \[Pat92, Fact 2\]\[Riv90, p.108\]
* $`T_d(1+\mu )e^{2d\sqrt{2\mu +\mu ^2}}`$ for all $`\mu 0`$ \[Pat92, p.471, before Fact 2\]<sup>3</sup><sup>3</sup>3For $`x=1+\mu `$: $`T_d(x)(x+\sqrt{x^21})^d=(1+\mu +\sqrt{2\mu +\mu ^2})^d(1+2\sqrt{2\mu +\mu ^2})^de^{2d\sqrt{2\mu +\mu ^2}}`$ (Paturi, personal communication).

Linking all this we obtain

$$1=q(1+\mu )\epsilon ae^{b/\delta }|T_d(1+\mu )|\epsilon ae^{b/\delta +2d\sqrt{2\mu +\mu ^2}}.$$

This shows that if $`q`$ is “big” just outside the interval $`[1,1]`$, then it cannot have been very small inside this interval, so $`\epsilon `$ cannot have been very small. Substituting $`\delta =(N1)/d^2`$ and $`\mu =2/(N1)`$ we obtain the following lower bound on $`\epsilon `$:

$$\epsilon \frac{1}{a}e^{bd^2/(N1)4d/\sqrt{N/(N1)^2}}.$$

Since $`d2T`$, where $`T`$ is the number of queries of the quantum search algorithm, we have (simplifying a bit):

###### Theorem 2

If $`T<N`$ then $`\epsilon \mathrm{\Omega }\left(e^{4bT^2/N8T/\sqrt{N}}\right)`$.

We note some special cases of this general theorem:

###### Corollary 1

No quantum network for bounded-error search of an unordered list that uses $`O(\sqrt{N})`$ queries can have error probability $`o(1)`$.

For instance, an error $`1/N`$ cannot be achieved using only $`O(\sqrt{N})`$ queries.<sup>4</sup><sup>4</sup>4Which is too bad, because such a small error would reduce the quantum complexity of $`\mathrm{\Sigma }_2`$ (the second level of the polynomial hierarchy) from $`O(\sqrt{2^n}n)`$ to $`O(\sqrt{2^n})`$ \[BCW98\].

###### Corollary 2

Every quantum network for bounded-error search of an unordered list that uses $`N^{0.5+\alpha }`$ queries ($`\alpha 0`$) must have error probability $`\mathrm{\Omega }\left(1/2^{cN^{2\alpha }}\right)`$ (where $`c>0`$ is some fixed constant).

In particular, this shows that we cannot obtain error probability $`1/2^N`$ unless we have $`\alpha =0.5`$ and thus use $`\mathrm{\Omega }(N)`$ queries. \[BCW98, Theorem 1.16\] proves the upper bound that the error probability can be made as small as $`1/2^{N^\alpha }`$ using $`O(N^{0.5+\alpha })`$ queries, so there is still a gap between upper and lower bound.

Finally, a lower bound on $`T`$ in terms of $`\epsilon `$ and $`N`$:

###### Corollary 3

If $`T(N)/\sqrt{N}\mathrm{}`$ but $`T<N`$, then $`T\mathrm{\Omega }\left(\sqrt{N\mathrm{log}(1/\epsilon )}\right)`$.

## 4 The Influence of the Number of Solutions

Suppose we have a quantum search algorithm that uses $`T`$ queries and works well (i.e. has error $`\epsilon `$) whenever the number of 1s in the list of $`N`$ items is either 0 or at least $`t`$. (Here $`t`$ is some fixed number $`<N`$.) Such an algorithm induces a polynomial of degree $`d2T`$ with the following properties:

> $`s(0)=0`$   
> $`1\epsilon s(x)1`$ for all integers $`x[t,N]`$

Define $`p(x)=1s(Nx)`$, which has degree $`d`$ and

> $`0p(x)\epsilon `$ for all integers $`x[0,Nt]`$   
> $`p(N)=1`$

Now we define $`q(x)=p((x+1)(Nt)/2)`$, $`\delta =(Nt)/d^2`$ and $`\mu =2t/(Nt)`$, and derive completely analogous to the previous section:

$`1`$ $`=`$ $`q(1+\mu )\epsilon ae^{b/\delta }|T_d(1+\mu )|\epsilon ae^{b/\delta +2d\sqrt{2\mu +\mu ^2}}`$   
$`=`$ $`\epsilon ae^{bd^2/(Nt)+2d\sqrt{4t/(Nt)+4t^2/(Nt)^2}}`$   
$`=`$ $`\epsilon ae^{bd^2/(Nt)+4d\sqrt{tN/(Nt)^2}}.`$   
Hence for quantum search in this situation we have the bound:

$$\epsilon \mathrm{\Omega }\left(e^{bd^2/(Nt)4d\sqrt{tN/(Nt)^2}}\right)\mathrm{\Omega }\left(e^{4bT^2/(Nt)8T\sqrt{tN/(Nt)^2}}\right).$$

\[BBHT98\] proves that an expected number of $`O(\sqrt{N/t})`$ queries is sufficient to search with high probability. If we put $`T=c\sqrt{N/t}`$ then the lower bound on the error probability becomes roughly $`\mathrm{\Omega }(e^{c^{}c})`$ (for some constant $`c^{}>0`$), which can indeed be made arbitrarily small by increasing $`c`$. On the other hand, if $`To(\sqrt{N/t})`$ then the lower bound on the error goes to the constant $`1/a`$ for $`N\mathrm{}`$ and $`t=o(N)`$. Now if we were able to achieve some error $`<1/2`$ using $`o(\sqrt{N/t})`$ queries, we could also make the error $`<1/a`$ by repeating a constant number of times, which would still take only $`o(\sqrt{N/t})`$ queries. This shows that we cannot achieve error $`<1/2`$ using $`o(\sqrt{N/t})`$ queries. Thus the $`O(\sqrt{N/t})`$ upper bound is tight up to a constant factor (as already shown in a different way in \[BBHT98\]).

## 5 Application to Derandomization of RP

Let $`A`$ be some RP-algorithm for a language $`L`$ with running time $`p(n)`$. $`A`$ always gives the right answer ‘no’ for every input $`xL`$, and gives the right answer ‘yes’ with probability at least $`1/2`$ for every $`xL`$. We want to lower the error probability using as few calls to $`A`$ as possible. For a fixed input $`x`$ of length $`n`$ we can consider $`A`$ as a black-box of $`N2^{p(n)}`$ items. Each item corresponds to the value $`A`$ outputs when given a specific random string ($`A`$ can use at most $`p(n)`$ random bits and hence at most $`2^{p(n)}`$ distinct random strings). By definition of RP, this black-box satisfies the promise that either it contains 0 1s (if $`xL`$) or at least $`N/2`$ 1s (if $`xL`$).

A classical computer can improve the error probability to at most $`1/2^k`$ by making $`k`$ black-box queries (i.e. $`k`$ applications of the algorithm on $`k`$ different random strings) and answering ‘yes’ iff at least one those $`k`$ queries answered ‘yes’. How much better can a quantum computer do, if we only allow it to call $`A`$ as a black-box? Note that the classical method basically searches through a list of $`k`$ items, looking for a 1. Accordingly, the following quantum algorithm suggests itself: select $`k`$ random strings and search whether one of these gives a ‘yes’ in $`O(\sqrt{k})`$ applications of the algorithm. Thus we would expect a quantum computer to be able to achieve the same error probability $`1/2^k`$ using roughly $`\sqrt{k}`$ applications of the algorithm instead of $`k`$.

However, note that the situation here corresponds exactly to the previous section with $`t=N/2`$. Thus if the quantum computer makes $`T`$ queries and has error probability $`\epsilon `$ on the worst-case black-box, then

$$\epsilon \mathrm{\Omega }\left(e^{8bT^2/N8T\sqrt{2}}\right).$$

If we want $`\epsilon 1/2^k`$ (for some fixed $`k`$ and all $`N`$), it follows that $`Tck`$, for some $`c>0`$ that does not depend on $`k`$.<sup>5</sup><sup>5</sup>5For sufficiently large $`k`$, $`c`$ will be roughly $`1/8\sqrt{2}\mathrm{log}e0.06`$. Thus the quantum algorithm cannot achieve the square-root speed-up that we expected; it can achieve at most a linear speed-up.

Why does the above-mentioned $`\sqrt{k}`$-method not work? The reason is that the quantum searching algorithm itself has some error probability, in addition to the probability $`1/2^k`$ that the chosen sample of $`k`$ items does not contain a 1 when the larger list of $`N`$ items does contain a 1. The error introduced by quantum search can only be made sufficiently small at the cost of increasing $`k`$ and/or the number of queries spent.

In sum: on a classical computer we can amplify an RP-algorithm to error probability $`\epsilon 1/2^k`$ using $`k`$ applications of the algorithm, on a quantum computer we cannot do much better: we still need at least $`ck`$ applications to achieve error $`\epsilon 1/2^k`$, provided we use the RP-machine only as a black-box.

## 6 Lower Bound on Search in an Ordered List

Grover’s algorithm can find a specific item in an unordered list of $`N`$ items with high probability, using only $`O(\sqrt{N})`$ queries (a.k.a. database look-ups), whereas a classical algorithm needs $`\mathrm{\Theta }(N)`$ queries for this. There exist several lower-bound proofs that show that the $`O(\sqrt{N})`$ is optimal \[BBBV97, BBHT98, Zal97, BBC<sup>+</sup>98, Gro98a\].

What about search in a list of $`N`$ items which is ordered according to some key-value of each item? A classical deterministic algorithm can search such a list using $`\mathrm{log}N`$ queries by means of binary search (each query can effectively halve the relevant part of the list: looking at the key of the middle item of the list tells you whether the item you are searching for is in the first or the second half of the list). How much better can we do on a quantum computer? Can we again get a square-root speed-up? Here we show that the speed-up cannot be much better than a square-root: we prove a lower bound of $`\mathrm{\Omega }(\sqrt{\mathrm{log}N}/\mathrm{log}\mathrm{log}N)`$ queries for bounded-error quantum search of an ordered list. In contrast, we have no upper bound better than the classical $`\mathrm{log}N`$.

We will formalize a query on an ordered list as follows, abstracting from the specific contents of the key field. The list is viewed as a list of $`N`$ bits, $`x_0,\mathrm{},x_{N1}`$, and there is an unknown number $`i`$ such that $`x_j=1`$ iff $`ji`$. Here $`x_j`$ being 1 can be interpreted as saying that the $`j`$th item on the list has a key-value smaller or equal to the value we are looking for. The goal is to find the number $`i`$, which is the point in the list where the looked-for item resides, using as few queries as possible. In quantum network terms, a query corresponds to a gate $`C`$ that maps

$$|j,b,\overline{0}|j,bx_j,\overline{0}.$$

The following theorem proves a lower bound of roughly $`\sqrt{\mathrm{log}N}`$ queries for quantum searching an ordered list with bounded error probability. To improve readability, we have deferred some of the more technical details to the appendix. Basically these show that we can approximately simulate the gate $`C`$ using roughly $`\sqrt{\mathrm{log}N}`$ queries to a black-box of $`\mathrm{log}N`$ bits that represents the number $`i`$.

###### Theorem 3

A quantum network for bounded-error search of an ordered list of $`N`$ items must use at least $`\mathrm{\Omega }(\sqrt{\mathrm{log}N}/\mathrm{log}\mathrm{log}N)`$ queries.

Proof  Suppose we have a network $`S`$ for bounded-error ordered search that uses $`T`$ queries to find the number $`i`$ hidden in an ordered black-box $`X`$ with high probability. Since $`\mathrm{log}N`$ queries are sufficient for this (classical binary search), we can assume $`T\mathrm{log}N`$. We will show how we can get from $`S`$ to a network $`\stackrel{~}{S}`$ that determines the whole contents of an arbitrary black-box $`Y`$ of $`\mathrm{log}N`$ bits with high probability, using only $`TO(\sqrt{\mathrm{log}N}\mathrm{log}\mathrm{log}N)`$ queries to $`Y`$. This would allow us to compute the PARITY-function of $`Y`$ (i.e. whether or not $`Y`$ contains odd many 1s). Since we have a $`(\mathrm{log}N)/2`$ lower bound for the latter \[BBC<sup>+</sup>98, Proposition 6.4\], we have

$$TO(\sqrt{\mathrm{log}N}\mathrm{log}\mathrm{log}N)\frac{\mathrm{log}N}{2},$$

from which the theorem follows.

So let $`Y`$ be an arbitrary black-box of $`\mathrm{log}N`$ bits. This represents a number $`i\{0,\mathrm{},N1\}`$. Let $`X=(x_0,\mathrm{},x_{N1})`$ be the ordered black-box corresponding to $`i`$, so $`x_j=1`$ iff $`ji`$. The network $`S`$, when allowed to make queries to $`X`$, outputs the number $`i`$ with high probability. A query-gate $`C`$ for $`X`$ maps

$$|j,b,\overline{0}|j,bx_j,\overline{0}.$$

Since $`x_j=1`$ iff $`ji`$, Lemmas 2 and 3 of the appendix imply that there is a quantum network $`\stackrel{~}{C}`$ that uses $`O(\sqrt{\mathrm{log}N}\mathrm{log}\mathrm{log}N)`$ queries to $`Y`$ and maps

$$|j,b,\overline{0}|j,bx_j,\overline{0}+|j|W_{jb},$$

where $`|W_{jb}\eta /\mathrm{log}N`$ for all $`j,b`$, for some small fixed $`\eta `$ of our choice.

Let $`\stackrel{~}{S}`$ be obtained from $`S`$ by replacing all $`T`$ $`C`$-gates by $`\stackrel{~}{C}`$-networks. Note that $`\stackrel{~}{S}`$ contains $`TO(\sqrt{\mathrm{log}N}\mathrm{log}\mathrm{log}N)`$ queries to $`Y`$. Consider the way $`\stackrel{~}{S}`$ acts on initial state $`|\overline{0}`$, compared to $`S`$. Each replacement of $`C`$ by $`\stackrel{~}{C}`$ introduces an error, but each of these errors is at most $`\sqrt{2}\eta /\mathrm{log}N`$ in Euclidean norm by Lemma 4. By unitarity these $`T`$ errors add linearly, so the final states will be close together:

$$S|\overline{0}\stackrel{~}{S}|\overline{0}T\sqrt{2}\eta /\mathrm{log}N\sqrt{2}\eta .$$

Since observing the final state $`S|\overline{0}`$ yields the number $`i`$ with high probability, observing $`\stackrel{~}{S}|\overline{0}`$ will also yield $`i`$ with high probability. Thus the network $`\stackrel{~}{S}`$ allows us to learn $`i`$, and hence the whole black-box $`Y`$. $`\mathrm{}`$   

## Acknowledgements

We would like to thank David Deutsch, Wim van Dam and Mike Mosca for discussions which emphasized the importance of making the error in quantum search as small as possible.

## Appendix A Some Technical Lemmas

Our lower-bound proof for ordered search uses three technical lemmas.

The first lemma can be obtained from the result of Dürr and Høyer \[DH96\] that a quantum algorithm can find the minimum element on a list of $`N`$ items using $`O(\sqrt{N})`$ queries. We can use this to find the leftmost bit where two lists differ, which tells us which of the two numbers represented by the two lists is bigger.

###### Lemma 2

There exists a quantum algorithm $`A`$ that with bounded error probability outputs on input $`j`$ ($`0jN1`$) whether $`j`$ is smaller or equal to a number $`i`$ represented by a black-box of $`\mathrm{log}N`$ bits, using $`O(\sqrt{\mathrm{log}N})`$ queries to the black-box.

By standard techniques, we can make the error probability $`O(1/\mathrm{log}N)`$ by repeating the algorithm $`O(\mathrm{log}\mathrm{log}N)`$ times.

The second lemma shows how to obtain an approximately “clean” computation that uses no measurements (the proof is as in \[CDNT97, Section 3\] and \[BCW98, Theorem 1.14\]).

###### Lemma 3

Suppose there exists a quantum algorithm $`A`$ that uses $`T`$ queries and outputs a bit $`x_j`$ with error probability $`\epsilon `$ on initial state $`|j,\overline{0}`$, for every $`j`$, and does not change the $`j`$-register. Then there exists a quantum algorithm $`A^{}`$ that uses $`2T`$ queries and no measurements, and maps

$$|j,b,\overline{0}|j,bx_j,\overline{0}+|j|W_{jb},$$

where $`|W_{jb}\sqrt{2\epsilon }`$, for every $`j`$ and $`b\{0,1\}`$.

Proof  The idea is the familiar “compute, copy answer, uncompute”-sequence. By standard techniques, we can assume $`A`$ itself uses no measurements and is followed by a single measurement. Then there exist amplitudes $`\alpha _0`$ and $`\alpha _1`$ and unit-length vectors $`|V_0`$ and $`|V_1`$ such that

$$A|j,0,\overline{0}=\alpha _0|j,x_j|V_0+\alpha _1|j,\overline{x_j}|V_1,$$

and $`|\alpha _1|^2\epsilon `$. For ease of notation, we assume this state is preceded by the bit $`b`$. Applying the controlled-not operation that maps $`|b,j,x|bx,j,x`$, we get

$$\alpha _0|bx_j,j,x_j|V_0+\alpha _1|b\overline{x_j},j,\overline{x_j}|V_1=$$

$$|bx_j\left(\alpha _0|j,x_j|V_0+\alpha _1|j,\overline{x_j}|V_1\right)+\alpha _1|b\overline{x_j},j,\overline{x_j}|V_1\alpha _1|bx_j,j,\overline{x_j}|V_1.$$

Applying $`IA^1`$ gives

$$|bx_j|j,0,\overline{0}+(IA^1)\left(\alpha _1|b\overline{x_j},j,\overline{x_j}|V_1\alpha _1|bx_j,j,\overline{x_j}|V_1\right).$$

Applying an operation $`B`$ which swaps the first bit and $`j`$, we get

$$|j,bx_j,0,\overline{0}+B(IA^1)\left(\alpha _1|b\overline{x_j},j,\overline{x_j}|V_1\alpha _1|bx_j,j,\overline{x_j}|V_1\right).$$

Note that $`B(IA^1)\left(\alpha _1|b\overline{x_j},j,\overline{x_j}|V_1\alpha _1|bx_j,j,\overline{x_j}|V_1\right)=|j|W_{jb}`$ for some $`|W_{jb}`$, because $`A`$ and hence also $`A^1`$ do not change $`j`$. Now

$`|W_{jb}`$ $`=`$ $`|j|W_{jb}`$   
$`=`$ $`B(IA^1)\left(\alpha _1|b\overline{x_j},j,\overline{x_j}|V_1\alpha _1|bx_j,j,\overline{x_j}|V_1\right)`$   
$`=`$ $`\alpha _1|b\overline{x_j},j,\overline{x_j}|V_1\alpha _1|bx_j,j,\overline{x_j}|V_1`$   
$`=`$ $`\sqrt{2|\alpha _1|^2}\sqrt{2\epsilon }.`$   
Thus the quantum algorithm $`A^{}`$ which first applies $`A`$, then XORs the answer-bit into $`b`$, and then applies $`A^1`$, satisfies the lemma. $`\mathrm{}`$   

The next lemma uses an idea from \[CDNT97\]. It shows that if we can simulate a gate $`C`$ by means of a network $`\stackrel{~}{C}`$ that works well on basis states, then $`\stackrel{~}{C}`$ also works well on superpositions of basis states.

###### Lemma 4

Let $`C`$ and $`\stackrel{~}{C}`$ be unitary transformations such that

> $`C:|j,b,\overline{0}|j,bx_j,\overline{0}`$   
> $`\stackrel{~}{C}:|j,b,\overline{0}|j,bx_j,\overline{0}+|j|W_{jb}`$

If $`|W_{jb}\epsilon `$ for every $`j\{0,\mathrm{},N1\}`$ and $`b\{0,1\}`$, and $`|\varphi =_{j,b}\alpha _{jb}|j,b,\overline{0}`$ has norm 1, then

> $`C|\varphi \stackrel{~}{C}|\varphi \sqrt{2}\epsilon `$.

Proof 

$`C|\varphi \stackrel{~}{C}|\varphi `$ $`=`$ $`{\displaystyle \underset{j,b}{}}\alpha _{jb}|j|W_{jb}`$   
$``$ $`{\displaystyle \underset{j}{}}\alpha _{j0}|j|W_{j0}+{\displaystyle \underset{j}{}}\alpha _{j1}|j|W_{j1}`$   
$`\stackrel{(1)}{=}`$ $`\sqrt{{\displaystyle \underset{j}{}}|\alpha _{j0}|^2|j|W_{j0}^2}+\sqrt{{\displaystyle \underset{j}{}}|\alpha _{j1}|^2|j|W_{j1}^2}`$   
$``$ $`\epsilon \sqrt{{\displaystyle \underset{j}{}}|\alpha _{j0}|^2}+\epsilon \sqrt{{\displaystyle \underset{j}{}}|\alpha _{j1}|^2}\stackrel{(2)}{}\sqrt{2}\epsilon .`$   
Here $`(1)`$ holds because the states $`|j|W_{jb}`$ in $`_j\alpha _{jb}|j|W_{jb}`$ are all orthogonal, and $`(2)`$ holds because $`\sqrt{a}+\sqrt{1a}\sqrt{2}`$ for all $`a[0,1]`$. $`\mathrm{}`$