Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am...
-
date post
15-Jan-2016 -
Category
Documents
-
view
220 -
download
0
Transcript of Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am...
![Page 1: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/1.jpg)
Grover Algorithm
I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for
extensions and (possible) mistakes
Marek Perkowski
![Page 2: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/2.jpg)
From Grover to general search
![Page 3: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/3.jpg)
![Page 4: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/4.jpg)
![Page 5: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/5.jpg)
![Page 6: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/6.jpg)
Graph Coloring• Building oracle for graph coloring is a better example.• This is not an optimal way to do graph coloring but explains well the
principle of building oracles.
The Graph Coloring Problem
2
4
1
3
5
6 7
2
4
1
3
5
6 7
Color every node with a color. Every two nodes that share an edge should have different colors. Number of colors should be minimum
This graph is 3-colorable
![Page 7: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/7.jpg)
Simpler Graph Coloring Problem
2
1
3
4
Two wires for color of node 1
Two wires for color of node 2
Two wires for color of node 3
Two wires for color of node 4
Gives “1” when nodes 1 and 2 have different colors
12
13
23
24
34
Value 1 for good coloring
We need to give all possible colors here
![Page 8: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/8.jpg)
Simpler Graph Coloring Problem
12
13
23
24
34
Value 1 for good coloring
We need to give all possible colors here
H
H
H
H
H
Give Hadamard for each wire to get superposition of all state, which means the set of all colorings
|0>|0>
|0>
![Page 9: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/9.jpg)
Block Diagram
Vector Of
Hadamards
Vector Of
Basic States
|0>Oracle with Comparators,
Global AND gate
Work bits
Output of AND
All good colorings are encoded by negative phase
Think about this as a very big Kmap with -1 for every good coloring
![Page 10: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/10.jpg)
What Grover algorithm does?
• Grover algorithm looks to a very big Kmap and tells where is the -1 in it.
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 -1 1 1 1 1 1
1 1 1 1 1 1 1 1
Here is -1
![Page 11: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/11.jpg)
What “Grover for multiple solutions” algorithm does?
• Grover algorithm looks to a very big Kmap and tells where is the -1 in it.
• “Grover for many solutions” will tell all solutions.
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 -1 1 1 1 1 1
1 1 1 -1 -1 1 1 1
Here is -1, and here is -1, and here
![Page 12: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/12.jpg)
Variants of Grover
• With this oracle the “Grover algorithm for many solutions” will find all good colorings of the graph.
• If we want to find the coloring, that is good and in addition has less than K colors, we need to add the cost comparison circuit to the oracle.
• Then the oracle’s answers will be “one” only if the coloring is good and has less colors than K.
• The oracle thus becomes more complicated but the Grover algorithm can be still used.
![Page 13: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/13.jpg)
Another example
![Page 14: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/14.jpg)
![Page 15: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/15.jpg)
This is a better example of problems for Grover
![Page 16: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/16.jpg)
Advantage of Grover, although not “tractable”
![Page 17: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/17.jpg)
Example of oracle
![Page 18: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/18.jpg)
Another example of Oracle, Another example of Oracle, more realisticmore realistic
![Page 19: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/19.jpg)
Working bits
tour
Answer bit or oracle bit
![Page 20: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/20.jpg)
![Page 21: Grover Algorithm I used slides of Anuj Dawar, Jake Biamonte, Julian Miller and Orlin Grabbe but I am to be blamed for extensions and (possible) mistakes.](https://reader036.fdocuments.us/reader036/viewer/2022062305/56649d4c5503460f94a2b065/html5/thumbnails/21.jpg)
Possible Applications
• Formulate an oracle (reversible circuit) for the following problems:– 1. Graph coloring with of a planar map.– 2. Graph coloring with the minimum number of colors
of an arbitrary graph.– 3. Satisfiability.– 4. Set Covering.– 5. Euler Path in a graph.– 6. Hamiltonian Path in a graph.– 7. Cryptographic Puzzle like SEND+MORE=MONEY.