Search On A Hypercubic Lattice Using A Q
Search On A Hypercubic Lattice Using A Q
d > 2
Apoorva Patel1, 2, ∗ and Md. Aminoor Rahaman2, †
1
Centre for High Energy Physics, Indian Institute of Science, Bangalore-560012, India
2
Supercomputer Education and Research Centre, Indian Institute of Science, Bangalore-560012, India
(Dated: October 5, 2010)
Random walks describe diffusion processes, where movement at every time step is restricted to only
the neighbouring locations. We construct a quantum random walk algorithm, based on discretisation
of the Dirac evolution operator inspired by staggered lattice fermions. We use it to investigate the
spatial search problem, i.e. find a marked vertex on a d-dimensional hypercubic lattice. The
restriction on movement hardly matters for d > 2, and scaling behaviour close to Grover’s optimal
algorithm (which has no restriction on movement) can be achieved. Using numerical simulations, we
optimise the proportionality constants of the scaling behaviour, and demonstrate the approach to
arXiv:1003.0065v2 [quant-ph] 4 Oct 2010
that for Grover’s algorithm (equivalent to the mean field theory or the d → ∞ limit). In particular,
the scaling behaviour for d = 3 is only about 25% higher than the optimal d → ∞ value.
I. SPATIAL SEARCH USING THE the marked vertex [8]. The optimization criterion for the
DIRAC OPERATOR algorithm is to concentrate the amplitude distribution
toward the marked vertex as quickly as possible. Grover
The spatial search problem is to find a marked object constructed the optimal global diffusion operator, but it
from an unsorted database of size N spread over dis- requires movement from any vertex to any other vertex
tinct locations. Its characteristic is that one can proceed in just one step. That corresponds to a fully connected
from any location to only its neighbours, while inspect- graph, or equivalently the mean field theory limit. When
ing the objects. The problem is conventionally repre- movements are restricted to be local (i.e. one can go from
sented by a graph, with the vertices denoting the loca- a vertex to only its neighbours in one step), the search
tions of objects and the edges labeling the connectivity algorithm slows down. It is then worthwhile to redesign
of neighbours. Classical algorithms for this problem are the search algorithm by understanding the extent of slow
O(N ), since they can do no better than inspect one lo- down due to local movements, and how it depends on the
cation after another until reaching the marked object. spatial arrangement of the database. That is the question
On the other hand, quantum algorithms can do better we address quantitatively in this article. As discussed in
in search problems by working with a superposition of what follows, for the best spatial search algorithms, the
states, Grover’s algorithm being the prime example [1]. slow down is in the scaling prefactor for d > 2 and in the
The spatial search problem has been a focus of inves- scaling form for d ≤ 2.
tigation in recent years using different quantum algo- A diffusion process can be modeled either using con-
rithmic techniques, both analytical and numerical, and tinuous time and a first order time derivative, or using
in a variety of spatial geometries ranging from a single discrete time and a single time step evolution. In its
hypercube to regular lattices [2–7]. These studies have discrete version, it is generically described as a random
mainly looked at the asymptotic scaling forms of the al- walk, whereby a probability distribution evolves in a non-
gorithms, and have not varied the database size N and deterministic manner at every time step. Such random
its dimension d independently. In this work, we study walks have been used to tackle a wide range of graph
the specific case of searching for a marked vertex on a theory problems, usually with a local and translation-
d-dimensional hypercubic lattice with N = Ld vertices. ally symmetric evolution rule. We use a quantum ver-
We let N and d be independent, as well as determine the sion of this process, i.e. quantum random walks [9]. It
scaling prefactors, and thereby develop a broad picture of provides a unitary evolution of the quantum amplitude
how the dimension of the database (or the connectivity distribution, such that the amplitude at each vertex gets
of the graph) influences the spatial search problem. redistributed over itself and its neighbours at every time
step. It is worth noting that quantum random walks are
The quantum algorithmic strategy for spatial search is
deterministic, unlike classical random walks, with quan-
to construct a Hamiltonian evolution, where the kinetic
tum superposition allowing simultaneous exploration of
part of the Hamiltonian diffuses the amplitude distribu-
multiple possibilities. Several quantum algorithms have
tion all over the lattice and the potential part of the
used them as important ingredients, and an introductory
Hamiltonian attracts the amplitude distribution toward
overview can be found in Ref.[10].
On a periodic lattice with translational symmetry, spa-
tial propagation modes are characterized by their wave
∗ Electronic address: [email protected] vectors ~k. Quantum diffusion depends on the energy of
† Electronic address: [email protected] these modes according to U (~k, t) = exp(−iE(~k)t). The
2
lowest energy mode, ~k = 0, corresponding to a uni- arbitrarily separated vertices. To make U also local, we
form distribution, is an eigenstate of the diffusion op- split H in to block-diagonal Hermitian parts and then
erator and does not propagate. The slowest propagating exponentiate each part separately [13]. For a bipartite
modes are the ones with the smallest nonzero |~k|. The lattice, partitioning of H in to two parts (which we label
commonly used diffusion operator is the Laplacian, with “odd” and “even”) is sufficient for this purpose [14]:
E(~k) ∝ |~k|2 . The alternative Dirac operator, available Hfree = Ho + He . (6)
in a quantum setting, provides a faster diffusion of the
slowest modes with E(~k) ∝ |~k|. Its quadratically faster This partition is illustrated in Fig.1 for d = 1 and d = 2.
spread makes it better suited to quantum spatial search Each part contains all the vertices, but only half of the
algorithms [3, 4]. links attached to each vertex. Each link is associated
An automatic consequence of the Dirac operator is the with a term in Hfree providing propagation along it, and
appearance of an internal degree of freedom correspond- appears in only one of the two parts. H thus gets divided
ing to spin, whereby the quantum state becomes a multi- in to a set of non-overlapping blocks of size 2d × 2d (each
component spinor. These spinor components can guide block corresponds to an elementary hypercube on the lat-
the diffusion process, and be interpreted as the states of tice) that can be exactly exponentiated. The amplitude
a coin [3, 4]. While this is the only possibility for the distribution then evolves according to
continuum theory, another option is available for a lat- ψ(~x; t) = W t ψ(~x; 0) , W = Ue Uo = e−iHe τ e−iHo τ . (7)
tice theory, i.e. the staggered fermion formalism [11]. In
this approach, the spinor degrees of freedom are spread in Each block of the unitary matrices Uo(e) mixes ampli-
coordinate space over an elementary hypercube, instead tudes of vertices belonging to a single elementary hy-
of being in an internal space. We follow it to construct percube, and the amplitude distribution spreads in time
a quantum search algorithm on a hypercubic lattice, re- because the two alternating matrices do not commute.
ducing the total Hilbert space dimension by 2d and elim- Note that W does not perform evolution according to
inating the coin toss instruction. Hfree exactly. Instead, W = exp(−iHfree τ ) + O(τ 2 ).
Still, the truncation is such that W is exactly unitary,
i.e. W = exp(−iH̃τ ) for some H̃.
A. Bipartite Decomposition We adopt the convention where the walk operator W
is real. For d = 1, we set
The free particle Dirac Hamiltonian in d dimensions is ih i
Ho |xi = − (−1)x |x + (−1)x i , (8)
2
Hfree = −i~ ~ + βm .
α·∇ (1) i h i
He |xi = (−1)x |x − (−1)x i . (9)
On a hypercubic lattice, with the simplest discretization 2
of the gradient operator, The resultant Hamiltonian blocks are HoB = −σ2 /2, and
HeB = σ2 /2 when operating on the block with coordi-
1 nates flipped in sign. With (HoB )2 = (HeB )2 = 41 I,
∇n f (~x) = [f (~x + n̂) − f (~x − n̂)] , (2)
2
Uo(e) = cI − 2isHo(e) , |c|2 + |s|2 = 1 , (10)
and a convenient choice of basis, the anticommuting ma-
trices α
~ , β are spin-diagonalized to location dependent
signs: −2 −1 0 1 2
ψ → T ψ, H → T HT , †
T =
xd−1
αxd d αd−1 · · · αx2 2 αx1 1 ,(3) (a) o e o e
n−1
Y d
Y
αn → (−1)xj , β→ (−1)xj β . (4)
j=1 j=1 e
e
With this choice, translational invariance holds in steps
11111
00000 01 010,1 011,1
11111
00000
of 2 (instead of 1), and the squared Hamiltonian,
00000
11111
o 00000
11111
00000
11111 00000
11111 o
2
Hfree = −∇ ~ ·∇
~ + m2 , (5)
(b) 00000
11111
−1,001 00000
11111
010,0 011,0
2
has eigenvalues n sin (kn )+m2 on a hypercubic lattice.
P e e
Inclusion of a mass term slows down the diffusion process, −1,−1
11111
00000 01 010,−1 01
11111
00000
but it also regulates the ~k = 0 mode. In the present 00000
11111 00000
11111
article, we set m = 0; in an accompanying article [12], 00000
11111
o
00000
11111 o
we investigate the advantage a nonzero mass offers when 00000
11111 00000
11111
the problem has an infrared divergence.
Even when the Hamiltonian H is local, the discrete FIG. 1: Bipartite decomposition of the hypercubic lattice in
time evolution operator U = exp(−iHτ ) may connect to odd and even parts: (a) for d = 1, (b) for d = 2.
3
Then the walk operator becomes Exponentiation of this potential produces a phase change
for the amplitude at the marked vertex. For the steep-
c s
est attraction of the quantum random walk toward the
W = Ũ C , C = UoB = , (12) marked vertex, it is optimal to choose V0 so as to make
−s c
X the corresponding evolution phase maximally different
Ũ |Xi = c|Xi − s (±σ± )|X ± 1i . (13) from 1, i.e. e−iV0 τ = −1. The sign provided by β does
± not matter in this case, and the evolution phase becomes
the binary oracle,
The operator C = UoB just mixes the components of Ψ
within the block. The first term of the operator Ũ is sta- R = I − 2|~0ih~0| . (18)
tionary, while the other moves the amplitude to neigh- The search algorithm alternates between diffusion and
bouring blocks. The movement is accompanied by chi- oracle operators—a discrete version of Trotter’s formula
rality flip, a characteristic feature of the Dirac opera- involving Ho , He and V —yielding the evolution
tor, because of the raising and lowering Pauli operators
σ± = (σ1 ± iσ2 )/2. ψ(~x; t1 , t2 ) = [W t1 R]t2 ψ(~x; 0, 0) . (19)
In d dimensions, the preceding structure generalises
to 2d × 2d Hamiltonian blocks that can be expressed in Here t2 is the number of search oracle queries, and t1 is
terms of tensor products of Pauli matrices [15]. When the number of walk steps between queries. Both should
operating on hypercubes with coordinate labels {0, 1}⊗d, be minimised to find the the quickest solution to the
search problem.
d Since this algorithm iterates a unitary operator on the
1 X ⊗(d−j) ⊗(j−1) initial state, it produces periodic results. As a function of
HoB = − I ⊗ σ2 ⊗ σ3 , (14)
2 j=1 the number of iterations, the probability of being at the
marked vertex first increases, reaches a peak value P after
and HeB = −HoB when operating on a hypercube with t2 search oracle queries, then decreases toward zero, and
all coordinates flipped in sign. Note that Eq.(14) is the thereafter keeps on repeating this cycle. Grover’s algo-
sum of d terms, which mutually anticommute and whose rithm is designed to evolve the quantum state in a two-
squares are proportional to identity. This is the charac- dimensional Hilbert space (spanned by the initial and
teristic signature of the Dirac Hamiltonian, Eq.(1). The marked states), and is able to reach P = 1. That does
block-diagonal matrices satisfy Ho2 = He2 = d4 I, and ex- not hold for spatial search, and the resultant values of P
ponentiate to are less than 1. The remedy is to augment the algorithm
by the amplitude amplification procedure [16], to find
2 the marked vertex with Θ(1) probability. The complex-
Uo(e) = cI − is √ Ho(e) , |c|2 + |s|2 = 1 . (15) ity of the algorithm is then characterised by the effective
d √
number of search oracle queries, t2 / P .
√
The parameter s = sin( dτ /2) can be optimised, to
achieve the fastest diffusion across the lattice. Note that
C. Complexity Bounds
the d-dimensional walk is not the tensor production of d
one-dimensional walks.
Again separating the degrees of freedom within each Spatial search obeys two simple lower bounds. One
~
local hypercube as ~x ≡ X⊗{0,-1} ⊗d arises from the fact that while the marked vertex could
, the location depen-
be anywhere on the lattice, one step of the local walk
dent signs can be rewritten as operators acting on the
can move from any vertex to only its nearest neighbours.
spinor (or coin) degrees of freedom. The walk operator
Since the marked vertex cannot be located without reach-
takes the form: W = Ũ C, C = UoB , and
ing it, the worst case scenario on a hypercubic lattice re-
~ = c|Xi
~ quires Ω(dL) steps. This bound is the strongest in one
Ũ |Xi (16) dimension, where quantum search is unable to improve
d
s X X ⊗(j−1) ⊗(d−j) ~
on the O(N ) classical search.
− √ (I ⊗ (±σ± ) ⊗ σ3 )|X ± ĵi . The other bound follows from the fact that spatial
d ± j=1
search cannot outperform Grover’s optimal algorithm,
4
√
and so it must require Ω( N ) oracle queries. That is II. OPTIMISATION OF PARAMETERS
independent of d, and stronger than the first bound for
d > 2. As a matter of fact, the first bound weakens with The fastest search amounts to finding the shortest uni-
increasing d, as the number of neighbours of a vertex in- tary evolution path between the initial state |si and the
crease and steps required to go from one corner of the marked state |~0i. This path is a geodesic arc on the uni-
lattice to another decrease. In analogy with mean field
tary sphere from |si to |~0i, and Grover’s optimal algo-
theory behaviour of problems in statistical mechanics,
rithm strides along this path perfectly. In our algorithm,
we can thus expect that in the d → ∞ limit the local-
Eq.(19), we have replaced Grover’s optimal diffusion op-
ity restriction on the walk would become irrelevant and
erator, G = 2|sihs| − 1, with the walk operator W t1 . So
the complexity of spatial search would approach that of
to optimise our algorithm, we need to tune the param-
Grover’s algorithm. (Note that the maximum value of d
eters appearing in W t1 , i.e. s (or c) and t1 , such that
is log2 N for finite N .) Our results
√ in this work demon- W t1 R approximates a rotation in the two-dimensional
strate that not only is the Ω( N ) complexity scaling |si-|~0i subspace by the largest possible angle.
achievable for d > 2, but one can get pretty close to the The operator G has |si as an eigenstate with eigen-
asymptotic prefactor π/4 as well. value 1. All other states orthogonal to√|si, in particular
√
Combined together, the two √ bounds make the complex- the combination |s⊥ i = (|si− N |~0i)/ N − 1 in the |si-
ity of spatial search Ω(dN 1/d ,
√ N ). The two bounds are |~0i subspace, are its eigenstates with eigenvalue −1. The
of the same magnitude, Ω( N ), for the critical case of walk operator W = Ue Uo also has |si as an eigenstate
d = 2. It is a familiar occurrence in statistical mechan- with eigenvalue 1. However, its other eigenvalues are
ics of critical phenomena that an interplay of different spread around the unit circle, and evolution under W t1 R
dynamical features produces logarithmic correction fac- does not remain fully confined to the |si-|~0i subspace. If
tors in critical dimensions due to infrared divergences. the outward diffusion is not controlled, the probability of
The same seems to be true for spatial search in d = 2, remaining in the |si-|~0i subspace would decay exponen-
where algorithms are slowed down by extra logarithmic tially with the number of iterations. To reach the marked
factors [3–5]. It is an open question to design algorithms, state with a constant probability, therefore, parameters
perhaps using additional parameters, that suppress the must be tuned so that part of the outward diffusion sub-
logarithmic factors as much as possible. We look at the sequently returns to the |si-|~0i subspace.
special d = 2 case in an accompanying article.
The way the lower bounds arise in spatial search also
illustrates an interplay of two distinct physical princi- A. Analytical Criteria
ples, special relativity (or no faster than light signaling)
and unitarity. It is well-known that the two are compati- The optimisation condition that makes W t1 as close
ble, but just barely so, in the sense that physical theories an approximation to G as possible can be formulated in
that are unitary but not relativistic or relativistic but not several different ways. Though they all lead to the same
unitary exist. Furthermore, the best algorithms should result, describing them separately is instructive.
arise in a framework that respects both the principles, (1) Maximise the overlap of W t1 and G, i.e.
i.e. relativistic quantum mechanics. In spatial search, X
locality of the quantum walk and the square-root speed T r(W t1 G) = T r(2|sihs|−W t1 ) = 2− hi|W t1 |ii . (20)
up produced by the Dirac equation (through change in i
the dispersion relation) follow from special relativity. On
the other hand, optimality of square-root speed up pro- hi|W t1 |ii is the amplitude for the random walk to return
vided by Grover’s algorithm is a consequence of unitarity to the starting state |ii after t1 time steps. Since W is
[17, 18]. Why these two distinct physical principles lead translationally invariant along each coordinate direction
to the same scaling constraint is not understood, and is in steps of 2, we need to evaluate hi|W t1 |ii only for states
a really interesting question to explore. At present, how- |ii in an elementary hypercube. Now, any closed path
ever, we have nothing more to add. on a hypercubic lattice takes an even number of steps
along each coordinate direction, and all location depen-
We point out that preparation of the unbiased initial dent propagation signs (cf. Eq.(4)) get squared to 1 in
state for the search problem, i.e. the translationally
P √ in- the process. As a result, hi|W t1 |ii is independent of |ii,
variant uniform superposition state |si = x |~xi/ N , is and the optimisation condition becomes the minimisation
not at all difficult using local directed walk steps. For of A(t1 ) ≡ h~0|W t1 |~0i.
instance, one can start at the origin, step by step trans- (2) Make |s⊥ i approximate an eigenvector of W t1 , with
fer the amplitude to the next vertex along an axis, and an eigenvalue approaching −1, i.e. minimise
achieve an amplitude L−1/2 at all the vertices on the axis
after L steps. Repeating the procedure for each remain- 1
hs⊥ |W t1 |s⊥ i =
ing coordinate direction produces the state |si after dL − 1 + N A(t1 ) , (21)
N −1
steps in total. Clearly, this preparation does not add to
the complexity of the algorithm. which happens to be the same condition as given earlier.
5
qP
In addition, unitarity of the evolution operator implies exp(±iτ 2
j sin kj ), with the eigenphases in the inter-
√ √ 2
2 val [−τ d, τ d]. The average value of Hfree is d/2,
p and
|hs⊥ |W t1 |s⊥ i| ≤ 1 =⇒ − 1 + ≤ A(t1 ) ≤ 1 . (22)
N the corresponding eigenvalues of W are exp(±iτ d/2).
We find that this average value plays an important role
(3) Maximise the rotation provided by the operator
in determination of the optimal parameters.
W t1 R along the |si-|~0i subspace. This rotation is given
by the projection
Probability
t =1
portant fact that all optimal features appear simultane- 1
Probability
t =2
1
0.05
Probability
t1 = 1
0.1 0
30
0.05 20 30
20
0 10 10
0 500 1000 1500 0 0
Time
Probability
t1 = 2
0.1 0.1
Probability
t =3
1
0.05 0.05
0
0 500 1000 1500 0
30
Time 30
20
20
10 10
Probability
t1 = 3
0.1 0 0
0.05
0
0.1
Probability
Time 0.05
Probability
t1 = 4 0
0.1 30
20 30
0.05 20
10 10
0 0 0
0 500 1000 1500
Time
FIG. 3: (Color online) Probability distribution for the spatial
search problem on a 323 lattice, at the instance when the
FIG. 2: (Color online) Time evolution of the probability at the probability at the marked vertex (16, 16, 16) attains its peak
√
marked√vertex for the spatial search problem on a 323 lattice. value. The displayed results are for the z = 16 slice. s = 1/ 2
s = 1/ 2 and t1 increases from 1 (top) to 4 (bottom). and t1 increases from 1 (top) to 4 (bottom).
7
1
110
d=3
100 d=4
1000 P 0.8
d=5
90 t
2 d=6
80 d=7
2d P
0.6
70
60
0.4
50
40
0.2
30 0.4 0.5 0.6 0.7 0.8
0.4 0.5 0.6 0.7 0.8 s
s
FIG. 5: (Color online) Optimisation of s for t1 = 3 in different
FIG. 4: (Color online) Optimisation of s for t1 = 3 on a 323 dimensions. Lattice sizes L = 32, 16, 16, 8, 8 were used for
lattice, using peak probability P as well as oracle queries t2 . d = 3, 4, 5, 6, 7, respectively.
8
√
W t1 is to G. We computed A(t1 ), by starting with unit 1/ 2 for t1 = 3 and s = 0.5410 for t1 = 4.
amplitude at the marked vertex, and then measuring the To extract the scaling properties of the algorithm, we
amplitude at the marked vertex after t1 walk steps. At studied the behaviour of P and t2 , as a function of L and
the beginning of this subsection we mentioned that check- d. We found that the finite size effects in our data, as
ing A(t1 ) is not as elaborate an optimisation test as us- L → ∞ at fixed d, are well described by series in inverse
ing the full search algorithm. Nevertheless, the results powers of L. In Figs.6-7, we show some of our results
corroborate our optimisation of spatial search: The min- with the fitting functions:
imum value of A(t1 ) is reasonably close to −1, and occurs
at approximately the same value of s (and hence θ) that b1 t2 b2
P = a1 + , √ = a2 + . (26)
provides the optimal search (the mismatch decreases with L N L
increasing d). We also observe that A(t1 ) gets closer to
−1, suggesting that the algorithm becomes more efficient, All the fit parameters are listed in Table II, where error
with increasing d as well as t1 . refers to the r.m.s. deviation of the data from the fit. We
Given the strong correlation between the optimal val- do not have sufficient data for d = 8 and d = 9, to make
ues of s and t1 , the computational cost of the algorithm accurate fits or to see the asymptotic behaviour. Our
is minimised by choosing the smallest t1 . For t1 = 1, analysis, therefore, relies on the patterns seen for d = 3
Eq.(25) does not have a solution with θ ≈ π, the optimal to d = 7, while we use d = 8 and d = 9 values only for
value of s is very close to 1, and our algorithm does not consistency checks.
work well there. Then t1 = 2 is the choice that min- We observe the following features:
imises the number of walk steps in the algorithm. Even (1) There is not much difference among the a1 and a2
when the emphasis is on optimising P and t2 , most of values for different optimised s-t1 pairs. This confirms
the improvement can be obtained by going from t1 = 2 our earlier inference that implementing our algorithm for
to t1 = 3, and we need not go beyond that. t1 = 2 minimises the running cost.
(2) P approaches a constant as L → ∞, with a1 decreas-
ing approximately as 2−d with increasing d. As men-
III. SIMULATION RESULTS tioned before, this is a consequence of the fact that in
the staggered fermion implementation of the Dirac op-
erator, only the degree of freedom corresponding to the
We carried out numerical simulations of the quantum location of the marked vertex on the elementary hyper-
spatial search problem, with a single marked vertex and cube participates in the search process. Since the number
lattice dimension ranging from 3 to 9. The matrices Uo(e) of vertices in an elementary hypercube is 2d , P is upper
are real with our conventions, and that was convenient bounded by 2−d . Our algorithm achieves that bound up
for simulations. The optimal values of s-t1 pairs depend to a constant multiple close to 1.
a little on the lattice size and dimension. We are only (3) b1 decreases toward zero with increasing d, which
interested in the asymptotic behaviour of the algorithm, is also true for |b2 | to a large extent. Thus the small-
however, so we used the same parameter values for all est d = 3 has the largest finite size corrections to the
lattice sizes and dimensions: s = 0.9539 for t1 = 2, s =
0.35
0.12
0.3
0.1 d=3
d=3 d=4
0.25
d=4 d=5
0.08 d=5 d=6
t2 / N
d=8
0.06
P
0.15 d=9
0.04
0.1
0.02 0.05
0 0
5 10 15 20 25 5 10 15 20 25
log2 N log2 N
FIG. 6: (Color online) Peak probability at the marked vertex FIG. 7: (Color online) Number of search oracle queries as a
as a function of database size (ranging from 28 to 227 ) in differ- function of database size (ranging from 28 to 227 ) in different
ent dimensions. The points are the data from the simulations dimensions. The points are the data from √ the simulations
with t1 = 3, and the curves are the fits P = a1 + (b1 /L). with t1 = 3, and the curves are the fits (t2 / N ) = a2 +(b2 /L).
9
√
TABLE II: Fit parameters for peak probability P and search oracle queries t2 / N vs. L.
√
s t1 d L a1 b1 Error a2 b2 Error a2 / a1
3 64,128,256,512 0.0911 0.0964 2.43×10−5 0.3237 0.1440 4.57×10−4 1.072
4 16,32,48,64 0.0522 0.0100 3.02×10−5 0.2167 −0.0832 1.05×10−3 0.948
5 12,16,24,32 0.0275 0.0009 1.70×10−6 0.1486 −0.0243 2.39×10−4 0.896
0.9539 2
6 12,14,16,18 0.0141 0.0001 2.31×10−7 0.1043 −0.0208 1.78×10−4 0.878
7 6,8,10 0.0072 −0.0004 1.40×10−6 0.0757 −0.0338 2.47×10−4 0.892
8 6,8 0.0036 — 3.50×10−6 0.0509 — 7.23×10−5 0.848
9 6 0.0018 — — 0.0356 — — 0.839
−6 −3
3 64,128,256,512 0.0968 0.0920 2.73×10 0.3141 −0.0306 1.23×10 1.010
4 16,32,48,64 0.0542 0.0076 1.46×10−5 0.2097 0.0151 6.71×10−4 0.901
√ 5 12,16,24,32 0.0283 0.0010 4.66×10−6 0.1470 −0.0300 2.12×10−4 0.874
1/ 2 3
6 12,14,16,18 0.0145 0.0001 5.79×10−7 0.1035 −0.0269 1.88×10−4 0.860
7 6,8,10 0.0074 −0.0003 1.46×10−6 0.0750 −0.0296 3.39×10−4 0.872
8 6,8 0.0037 — 3.00×10−6 0.0498 — 4.55×10−5 0.819
9 6 0.0019 — — 0.0353 — — 0.810
3 64,128,256,512 0.0984 0.0936 1.84×10−5 0.3123 −0.1239 8.46×10−4 0.996
4 16,32,48,64 0.0548 0.0087 2.24×10−5 0.2103 −0.0500 3.57×10−4 0.898
5 12,16,24,32 0.0285 0.0013 8.05×10−6 0.1455 −0.0142 2.25×10−4 0.862
0.5410 4
6 12,14,16,18 0.0146 0.0002 7.67×10−7 0.1015 0.0043 6.28×10−5 0.840
7 6,8,10 0.0074 −0.0003 2.86×10−6 0.0733 −0.0194 2.01×10−4 0.852
8 6,8 0.0037 — 4.50×10−6 0.0505 — 4.39×10−4 0.830
9 6 0.0019 — — 0.0353 — — 0.810
asymptotic L → ∞ behaviour. This suggests that as the This is in agreement with the fact that, with only one
number of neighbours of a vertex increase, the finite size degree of freedom per elementary hypercube participat-
of the lattice becomes less√and less relevant. ing in the search process, the effective number of vertices
(4) t2 is proportional to N as L → ∞, with a2 de- being searched is N/2d . √
creasing approximately as 2−d/2 with increasing pd. Thus (5) In the combination t2 / P , describing the effective
t2 scales with the database size as (L/2)d/2 = N/2d. number of oracle queries for our algorithm, the factors of
2d arising from the number of vertices √ in an elementary
√
hypercube fully cancel. That makes t2 / P scale as N ,
√
and a2 / a1 describes the complexity scaling of our al-
2 gorithm. As listed in the rightmost column of Table II,
√
1 a2 / a1 shows a gradual decrease with increasing d, and
0 log2 a1
our results are just above the corresponding value π/4 for
log2 a2 Grover’s optimal algorithm. More explicitly, our result
−2 a2 / a1
√ for d = 3 is about 25% above π/4, decreasing to about
10% above π/4 for d = 7. These values imply that our
−4 algorithm improves in efficiency with increasing d, and
is not too far from the optimal behaviour even for the
smallest dimension d = 3.
−6
To analyse the dimension dependence of our algorithm
in more detail, we fit the values in Table II to the func-
−8 tional forms,
√
TABLE III: Fit parameters for log2 a1 , log2 a2 and a2 / a1 vs. d.
s t1 Fitted d c1 d1 Error c2 d2 Error c3 d3 Error
0.9539 2 −0.553 −0.938 4.77×10−2 −0.085 −0.526 2.53×10−2 0.721 0.995 1.71×10−2
√
1/ 2 3 3,4,5,6,7,8 −0.458 −0.947 4.48×10−2 −0.138 −0.521 2.57×10−2 0.729 0.791 1.63×10−2
0.5410 4 −0.421 −0.951 3.78×10−2 −0.151 −0.521 2.09×10−2 0.725 0.761 1.32×10−2
The fit parameters for the three different optimised s- d) available. For our staggered fermion implementation
t1 pairs are listed in Table III. They support our earlier of the Dirac operator, L has to be even, and the small-
scaling observations: d1 close to −1 means that P scales est L possible is 4. Because of small values of d that we
−d
roughly as 2p , and d2 close to −0.5 means that t2 scales have worked with, and discrete nature of t2 , our data for
roughly as N/2d . Interpreting Grover’s algorithm as L = 4 do not show smooth asymptotic behaviour. We
the d → ∞ limit of the spatial search algorithm, we ex- therefore omitted L = 4 from our analysis, and our best
pect c3 to be close to π/4. It turns out to be somewhat results are for L = 6.
smaller, but is not very accurately determined due to siz- We can fit the data reasonably well as
able correction from d3 for the values of d that we have.
t2 bl
We believe that simulations for larger lattice sizes and √ = al + . (29)
higher dimensions can remedy this problem. NP d
To look at our data in a different manner, we analyse The fit parameters for the three different optimised s-t1
√
the scaling behaviour of t2 / N P as a function of the pairs are listed in Table IV. We note that al is close to
database size. In Fig.9, we plot a subset of the data, il- π/4 when data for d > 6 are available, but it cannot be
√
lustrating how t2 / N P behaves for fixed lattice size L accurately determined using data for small d only due to
when the database size is changed by changing d. The ap- sizable corrections from bl .
proach to the asymptotic
√ behaviour is particularly clear
in this form, with t2 / N P decreasing toward π/4 as the
database size increases. It is also obvious that, for fixed IV. RESULTS FOR MULTIPLE
MARKED VERTICES
N , our algorithm improves in efficiency with decreasing
L (or equivalently with increasing d). This is a conse-
quence of the increase in the number of neighbours of We also carried out a few simulations of spatial search
a vertex with increasing d. An important implication is with more than one marked vertex. The change from
that, given a database of size N , it is best to implement the single marked vertex algorithm is that the search or-
the algorithm using the smallest L (and hence the largest acle now flips the sign of amplitudes at several distinct
vertices, say M . To see clear patterns in the results, we
needed to keep the marked vertices well separated and
avoid interference effects.
1.1 With the staggered fermion implementation of the
Dirac operator, it matters whether the marked vertices
1 √
L=6 TABLE IV: Fit parameters for t2 / N P vs. d at fixed L.
L=8
t2 / N P
L=32 6 5,6,7,8,9
0.9539 2 8 4,5,6,7,8 0.805 0.293 5.31×10−4
16 3,4,5,6 0.663 1.132 1.73×10−2
π/4 32 3,4,5 0.625 1.304 5.77×10−3
Grover
6 4,5,6,7,8,9 0.819 0.006 1.28×10−2
√ 0.803 0.234 3.28×10−3
1/ 2 3 8 4,5,6,7,8
0.7
5 10 15 20 25 16 3,4,5,6 0.773 0.471 6.46×10−3
log2 N 32 3,4,5 0.724 0.705 3.23×10−3
√ 6 4,5,6,7,8,9 0.837 −0.092 1.35×10−2
FIG. 9: (Color online) t2 / N P as a function of the database
size for different lattice sizes. The points 0.5410 4 8 4,5,6,7,8 0.791 0.272 3.79×10−3
√ are the data for
t1 = 3, and the curves are the fits (t2 / N P ) = al + (bl /d). 16 3,4,5,6 0.767 0.450 1.29×10−3
Also shown is the limiting value corresponding to Grover’s 32 3,4,5 0.711 0.726 1.13×10−3
optimal algorithm.
11
p
belong to the same corner of the elementary hypercube i.e. proportional to N/M .
or to different corners. So we considered various hyper-
cube locations for the marked vertices. In Table V, we
compare our illustrative results for two and three marked
vertices with those for a single marked vertex. The val- V. SUMMARY
ues for peak probability √ P and corresponding time t2
were obtained with s = 1/ 2 and t1 = 3 on a 643 lattice.
When the marked vertices belong to the same corner of We have formulated the spatial search problem us-
the elementary hypercube (e.g. (0,32,32) and (32,32,32)), ing staggered fermion discretisation of the Dirac oper-
they involve the same degree of freedom. In that case, ator on a hypercubic lattice in arbitrary dimension. Our
we observe that P decreases by a factor of M and t2 de- search strategy, Eq.(19), mimics that of Grover’s algo-
√
creases by a factor of M . On the other hand, when rithm. The locality restriction on the walk operator be-
the marked vertices belong to different corners of the ele- comes less and less relevant as the dimensionality of the
mentary hypercube (e.g. (0,32,33) and (32,32,32)), they space increases, and we expect to reach the optimal scal-
involve different degrees of freedom. In that case, we ing behaviour of Grover’s algorithm as d → ∞.
find that P and t2 are more or less the same as for the We have verified our theoretical expectations by nu-
single marked vertex case. This pattern is also followed merical simulations of the algorithm for d = 3 to d = 9.
when some marked vertices are at the same corner of the We clearly demonstrate the approach to the d → ∞
elementary hypercube and some at different corners. limit, and find that even for d = 3 our algorithm is only
We can infer the following equipartition rule from these 25% less efficient. From a computational cost point of
observations. A fixed peak probability (upper bounded view, for a fixed database size N , our best parameters
by 2−d ) is available for each corner degree of freedom are t1 = 2 and the largest d available. With the stag-
of the elementary hypercube. Multiple marked vertices gered fermion implementation, our algorithm works in
corresponding to the same degree of freedom share this total Hilbert space dimension N . That is a big reduction
peak probability equally, while different degrees of free- from the total Hilbert dimension 2d N required by the
dom evolve independently of each other. Apart from this algorithms that use coin or internal degrees of freedom
caveat, the dependence of t2 on M for our spatial search (for the best d = Θ(ln N ), 2d = O(N ) is substantial),
algorithm is the same as in the case of Grover’s algorithm, and makes our exercise worthwhile.
[1] L.K. Grover, Proceedings of STOC’96 (ACM Press, New [8] L.K. Grover, Pramana 56 (2001) 333,
York, 1996), p. 212, arXiv:quant-ph/9605043. arXiv:quant-ph/0109116.
[2] N. Shenvi, J. Kempe and K. Birgitta Whaley, Phys. Rev. [9] Y. Aharonov, L. Davidovich and N. Zagury, Phys. Rev.
A67 (2003) 052307, arXiv:quant-ph/0210064. A48 (1993) 1687.
[3] A. Ambainis, J. Kempe and A. Rivosh, Proceedings of [10] J. Kempe, Contemporary Physics 44 (2003) 307,
ACM-SIAM SODA’05 (ACM Press, New York, 2005), arXiv:quant-ph/0303081.
p. 1099, arXiv:quant-ph/0402107. [11] L. Susskind, Phys. Rev. D16 (1977) 3031.
[4] A.M. Childs and J. Goldstone, Phys. Rev. A70 (2004) [12] A. Patel, K.S. Raghunathan and Md.A. Rahaman, Phys.
042312, arXiv:quant-ph/0405120. Rev. A82 (2010) 032331, arXiv:1003.5564.
[5] A. Tulsi, Phys. Rev. A78 (2008) 012310, arXiv:0801.0497. [13] A. Patel, K.S. Raghunathan and P. Rungta, Phys. Rev.
[6] B. Hein and G. Tanner, J. Phys. A42 (2009) 085303, A71 (2005) 032347, arXiv:quant-ph/0405128.
arXiv:0906.3094. [14] This is in spite of the fact that Dirac spinors require
[7] G. Abal, R. Donangelo, F.L. Marquezino and R. Por- 2[(d+1)/2] components in d dimensions. For example, in
tugal, Math. Struct. Comp. Sci. (2010), to appear, d = 3, a Rubik’s cube can have the central cube labeled
arXiv:1001.1139. “o” and the eight corner cubes labeled “e”.
12
[15] A. Patel, K.S. Raghunathan and P. Rungta, Pro- and H.E. Brandt (AMS, Providence, 2002), p. 53,
ceedings of the Workshop on Quantum Information, arXiv:quant-ph/0005055.
Computation and Communication (QICC-2005), IIT [17] C. Zalka, Phys. Rev. A60 (1999) 2746,
Kharagpur, India, (Allied Publishers, 2006), p. 41, arXiv:quant-ph/9711070.
arXiv:quant-ph/0506221. [18] C. Bennett, E. Bernstein, G. Brassard and U.
[16] G. Brassard, P. Hoyer, M. Mosca and A. Tapp, in Quan- Vazirani, SIAM J. Comput. 26 (1997) 1510,
tum Computation and Information, AMS Contempo- arXiv:quant-ph/9701001.
rary Mathematics Series Vol. 305, eds. S.J. Lomonaco