Lecture 2: Techniques for quantum algorithms
Download
Report
Transcript Lecture 2: Techniques for quantum algorithms
Lecture 2: Techniques
for quantum algorithms
Dominic Berry
Macquarie University
Groverโs search algorithm
๏ฎ
๏ฎ
1996
Problem: Given a function ๐(๐ฅ) mapping ๐ bits to 1 bit
๐ ๐ฅ : 0,1 ๐ โ {0,1}, determine the value of ๐ฅ such that ๐ ๐ฅ = 1.
Classically we need to evaluate ๐ ๐ values, ๐ = 2๐ .
๏ฎ
๏ฎ
1.
2.
Groverโs algorithm enables a search
with ๐ ๐ queries.
Quantum algorithm has two crucial
steps:
Calculate the function on all values
simultaneously.
Reflect about the equal superposition
state.
๏ฎ
These steps are repeated ๐
times.
๏ฎ
This is optimal.
๐
Lov Grover
1997
Optimality of Groverโs algorithm
๏ฎ
It is not possible to perform any better.
๏ฎ
NP is the class of problems that can be verified in
polynomial time. That is, if given ๐, you can verify
that ๐ ๐ = 1 efficiently โ but it is hard to find ๐.
๏ฎ
If it were possible to achieve an exponential
speedup for search, it would mean that a quantum
computer can solve NP problems in polynomial
time.
Bennett, Bernstein,
Brassard, Vazirani
๏ฎ
It is not possible to search any faster than ๐.
๏ฎ
NP problems are still fundamentally hard on
quantum computers.
1997
Optimality of Groverโs algorithm
Method of solution:
๏ฎ Denote operations between oracle calls by ๐โ . The
general state produced by the sequence of ๐ oracle
calls is then
๐โช = ๐ ๐ ๐
|๐๐
๐ ๐ ๐โ1 ๐๐ โฆ ๐2 ๐๐ ๐1 ๐๐ ๐
๏ฎ
๏ฎ
If we did not call the oracle, then the state would be
|๐ ๐ โช = ๐๐ ๐๐โ1 โฆ ๐2 ๐1 |๐โช
When we sum over all ๐ we need large ๐ to make
the following quantity large:
๐
๐โช
|๐๐
๐๐ =
โ
Bennett, Bernstein,
Brassard, Vazirani
2
๐
|๐ โช
๐=1
๏ฎ
We then show that, unless ๐๐ is large, we cannot
obtain the solution with high probability.
Amplitude amplification
๏ฎ
Problem: Given a function ๐(๐ฅ) mapping ๐ bits to 1 bit
๐ ๐ฅ : 0,1 ๐ โ {0,1}, and an algorithm that produces a state that
is a superposition of values of ๐ฅ, obtain a state that is
superposition only of values of ๐ฅ such that ๐(๐ฅ) = 1.
๏ฎ
The idea is that ๐(๐ฅ) = 1 corresponds to a success, and we want
to amplify the successful component of the state.
๏ฎ
Denote the state prepared by the algorithm
๐
๐ =
๐๐ฅ |๐ฅโช
๐ฅ=1
๏ฎ
Let the ๐ success states be ๐๐ .
๏ฎ
If we were just to measure, the probability of obtaining success
would be
๐=
๐๐ฅ
2
๐ฅโ{๐๐ }
๏ฎ
Classically repeating would require ๐(1/๐) repetitions.
๏ฎ
Amplitude amplification only needs ๐(1/ ๐).
1997
Brassard & Høyer
Amplitude amplification
๏ฎ
Method: Alternate reflections about the prepared state |๐ โช and
the solution states |๐๐ โช.
๏ฎ
As for Groverโs algorithm, the reflection about the superposition
state is the oracle
๐
๐๐ = ๐ โ 2๐๐ ,
๐๐ =
๐๐ โฉ๐๐ |
๐=1
๏ฎ
๏ฎ
In Groverโs algorithm, we can denote the operation that
transforms |0โช to the equal superposition state by ๐. This is just
a tensor product of Hadamards.
The reflection is obtained by performing ๐ โ , reflecting about |0โช,
then performing ๐ again.
๐๐ = 2 ๐ โฉ๐ | โ ๐ = ๐ 2 0 0 โ๐ ๐ โ
๏ฎ
Here we can denote the algorithm by a unitary operation ๐ that
transforms |0โช to |๐ โช.
๏ฎ
The reflection is obtained in exactly the same way:
๐๐ = ๐ 2 0 0 โ๐ ๐ โ
1997
Brassard & Høyer
Amplitude amplification
1997
๐๐ = ๐ โ 2๐๐
๐๐ = 2 ๐ โฉ๐ | โ ๐
๏ฎ
The initial state can be written as
๐
๐ =
๐๐ฅ |๐ฅโช =
๐ฅ=1
๐๐ฅ |๐ฅโช +
๐ฅโ{๐๐ }
๐๐ฅ |๐ฅโช
๐ฅโ{๐๐ }
Brassard & Høyer
= cos ๐ ๐ โฒ + sin ๐ |๐โช
where sin2 ๐ = ๐,
1
โฒ
๐ =
๐๐ฅ |๐ฅโช ,
1 โ ๐ ๐ฅโ{๐ }
๐
1
๐ =
๐
๐๐ฅ |๐ฅโช
๐ฅโ{๐๐ }
๏ฎ
The action of ๐๐ on ๐ is
๐๐ ๐ = (2 ๐ โฉ๐ | โ ๐) ๐
=2๐ ๐ ๐ โ ๐
= 2 sin ๐ ๐ โ ๐
๏ฎ
This gives
๐๐ ๐ = 2 sin ๐ cos ๐ ๐ โฒ + sin ๐ |๐โช โ ๐
= 2 sin ๐ cos ๐ ๐ โฒ โ 1 โ 2 sin2 ๐ ๐
= sin 2๐ ๐ โฒ โ cos 2๐ |๐โช
Amplitude amplification
1997
๐๐ = ๐ โ 2๐๐
๐๐ = 2 ๐ โฉ๐ | โ ๐
๐ = cos ๐ ๐ โฒ + sin ๐ |๐โช
sin2 ๐ = ๐
๐๐ ๐ = sin 2๐ ๐ โฒ โ cos 2๐ |๐โช
๏ฎ
The action of ๐๐ on ๐ โฒ is
๐๐ ๐ โฒ = (2 ๐ โฉ๐ | โ ๐) ๐ โฒ
= 2 ๐ ๐ โฒ ๐ โ ๐ โฒ
= 2 cos ๐ ๐ โ |๐ โฒ โช
๏ฎ
This gives
๐๐ ๐ โฒ = 2 cos ๐ cos ๐ ๐ โฒ + sin ๐ |๐โช โ ๐ โฒ
= 2 cos 2 ๐ โ 1 sโฒ + 2 sin ๐ cos ๐ ๐
= cos 2๐ ๐ โฒ + sin 2๐ |๐โช
๏ฎ
Consider the state
๐ = cos ๐ ๐ โฒ + sin ๐ |๐โช
๏ฎ
The action of ๐๐ is
๐๐ ๐ = cos ๐ ๐ โฒ โ sin ๐ |๐โช
๏ฎ
Then applying ๐๐ gives ๐๐ ๐๐ ๐
= cos ๐ cos 2๐ ๐ โฒ + sin 2๐ |๐โช โ sin ๐ sin 2๐ ๐ โฒ โ cos 2๐ |๐โช
= cos ๐ cos 2๐ โ sin ๐ sin 2๐ ๐ โฒ + cos ๐ sin 2๐ + sin ๐ cos 2๐ ๐
= cos(๐ + 2๐) ๐ โฒ + sin(๐ + 2๐) ๐
Brassard & Høyer
Amplitude amplification
๐๐ = ๐ โ 2๐๐
๐๐ = 2 ๐ โฉ๐ | โ ๐
๐ = cos ๐ ๐ โฒ + sin ๐ |๐โช
sin2 ๐ = ๐
๐๐ ๐ = sin 2๐ ๐ โฒ โ cos 2๐ |๐โช
๐๐ ๐ โฒ = cos 2๐ ๐ โฒ + sin 2๐ |๐โช
๏ฎ
With the state
๐ = cos ๐ ๐ โฒ + sin ๐ |๐โช
๐๐ ๐๐ ๐ = cos(๐ + 2๐) ๐ โฒ + sin(๐ + 2๐) ๐
๏ฎ
This means that the algorithm gives
๐๐ ๐๐
๏ฎ
๐
๐ = cos[ 2๐ + 1 ๐] ๐ โฒ + sin 2๐ + 1 ๐ |๐โช
The optimal number of iterations is therefore
๐
2๐ + 1 โ
2๐
๐
๐โ
4 ๐
1997
Brassard & Høyer
State preparation
๏ฎ
Consider an alternative formulation of the amplitude amplification
problem.
๏ฎ
Our algorithm gives us the state
2000
๐
๐ =
๐ ๐ฅ |๐ฅโช sin ๐๐ฅ 0 + cos ๐๐ฅ |1โช
๐ฅ=1
Lov Grover
๏ฎ
We want to remove the |1โช component โ i.e., we want the effect
of a measurement on the ancilla with result 0.
๏ฎ
We use these two reflections:
๐๐ = ๐ โ (๐ โ 2|0โชโฉ0|)
๐๐ = 2 ๐ โฉ๐ | โ ๐
๏ฎ
This is now identical to standard amplitude amplification. The
oracle is just returning success if the ancilla is in state |0โช.
๏ฎ
The number of steps is
~
๐
4 ๐
=
๐
4
โ1/2
๐
๐ ๐ฅ2 sin2 ๐๐ฅ
๐ฅ=1
State preparation
๏ฎ
We want to prepare the state
2000
๐
๐ =
๐๐ฅ |๐ฅโช
๐ฅ=1
๏ฎ
Consider an oracle that yields ๐๐ ๐ฅ |0โช = |๐ฅโช|๐๐ฅ โช. The
procedure is as follows:
1.
Start with an equal superposition state with two ancillas
๐
1
๐ ๐ฅ=1
2.
Apply oracle to give
|๐ฅโช 0 |0โช
๐
๐ฅ ๐๐ฅ |0โช
๐ฅ=1
3.
Apply a rotation on the second ancilla controlled by the state of
the first ancilla to give
๐
๐ฅ ๐๐ฅ
๐ฅ=1
๐๐ฅ 0 + 1 โ ๐๐ฅ 2 |1โช
Lov Grover
2000
State preparation
๏ฎ
We want to prepare the state
๐
๐ =
๐๐ฅ |๐ฅโช
4.
๐ =
๐ฅ=1
๏ฎ
Consider an oracle that yields
๐๐ ๐ฅ |0โช = |๐ฅโช|๐๐ฅ โช. The procedure is:
1.
Start with an equal superposition state
with two ancillas
1
๐
๐ ๐ฅ=1
2.
3.
The number of steps required in the
amplitude amplification is then
๐
๐ ๐
~
=
4 ๐
4
๏ฎ
This problem may be used to encode a
search problem; for example, where
๐๐ = 1 for an unknown ๐. That means
that this complexity is optimal for worstcase problems.
๏ฎ
For specific problems, the complexity
may be improved upon.
Apply a rotation on the second ancilla
controlled by the state of the first ancilla
1
๐
๐ ๐ฅ=1
๐ฅ ๐๐ฅ
๐๐ฅ 0 + 1 โ ๐๐ฅ 2 |1โช
๐๐ฅ 0 + 1 โ ๐๐ฅ 2 |1โช
๏ฎ
๐
๐ ๐ฅ=1
๐ ๐ฅ=1
๐ฅ 0
The procedure in steps 1 to 4 then
prepares the state |๐ โช that can be used
in the amplitude amplification
procedure described earlier.
|๐ฅโช 0 |0โช
๐ฅ ๐๐ฅ |0โช
1
๐
5.
Apply oracle to give
1
Invert the oracle to give
Quantum phase estimation
๏ฎ
Often in quantum algorithms, one has a unitary operator ๐, and
wants to find an eigenvalue.
๏ฎ
Given a state in the form
๐
๐ =
๐๐ |๐๐ โช
๐=1
where e๐๐๐ is an eigenvalue of ๐ and |๐๐ โช is the corresponding
eigenvector, one wants to obtain an estimate, ๐๐ , of ๐๐ with
probability ๐๐ 2 .
๏ฎ
1995
Alternatively, one wants to place the estimate in an ancillary
register in a coherent way to obtain (approximately) the state
๐
๐๐ |๐๐ โช|๐๐ โช
๐=1
Alexei Kitaev
Quantum phase estimation
๏ฎ
Consider an initial eigenstate ๐ = |๐โช.
๏ฎ
The Hadamard gives ( 0 + |1โช)/ 2.
๏ฎ
The controlled ๐ โ operation gives ( 0 + ๐ ๐โ๐ |1โช)/ 2.
๏ฎ
The state of the set of ๐ qubits is
1
2๐
|0โช
|0โช
|0โช
|0โช
|0โช
|0โช
|๐โช
2๐ โ1
๐ ๐๐ฅ๐ |๐ฅโช
Alexei Kitaev
๐ฅ=0
๐ป
๐ป
๐ป
๐ป
๐ป
๐ป
Inverse
QFT
๐
1995
๐ 2 ๐ 4 ๐ 8 ๐16 ๐ 32
bits
of ๐
1995
Quantum phase estimation
๏ฎ
Consider an initial eigenstate ๐ = |๐โช.
๏ฎ
The Hadamard gives ( 0 + |1โช)/ 2.
๏ฎ
The controlled ๐ โ operation gives ( 0 + ๐ ๐โ๐ |1โช)/ 2.
๏ฎ
The state of the set of ๐ qubits is
2๐ โ1
1
2๐
๏ฎ
Net result is state
๐
๐
๐ โ2๐๐๐ฅ๐ฆ/2 ๐ฆ โฉ๐ฅ|
๐ =
๐๐ |๐๐ โช
๐=1
becomes
๐
It therefore gives
1
2๐
๏ฎ
๐ฅ=0
2๐ โ1
2๐ ๐ฅ,๐ฆ=0
๏ฎ
Alexei Kitaev
The inverse QFT is the operation
1
๏ฎ
๐ ๐๐ฅ๐ |๐ฅโช
2๐ โ1
๐
๐ โ2๐๐๐ฅ๐ฆ/2 ๐ ๐๐ฅ๐
๐ฆ
๐ฅ,๐ฆ=0
๐๐ ๐๐ |๐๐ โช
๐=1
For ๐ = 2๐๐/2๐ , the sum over ๐ฅ is nonzero only for ๐ฆ = ๐, giving the state |๐โช.
That is, for ๐ = 2๐ × 0. ๐1 ๐2 ๐3 โฆ ๐๐ , the output state is
๐1 ๐2 โฆ |๐๐ โช
Operation conversion
๏ฎ
We can implement one unitary ๐, but we want to implement a different
operation ๐.
๏ฎ
The operations share eigenstates, but the eigenvalues are related by a
function.
๐ ๐ = ๐ ๐๐ ๐
๐ ๐ = ๐ ๐ |๐โช
๏ฎ
Implement the unitary V many times and perform phase estimation to give
๐
๐
๐ =
๐๐ |๐๐ โช
๐=1
๏ฎ
โฆ
๐ ๐ ๐๐ | ๐๐ โช
๐=1
The eigenvalue ๐(๐) can then be imposed, giving (ignoring error)
๐
๐๐ ๐(๐๐ ) ๐๐ |๐๐ โช
๐=1
๏ฎ
Inverting the phase estimation gives
๐
๐๐ ๐(๐๐ ) ๐๐ = ๐|๐โช
๐=1
Simulation of Hamiltonians
๏ฎ
In general, the problem of simulating a physical system is
that of simulating Hamiltonian evolution:
๐
๐ = โ๐๐ป(๐ก)|๐โช
๐๐ก ๐ก
๏ฎ
For a constant Hamiltonian, we would have
๐๐ก = ๐ โ๐๐ป๐ก |๐0 โช
๏ฎ
A typical physical system consists of many subsystems:
1996
Seth Lloyd
๏ฎ
Each subsystem is of limited
dimension ๐, but with ๐ subsystems
the overall dimension is ๐ ๐ .
๏ฎ
A typical Hamiltonian is a sum of local
terms on individual subsystems, and
interaction terms on 2 subsystems.
๐ป=
๐ป๐
๐
1996
Simulation of Hamiltonians
๏ฎ
We want to simulate the evolution
๐๐ก = ๐ โ๐๐ป๐ก |๐0 โช
๏ฎ
With a Hamiltonian a sum of terms:
๐ป=
๐ป๐
๐
๏ฎ
Each individual ๐ป๐ has low dimension, so could be
efficiently simulated on its own.
๏ฎ
Seth Lloyd
That is, we can perform
๐ โ๐๐ป๐๐ก
๏ฎ
For short times we can use the
approximation that
๐ โ๐๐ป1๐ฟ๐ก ๐ โ๐๐ป2 ๐ฟ๐ก โฆ ๐ โ๐๐ป๐พโ1 ๐ฟ๐ก ๐ โ๐๐ป๐พ ๐ฟ๐ก โ ๐ โ๐๐ป๐ฟ๐ก
1996
Simulation of Hamiltonians
๏ฎ
For short times we can use the approximation that
๐ โ๐๐ป1 ๐ฟ๐ก ๐ โ๐๐ป2๐ฟ๐ก โฆ ๐ โ๐๐ป๐พโ1๐ฟ๐ก ๐ โ๐๐ป๐พ ๐ฟ๐ก โ ๐ โ๐๐ป๐ฟ๐ก
๏ฎ
๏ฎ
๏ฎ
๏ฎ
This approximation is because
๐ โ๐๐ป1๐ฟ๐ก ๐ โ๐๐ป2 ๐ฟ๐ก โฆ ๐ โ๐๐ป๐พโ1 ๐ฟ๐ก ๐ โ๐๐ป๐พ ๐ฟ๐ก
= ๐ โ ๐๐ป1 ๐ฟ๐ก + ๐ ๐ฟ๐ก 2 ๐ โ ๐๐ป2 ๐ฟ๐ก + ๐ ๐ฟ๐ก 2 โฆ
โฆ ๐ โ ๐๐ป๐พ ๐ฟ๐ก + ๐ ๐ฟ๐ก 2
= ๐ โ ๐๐ป1 ๐ฟ๐ก โ ๐๐ป2 ๐ฟ๐ก โฆ โ ๐๐ป๐พ ๐ฟ๐ก + ๐ ๐ฟ๐ก 2
= ๐ โ ๐๐ป๐ฟ๐ก + ๐ ๐ฟ๐ก 2
= ๐ โ๐๐ป๐ฟ๐ก + ๐(๐ฟ๐ก 2 )
If we divide long time ๐ก into ๐ intervals, then
๐
๐ โ๐๐ป๐ก = ๐ โ๐๐ป๐ก/๐ = ๐ โ๐๐ป1 ๐ก/๐ ๐ โ๐๐ป2๐ก/๐ โฆ ๐ โ๐๐ป๐พ ๐ก/๐ + ๐ ๐ก/๐ 2
๐
โ๐๐ป
๐ก/๐
โ๐๐ป
๐ก/๐
โ๐๐ป
๐ก/๐
1
2
๐พ
= ๐
๐
โฆ๐
+ ๐ ๐ก 2 /๐
Typically, we want to simulate a system with some maximum
allowable error ๐.
Then we need
๐ โ ๐ก 2 /๐.
Seth Lloyd
๐