Quantum walk search explained

In the context of quantum computing, the quantum walk search is a quantum algorithm for finding a marked node in a graph.

The concept of a quantum walk is inspired by classical random walks, in which a walker moves randomly through a graph or lattice. In a classical random walk, the position of the walker can be described using a probability distribution over the different nodes of the graph. In a quantum walk, on the other hand, the walker is represented by a quantum state, which can be in a superposition of several locations simultaneously.[1]

Search algorithms based on quantum walks have the potential to find applications in various fields, including optimization, machine learning, cryptography, and network analysis.[2] The efficiency and probability of success of a quantum walk search depend heavily on the structure of the search space. In general, quantum walk search algorithms offer an asymptotic quadratic speedup similar to that of Grover's algorithm.[3] [4]

One of the first works on the application of quantum walk to search problems was proposed by Neil Shenvi, Julia Kempe, and K. Birgitta Whaley.[5]

Classical problem description

Given a search space

X

and a subset

M\subseteqX

which contains the marked elements, a probabilistic search algorithm samples an element

x\inX

uniformly at random at each step, until it finds a marked element from

M

. If we define

\epsilon=|M|/|N|

as the fraction of marked elements, a procedure of that kind must be repeated

O(1/\epsilon)

times to find a marked element.

If we have information about the structure of

X

we can model it as a graph

G(V,E)

, where every vertex

V=\{v1,...,vn\}

represents a sample from the search space with

|X|=n

, while the edges represent the conditional probability to sample the next element starting from the current sample.

We perform a search by starting from a random vertex

v1

and, if it does not belong to

M

, we sample the next vertex

v2

among the ones connected to

v1

. This procedure is known as random walk search. To have a probability close to

1

to find the marked node, we need to take asymptotically

O(1/\epsilon\delta)

steps on the graph, where the parameter

\delta

is the spectral gap associated to the stochastic matrix

P

of the graph.[6]

To assess the computational cost of a random walk algorithm, one usually divides the procedure into three sub-phases such as Setup, Check, and Update, and analyses their cost.

SetupThe setup cost

S

refers to the initialization of the stationary distribution over the vertices of the graph.
UpdateThe update cost

U

is the cost to simulate a transition on the graph according to the transition probability defined in

P

.
CheckThe check cost

C

is the cost to verify if the current element belongs to the set

M

.

The total cost of a random walk search algorithm is

S+1l(
\epsilon
1
\delta

U+Cr)

. The greedy version of the algorithm, where the check is performed after every step on the graph has a complexity of
S+1
\epsilon\delta

l(U+Cr)

. The presence of the spectral gap term

\delta

in the cost formulation can be thought of as the minimum number of steps that the walker must perform to reach the stationary distribution. This quantity is also known as mixing time.[7]

Algorithm description

The quantum walk search algorithm was first proposed by Magniez et al., also known as MNRS algorithm, and is based on the quantum walk formulation proposed by Mario Szegedy. The walk is performed on the directed edges of the graph so to represent the quantum state associated with the search space we need two quantum registers

|i\rangle|j\rangle

, which correspond to the edge from

vi

to

vj

. To easily understand how it works, the algorithm can be explained through its geometric interpretation. We first define

|pi\rangle=\sumj\sqrt{Pij

} |j\rangle as the uniform superposition over the neighbours of

|i\rangle

. We additionally define the superposition over the marked and non-marked states, often referred to as the good and bad states, as
|G\rangle=1
\sqrt{|M|
}\sum_|i\rangle |p_\rangle and
|B\rangle=1
\sqrt{X-|M|
}\sum_|i\rangle |p_\rangle

where

M

is the set of marked elements. The uniform superposition over all the edges

U

can be viewed a combination of good and bad states.
|U\rangle=1
\sqrt{X
}\sum_|i\rangle |p_\rangle = \sin(\theta)|G\rangle +\cos(\theta)|B\rangle with

\theta=\arcsin(\sqrt{\epsilon})

.[8]

The algorithm is composed of the following steps:

  1. Initialize the quantum state with

|U\rangle

, usually it is done by some state preparation routine.
  1. Repeat for

O(1/\sqrt{\epsilon})

:
    • Perform a reflection through

|B\rangle

    • Perform a reflection through

|U\rangle

  1. Measure the first quantum register and check if it is marked

Since the way the algorithm finds a marked element is based on the amplitude amplification technique, the proof of correctness is similar to the one of Grover's algorithm (which can also be viewed as a special case of a quantum walk on a fully connected graph). The two reflections through

|U\rangle

and

|B\rangle

exhibit the effect of moving the quantum state toward the good state. After

k

applications of the reflections the state can be written as

\sin((2k+1)\theta)|G\rangle+\cos((2k+1)\theta)|B\rangle

, and by setting

k\thickapprox

\pi
4\theta

=O(1/\sqrt{\epsilon})

we have that

\sin((2k+1)\theta)\thickapprox1

which yields the good state with a high probability.
First reflectionThe first reflection has the effect of checking if the current vertex is marked and applying a phase shift equal to

-1

if it is so. This is a common procedure in many quantum algorithms based on amplitude amplification and can be realized through a quantum oracle function that verifies the condition

|i\rangle\inM

.

W

which must reflect the structure of the graph we are exploring. The walk operator can be defined as

W=ref(l{B})ref(l{A})

where

ref(l{B})

and

ref(l{A})

are two reflections through the subspaces

l{A}=span\{|i\rangle,|pi\rangle\}

and

l{B}=span\{|pj\rangle,|j\rangle\}

. Since the eigenvalues of

W

are on the form

e\pm2i\theta

and the operator has a unique eigenvalue equal to

1

corresponding to

|U\rangle

given by

\theta=0

, we can perform a phase estimation with precision

O(1/\sqrt{\delta})

to find the unique eigenvalue. The precision of the reflection depends on the number of qubits used to estimate the phase.
ComplexityWith the same formalism used to estimate the cost of the classical random walk algorithm, the quantum costs can be summarised with:

|U\rangle

|U\rangle

|B\rangle

The total cost of the quantum walk search is

S+1
\sqrt{\epsilon
}\biggl(\fracU + C\biggr), which results in a quadratic speedup compared to the classical version. Compared to Grover's algorithm quantum walks become advantageous in the presence of large data structures associated with each quantum state, since in the first case they are entirely rebuilt at each iteration while in walks they are only partially updated in each step.[9]

Hypercube example

This is an example of how to apply the quantum walk search on a hypercube graph.[10] Although in the original description Szegedy quantum walks are used, for this example we show the use of coined quantum walk as it is more intuitive to understand. In any case, the two formalizations turn out to be equivalent under specific assumptions.[11]

The search space is a

n

-hypercube with

n=4

, it has

|V|=24

vertices and it has a degree equal to

4

. Each node

vi

can be labeled with a binary string of

4

bits and two nodes are connected by an edge if their Hamming distance is

1

. To set up the quantum walk search we need a coin register of dimension

l{H}n

to encode all the possible directions which a walker can choose and a vertex register of dimension
2n
l{H}
to represent the vertices.

The computational basis is

|d\rangle|v\rangle

with

\{d\inD=\{00,01,10,11\},v\inV=\{0000,0001,...,1111\}\}

.

The walk is performed by two operators:

C

is used to create the superposition over the possible directions

S

is used to take a step in the graph according to one direction

Thus, the walk operator is

W=SC

.

In the case of the hypercube graph, we can leverage the fact that the binary encoding of the vertices differ by only one bit for any couple of adjacent nodes to construct an efficient shift operator. The shift operator can be written as:

n
S=\sum
d=1
n
\sum
v=1

|d\rangle|ved\rangle\langled|\langlev|

where

ed

is the

d

-basis for the hypercube (if

n=4

the basis are

\{0001,0010,0100,1000\}

). For the coin there are multiple choices such as the Grover coin or the Fourier coin, one can choose the Grover coin to have an equal superposition over all the directions.

The algorithm works as follows:

  1. Repeat for

O(1/\sqrt{\epsilon})

    • Initialise the counting register for the phase in superposition
    • Perform a phase estimation on

W

with

O(1/\sqrt{\delta})

precision
    • Mark an auxiliary qubit if the estimated phase is

\tilde{\theta}=0

    • Un-compute auxiliary data structure
  1. Measure the vertex register

The shift operator is a key factor to the implementation on an efficient quantum walk, while for certain families of graph such as toroids and lattices, the shift is known, for non-regular graph the design of an effective shift operator is still an open challenge.[12]

Applications

J(n,k)

.[13]
Element distinctness Given a function

f

defined on

\{n\}

, it asks to find two distinct elements

i,j\in\{n\}

such that

f(i)=f(j)

if there exist such a pair.[14]
Matrix product verificationGiven three

n x n

matrices

A,B

and

C

, the problem asks to verify if

AB=C

or otherwise find the indices

i,j

such that

(AB)i,jCi,j

.
Triangle A triangle is a complete subgraph on three vertices part of an undirected graph

G

. Given the adjacent matrix of a graph the problem asks to find a triangle if there is any.

See also

References

  1. Book: Quantum walks and search algorithms . 2013 . Springer . 978-1-4614-6335-1 . Portugal . Renato . Quantum science and technology . New York Heidelberg . 17–37 . en.
  2. Kadian . Karuna . Garhwal . Sunita . Kumar . Ajay . 2021-08-01 . Quantum walk and its application domains: A systematic review . Computer Science Review . en . 41 . 100419 . 10.1016/j.cosrev.2021.100419 . 238207718 . 1574-0137.
  3. Book: Grover, Lov K. . Proceedings of the twenty-eighth annual ACM symposium on Theory of computing - STOC '96 . A fast quantum mechanical algorithm for database search . 1996-07-01 . https://dl.acm.org/doi/10.1145/237814.237866 . New York, NY, USA . Association for Computing Machinery . 212–219 . 10.1145/237814.237866 . 978-0-89791-785-8. 207198067 .
  4. Santos . Raqueline A. M. . 2016-08-26 . Szegedy's quantum walk with queries . Quantum Information Processing . 15 . 11 . 4461–4475 . 10.1007/s11128-016-1427-4 . 1603.05473 . 2016QuIP...15.4461S . 254989663 . 1570-0755.
  5. Shenvi . Neil . Kempe . Julia . Whaley . K. Birgitta . 2003-05-23 . A Quantum Random Walk Search Algorithm . Physical Review A . 67 . 5 . 052307 . 10.1103/PhysRevA.67.052307 . quant-ph/0210064 . 2003PhRvA..67e2307S . 8688989 . 1050-2947.
  6. Book: Magniez . Frederic . Nayak . Ashwin . Roland . Jeremie . Santha . Miklos . Proceedings of the thirty-ninth annual ACM symposium on Theory of computing . Search via quantum walk . 2007-06-11 . https://doi.org/10.1145/1250790.1250874 . STOC '07 . New York, NY, USA . Association for Computing Machinery . 575–584 . 10.1145/1250790.1250874 . 978-1-59593-631-8. 1918990 .
  7. Book: Levin . David Asher . Markov chains and mixing times . Peres . Yuval . American Mathematical Society . Elizabeth L. Wilmer, James G. Propp, David Bruce Wilson, American Mathematical Society . 2017 . 978-1-4704-2962-1 . Second . Providence, Rhode Island . 8–15.
  8. de Wolf . Ronald . 2019 . Quantum Computing: Lecture Notes . quant-ph . 1907.09415.
  9. Quantum Cost Models for Cryptanalysis of Isogenies . University of Waterloo . 2019-05-01 . Master Thesis . en . Samuel . Jaques. p 67-68.
  10. Web site: Quantum Walk Search Algorithm . 2023-07-05 . learn.qiskit.org . en.
  11. Wong . Thomas G. . 2017 . Equivalence of Szegedy's and Coined Quantum Walks . Quantum Information Processing . 16 . 9 . 215 . 10.1007/s11128-017-1667-y . 1611.02238 . 2017QuIP...16..215W . 254985379 . 1570-0755.
  12. Douglas . B. L. . Wang . J. B. . 2007 . Efficient quantum circuit implementation of quantum walks . quant-ph . 0706.0304 .
  13. Agong . Louis Anthony . Amarra . Carmen . Caughman . John S. . Herman . Ari J. . Terada . Taiyo S. . 2018-01-01 . On the girth and diameter of generalized Johnson graphs . Discrete Mathematics . en . 341 . 1 . 138–142 . 10.1016/j.disc.2017.08.022 . 257985351 . 0012-365X. free . 2304.02864 .
  14. Ambainis . Andris . 2007 . Quantum Walk Algorithm for Element Distinctness . SIAM Journal on Computing . en . 37 . 1 . 210–239 . 10.1137/S0097539705447311 . 0097-5397. 10.1.1.251.5460 .

Further reading

External links