Quantum walk search

From HandWiki

In the context of quantum computing, the quantum walk search is a quantum algorithm for finding a marked node in a graph.[1] 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 [math]\displaystyle{ X }[/math] and a subset [math]\displaystyle{ M \subseteq X }[/math] which contains the marked elements, a probabilistic search algorithm samples an element [math]\displaystyle{ x \in X }[/math] uniformly at random at each step, until it finds a marked element from [math]\displaystyle{ M }[/math]. If we define [math]\displaystyle{ \epsilon = |M|/|N| }[/math] as the fraction of marked elements, a procedure of that kind must be repeated [math]\displaystyle{ O(1/\epsilon) }[/math] times to find a marked element.[6]

If we have information about the structure of [math]\displaystyle{ X }[/math] we can model it as a graph [math]\displaystyle{ G(V,E) }[/math], where every vertex [math]\displaystyle{ V=\{v_{1},\dots, v_{n}\} }[/math] represents a sample from the search space with [math]\displaystyle{ |X|=n }[/math], while the edges represent the conditional probability to sample the next element starting from the current sample.[6]

We perform a search by starting from a random vertex [math]\displaystyle{ v_{1} }[/math]and, if it does not belong to [math]\displaystyle{ M }[/math], we sample the next vertex [math]\displaystyle{ v_{2} }[/math] among the ones connected to [math]\displaystyle{ v_{1} }[/math]. This procedure is known as random walk search. To have a probability close to [math]\displaystyle{ 1 }[/math] to find the marked node, we need to take asymptotically [math]\displaystyle{ O(1/\epsilon\delta ) }[/math] steps on the graph, where the parameter [math]\displaystyle{ \delta }[/math] is the spectral gap associated to the stochastic matrix [math]\displaystyle{ P }[/math] of the graph.[7]

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.[6]

Setup

The setup cost [math]\displaystyle{ S }[/math] refers to the initialization of the stationary distribution over the vertices of the graph.[6]

Update

The update cost [math]\displaystyle{ U }[/math] is the cost to simulate a transition on the graph according to the transition probability defined in [math]\displaystyle{ P }[/math].[6]

Check

The check cost [math]\displaystyle{ C }[/math] is the cost to verify if the current element belongs to the set [math]\displaystyle{ M }[/math]. [6]

The total cost of a random walk search algorithm is [math]\displaystyle{ S+\frac{1}{\epsilon}\biggl(\frac{1}{\delta}U + C\biggr) }[/math]. The greedy version of the algorithm, where the check is performed after every step on the graph has a complexity of [math]\displaystyle{ S+\frac{1}{\epsilon \delta}\biggl(U+ C\biggr) }[/math]. The presence of the spectral gap term [math]\displaystyle{ \delta }[/math] 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.[8]

Algorithm description

The quantum walk search algorithm was first proposed by Magniez et al.[7] , 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 [math]\displaystyle{ |i\rangle|j\rangle }[/math], which correspond to the edge from [math]\displaystyle{ v_{i} }[/math] to [math]\displaystyle{ v_{j} }[/math]. To easily understand how it works, the algorithm can be explained through its geometric interpretation. We first define [math]\displaystyle{ |p_{i}\rangle = \sum_{j} \sqrt{P_{ij}} |j\rangle }[/math] as the uniform superposition over the neighbours of [math]\displaystyle{ |i\rangle }[/math]. We additionally define the superposition over the marked and non-marked states, often referred to as the good and bad states, as

[math]\displaystyle{ |G\rangle=\frac{1}{\sqrt{|M|}}\sum_{i \in M}|i\rangle |p_{i}\rangle }[/math] and [math]\displaystyle{ |B\rangle=\frac{1}{\sqrt{X-|M|}}\sum_{i \not\in M}|i\rangle |p_{i}\rangle }[/math]

where [math]\displaystyle{ M }[/math] is the set of marked elements. The uniform superposition over all the edges [math]\displaystyle{ U }[/math] can be viewed a combination of good and bad states.

[math]\displaystyle{ |U\rangle=\frac{1}{\sqrt{X}}\sum_{i \in X}|i\rangle |p_{i}\rangle = \sin(\theta)|G\rangle + \cos(\theta)|B\rangle }[/math] with [math]\displaystyle{ \theta = \arcsin(\sqrt{\epsilon}) }[/math].[9]

Schematic view of quantum phase estimation on walk operator

The algorithm is composed of the following steps:

  1. Initialize the quantum state with [math]\displaystyle{ |U\rangle }[/math], usually it is done by some state preparation routine.
  2. Repeat for [math]\displaystyle{ O(1/\sqrt{\epsilon}) }[/math]:
    • Perform a reflection through [math]\displaystyle{ |B\rangle }[/math]
    • Perform a reflection through [math]\displaystyle{ |U\rangle }[/math]
  3. 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,[10] 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 [math]\displaystyle{ |U\rangle }[/math] and [math]\displaystyle{ |B\rangle }[/math] have the effect to move the quantum state toward the good state, after [math]\displaystyle{ k }[/math] applications of the reflections the state can be written as [math]\displaystyle{ \sin((2k+1)\theta)|G\rangle + \cos((2k+1)\theta)|B\rangle }[/math] and by setting [math]\displaystyle{ k\thickapprox \frac{\pi}{4\theta} = O(1/\sqrt{\epsilon}) }[/math] we have that [math]\displaystyle{ \sin((2k+1)\theta) \thickapprox 1 }[/math] which yields the good state with a high probability.[9]

First reflection

The first reflection has the effect of checking if the current vertex is marked and applying a phase shift equal to [math]\displaystyle{ -1 }[/math] if it is so. This is a common procedure in many quantum algorithms based on amplitude amplification and this can be realized through a quantum oracle function which verifies the condition [math]\displaystyle{ |i\rangle \in M }[/math].[9]

Second reflection

The second reflection is implemented with a quantum phase estimation over the walk operator [math]\displaystyle{ W }[/math] which must reflect the structure of the graph we are exploring. The walk operator can be defined as [math]\displaystyle{ W=ref(\mathcal{B})ref(\mathcal{A}) }[/math] where [math]\displaystyle{ ref(\mathcal{B}) }[/math] and [math]\displaystyle{ ref(\mathcal{A}) }[/math] are two reflections through the subspaces [math]\displaystyle{ \mathcal{A}=span\{|i\rangle, |p_{i}\rangle\} }[/math] and [math]\displaystyle{ \mathcal{B}=span\{|p_{j}\rangle, |j\rangle\} }[/math].[9] Since the eigenvalues of [math]\displaystyle{ W }[/math] are on the form [math]\displaystyle{ e^{\pm2i\theta} }[/math]and the operator has a unique eigenvalue equal to [math]\displaystyle{ 1 }[/math] corresponding to [math]\displaystyle{ |U \rangle }[/math] given by [math]\displaystyle{ \theta = 0 }[/math], we can perform a phase estimation with precision [math]\displaystyle{ O(1/\sqrt{\delta}) }[/math] to find the unique eigenvalue. The precision of the reflection depends on the number of qubits used to estimate the phase.[9]

Complexity

With the same formalism used to estimate the cost of the classical random walk algorithm, the quantum costs can be summarised with:

  • S: is the cost to initialize the superposition [math]\displaystyle{ |U\rangle }[/math]
  • U: is the cost perform a step on the graph in superposition i.e. reflection through [math]\displaystyle{ |U\rangle }[/math]
  • C: is the cost to implement the quantum oracle i.e. reflection through [math]\displaystyle{ |B\rangle }[/math]

The total cost of the quantum walk search is [math]\displaystyle{ S+\frac{1}{\sqrt{\epsilon}}\biggl(\frac{1}{\sqrt{\delta}}U + C\biggr) }[/math], 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.[11]

Hypercube example

This is an example of how to apply the quantum walk search on a hypercube graph.[12]

Four-dimensional hypercube with binary labels

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.[13]

The search space is a [math]\displaystyle{ n }[/math]-hypercube with [math]\displaystyle{ n=4 }[/math], it has [math]\displaystyle{ |V|=2^{4} }[/math] vertices and it has a degree equal to [math]\displaystyle{ 4 }[/math]. Each node [math]\displaystyle{ v_{i} }[/math] can be labeled with a binary string of [math]\displaystyle{ 4 }[/math] bits and two nodes are connected by an edge if their Hamming distance is [math]\displaystyle{ 1 }[/math]. To set up the quantum walk search we need a coin register of dimension [math]\displaystyle{ \mathcal{H}^{n} }[/math] to encode all the possible directions which a walker can choose and a vertex register of dimension [math]\displaystyle{ \mathcal{H}^{2^{n}} }[/math]to represent the vertices.[12]

The computational basis is [math]\displaystyle{ |d\rangle |v\rangle }[/math] with[math]\displaystyle{ \{d \in D=\{00,01,10,11\},v \in V=\{0000,0001, \dots ,1111\}\} }[/math].

The walk is performed by two operators:

  • Coin operator [math]\displaystyle{ C }[/math] is used to create the superposition over the possible directions
  • Shift operator [math]\displaystyle{ S }[/math] is used to take a step in the graph according to one direction

Thus, the walk operator is [math]\displaystyle{ W=SC }[/math].[12]

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:

[math]\displaystyle{ S=\sum_{d=1}^{n}\sum_{v=1}^{n}|d\rangle|v \oplus e_{d} \rangle \langle d | \langle v| }[/math]

where [math]\displaystyle{ e_{d} }[/math] is the [math]\displaystyle{ d }[/math]-basis for the hypercube ( if [math]\displaystyle{ n=4 }[/math] the basis are [math]\displaystyle{ \{0001,0010,0100,1000\} }[/math]). 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.[12]

The algorithm works as follows:

  1. Repeat for [math]\displaystyle{ O(1/\sqrt{\epsilon}) }[/math]
    • Initialise the counting register for the phase in superposition
    • Perform a phase estimation on [math]\displaystyle{ W }[/math] with [math]\displaystyle{ O(1/\sqrt{\delta}) }[/math] precision
    • Mark an auxiliary qubit if the estimated phase is [math]\displaystyle{ \tilde{\theta}=0 }[/math]
    • Un-compute auxiliary data structure
  2. 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 shit operator is still an open challenge.[14]

Applications

The following applications are based on quantum walk on Johnson graph [math]\displaystyle{ J(n,k) }[/math].[15]

Element distinctness

Given a function [math]\displaystyle{ f }[/math] defined on [math]\displaystyle{ \{n\} }[/math], it asks to find two distinct elements [math]\displaystyle{ i,j \in \{n\} }[/math] such that [math]\displaystyle{ f(i)=f(j) }[/math] if there exist such a pair.[16]

Matrix product verification

Given three [math]\displaystyle{ n\times n }[/math] matrices [math]\displaystyle{ A,B }[/math] and [math]\displaystyle{ C }[/math], the problem asks to verify if [math]\displaystyle{ AB=C }[/math] or otherwise find the indices [math]\displaystyle{ i,j }[/math] such that [math]\displaystyle{ (AB)_{i,j} \neq C_{i,j} }[/math].[6]

Triangle

A triangle is a complete subgraph on three vertices part of an undirected graph [math]\displaystyle{ G }[/math]. Given the adjacent matrix of a graph the problem asks to find a triangle if there is any.[6]

See also

References

  1. 1.0 1.1 Portugal, Renato, ed (2013) (in en). Quantum walks and search algorithms. Quantum science and technology. New York Heidelberg: Springer. pp. 17–37. ISBN 978-1-4614-6335-1. 
  2. Kadian, Karuna; Garhwal, Sunita; Kumar, Ajay (2021-08-01). "Quantum walk and its application domains: A systematic review" (in en). Computer Science Review 41: 100419. doi:10.1016/j.cosrev.2021.100419. ISSN 1574-0137. https://www.sciencedirect.com/science/article/pii/S1574013721000599. 
  3. Grover, Lov K. (1996-07-01). "A fast quantum mechanical algorithm for database search". Proceedings of the twenty-eighth annual ACM symposium on Theory of computing - STOC '96. New York, NY, USA: Association for Computing Machinery. pp. 212–219. doi:10.1145/237814.237866. ISBN 978-0-89791-785-8. https://dl.acm.org/doi/10.1145/237814.237866. 
  4. Santos, Raqueline A. M. (2016-08-26). "Szegedy's quantum walk with queries". Quantum Information Processing 15 (11): 4461–4475. doi:10.1007/s11128-016-1427-4. ISSN 1570-0755. Bibcode2016QuIP...15.4461S. http://dx.doi.org/10.1007/s11128-016-1427-4. 
  5. Shenvi, Neil; Kempe, Julia; Whaley, K. Birgitta (2003-05-23). "A Quantum Random Walk Search Algorithm". Physical Review A 67 (5): 052307. doi:10.1103/PhysRevA.67.052307. ISSN 1050-2947. Bibcode2003PhRvA..67e2307S. 
  6. 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 Santha, Miklos (2008), Agrawal, Manindra; Du, Dingzhu; Duan, Zhenhua et al., eds., "Quantum walk based search algorithms" (in en), Theory and Applications of Models of Computation, Lecture Notes in Computer Science (Berlin, Heidelberg: Springer Berlin Heidelberg) 4978: pp. 31–46, doi:10.1007/978-3-540-79228-4_3, ISBN 978-3-540-79227-7, http://link.springer.com/10.1007/978-3-540-79228-4_3, retrieved 2023-07-05 
  7. 7.0 7.1 Magniez, Frederic; Nayak, Ashwin; Roland, Jeremie; Santha, Miklos (2007-06-11). "Search via quantum walk". Proceedings of the thirty-ninth annual ACM symposium on Theory of computing. STOC '07. New York, NY, USA: Association for Computing Machinery. pp. 575–584. doi:10.1145/1250790.1250874. ISBN 978-1-59593-631-8. https://doi.org/10.1145/1250790.1250874. 
  8. Levin, David Asher; Peres, Yuval (2017). Markov chains and mixing times. Elizabeth L. Wilmer, James G. Propp, David Bruce Wilson, American Mathematical Society (Second ed.). Providence, Rhode Island: American Mathematical Society. pp. 8–15. ISBN 978-1-4704-2962-1. 
  9. 9.0 9.1 9.2 9.3 9.4 de Wolf, Ronald (2019). "Quantum Computing: Lecture Notes". arXiv:1907.09415 [quant-ph].
  10. Brassard, Gilles; Hoyer, Peter; Mosca, Michele; Tapp, Alain (2002), "Quantum Amplitude Amplification and Estimation", Quantum Computation and Information, Contemporary Mathematics, 305, pp. 53–74, doi:10.1090/conm/305/05215, ISBN 9780821821404 
  11. Jaques, Samuel (2019-05-01). Quantum Cost Models for Cryptanalysis of Isogenies (Master Thesis thesis). University of Waterloo.p 67-68.
  12. 12.0 12.1 12.2 12.3 "Quantum Walk Search Algorithm" (in en). https://learn.qiskit.org/. 
  13. Wong, Thomas G. (2017). "Equivalence of Szegedy's and Coined Quantum Walks". Quantum Information Processing 16 (9): 215. doi:10.1007/s11128-017-1667-y. ISSN 1570-0755. Bibcode2017QuIP...16..215W. 
  14. Douglas, B. L.; Wang, J. B. (2007). "Efficient quantum circuit implementation of quantum walks". arXiv:0706.0304 [quant-ph].
  15. 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" (in en). Discrete Mathematics 341 (1): 138–142. doi:10.1016/j.disc.2017.08.022. ISSN 0012-365X. https://www.sciencedirect.com/science/article/pii/S0012365X17302807. 
  16. Ambainis, Andris (2007). "Quantum Walk Algorithm for Element Distinctness" (in en). SIAM Journal on Computing 37 (1): 210–239. doi:10.1137/S0097539705447311. ISSN 0097-5397. http://epubs.siam.org/doi/10.1137/S0097539705447311. 

Further reading

  • Nielsen, Michael A.; Chuang, Isaac L. (2010). Quantum computation and quantum information (10th anniversary ed.). Cambridge: Cambridge university press. ISBN 978-1-107-00217-3. 
  • Hidary, Jack D. (2019). Quantum computing: an applied approach. Cham, Switzerland: Springer. ISBN 978-3-030-23921-3. 

External links