[Quantum Information] Grover Search Algorithm
Grover Search Algorithm
Notes from RWTH Aachen University course
“Quantum Information” Summer semester 2020
professor: Müller, Markus
Grover Search Algorithm
Complexity
Complexity class P
- example: Eulerian path
- Finding the solution: polynomially with the size of the problem
- checking the solution is easy as well
Complexity class NP
- example: Hamiltonian path
- finding the solution is hard (cannot be achieved in polynomial time)
- checking the solution is easy
- NP: solution can be found by non-deterministic (N) Turing machine in polynomial time
such machine does not exist
Hamiltonian Cycle (HC) can be reduced to Traveling Salesman Problem (TSP)
- If we can solve TSP, then we can solve HC
(G of HC, the original edges weight 1 and the non-existing edges weight 2, if there is a cycle value < (n+1), where n=(# nodes), it contains HC.) - If TSP is tractable, then HC is also tractable
- If HC is hard, then TSP must also be hard
- If we can solve TSP, then we can solve HC
example: k-coloring
- Graph 2-coloring is P
- Graph 3-coloring is in NP-complete
- sudoku: NP-complete
- 2-SAT (satisfiability) is P
- (x1∨¯x3)∧(x2∨¯x4)∧...
- 3-SAT (satisfiability) is NP-complete
- (x1∨¯x2∨¯x4)∧(x2∨¯x3∨¯x5)∧...
BQP: bounded-error quantum polynomial time
- with error probability of at most ε
many decision problem can be considered as search problem
Grover Search Algorithm
- Problem:
- Search through the space of N=2n elements
- n bits information of the element
- assume that the number of solutions is exatly M,M≪N
- can be represented by a function f
- f(x)=1, then x is the answer
- f(x)=0, then x is not the answer
- Algorithm:
- Oracle: Of
- |x⟩|−⟩Of→(−1)f(x)|x⟩|−⟩
- If measure |x⟩, then x is not a solution
If measure −|x⟩, then x is a solution
the oracle does not know any of the solution, it only able to recognize a solution
- Oracle: Of
- Prepare the initial state
- |ψ⟩=1√N∑x|x⟩
- 1√N∑x|x⟩=1√N(√N−M1√N−M∑f(x)≠1|x⟩+√M1√M∑f(x)=1|x⟩)=√N−MN|α⟩+√MN|β⟩=√1−ε|α⟩+√ε|β⟩
where ε=M/N≪1 - probability to find any solution. projector onto the solution space:
ˆP=∑f(x)=1|x⟩⟨x|
probability = ⟨ψ|ˆP|ψ⟩=ε
- |ψ⟩=1√N∑x|x⟩
- Prepare a grover step G iteratively k times
- applying oracle Of,±
- The oracle
O=1−2ˆP=1−2∑f(x)=1|x⟩⟨x|
then
O|x⟩=|x⟩, if |x⟩ is not a solution
O|x⟩=−|x⟩, if |x⟩ is a solution
- The oracle
- applying reflection operator U=2|ψ⟩⟨ψ|−1
- $UO|ψ⟩=(2|ψ⟩⟨ψ|−1)(|ψ⟩−2√ε|β⟩)=(1−4ε)√1−ε|α⟩+(3−4ε)√ε|β⟩
$ - now, the probability to find any solution is ≈9⋅ε
increase by a factor of 9 - geometric visualization
- Of: reflect |ψ⟩ over |β⟩
- G: reflect O|ψ⟩ over |ψ⟩
- the original angle θ/2
after GOf, rotated by θ to |β⟩
- after k iterations
Gk|ψ⟩=cos(2k+12θ)|α⟩+sin(2k+12θ)|β⟩ - the optimal k steps
k≈π4√NM - complexity:
O(√NM)
classical: O(N/M), a quadratic speedup
- $UO|ψ⟩=(2|ψ⟩⟨ψ|−1)(|ψ⟩−2√ε|β⟩)=(1−4ε)√1−ε|α⟩+(3−4ε)√ε|β⟩
- applying oracle Of,±
- measuring all n-qubits yields an outcome x
- Discussion
- Is not reaching the solution state |β⟩ exatly?
- in generally ˜k is not an integer
- choose the nearest k still with small error probability
- Quantum computer cannot solve the NP-complete problem efficiently.
- example: Hamiltonian Path
- complexity O(nn)=O(2n⋅log(n))
- quantum computing O(p(n)2n⋅log(n)/2)
- p(n): polynomial overhead
- /2: quantum speedup
- Grover Search is optimal
- can be proved no quantum algorithm can use less than O(√NM) oracle access
Reading
Nielsen and Chuang
6.1 The quantum search algorithm
留言
張貼留言