grover. part 2 anuj dawar. components of grover loop the oracle -- o the hadamard transforms -- h...

22
Grover. Part 2 Anuj Dawar

Post on 21-Dec-2015

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Grover. Part 2

Anuj Dawar

Page 2: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Components of Grover Loop

• The Oracle -- O

• The Hadamard Transforms -- H

• The Zero State Phase Shift -- Z

Page 3: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Inputs oracle

We need to initialize in a superposed state

This is action of quantum oracle

Page 4: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

This is a typical way how oracle operates

This is a typical way how oracle operation is described

Encodes input combination with changed sign in a superposition of all

Page 5: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Role of Oracle

• We want to encode input combination with changed sign in a superposition of all states.

• This is done by Oracle together with Hadamards.

• We need a circuit to distinguish somehow globally good and bad states.

Page 6: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Vector of Hadamards

Page 7: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

This is value of oracle bit

Flips the data phase

All information of oracle is in the phase but how to read it?

This is just an example of a single minterm, but can be any function

Page 8: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Flips the oracle bit when all bits are zero

Rewriting matrix Z to Dirac notation, you can change phase globally

This is state of all zeros

Page 9: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

In each G

This is a global view of Grover. Repeatitions of G

Here you have all components of Grover’s loop

Page 10: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Generality

• Observe that a problem is described only by Oracle.

• So by changing the Oracle you can have your own quantum algorithm.

• You can still improve the Grover loop for particular special cases

Page 11: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

proof

Here we explain in detail what

happens inside G. This can be

generalized to G-like circuits

Grover iterate has two tasks: (1) invert the solution states and (2) invert all states about the mean

Page 12: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Here we prove that |> < | used inside HZH calculates the mean

a

Page 13: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

This proof is easy and it only uses formalisms that we already know.

(( ))

(( ))

From previous slide

What does it mean invert all states about the mean?

Page 14: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

For every bit

Amplitudes of bits after Hadamard

Positive or negative amplitudes in other explanations

All possible states

Page 15: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Amplitudes of bits after one stage of G

This value based on previous slide

Page 16: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

This slides explains mechanism of Grover-like algorithms

Page 17: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

You can verify it also in simulation

Additional Additional ExerciseExercise

Page 18: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

Here we calculate analytically when to stop

The equations taken from the previous slides “Grover Iterate”

For marked state

For unmarked state

Page 19: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z

We found k from these equations

recursionWe want to find how many times to iterate

Page 20: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z
Page 21: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z
Page 22: Grover. Part 2 Anuj Dawar. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z