Quantum Algorithms Peter Høyer University of Calgary CSSQI 2015 Canadian Summer School on Quantum Information Toronto, August 11, 2015
QUERY MODEL x1 x2 xn x1 0 1 0 0 0 1 0 1 0 0 0 0 xn You can ask questions of the form: What is xi?
A Query What is xi? i Query xi Remember the input i Query i xi b Reversible i Query i b xi i b Unitary U X i b xi
A Query i b U X i b xi ᵢ αᵢ i b ᵢ αᵢ i b xi Query in superposition 1 query 1 unit cost
Alternative query model i i b U X i b xi RX (-1) x i i Proof of i UX 1 H H 1 (-1) x i i
Alternative query model i i b U X i b xi RX (-1) x i i Proof of i b H RX H i b xi
Problems x1 xn 0 1 0 0 0 1 0 1 0 0 0 0 For instance we might want to know: Is x1 = x2 = x3 = = xn = 0? Is x1 x2 x3 xn? How many indices are there with xi =1? Find index i such that xi =1 Is graph G connected? Does graph G contain a triangle?
1-out-of-4 in one query x1 0 x2 0 x3 1 x4 0 + + + RX ψ 1 2 3 4 1000 0100 0010 0001-1 + 2 + 3 + 4 + 1-2 + 3 + 4 + 1 + 2-3 + 4 + 1 + 2 + 3-4
1-out-of-4 in one query x1 0 x2 0 x3 1 x4 0 + + + RX ψ U 3 1 2 3 4 - + + + + + + - + + + - + + + -
Non-query x1 0 x2 0 x3 1 0 RX 0-0 0 + 0 + 1 + 2 + 3 1-2 + 3 1 + 2-3
Binary searching x1 x2 x3 x 1 x 2 x 3 = 001, 011, or 111 + + RX ψ α 1 β 2 γ 3 001 011 111 - α 1 + β 2 - γ 3 α 1 - β 2 - γ 3 α 1 - β 2 - γ 3
1-out-of-N x1 x2 xn Ψ0 = 1 + 2 + + N RX R Ψ Ψ RX R Ψ = Id - 2 i i i : xi = 1 = Id - 2 Ψ0 Ψ0 - +- + + + + + + + + + + + + +- + + + + + + +- + + + + + + +- + + + + + + +- + + + + + + +-
Grover s algorithm x1 x2 xn Ψ0 = 1 + 2 + + N RX R Ψ Ψ RX = Id - 2 i i i : xi = 1 R Ψ = Id - 2 Ψ0 Ψ0
Ref * Ref = Rotation θ
Grover s algorithm RX R Ψ RX = Id - 2 i i i : xi = 1 = Id - 2 Ψg Ψg R Ψ = Id - 2 Ψ0 Ψ0
Two reflections = a rotation RX R Ψ 2θ RX = Id - 2 Ψg Ψg θ R Ψ = Id - 2 Ψ0 Ψ0 If Ψg Ψ0 = sin(θ), then rotation by angle 2θ
Amplitude amplification A 0 = Ψ = Ψgood + Ψbad p = sin 2 (θ) = Ψgood Ψgood Ψgood RX = Id - 2 Ψgood Ψgood θ Ψbad R Ψ = Id - 2 Ψ Ψ
Amplitude amplification A 0 = Ψ = Ψgood + Ψbad p = sin 2 (θ) = Ψgood Ψgood Ψgood RX = Id - 2 Ψgood Ψgood θ Ψbad R Ψ = Id - 2 Ψ Ψ R Ψ RX R Ψ RX R Ψ RX R Ψ RX R Ψ RX R Ψ RX A 0 #Iterations T to get close to Ψgood = π/2 2θ 1 p
De-randomize (if p is known) A 0 = Ψ Ψgood Theorem: If probability p is known, we can de-randomize θ Ψbad Proof: If (2T+1)θ is slightly more than π/2, then choose slightly smaller angle θ < θ such that (2T+1)θ is equal to π/2.
Guessing if p is un-known A 0 = Ψ Ψgood Algorithm: A 0 (R Ψ RX) A 0 (R RX) r Ψ A 0 r [1,2] (R RX) r Ψ A 0 r [1,4] (R RX) r Ψ A 0 r [1,8] (R RX) r Ψ A 0 r [1,16] #Iterations T to get close to Ψgood π/2 2θ Ψbad
Ref * Ref = Rotation RX = Id - 2 Ψg Ψg R Ψ = Id - 2 Ψ0 Ψ0 # Iterations 1 θ θ1
Ref * Ref = Rotation RX = Id - 2 ProjA R Id - 2 Ψ = ProjB # Iterations + + + + + a1 a2 a3 a4 a5 a6 2 2 2 2 2 2 θ1 θ2 θ3 θ4 θ5 θ6 a2 θ2 a1 θ1 a5 θ5 a3 θ3 θ4 a4 a6 θ6 Detect versus Finding solutions? Search for state Ψgood a1 + a2 + + a6 = 1
Quantum algorithms 0 A RX R Ψ RX R Ψ RX R Ψ 0 0 0 0 A RX R RX RX Ψ R Ψ R Ψ RX RX RX V0 V1 V2 VT T queries to oracle X {0,1} N
Life of a student Before One day of work: After Requires lots of days of work
Lower bounds 0 0 RX RX RX V0 V1 V2 VT To prove a lower bound, we show 1. We know very little in the beginning 2. We learn only a little by each query 3. We need to learn a lot Then we conclude we need a lot of queries
0001 0101 1001 01 10 1000 1010 1 1 1 1 Finding inputs x = x1 x2 x3 x4 {0,1} 4 x1 = 1 x3 = 0
0001 0101 1001 0001 0101 0 2 1 3 3 2 1 2 2 3 3 34 Distinguishing inputs 01 10 1000 1010 1 1 1 1 1001 01 10 1000 1010 1 1 1 1 2 2 2 3 3 0001 2 1 3 0101 1 4 3 3 1001 01 10 0 1000 1010 1 1 1 1 x = x1 x2 x3 x4 {0,1} 4 W0 = Σ (Γ)jk jk = 2(2+3+2+2+3+2+1+3 +1+4+3+3) = 58
0001 0101 1001 0001 0101 0 2 1 3 3 2 1 2 2 3 3 34 2 3 1 Distinguishing inputs 01 10 1000 1010 1 1 1 1 3 2 4 1001 01 10 1000 1010 1 1 1 1 0 2 1 3 2 3 3 x = x1 x2 x3 x4 {0,1} 4 0001 0101 1001 01 10 1000 1010 1 1 1 1 W0 = Σ (Γ)jk jk x1 = 1 = 1 Γ 1 ΔW = 2(3+2+2+2+1+3+1) = 28
0001 0101 1001 0001 0101 0 2 1 3 3 2 1 2 2 3 3 34 2 3 1 Distinguishing inputs 01 10 1000 1010 1 1 1 1 3 2 4 1001 01 10 1000 1010 1 1 1 1 0 2 1 3 2 3 3 x = x1 x2 x3 x4 {0,1} 4 0001 0101 1001 01 10 1000 1010 1 1 1 1 W0 = Σ (Γ)jk jk WT ε W0 x1 = 1 = 1 Γ 1 ΔW = 2(3+2+2+2+1+3+1) = 28 = 1 Γ 1 1 = 1 Γ 1 T (1-ε) max = i 1 Γ i 1
0001 0101 1001 0001 0101 0 2 1 3 3 2 1 2 2 3 3 34 2 3 1 Distinguishing inputs 01 10 1000 1010 1 1 1 1 3 2 4 1001 01 10 1000 1010 1 1 1 1 0 2 1 3 2 3 3 x = x1 x2 x3 x4 {0,1} 4 0001 0101 1001 01 10 1000 1010 1 1 1 1 W0 = Σ (Γ)jk jk WT ε W0 x1 = 1 = Ψ Γ Ψ ΔW = 2(3+2+2+2+1+3+1) = 28 = φ Γ 1 φ = Ψ Γ Ψ T (1-ε) max = i φ Γ i φ
0001 0101 1001 0001 0101 0 2 1 3 3 2 1 2 2 3 3 34 2 3 1 Distinguishing inputs 01 10 1000 1010 1 1 1 1 3 2 4 1001 01 10 1000 1010 1 1 1 1 0 2 1 3 2 3 3 x = x1 x2 x3 x4 {0,1} 4 0001 0101 1001 01 10 1000 1010 1 1 1 1 W0 = Σ (Γ)jk jk WT ε W0 T (1-ε) maxi x1 = 1 = Γ ΔW = 2(3+2+2+2+1+3+1) = 28 = Γ 1 Γ Γ i
Binary Searching 1/1 1/2 1/3 1/4 1/5 1/1 1/1 1/2 1/3 1/4 1/2 1/1 1 /1 1 /2 1 /3 1/3 1/2 1/1 1/1 1/2 1/4 1 /3 1 /2 1/1 1/1 1/5 1/4 1/3 1/2 1 /1 x1 x2 x5 x1 x2 x5 = 00000, 00001, 00011, 00111, 01111, or 11111 00000 0000 1 000 1 1 00 1 1 1 0 1 1 1 1 1 1 1 1 1 00000 0000 1 000 1 1 00 1 1 1 0 1 1 1 1 1 1 1 1 1 Find index i of left-most 1 W0 ΔW WT T = Γ Γi ε Γ (1-ε) Γ Γi = Θ(Nlog N) = Θ(N) = Θ(log N)
Polynomial Method i b U X i b xi α i, 0 + β i, 1 { α i, 0 + β i, 1 α i, 1 + β i, 0 if xi = 0 if xi = 1 = [βxi + α(1-xi)] i, 0 + [αxi + β(1-xi)] i, 1 Polynomials of degree 1 in variable xi 0 0 UX UX UX V0 V1 V2 VT
Lower bounds OR2 = x1 + x2 - x1x2 Parity3 = x1 + x2 + x3 - x1x2 - x1x3 - x2x3 + x1x2x3 degree(orn) = N QE(ORN) N/2 degree(parityn) = N QE(ParityN) N/2 Polynomials of degree T in variables xi 0 0 UX UX UX V0 V1 V2 VT
Lower bounds degree(orn) = Θ( N) degree(parityn) = Θ(N) QE(f) deg(f) Q2(ORN) Q2(ParityN) Ω(N) Q2(f) deg(f) Ω( N) Polynomials of degree T in variables xi 0 0 UX UX UX V0 V1 V2 VT
Binary Searching 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 Output = leaf number 22 32 leaves N leaves = log 2 (N) for binary search
Haar Wavelet 1 1 1 1 1 1 1 1 1 1 1 1-1 -1-1 -1 1 1-1 -1 1 1-1 -1 1-1 1-1 1-1 1-1
Binary Searching 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1
Binary Searching 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1-1 -1-1 -1 1 1-1 -1 1 1-1 -1 1-1 1-1 1-1 Binary Searching 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1-1 + + + 22
Binary Searching 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 + + + 22 32 leaves = 11 pebbles N leaves = log 3 (N) quantum search
s Peter Høyer University of Calgary