Grover's Algorithm: Quantum Algorithms
Grover's Algorithm: Quantum Algorithms
Shor-type Grover-type
Grover’s Algorithm Algorithms
Quantum Algorithms
Counting
•Searching
•Factoring
•Marked state
•Discrete log •Minimum
•Abelian stabilizer •Median
Speed-up:
Speed-up:
Exponential?
quadratic
Quantum
Simulations
Lov K. Grover Grover
Bell Labs Sesame Street
Find the name of the person Find the name of the person
with phone number: 3397 0454 with phone number: 3397 0454
• What is the size of this problem? • The size of the problem is O(c2 log k),
• The network might be directed (It could take • How many possible tours are there?
longer to get from A to B than from B to A) • Equal to the number of permutations of cities
• Each city could be connected to every other city • There are c! possible tours
• Therefore if there are c cities, there could be • c! ~ O(exp(c log c))
c(c-1) edges
• Therefore the number of possible inputs scales
• Each edge requires log k bits to store exponentially with the size of the problem
1
Traveling salesman Problem Traveling salesman Problem
22 km 23 km 22 km 23 km
Given a network and a Given a network and a
number, k, is there a tour 15 km
12 km number, k, is there a tour 15 km
12 km
2
The Quantum Oracle The Quantum Oracle
x q w ⎯⎯→
O
x q ⊕ f ( x) w • If x is not a solution, the oracle does nothing
x q ⎯⎯→ x q ⊕ f ( x )
O
x ( 1
2
0 − 1
2
1 ) ⎯⎯→
O
− x ( 1
2
0 − 1
2
1)
• We can write both of these as
• Suppose the oracle qubit is initially in the state
x ( 1
2
0 − 1
2
1 ) ⎯⎯→
O
( − 1) f ( x ) x ( 1
2
0 − 1
2
1)
q = 1
2
0 − 1
2
1 • Or simply as
x ⎯⎯→
O
(− 1) f ( x ) x
0 0 0⎤
n qubits
⎢ 0 0⎥
⎢
1 0 L
⎥
0 H
Z =⎢ 0 0 1 0⎥ G G G
qubits
⎢ ⎥
Work
⎢ M O 0⎥
⎢⎣ 0 0 0 0 1 ⎥⎦
(1) Apply the oracle
(2) Apply the Hadamards
Z =20 0 −I
G = H Z HO (3) Apply the zero state
phase shift
(4) Apply the Hadamards
3
Grover Iterate Grover Iterate
G = HZHO HZH = 2 ψ ψ − I
• O: inverts the solution states ⎡1 1 1 1⎤ ⎡ α 0 ⎤ ⎡ ∑Nα n ⎤
⎢ ∑αn ⎥
• HZH: invert all states about the mean ⎢1 L 1⎥ ⎢ α1 ⎥
1 ⎢
1 1
⎥⎢ ⎥ ⎢ N ⎥
HZH (ψ ψ ) α = ⎢1 1 1 1⎥ ⎢ α 2 ⎥ = ⎢ ∑Nα n ⎥
H (2 0 0 − I ) H N ⎢
⎢ M O
⎥⎢ ⎥
⎥⎢ M ⎥
⎢ ⎥
2 H 0 0 H − HIH ⎢⎣ 1 1 1 1 ⎥⎦ ⎢⎣α N ⎥⎦ ⎢ M ⎥
⎢ ∑αn ⎥
2 ψ ψ − HIH ⎣ N ⎦
2ψ ψ − I
HZH = 2 ψ ψ − I 1 N −1
ψ ≡H 0 =
N
∑x
x =0
HZH α = ( 2 ψ ψ − I ) ∑ α n n 1
n
N
= ∑ 2α
n
− αn n 0 1 2 3
N −1
HZH: invert all states about the mean • The probability of measuring the marked
state, 1 1
P(m) = =
N 2n
Amplitude
G = HZHO G = HZHO
1 1
N N
4
Grover’s Algorithm How many Grover iterates do we need?
Amplitude