Lecture 5 - Department of Computer Science and Engineering, CUHK

advertisement
Quantum Computing
(Fall 2013)
Instructor: Shengyu Zhang.
Lecture 5 Quantum searching algorithms and lower bounds
1. Grover’s search
After learning quantum algorithms for algebraic problems, we have a feeling that quantum
speedup (over classical algorithms) needs a strong algebraic structure in the problem. Thus it
was a surprise when Grover discovered that searching, one of the most fundamental
primitives, in a totally unstructured set, provides quantum speedup.
Consider a set of 𝑛 elements, say {22,8,3,12,…}. We want to see whether there is a target
element, say 11. Suppose that once given any particular element, it is easy for us to check
whether it’s our target. Classically, to solve the problem, we clearly need to scan the whole
list, yielding a complexity of 𝛩(𝑛). Using Grover’s search, we can finish the job by looking
at the list only O(√𝑛) times.
To make it easier to state, suppose that we are given a string π‘₯ ∈ {0,1}𝑛 and we want to
decide whether π‘₯ = 00 … 0. We have an oracle to tell us whether a particular position is 1 or
0. That is, if we make a query “π‘₯𝑖 =?”, then the oracle gives the answer. Such algorithms are
called query algorithms. You must have seen these when learning sorting, where the oracle
answers the question “π‘₯𝑖 > π‘₯𝑗 ?” and it is well-known that the optimal sorting algorithm needs
𝑂(𝑛 log 𝑛) queries. In a quantum algorithm, we can make queries in superposition, and get
corresponding answers in superposition as well. For example, if we make a query by
inputting ∑𝑖|𝑖⟩|0⟩ to the oracle, then we’ll get ∑𝑖|𝑖⟩|π‘₯𝑖 ⟩ in the answer. We can also assume
that the oracle takes a query ∑𝑖|𝑖⟩ and answers ∑𝑖(−1)π‘₯𝑖 |𝑖⟩. Can you see why?
Assuming the latter oracle format, we now give the Grover’s algorithm.
1
√𝑛
𝑂 1
→
√𝑛
∑𝑛−1
𝑖=0 |𝑖⟩
π‘₯𝑖
∑𝑛−1
𝑖=0 (−1) |𝑖⟩
(𝐻 ⊗log 𝑛 𝑅0 𝐻 ⊗log 𝑛 )
→
π‘˜
…
Here 𝑅0 is the reflection about the state |0⟩, namely, 𝑅0 |0⟩ = |0⟩ and 𝑅0 |𝑖⟩ = −|𝑖⟩ for all
𝑖 ∈ {1,2, … , 𝑛 − 1}. The oracle 𝑂 can also be viewed as a reflection about the state
1
√𝑛−π‘š
∑𝑖:π‘₯𝑖 =0 |𝑖⟩, where π‘š = |{𝑖: π‘₯𝑖 = 1}|. These two reflections combined have the effect of
rotating the current state towards a target one
1
√π‘š
∑𝑖:π‘₯𝑖 =1 |𝑖⟩ by 2πœƒ where πœƒ =
arccos(√1 − π‘š/𝑛) = 𝛩(√π‘š/𝑛). So it takes (π/2)/2πœƒ = Θ(√𝑛/π‘š) iterations. Since in
each iteration the algorithm only takes 1 query, the algorithm needs Θ(√𝑛/π‘š) = 𝑂(√𝑛)
queries.
(In class, I’ll show a geometrical interpretation of the algorithm, and things will be very
clear.)
After the rotations, measure in the computational basis and then verify it by one more query.
In this way we’ll find an 𝑖 with π‘₯𝑖 = 1.
Question: What if we don’t know π‘š in advance? We can try π‘š = 𝑛/2, 𝑛/4, 𝑛/8, … until
we succeed.
2. Quantum query algorithms
Grover’s searching algorithm belongs to the general class of quantum query algorithms.
Suppose 𝑓: 𝛴𝐼 𝑛 → 𝛴𝑂 and an oracle O has the following effect:
𝑂
∑ 𝛼𝑖,π‘Ž,𝑧 |𝑖, π‘Ž, 𝑧⟩ → ∑ 𝛼𝑖,π‘Ž,𝑧 |𝑖, π‘Ž + π‘₯𝑖 , 𝑧⟩
𝑖,π‘Ž,𝑧
𝑖,π‘Ž,𝑧
where the addition π‘Ž + π‘₯𝑖 is π‘šπ‘œπ‘‘ |Σ𝐼 |. That is, the oracle tells the value of input variables
π‘₯𝑖 in superposition. Note that it doesn’t let us to get all information of input variables in one
query, since the answers are in a superposition and we cannot extract the 𝑛 bits from it.
Recall that even the last algorithm we talked about in last lecture (for HSP for non-Abelian
group) falls in the framework of query algorithm.
A general question is how to design query efficient algorithms and how to prove lower
bounds for quantum query complexity. Namely, we want to pin down the quantum query
complexity π‘„πœ– (𝑓), the smallest number of queries needed to compute 𝑓 with error
probability at most πœ– on any input. Next we introduce one powerful method for lower bound
proving.
3. Quantum adversary method
To use the quantum adversary method, we need to first find a matrix 𝛀 ∈ ℂ𝑁×𝑁 where 𝑁 = |Σ𝐼 |𝑛 .
Index the rows by π‘₯ and columns by 𝑦. The matrix needs to satisfy 𝛀(π‘₯, 𝑦) = 0 as long as 𝑓(π‘₯) =
𝑓(𝑦). Define 𝐷𝑖 ∈ ℂ𝑁×𝑁 by 𝐷𝑖 (π‘₯, 𝑦) = 1 if π‘₯𝑖 ≠ 𝑦𝑖 and 𝐷𝑖 (π‘₯, 𝑦) = 0 otherwise. Suppose 𝛀 is
nonzero, and consider the quantity
‖𝛀‖
.
maxβ€–π›€βˆ˜π·π‘– β€–
This is a lower bound of the quantum query complexity!
𝑖
‖𝛀‖
Taking the best 𝛀 and denote 𝐴𝐷𝑉(𝑓) = max maxβ€–π›€βˆ˜π· β€–. The lower bound goes like the following.
𝛀≠0
𝑖
𝑖
1
π‘„πœ– (𝑓) ≥ ( − √πœ–(1 − πœ–)) 𝐴𝐷𝑉(𝑓)
2
The proof is in paper [HLS07], which is well written and self-contained enough to be easily read.
Thus there is no point of copying the proof here. I’ll show the whole proof in class.
Note
Grover’s search first appeared in [Gro96]. The quantum adversary method was originally
discovered in a weaker form by Ambainis [Amb02], and various equivalent forms were
founded; see [SS06]. The final form as we presented was proposed in [HLS07], which is
stronger than previous ones.
Reference
[Amb02] Andris Ambainis, Quantum Lower Bounds by Quantum Arguments, Journal of
Computer and System Sciences, Volume 64, Issue 4, pages 750–767, 2002. (Earlier at STOC’00.)
[Gro96] Lov Grover, A fast quantum mechanical algorithm for database search, in Proceedings of
the twenty-eighth annual ACM symposium on Theory of computing, pages 212-219, 1996.
[HLS07] Peter Hoyer, Troy Lee, Robert Spalek, Negative weights make adversaries stronger, in
Proceedings of the thirty-ninth annual ACM symposium on Theory of computing, pages 526 – 535,
2007.
[SS06] Robert Spalek, Mario Szegedy, All Quantum Adversary Methods are Equivalent, Theory
of Computing 2(1): 1-18, 2006.
Download