Peter Høyer Quantum Searching August 1, 2005, Université de Montréal The Fifth Canadian Summer School on Quantum Information
Quadratic speed-up Cost was O(M) * Actual running time on a quantum computer might be incomparable to running time on a classical computer. Availability of quantum computers is limited. Additional error correction not included. Not applicable in conjunction with measurements. Verifier required. * √ Now only O( M) Cost: O(M)
Grover’s Problem N Input: Problem: f:{1,2,,N}{0,1} Find integer i such that f(i)=1 You can ask questions of the form: “What is f(j)?”
A query j f(j) “What is f(j)?” Query
Remember the input j f(j) “What is f(j)?” Query Remember the input: j f(j) Query j
Reversible j f(j) “What is f(j)?” Query Remember the input: j f(j) Query j Reversible: j bf(j) Query j b 0000 = 0 0101 = 1 1010 1111 = 0 b {0,1}
Unitary Query j f(j) “What is f(j)?” Query Remember the input: j f(j) Query j Reversible: j bf(j) Query j b Unitary: U f |j |b |j |bf(j) b {0,1}
Unitary Query Unitary: U f |j |b |j |bf(j) |j|b |j|bf(j) |j|0 ∑ j=1 N ∑ N 1 √N 1 |j|f(j) “Apply function f in superposition”
Computational Cost U f |j |b |j |bf(j) 1 query 1 unit cost
Alternative query model S f |j (-1) f(j) |j U f |j |b |j |bf(j) U f |j |1 (-1) f(j) |j |1 H H Proof of : |b H |0+(-1) b |1 “Compute the value of f in the phases”
Grover’s Algorithm N Suppose t solutions (here t=3) Grover:1/p √ = N/t queries √ Repetition:1/p = N/t queries The “classical” algorithm: N 1 √N Success probability = p = t/N A|0| 0 ∑ i=1 |i
Standard Analysis N 1/N 2/N 3/N Success probability Classical repetitionGrover 4/N 5/N 6/N 7/N 8/N 9/N N 1 √N A|0| 0 ∑ i=1 |i (1)(2)(3)(1)(2)(3)
Grover’s Algorithm Rotation
Amplitude Amplification A = some algorithm p = success probability of A m repetitions success probability ≈ mp (provided mp ≤ 2/3, say)
Amplitude Amplification A = some algorithm p = success probability of A m repetitions success probability ≈ mp (provided mp ≤ 2/3, say) (Solutions must be verifiable) √
General Setting Algorithm A, Verifier f, f:{1,2,,N}{0,1} A|0| 0 ∑ i=1 i |i N N f:{1,2,,N}{0,1} A|0| 0 ∑ i=1 |i N 1 √N Example: Grover
General Setting Algorithm A, Verifier f, f:{1,2,,N}{0,1} A|0| 0 ∑ i=1 i |i N 1 application of A 1 query to U f 1 unit cost U f |j |b |j |bf(j) A |0 |0|0
General Setting Algorithm A, Let |Good~∑ i:f(i)=1 i |i |Bad~∑ i:f(i)=0 i |i Success prob. of A = p = sin 2 θ Verifier f, f:{1,2,,N}{0,1} A|0| 0 ∑ i=1 i |i N A|0| 0 sinθ|Goodcosθ|Bad
General Setting Algorithm A, Let |Good~∑ i:f(i)=1 i |i |Bad~∑ i:f(i)=0 i |i Success prob. of A = p = sin 2 θ Verifier f, f:{1,2,,N}{0,1} A|0| 0 sinθ|Goodcosθ|Bad A|0| 0 ∑ i=1 i |i N
2-dimensional subspace A|0| 0 sinθ|Goodcosθ|Bad |Good |Bad θ |0|0 2θ2θ || Q| Operator Q rotates by angle 2θ 3θ3θ 5θ5θ QA|0 QQA|0
Amplitude Amplification Algorithm A, Let |Good~∑ i:f(i)=1 i |i |Bad~∑ i:f(i)=0 i |i Success prob. of A = p = sin 2 θ Verifier f, f:{1,2,,N}{0,1} A|0| 0 sinθ|Goodcosθ|Bad A|0| 0 ∑ i=1 i |i N 2θ2θ || Q| |Good |Bad
Amplitude Amplification |Good |Bad θ A|0| 0 A|0sinθ|Goodcosθ|Bad QQA|0sin5θ|Goodcos5θ|Bad 5θ5θ QA|0sin3θ|Goodcos3θ|Bad 3θ3θ QQQA|0sin7θ|Goodcos7θ|Bad 7θ7θ Q m A |0 = sin((2m+1)θ) |Good + cos((2m+1)θ) |Bad
Maximizing the success prob. |Good |Bad Q m A |0 = sin((2m+1)θ) |Good + cos((2m+1)θ) |Bad θ A|0| 0 4 π √p Theorem: Set m=, then Prob[Bad] ≤ sin 2 θ = p π2π2 After m rotations, angle is (2m+1)θ. We want (2m+1)θ ≈. Since sin 2 θ = p, then θ ≈ √p. □ 2θ2θ Proof: Note: Classically, m=. A quadratic speed-up! 1p1p
“De-randomization” (p known) |Good |Bad Q m A |0 = sin((2m+1)θ) |Good + cos((2m+1)θ) |Bad θ A|0| 0 Theorem: If prob. p is known, we can “de-randomize”. 2θ2θ π2π2 If (2m+1)θ is slightly more than, then choose slightly smaller angle θ’<θ such that (2m+1)θ’ IS equal to. □ π2π2 Proof: θ’θ’
If m is not known? |Good |Bad θ 2θ2θ A|0| 0
Guessing when p unknown θ A|0| 0 |Good |Bad A random vector yields success prob. = 1/2 Solution: obtain a near-random vector by classically guessing m.
Bizarre example Viewer discretion is advised...
Kiil, the cat 13 1 cat 2 cats 11 trials 7 trials What is the highest floor from which the cat will survive, if it jumps out the window from that floor?
Guessing when p unknown θ A|0| 0 |Good |Bad Set M=1, λ=1.99 Repeat forever: Set M=λM Let m R [1,M] Do Q m A|0 Measure, say |i If f(i)=1, then break Output i 1) 2) 3) Algorithm:
Q Rotation |Good |Bad 2θ2θ || Q| S 0 |0 = |0 S 0 |i = - |i (i≠0) S f |i = |i (f(i)=1) S f |i = - |i (f(i)=0) Q = - SfSf AS 0 A -1
Q Rotation |Good |Bad S 0 |0 = |0 S 0 |i = - |i (i≠0) S f |i = |i (f(i)=1) S f |i = - |i (f(i)=0) S f reflection about |Good AS 0 A -1 reflection about | 0 Q rotation by 2θ θ || 2θ2θ 2θ2θ |0|0 Q = SfSf AS 0 A -1 -
Cost of Q Q = -AS 0 A -1 S f 1 application of A 1 query to U f 1 unit cost U f |j |b |j |bf(j) A |0 |0|0 1 application of Q2 applications of U f + 2 applications of A + 1 application of S 0 5 units cost
The Recipe Algorithm A, Verifier f, f:{1,2,,N}{0,1} A|0| 0 ∑ i=1 i |i N Q = -AS 0 A -1 S f S 0 |0 = |0 S 0 |i = |i (i≠0) S f |i = |i (f(i)=1) S f |i = |i (f(i)=0) Define reflections: Amplitude Amplification operator: - -
Complete Grover N f:{1,2,,N}{0,1} Q = -AS 0 A -1 S f S 0 |0 = |0 S 0 |i = - |i (i≠0) S f |i = |i (f(i)=1) S f |i = - |i (f(i)=0) N A|0=∑ i=1 |i 1 √N Apply A on |0, gives | Repeat O(√N) times: Apply Q on | Measure | Return outcome |i 1) 2) 3) 4) Grover’s algorithm: Theorem: Prob[f(i)=1] ≥ 2/3
General rotation Q = -AS 0 A -1 S f S 0 |0 = |0 S 0 |i = |i (i≠0) S f |i = |i (f(i)=1) S f |i = |i (f(i)=0) - - ΦsΦs ΦfΦf Φ s,Φ f C* - - Suitable choices of phases: Φ s = Φ f = -1 Φ s = Φ f = i = √-1 Φ s = Φ f = e π i/3 Φ s = Φ f such that Re(Φ s )>0
General Analysis A|0sinθ|Goodcosθ|Bad Q(Φ s,Φ f )A|0 α sinθ|Good β cosθ|Bad -Φ s Φ f -1+Φ f -Φ s Φ f 1-Φ s -Φ f -Φs-Φs sin 2 θ cos 2 θ α β =
General Analysis A|0sinθ|Goodcosθ|Bad Q(Φ s,Φ f )A|0 α sinθ|Good β cosθ|Bad -Φ s Φ f -1+Φ f -Φ s Φ f 1-Φ s -Φ f -Φs-Φs sin 2 θ cos 2 θ α β = Φ s = Φ f = sin 2 θ cos 2 θ α β =
General Analysis A|0sinθ|Goodcosθ|Bad Q(Φ s,Φ f )A|0 α sinθ|Good β cosθ|Bad -Φ s Φ f -1+Φ f -Φ s Φ f 1-Φ s -Φ f -Φs-Φs sin 2 θ cos 2 θ α β = Φ s = Φ f = i 1 i 1-2i -i sin 2 θ cos 2 θ α β =
General Analysis A|0sinθ|Goodcosθ|Bad Q(Φ s,Φ f )A|0 α sinθ|Good β cosθ|Bad -Φ s Φ f -1+Φ f -Φ s Φ f 1-Φ s -Φ f -Φs-Φs sin 2 θ cos 2 θ α β = Φ s = Φ f = e π i/3 -e 2π i/ e π i/3 -e π i/3 sin 2 θ cos 2 θ α β =
General Analysis A|0sinθ|Goodcosθ|Bad Q(Φ s,Φ f )A|0 α sinθ|Good β cosθ|Bad -Φ s Φ f -1+Φ f -Φ s Φ f 1-Φ s -Φ f -Φs-Φs sin 2 θ cos 2 θ α β = Φ s = Φ f such that Re(Φ s )>0 <1 sin 2 θ cos 2 θ α β = ? ? ?
The Recipe Algorithm A, Verifier f, f:{1,2,,N}{0,1} A|0| 0 ∑ i=1 i |i N Q = -AS 0 A -1 S f S 0 |0 = |0 S 0 |i = |i (i≠0) S f |i = |i (f(i)=1) S f |i = |i (f(i)=0) Define reflections: Amplitude Amplification operator: - -