Quantum Grover Algorithm Search
Quantum Grover Algorithm Search
Today’s lecture:
1. Shor’s quantum algorithm for factoring
2. Grover’s quantum algorithm for search
3. Other algorithms
|0i
.. QFT QFT ..
. . measure
|0i
Of
|0i
.. ..
. . measure
|0i
2πi rb rb
Sum 6= 0 iff e = 1 iff
q is an integer
q
q
Only the b that are multiples of have non-zero amplitude!
r
Main Quantum Algorithms: Shor and Grover – p. 8/23
Easy case: r|q (continued)
q
5. Observe 1st register: random multiple b = c , c ∈ [0, r):
r
b c
=
q r
b
Then: we know r by writing in lowest terms
q
Grover’s algorithm
|0i H ...
n |0i H G G ... G measure
|0i H ...
| {z }
k
Rough idea: each iteration moves √1N amplitude
√
towards solutions ⇒k ≈ N iterations should suffice
Example: N = 4 ⇒ k = 1
Choose k nearest integer (small error)
π√
Query complexity is k ≈ N
4
√
Gate complexity is O( N log N )
√ √
That’s N queries, and N log N elementary gates
r
N
If there are t solutions, then iterations suffice
t
Question: is f satisfiable?
Grover’s algorithm
√
(1996) searches a size-N search
space in ∼ N time
quadratic speed-up over classical
widely applicable