grover. part 2. components of grover loop the oracle -- o the hadamard transforms -- h the zero...
Post on 20-Jan-2016
224 views
TRANSCRIPT
![Page 1: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/1.jpg)
Grover. Part 2
![Page 2: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/2.jpg)
Components of Grover Loop
• The Oracle -- O
• The Hadamard Transforms -- H
• The Zero State Phase Shift -- Z
O is an Oracle
H is Hadamards
H is Hadamards
Z is Zero State Phase Shift
Grover Iterate
![Page 3: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/3.jpg)
Inputs oracle
We need to initialize in a superposed state
This is action of quantum oracle
![Page 4: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/4.jpg)
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. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/5.jpg)
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. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/6.jpg)
Vector of Hadamards
![Page 7: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/7.jpg)
Notation Reminder
a Control with value a=1
a Control with value a=0
a
equivalent
![Page 8: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/8.jpg)
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
Zero State Phase Shift Circuit
![Page 9: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/9.jpg)
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 10: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/10.jpg)
2 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
0 -1 0 0
0 0 -1 0
0 0 0 -1
-1 0 0 0
0 -1 0 0
0 0 -1 0
0 0 0 -1
+ =
With accuracy to phase
![Page 11: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/11.jpg)
In each G
This is a global view of Grover. Repeatitions of G
Here you have all components of Grover’s loop
![Page 12: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/12.jpg)
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 13: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/13.jpg)
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 14: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/14.jpg)
Here we prove that |> < | used inside HZH calculates the mean
a Vector of mean values
Will be explained in next slide
Explanation of the first part of Grover iterate formula
![Page 15: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/15.jpg)
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 16: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/16.jpg)
For every bit
Amplitudes of bits after Hadamard
Positive or negative amplitudes in other explanations
All possible states
![Page 17: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/17.jpg)
Amplitudes of bits after one stage of G
This value based on previous slide
![Page 18: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/18.jpg)
This slides explains the basic mechanism of the Grover-like algorithms
![Page 19: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/19.jpg)
You can verify it also in simulation
Additional Additional ExerciseExercise
This is a lot calculations, requires matrix multiplication
![Page 20: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/20.jpg)
Here we calculate analytically when to stop
The equations taken from the previous slides “Grover Iterate”
For marked state
For unmarked state
![Page 21: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/21.jpg)
We found k from these equations
recursionWe want to find how many times to iterate
![Page 22: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/22.jpg)
![Page 23: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/23.jpg)
But you can do better if you have knowledge, for instance the upper bound of chromatic number in graph coloring
![Page 24: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/24.jpg)
Grover search example.
• Here is an example of Grover search for n = 3 qubits, where N = 2n =8. – We omit reference to qubit n+1, which is in
state 1 /√2 (|0>−|1>i) and does not change.
• The dimension of the unitary operators for this example is thus 2n = 8 also.)
![Page 25: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/25.jpg)
• (Remember that numbering starts with 0 and ends with 7, so that the -1 here is in the slot for |5>.)
• This matrix reverses the sign on state |5>, and leaves the other states unchanged.
•Suppose the unknown number is |a> = |5>. •The matrix or black box oracle Ufa is
oracle
![Page 26: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/26.jpg)
•The Walsh matrix W8 is
Now we use normalization
![Page 27: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/27.jpg)
The matrix −Uf0 is
![Page 28: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/28.jpg)
This matrix changes the sign on all states except |0>.
Finally, we have the repeated step RsRa in the
Grover algorithm:
oracle
shift
hadamards
![Page 29: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/29.jpg)
![Page 30: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/30.jpg)
![Page 31: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/31.jpg)
After second rotation we get
![Page 32: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/32.jpg)
Summary and our work
When you know anything about the problem (symmetry, observation, bounds, function within some classification class) you can design a better Grover like algorithm but for your data only.
This is enough in real life like CAD or Image Processing, since data are always specific, not the worst case data as in Mathematic proofs
![Page 33: Grover. Part 2. Components of Grover Loop The Oracle -- O The Hadamard Transforms -- H The Zero State Phase Shift -- Z O is an Oracle H is Hadamards H](https://reader035.vdocument.in/reader035/viewer/2022062322/56649d4a5503460f94a2729c/html5/thumbnails/33.jpg)
Problem for students
• Build the Grover algorithm for ternary quantum logic.
• First you need to generalize Hadamard transform to Chrestenson transform.
• Next you need to have some kind of ternary reversible gates to build oracle.
• The same gates will be used for Zero State Phase Shift circuit.