Quantum walk based search algorithms · Quantum walks [Meyer’96, Watrous’98, AAKV’01...
Transcript of Quantum walk based search algorithms · Quantum walks [Meyer’96, Watrous’98, AAKV’01...
Quantum walk based search algorithms
Miklos Santha
CNRS, LRI, Universite Paris-Sud
1/30
Overview of the talk
1 Classical search algorithms
2 Quantization of Markov chains
3 Quantum search algorithms
4 Applications
2/30
Classical search
3/30
Abstract search problem
Unordered SearchInput: Set X with M ⊆ X of marked elements, where ε = |M|/|X |Output: An element x ∈ M (or decide if there is any).
Search Algorithm 1 (Naive)Repeat for O(1/ε) steps
1 Pick uniformly random x ∈ X .
2 Check if x ∈ M, output if it is.
Additional structure for generating samples: Markov chain P on X .
4/30
Markov chains
Random walks on directed graphs: P = (pxy )
Abstract search problem
The problem
Input:
! a set of elements X
! with unknown subset of
marked elements M ! X“! = |M|
|X |”
Output:
! a marked element x " M
t
y z
x
pxy pxz
m
n
Available procedures
! Setup (cost S):
pick a random x " X! Check (cost C):
check whether x " M! Update (cost U):
make a random walk P
x
y z
pxy pxz
P =
! here: assume P ergodic, symmetric
! " = e-v gap of P
• Irreducible: Strongly connected=⇒ unique stationary distribution π = (πx)
• Ergodic: Also aperiodic=⇒ eigenvalue gap δ = 1− 2nd largest |eigenvalue|
• Reversible: πxpxy = πypyx
Undirected graph with weighted edges
• Symetric =⇒ π is the uniform distributionUndirected regular graph
5/30
Associated costs (symmetric chains)
Maintain some database d on X . The data associated with x isd(x).
• Setup cost S: Pick uniformly random x ∈ X , andconstruct d(x).
• Update cost U: Make one step from x to y according to P,and to update d(x) to d(y).
• Checking cost C: Check if x ∈ M using d(x).
Cost of Search Algorithm 1: (S + C)/ε,
6/30
Two Markov chain based search algorithmsIdea: Replace random sampling by the walk
Search Algorithm 21 Pick random x ∈ X .
2 Repeat O(1/ε)-times
1 Check if x ∈ M.2 Make O(1/δ) steps of the walk P starting with x .
Cost: S + (U/δ + C)/ε
Search Algorithm 31 Pick random x ∈ X .
2 Repeat O(1/εδ)-times
1 Check if x ∈ M.2 Make one step of P starting with x .
Cost: S + (U + C)/δε7/30
Random walk on edgesWant to simulate a walk on vertices by a walk on edges:
P irreducible Markov chain Pedge walk on directed edges
P : |u〉 −→ |x〉 pxy−→ |y〉 pyz−→ |z〉Idea:
P at |x〉 and comes from |u〉 Pedge at |x〉|u〉|x〉 pxy−→ |y〉 |x〉|u〉 pxy−→ |y〉|x〉
Definition Pedge = SPright, where
• Controlled stochastic right flip Pright : |x〉|u〉 pxy−→ |x〉|y〉• Shift S : |x〉|y〉 1−→ |y〉|x〉
2 steps of of the edge walk are PedgePedge = SPrightSPright:
|x〉|u〉 pxy−→ |y〉|x〉 pyz−→ |z〉|y〉This is the same as PleftPright, got rid of the shift!
8/30
Quantization of Markov chains
9/30
Quantum walks [Meyer’96, Watrous’98, AAKV’01 Ambainis’04]
Classical walk on vertex space X does not quantizeIdea: Take walk space as X × C where C is some coin spaceDefinition W = SF , product of a quantum coin flip F and a shift S
• d-regular graphs: C = {1, . . . , d}• Quantum coin flip: Independent from vertex x
F |x〉|i〉 = |x〉D|i〉,where D is reflection about 1√
d
∑j |j〉 ( = Grover diffusion)
• Shift:S |x〉|i〉 = |i th neighbor of x〉|i〉
• general walk: C = X , walk on directed edges• Controlled quantum right flip:
Fright|x〉|y〉 = |x〉F x |y〉
• Shift: S |x〉|y〉 = |y〉|x〉Again, two steps of the walk is FleftFright
10/30
Quantization of random walks [Szegedy’04]
P reversible Markov chain with stationary distribution πSuperposition over the neighbors of x : |px〉 =
∑y∈X√
pxy |y〉
Controlled quantum flip F x is Grover diffusion, the reflection
over |px〉:
ref |px 〉 = 2Π|px 〉 − Id
Definition: The quantum walk based on P:
W (P) = FleftFright
Walk subspace: Spanned by the states |x〉|px〉 and |py 〉|y〉
11/30
Spectral characterization of W (P) on the walk subspace
Theorem [Szegedy’04]: P ergodic, reversible Markov chain withstationary distribution π. Let the eigenvalues of P be:
1 = cos θ0 > cos θ1 ≥ . . . ≥ cos θk > −1Then, on the walk space, the spectrum of W (P) is:
• |π〉 =∑
x∈X
√πx |x〉|px〉 is the unique 1-eigenvector,
• e±2iθj are eigenvalues for 1 ≤ j ≤ k ,
• All remaining eigenvalues are −1.
Definition: The phase gap of W (P) is ∆(P) = 2θ1.Fact: Relation between phase gap and eigenvalue gap of P:∆ ≥ 2
√δ.
From random to quantum walks [Szegedy’04]
Random walk
! P = (pxy )
! E-v: !k = cos "k! Stationary dist. (cos "0 = 1):
# = (#x )
! E-v gap: $ = 1! | cos "1|
1!1!
"1"2"3
#1
#2#3
12/30
Spectral characterization of W (P) on the walk subspace
Theorem [Szegedy’04]: P ergodic, reversible Markov chain withstationary distribution π. Let the eigenvalues of P be:
1 = cos θ0 > cos θ1 ≥ . . . ≥ cos θk > −1Then, on the walk space, the spectrum of W (P) is:
• |π〉 =∑
x∈X
√πx |x〉|px〉 is the unique 1-eigenvector,
• e±2iθj are eigenvalues for 1 ≤ j ≤ k ,
• All remaining eigenvalues are −1.
Definition: The phase gap of W (P) is ∆(P) = 2θ1.Fact: Relation between phase gap and eigenvalue gap of P:∆ ≥ 2
√δ.
From random to quantum walks [Szegedy’04]
Random walk
! P = (pxy )
! E-v: !k = cos "k! Stationary dist. (cos "0 = 1):
# = (#x )
! E-v gap: $ = 1! | cos "1|
Quantum walk
! W = refY · refX! E-v (on X " Y): e±2i!k! Stationary state ("0 = 0):
|## =P
x
!"x |x"|px "
! phase gap: ! = |2"1|
0"
!
2!1
2!2
2!3
! = "($
$)%
quantum phase gap
= "!$classical e-v gap
"12/30
Quantum search
13/30
Quantum search algorithms
Cost model of available procedures with data:
• Setup cost S: Construct the stationary state
|π〉 =∑
x∈X
√πx |x〉|px〉
• Update cost U: Realize the transformation and its inverse:
|x〉|0〉 7→ |x〉|px〉• Checking cost C: Reflection on marked elements:
refM : |x〉 7→{ |x〉 if x ∈ M−|x〉 otherwise
Update operations implement ref |x〉|px 〉, and therefore W (P) :
1 |x〉|px〉 7→ |x〉|0〉2 Reflect on |x〉|0〉3 Undo first step
14/30
Grover search
Analogue of Search Algorithm 1
Grover search1 Prepare the stationary state: |π〉 =
∑x∈X
√πx |x〉|px〉
2 Repeat O(1/√ε)-times
1 Phase flip if first register is marked: −refM2 Reflect through |π〉 : ref |π〉
Theorem [Grover’96]: Final state is close to projection to markedelements |M〉 = 1√
ε
∑x∈M
√πx |x〉|px〉,
sinϕ =√ε
Grover’s algorithm
! We start with |!! = 1"|X |
!x!X |x!
! Goal: prepare |M! = 1"|M|
!x!M |x!
! We use 2 reflections:! through |M!!: refM! = #refM (C)! through |!!: ref! (S)
Grover’s algorithm
! Prepare |!! (S)
! Repeat T1$! apply refM! (C)! apply ref! (S)
Cost: 1"!(S+ C)
"
"
2" |##
|M#
|M!#
sin" = $M|##
=
s|M||X |
="
!
Cost: (S + C)/√ε
Idea: If S is high, replace ref |π〉 by some W (P)
15/30
Ambainis searchAnalogue of Search Algorithm 2
Ambainis search1 Prepare |π〉2 Repeat 1/
√ε – times
1 Phase flip if first register is marked :−refM2 Perform 1/
√δ – steps of W (P)
3 Output first register
Theorem [Ambainis’04]: If P is the random walk on the Johnsongraph then it finds a marked element with high probability, at cost
S + 1√ε( 1√
δU + C).
Definition: The Johnson graph J(n, r) = (V ,E ):V = {S ⊆ {1, 2, . . . , n} : |S | = r}E : {S ,T} is an edge if they differ exactly in two elementsEigenvalue gap : δ = Θ(1/r)
16/30
Szegedy search
Analogue of Search Algorithm 3
Szegedy search1 Prepare |π〉2 Repeat 1/(
√εδ) – times
1 Phase flip if first register is marked :−refM2 Perform one step of W (P)
3 Measure deviation from |π〉
Theorem [Szegedy’04]: If P is an ergodic, symmetric chain, then itdetects the presence of marked elements with high probability, atcost of
S + 1√εδ
(U + C).
17/30
Magniez-Nayak-Roland-Santha searchIdea: Use W = W (P) to simulate ref |π〉 in Grover search
Back to Grover’s algorithmUses 2 reflections:
! Through marked states: refM! Through initial state: ref!
What if ref! is expensive?
=! Replace ref! by quantum walk W !
Reflexion ref!
0!
Quantum walkW
0!
!
2"1
2"22"3
Back to Grover’s algorithmUses 2 reflections:
! Through marked states: refM! Through initial state: ref!
What if ref! is expensive?
=! Replace ref! by quantum walk W !
Reflexion ref!
0!
Quantum walkW
0!
!
2"1
2"22"3
Let |π〉, |ψ1〉, . . . , |ψt〉 be the eigenvectors of W (P) in the walksubspace, and ∆ the phase gap. Spectral Theorem =⇒• ref |π〉|π〉 = |π〉 W |π〉 = |π〉• ref |π〉|ψj〉 = −|ψj〉 W |ψj〉 = e2iθj |ψj〉 where |2θj | ≥ ∆
Since ∆ ≥ 2√δ, we need a procedures which computes the phase
of the eigenvalues of W (P) with precision√δ
Phase estimation theorem [Kitaev’96, CEMM’98]: One can estimatewith k/
√δ applications of W (P) the phase of an eigenstate with
precision√δ and with error 2−k .
18/30
MNRS search
MNRS search1 Prepare |π〉2 Repeat 1/
√ε steps of Grover search:
1 Phase flip if first register is marked :−refM2 Perform ref |π〉 with error
√ε:
1 Phase estimation for W (P) with precision√
δ and error√
ε2 If approximate phase is ∆-far from 0 then flip sign3 Undo phase estimation
3 Output first register
Theorem [Magniez-Nayak-Roland-Santha’07]: If P is an ergodic andreversible Markov chain, then it finds a marked element with highprobability, at cost of
S + 1√ε( log(1/ε)√
δU + C).
19/30
Removing the log factor
How to deal with errors in Grover search?
• Errors in checking [Høyer-Mosca-de Wolf 03]Recursive version of Grover search, alternating• Amplitude amplification• Checking whose error decreases geometrically
Conclusion: Overall complexity is the same as without error
• Errors in diffusionSimilar recursion, using duality betweenChecking ↔ Diffusion, refM ↔ refπ• Amplitude amplification• Phase estimation based diffusion whose error decreases
geometrically
20/30
MNRS Search
Theorem: If P is an ergodic and reversible chain, then the MNRSsearch finds a marked element with high probability, at cost of
S + 1√ε( 1√
δU + C).
Comparison with the other search algorithms:
• Conceptually simple and easy to analyze
• Unifies and generalizes previous approaches:• Ambainis search: Only for Johnson graph• Szegedy search: Only symmetric walk, only detects, run-time is
worse
• Improves several applications by log factors
21/30
Applications in the quantum querymodel of computation
22/30
Application 1
Element DistinctnessOracle Input: A function f defined on [n].Output: A pair of distinct elements i , j ∈ [n] such that f (i) = f (j)
Classically: nTheorem [Ambainis’04]: ED is solvable with n2/3 queries
P = Symmetric walk in the Johnson graph J(n, r)
x2x5 x7
x3
=
Element Distinctness via walk [Ambainis’04] 4
x2
x8 x13
x5 x2
x10 x13
x3
x2
x8 x13
x3
x2
x5 x13
x3
setup update checking
Quantum analogue- Speeds up both T1 and T2 quadratically [Ambainis‘04]
- Query complexity: r + (n/r) ( !r ! 2 + 0) ! n2/3 (optimal)
23/30
Element Distinctness
• Marked element: R ⊆ [n] if there exist i 6= j ∈ R such that
f (i) = f (j)
• Parameters: ε = (r/n)2, δ = 1/r
• Data structure: d(R) = {(v , f (v)) : v ∈ R}• Costs: S = r ,U = 1,C = 0.
• Complexity:
S +1√ε
(1√δ
U + C) = r + n/r1/2 = n2/3
when r = n2/3.
Lower bound: [Aaronson-Shi’04]: n2/3
24/30
Application 2Restricted Range AssociativityOracle Input: Operation ◦ : [n]× [n]→ [k] where k ∈ O(1).Output: Triple (a, b, c) such that (a ◦ b) ◦ c 6= a ◦ (b ◦ c)
Classically: n2
Theorem [Dorn-Thierauf’07]: RRA is solvable with n5/4 queries
P = Symmetric walk in the Johnson graph J(n, r)
• Marked element: R ⊆ [n] if there exist a, b ∈ R and c ∈ [n]such that (a ◦ b) ◦ c 6= a ◦ (b ◦ c)
• Parameters: ε = (r/n)2, δ = 1/r• Data structure: d(R) = {(a, b, a ◦ b) : a, b ∈ R ∪ [k]}• Costs: S = (r + k)2 = r2,U = r + k = r ,C = k
√rn =
√rn
• Complexity:
O(r2 + nr (√
r r +√
rn)) = n5/4
when r =√
n.
Lower bound (even with unrestricted range): n25/30
Application 3TriangleOracle Input: The adjacency matrix G of a graph on vertex set [n].Output: An edge of a triangle
Classically: n2
Theorem [Magniez-S-Szegedy’05]: T is solvable with n13/10 queries
P = Symmetric walk in the Johnson graph J(n, r)
• Marked element: R ⊆ [n] if it contains a triangle• Parameters: ε = (r/n)2, δ = 1/r• Data structure: d(R) = G |R• Costs: S = r2,U = r• Claim: Checking cost for Triangle is
√n × r2/3
• Complexity:
r2 + nr (√
r × r +√
n × r2/3) = n13/10
when r = n3/5.
Lower bound: n26/30
Triangle: Checking costClaim Checking cost for Triangle is
√n × r2/3
v
G|R
14Checking cost for Triangle edges
G|AG ! [n]2
G|A
Reduction: c(r) ! "n # QQC(Subproblem)
0
0
1
11
v0
v0 ! [n]
• G restricted to R, set of r vertices, is explicitly known• R is marked if an edge in R and some v form a triangle• Search over all v• For a fixed v , define secondary search problem
Input: Boolean fv on R where fv (u) = 1 if {u, v} is an edgeOutput: Edge {u, u′} in R such that fv (u) = fv (u′) = 1
• Analogous to Element Distinctness• Search in Johnson graph J(r , r2/3)• Complexity: r2/3
• Complexity of Checking is√
n × r2/3
27/30
Application 4Group CommutativityOracle Input: Operation ◦ for a group whose base set contains [n].Output: A couple (i , j) ∈ [n]× [n] such that i ◦ j 6= j ◦ iClassically [Pak’00]: n4/3
Theorem [Magniez-Nayak’05]: GC is solvable with n2/3 log n queries
The walk P: Space is S(n, r)× S(n, r) where
S(n, r) = {u ∈ [n]r : ui 6= uj if i 6= j}.For i ∈ [r ], x ∈ [n] and u = (u1, . . . , ui , . . . , uj , . . . , ur ) ∈ S(n, r) let
ui,x =
{(u1, . . . , uj , . . . , ui , . . . , ur ) if x = uj
(u1, . . . , x , . . . , uj , . . . , ur ) otherwise
u
1/21/2nr
u11
urn
.
.
.
1/2nr
One step of P: Independently in both coordinates28/30
Group Commutativity
• For u = u1, . . . , ur , set u = (· · · (u1 ◦ u2) · · · ) ◦ ur
• Marked element: (u, v) if u ◦ v 6= v ◦ u.
• Parameters: ε = (r/n)2, δ = 1/(r log r)
• Data structure: d(u, v) = (Tu,Tv )
u1
r = 4
Database associated to a state 11
u
u1 ! u2 u3 ! u4
u3 u4u2
• Costs: S = r ,U = log r ,C = 1
• Complexity:
r + nr (√
r log r × log r + 1) = n2/3 log n
when r = n2/3 log n.
Lower bound: n2/3
29/30
Conclusion
• Several quantum search algorithms
• MNRS search is conducive to composition of algorithms
• Extension: To ergodic, irreversible chains:eigenvalue 7→ singular value
• Phase estimation is used for NAND trees in [ACRSZ’07]
• Detection and search algorithms related to quantum hittingtime [MNRS08]
Open problems
• Exact complexity of• Matrix Product Verification• Associativity• Triangle
• Find other applications
• Schoning’s algorithm for 3-SAT
30/30