Grover'S Quantum Algorithm Applied To Global Optimisation
Grover'S Quantum Algorithm Applied To Global Optimisation
GLOBAL OPTIMISATION
Section 1. Introduction
This paper aims to provide the global optimisation community with
some background knowledge of quantum computation, and to explore
the importance of this topic for the future of global optimisation.
Quantum computing [7] holds great potential to increase the effi-
ciency of stochastic global optimisation methods. Current estimates
are that quantum computers are likely to be in commercial production
within two or three decades. These devices will be in many respects
similar to the computers of today, but will utilise circuitry capable of
quantum coherence [7], enabling data to be manipulated in entirely
new ways.
Grover introduced in [9] a quantum algorithm (that is, an algorithm
to be executed on a quantum computer) for locating a “marked” item
in a database. This was extended in [2] to a quantum algorithm for lo-
cating one of an unknown number of marked items. The latter method
was incorporated into a minimisation algorithm by Dürr and Høyer
in [8] (unpublished, but available electronically—see the reference list).
Dürr and Høyer’s algorithm can be viewed as an example of Grover
adaptive search (GAS), an algorithmic framework we introduced in [4].
GAS in turn is a quantum-computational implementation of hesitant
adaptive search [6], a parameterised pseudoalgorithm whose perfor-
mance is well understood. Here we analyse Dürr and Høyer’s method,
present another version of GAS, and explore the relative merits of the
two methods via numerical simulation.
in [4], but we reiterate the salient features here and give an intuitive
discussion.
Consider the following general search problem. Let n be a positive
integer, and let S = {0, 1}n , so that the domain size N = 2n . Let
h : S → {0, 1}. We wish to find a point u ∈ S such that h(u) = 1. We
further assume that h is a black-box, that is, that knowledge of h can
only be gained by sampling (evaluation), but no structural information
is available.
With conventional computing, the Boolean function h could be im-
plemented as a subroutine, i.e., a conventional logic circuit constructed
to take an input string of bits, representing a point of S, and output
the associated bit value of h. The subroutine could then be applied
to all points of S, in succession, to find a required point. Such a con-
ventional program would require on average N/2 evaluations to find a
marked point.
In quantum computing, the circuit implementing h (using gates that
work with qubits) inputs and outputs superpositions. Thus it “sees”
many possible answers at once. On a quantum computer, observing
the output will collapse it into a conventional bit string, according
to a probability distribution determined by the superposition; thus
quantum computing has a stochastic side. Rather than loop through
the N points in S, a quantum computer can operate on superposed
states in such a way that the probablity distribution governing the
collapse can be changed. √ Grover in [9] showed if exactly one point
π
is marked, then only 4 N such operations are required to find the
marked point.
Denote the set of marked points by M = {u ∈ S|h(u) = 1} and
denote the number of these marked target points by t. We may or
may not be aware of the value of t. Let p be the proportion of marked
points, t/N.
Grover introduced the Grover Rotation Operator, which incorporates
the oracle for h and provides a means of implementing a certain phase-
space rotation of the states of a quantum system encoding points in
the domain S. Repeated applications of this rotation can be used to
move from the equal amplitude state, which is simple to prepare within
a quantum computer, toward the states encoding the unknown marked
points. For details see [4, 2, 9].
A Grover search of r rotations applies the above rotation operator
r times, starting from the equal amplitude superposition of states, and
then observes (and hence collapses to a point) the output state. The
mathematical details in [2] show that executing such a search of r ro-
tations generates domain points according to the following probability
distribution γ on S:
4 BARITOMPA, BULGER AND WOOD
( gr (p)
t
, x ∈ M,
(1) γ({x}) = 1−gr (p)
N −t
, x ∈ S\M,
where
√
(2) gr (p) = sin2 [(2r + 1) arcsin p] .
Note that, in the special case of r = 0, Grover search only observes
the prepared equal amplitude superposition of states and so reduces to
choosing a point uniformly from the domain.
Most of the work in implementing the Grover Rotation Operator is
in the oracle query, so the cost of a Grover search of r rotations is taken
as the cost of r oracle queries. The output is a point in S, and as one
would usually want to know if it is in M or not, a further oracle query
(acting on the point) would give the function value under h.
Grover Search is sometimes portrayed as a method for the database
table lookup problem. This is only one elementary application, how-
ever. Other interesting applications concern “marking functions” h
which are more than simple tests of indexed data. Examples relating
to data encryption and the satisfiability problem are given in [2, 9].
GAS fits into the adaptive search framework developed in [5, 6, 15,
16, 17] which has proved useful for theoretical studies of convergence
of stochastic global optimisation methods. All adaptive algorithms as-
sume “improving” points can be found (at some cost). If Grover’s
algorithm were only applicable to database lookup, one might get the
impression that GAS would require all function values to be first com-
puted and tabled, before they could then be marked. However, Grover’s
algorithm can find points in an unknown target set, specified by an or-
acle. GAS exploits this ability by constructing, at each iteration, an
oracle targeting the current improving region. In this way, it builds a
sequence of domain points, each uniformly distributed in the improving
region of the previous point. Such a sequence is known to converge to
the global optimum very quickly; for instance, a unique optimum in a
domain of size N will be found after 1 + ln N such improvements, in
expectation (see [17]).
Unfortunately this does not mean that GAS can find the global op-
timum for a cost in proportion to ln N. The reason is that as the im-
proving fraction p decreases, larger rotation counts become necessary to
make improvement probable; thus the cost of GAS varies super-linearly
in the number of improvements required. Note also that not every iter-
ation finds a point in the improving region. The probability of finding
an improvement is given by Equation (2), and for a known p 1, a
rotation count r can be found making this probability very nearly 1.
But since in general we can only guess at p, lower probabilities result.
Readers may wonder why we use the best value yet seen as the
threshold in the Grover search. In a sense, all of the work of the
algorithm is done in the last step, when a Grover search is performed
using a threshold only a little larger than the global minimum. This
final Grover search is not made any easier by the information gained
in earlier steps. In the general case, however, where we have no prior
knowledge of the objective function’s range, these earlier steps are an
efficient way of finding a good value to use as a threshold in the final
step. The earlier steps are not great in number. Moreover, the cost
of each step is roughly inversely proportional to the square root of the
improving fraction; thus, if the sequence of rotation counts is chosen
suitably, most of the earlier steps will be much quicker than the final
one.
APPLYING GROVER ADAPTIVE SEARCH 7
1
g3(p)
0
0 0.2 0.4 0.6 0.8 1
p
This is the special case of GAS arising when the rotation count rn
is chosen randomly from an integer interval which is initialised to {0}
at each improvement,
√ but which grows exponentially to a maximum of
{0, . . . , d N − 1e} between improvements.
10 BARITOMPA, BULGER AND WOOD
The analysis of the algorithm reported in the archive [8] uses incor-
rect constants from a preprint of [2]. In our analysis that follows, we
correct this by using the published version of [2]. Because the Boyer
et al. algorithm underpins that of Dürr and Høyer, we begin with an
analysis of the former algorithm. Theorem 3 in [2] is an order of magni-
tude result, but inspection of the proof implies that the expected time
required by the Boyer et al. algorithm topfind one of t marked items
among a total of N items is bounded by 8 N/t. This constant can be
improved upon, though, as we shall see after the following theorem.
Theorem 1. The expected number of oracle queries required by the
Boyer et al. algorithm with parameter λ to find and verify a point from
a target subset of size t from a domain of size N is
j−1
X∞
dλj e Y 1 sin(4θdλi e)
(3) +
j=0
2 i=0 2 4dλi e sin(2θ)
p
where θ = arcsin( t/N ).
Proof. Conditioned on reaching iteration j, the expected number of
oracle queries required at that iteration is dλj e/2 (including the test of
the output of Grover’s algorithm for target subset membership.) The
probability of reaching iteration j is a product of failure rates; the
probability of the algorithm failing to terminate at iteration j, having
reached this iteration, is
1 sin(4θdλi e)
+
2 4dλi e sin(2θ)
(this is Lemma 2 in [2]). Thus the expected number of oracle queries
required at iteration j, not conditioned on whether the iteration is
reached, is
j−1
dλj e Y 1 sin(4θdλi e)
+ ,
2 i=0 2 4dλi e sin(2θ)
and summing over all possible iterations j = 0 . . . ∞ gives the result.
It is straightforward to evaluate the geometrically p convergent se-
ries (3) numerically. By graphing the ratio of (3) to N/t versus t
for a range of λ, empirically λ that gave the lowest maximum is 1.34.
The plot of Figure 2 uses this value of λ, and it justifies the following
observation.
Observation. The expected number of oracle queries required by the
Boyer et al. algorithm with parameter λ = 1.34 to find and verify a
pointpfrom a target subset of size t from a domain of size N is at most
1.32 N/t.
APPLYING GROVER ADAPTIVE SEARCH 11
1.4
1.2
Partial sums of (3) divided by (N/t)1/2
0.8
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Target proportion of domain
Now we can derive a performance bound for Dürr and Høyer’s algo-
rithm. This is similar to and extends the result in [8]; the main differ-
ence is in our treatment of the coefficient of the order bound. Also we
correct another technical error in their argument, which is pointed out
in our proof below.
Theorem 2. Assume the validity of the above observation. Let 1 ≤ s ≤
N and assume that there are s points in the domain with strictly better
objective function values than the remaining N −s points. The expected
number of oracle queries required by Dürr and Høyer’s algorithm with
λ = 1.34 to find one of these s points is bounded above by
√ XN
1
1.32 N √ .
r=s+1
r r − 1
function value, break ties arbitrarily, but let l(r) be the least rank and
h(r) the greatest rank among the points with the same value as the
rank r point. (In the distinct values case we will have l(r) = h(r) = r
for each r ∈ {1, . . . , N}.)
Since Dürr and Høyer’s algorithm will move through a succession of
threshold values with rank above s before finding the desired target
point, the bound on the expectation in question is given by
X
N
(4) p(N, r)B(N, l(r) − 1),
r=s+1
where p(N, r) is the probability of the rank r point ever being chosen
and B(N, l(r) − 1) is the expected number of iterations required by the
Boyer et al. algorithm to find and verify a point from a target subset
of size l(r) − 1.
The probability p(N, r) = 1/h(r). This is demonstrated in the proof
of Theorem 1 in [17], and in Lemma p 1 of [8]. Also, by the observation
on page 10, B(N, l(r) − 1) ≤ 1.32 N/(l(r) − 1).
In the distinct values case, substitution of the above value for p(N, r)
and bound for B(N, l(r) − 1) = B(N, r − 1) into (4) gives the theo-
rem immediately. In [8] it is claimed for the case of repeated objective
function values that since the equation p(N, r) = 1/r becomes the in-
equality p(N, r) ≤ 1/r, the bound still holds. This argument ignores
that the value of B(N, l(r) − 1) increases (for a given r) when repeated
values are allowed. Nevertheless, the theorem holds as follows. Con-
sider r̂ ∈ {1, . . . , N} with l(r̂) < h(r̂). We examine just that part of
the summation in (4) with index going from l(r̂) to h(r̂).
h(r̂) h(r̂)
X √ X 1
p(N, r)B(N, l(r) − 1) ≤ 1.32 N p
r=l(r̂) r=l(r̂)
h(r) l(r) − 1
h(r̂)
p X 1
= 1.32 N(l(r̂) − 1)
h(r̂)(l(r̂) − 1)
r=l(r̂)
h(r̂)
p X 1
= 1.32 N(l(r̂) − 1)
r(r − 1)
r=l(r̂)
h(r̂)
√ X 1
≤ 1.32 N √ .
r=l(r̂)
r r − 1
Remark. Dürr and Høyer’s method can be viewed as an implementa-
tion of Pure Adaptive Search [17], requiring no more than 1.32(N/t)1/2
iterations in expectation to find an improvement, when t is the cardi-
nality of the improving region.
APPLYING GROVER ADAPTIVE SEARCH 13
counts need not be considered once we pass the point where half the
expected improving region measure, divided by the cost, exceeds the
current best found benefit-to-cost ratio.
Success probability
λ= 8.00 λ= 8.00
0.6 λ=30.00 0.6 λ=30.00
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0
0 5 10 15 20 25 30 35 40 45 50 0
0 10 20 30 40 50 60 70 80 90 100
Effort Effort
Seeking 0.2% of the domain
0.9
λ= 1.24
0.8 λ= 1.34
λ= 1.44
0.7 λ= 1.54
Success probability
0.6
0.5
0.4
0.3
0.2
0.1
0
0 10 20 30 40 50 60 70 80 90 100
Effort
0.9 0.9
0.8 0.8
0.7 0.7
Success probability
Success probability
0.6 0.6
0.5 0.5
0.4 0.4
0.3 0.3
0.2 0.2
0.1 Durr & Hoyer, λ=1.34 0.1 Durr & Hoyer, λ=1.34
New method New method
0 0
0 5 10 15 20 25 30 35 40 45 50 0 10 20 30 40 50 60 70 80 90 100
Effort Effort
0.9
0.8
0.7
Success probability
0.6
0.5
0.4
0.3
0.2
Section 9. Conclusion
This paper outlines the significance of Grover’s quantumpsearch al-
gorithm (with its performance characteristics implying O( N/t) per-
formance taken as an axiom) for global optimisation. Grover search
can provide the basis of implementing adaptive global optimisation al-
gorithms. One example is an algorithm of Dürr and Høyer’s introduced
as a method for finding minimum values in a database. An improved
analysis of Dürr and Høyer’s algorithm suggests increasing its param-
eter λ from 8/7 to 1.34. Also, that algorithm fits the Grover Adaptive
Search framework, and thus is applicable to the more general global
optimisation problem. A new algorithm within the same framework is
proposed in Section 7. Our numerical experiments in Section 8 show
that the algorithms have similar performance. The method proposed
in Section 7 had its parameters tuned for the distinct objective func-
tion value case, and shows superior performance to that of Dürr and
Høyer’s in that case. On the other hand, Dürr and Høyer’s method
18 BARITOMPA, BULGER AND WOOD
References
[1] W. P. Baritompa, Handling different cost algorithms, Department of Mathe-
matics and Statistics, University of Canterbury Report, preprint, (2001).
[2] M. Boyer, G. Brassard, P. Høyer and A. Tapp, Tight bounds on quantum
searching, Fortschr. Phys., 46 (1998), pp. 493–506.
[3] S. H. Brooks, A discussion of random methods for seeking maxima, Oper. Res.,
6 (1958), pp. 244–251.
[4] D. W. Bulger, W. P. Baritompa and G. R. Wood, Implementing pure adaptive
search with Grover’s quantum algorithm, J. Optim. Theory Appl., 116 (2003),
pp. 517-529.
[5] D. W. Bulger, D. L. J. Alexander, W. P. Baritompa, G. R. Wood and Z. B.
Zabinsky, Expected hitting time for backtracking adaptive search, Optimiza-
tion , 53 (2004), pp. 189-202.
[6] D. W. Bulger and G. R. Wood, Hesitant adaptive search for global optimisa-
tion, Math. Program., 81 (1998), pp. 89–102.
[7] Centre for Quantum Computation, Oxford, http://www.qubit.org.
[8] C. Dürr and P. Høyer, A quantum algorithm for finding the minimum,
http://lanl.arxiv.org/abs/quant-ph/9607014, version 2 (7 Jan 1999).
[9] L. K. Grover, A fast quantum mechanical algorithm for database search,
Proceedings of the 28th Annual ACM Symposium on Theory of Computing,
(1996).
[10] L. K. Grover, A framework for fast quantum mechanical algorithms, Proceed-
ings of the 30th Annual ACM Symposium on Theory of Computing, (1998).
[11] E. M. T. Hendrix and O. Klepper, On uniform covering, adaptive random
search and raspberries, J. Global Optim., 18 (2000), pp. 143–163.
[12] R. Laflamme, Los Alamos scientists make seven bit quantum leap,
http://www.lanl.gov/worldview/news/releases/archive/00-041.html
(2000).
[13] P. W. Shor, Polynomial-time algorithms for prime factorization and discrete
logarithms on a quantum computer, SIAM J. Comput., 26 (1997), pp. 1484–
1509.
[14] C. P. Stephens and W. P. Baritompa, Global optimization requires global
information, J. Optim. Theory Appl., 96 (1998), pp. 575–588.
[15] G. R. Wood, Z. B. Zabinsky and B. P. Kristinsdottir, Hesitant adaptive search:
the distribution of the number of iterations to convergence, Math. Program.,
89 (2001), pp. 479–486.
APPLYING GROVER ADAPTIVE SEARCH 19
[16] Z.B. Zabinsky and R.L. Smith Pure adaptive search in global optimization,
Math. Program., 53 (1992), pp. 323–338.
[17] Z. B. Zabinsky, G. R. Wood, M. A. Steel and W. P. Baritompa, Pure adaptive
search for finite global optimization, Math. Program., 69 (1995), pp. 443–448.
[18] C. Zalka, Grover’s quantum searching algorithm is optimal, Phys. Rev. A, 60
(1999), pp. 2746–2751.