Grover's Algorithm: Raffaele Solcà Assistant: Dr. Alejandro Daleo 17.03.2008
Grover's Algorithm: Raffaele Solcà Assistant: Dr. Alejandro Daleo 17.03.2008
Raffaele Solcà
Assistant: Dr. Alejandro Daleo
17.03.2008
Contents
1. Introduction
• Grover’s algorithm
• Elements of a quantum computer
2. The algorithm
• Abstraction of the problem
• Design of the algorithm
• Example with n=2
• Analysis of the steps of the algorithm
• Implementation with local transformations
3. Geometrical interpretation
• Geometrical understanding of the algorithm
• Number of steps necessary to find the solution
• Probability of failure
4. The case with t solutions
• Number of steps and probability of failure
2
1. Introduction
3
1. Introduction
Measurement of qubits
• The wavefunction collapses in one of the states.
ϕ = ∑ α i i → j with probability α j
2
4
1. Introduction
Walsh-Hadamard Gate
• Generalization of H for many qubits
• Equivalent to apply H on each qubit
γ 1 ⊗L ⊗ γ n H γ 1 ⊗L ⊗ H γ n
γ i ∈ {0,1}
• Matrix : Wij =
1
(− 1)i ⋅ j 5
N
1. Introduction
Oracle
• Is a quantum mechanical operator.
• It is defined as
7
2. The algorithm
( )
ii. Repeat the following operation O N times:
a. Apply the oracle
1
b. Apply the diffusion matrix Dij = −δ ij + 2
N
iii. Measure the resulting state of first register.
8
2. The algorithm
9
2. The algorithm
i. Initial state 1 1 1 1
, , ,
2 2 2 2
1 1 1 1
ii. a. Application of the oracle , ,− ,
2 2 2 2
ii. b. Application of D
1
Dij = −δ ij + 2 1 1 1 1 1 1 1 1
N − , ,− , + 2 , , , = (0,0,1,0 )
2 2 2 2 4 4 4 4
iii.Measurement 2 = 10
with probability p =1
10
2. The algorithm
ψ =W ψ0 =
1
( 0 + 1 )⊗ ( 0 + 1 ) = ∑ i
1 1 3
2 2 2 i =0
11
2. The algorithm
12
2. The algorithm
13
We have seen
We will see
• Geometrical interpretation
• An application of step ii.
• The number of iterations we need to find the
right answer
• The case with t solution
14
3. Geometrical interpretation
Observation
• Define θ as sin (θ ) =
1
N
16
3. Geometrical interpretation
17
3. Geometrical interpretation
18
3. Geometrical interpretation
19
3. Geometrical interpretation
π
• We can approximate m ≈ N
4
Probability of failure
21
3. Geometrical interpretation
• By definition: sin (θ ) =
1
⇒ θ = 30°
2
22
3. Geometrical interpretation
23
4. The case with t solutions
sin (θ ) =
t
• We define:
N
π
• As for one solution we need m = steps
4θ
with a probability of failure
t
pu < sin 2 θ =
N 24
Summary
Grover’s algorithm
• How it is defined
• How it works: Example with n=2
Geometrical interpretation
• The effect of the application of step ii.
• How many step we have to apply
• What is the probability of failure / of finding the correct answer
25