Download Lecture 2

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Many-worlds interpretation wikipedia , lookup

Max Born wikipedia , lookup

Measurement in quantum mechanics wikipedia , lookup

Probability amplitude wikipedia , lookup

Renormalization group wikipedia , lookup

Algorithmic cooling wikipedia , lookup

Interpretations of quantum mechanics wikipedia , lookup

History of quantum field theory wikipedia , lookup

Quantum decoherence wikipedia , lookup

EPR paradox wikipedia , lookup

Path integral formulation wikipedia , lookup

Coherent states wikipedia , lookup

Orchestrated objective reduction wikipedia , lookup

Density matrix wikipedia , lookup

Quantum field theory wikipedia , lookup

Quantum key distribution wikipedia , lookup

Canonical quantization wikipedia , lookup

Quantum machine learning wikipedia , lookup

Quantum group wikipedia , lookup

Quantum state wikipedia , lookup

Hidden variable theory wikipedia , lookup

Quantum computing wikipedia , lookup

Quantum teleportation wikipedia , lookup

Symmetry in quantum mechanics wikipedia , lookup

T-symmetry wikipedia , lookup

Transcript
Quantum Computing
(Fall 2013)
Instructor: Shengyu Zhang.
Lecture 2 Factoring and Abelian HSP
1. Factoring problem
Historical importance: one of the oldest computational problems.
Average-case hardness: not only hard on worst-case inputs, but also on average-case inputs.
Relation to RSA: If Factoring is easy, then RSA is insecure.
Best classical algorithms: 2O(βˆšπ‘› log 𝑛) for 𝑛-bit numbers.
Shor’s quantum algorithm: 𝑂(𝑛3 ).
2. Quantum Fourier Transform (QFT)
Definition of QFT. In next class, we will define Fourier transform on general groups. Today,
we’ll only focus on a cyclic group: 𝑍𝑁 . (Sometimes it is written as 𝒁/𝑁𝒁.) Define πœ”π‘ =
𝑒 𝑖2πœ‹/𝑁 , a primitive 𝑁-th root of unity. For each π‘₯ ∈ 𝑍𝑁 , the QFT has the following effect on
the basis vector |π‘₯βŒͺ:
|π‘₯βŒͺ β†’
1
π‘₯𝑦
βˆ‘ πœ”π‘ |𝑦βŒͺ =
βˆšπ‘ π‘¦βˆˆπ‘
𝑁
1
βˆ‘ 𝑒 2πœ‹π‘–π‘₯𝑦/𝑁 |𝑦βŒͺ.
βˆšπ‘ π‘¦βˆˆπ‘
𝑁
In other words, the QFT is the following operator. 𝐹𝑍𝑁 =
form, it is
1
βˆšπ‘
βˆ‘π‘₯,π‘¦βˆˆπ‘π‘ πœ”π‘π‘₯𝑦 |𝑦βŒͺ〈π‘₯|. In matrix
Algorithm for QFT for π’πŸπ’ . (Note: the group is the cyclic group 𝑍𝑁 with 𝑁 = 2𝑛 , but not
π‘˜
(𝑍2 )×𝑛 ). Write both π‘₯ and 𝑦 by binary numbers, namely π‘₯ = βˆ‘π‘›βˆ’1
π‘˜=0 2 π‘₯π‘˜ and 𝑦 =
𝑗
βˆ‘π‘›βˆ’1
𝑗=0 2 𝑦𝑗 . Then
The QFT can be implemented by the following circuit, where we use some controlled-π‘…π‘Ÿ ,
1
0
π‘Ÿ ). (We’ve learned controlled-NOT in the last class; the general
0 𝑒 2πœ‹π‘–/2
with π‘…π‘Ÿ = (
controlled-unitary operator is similar: Conditioned on the control bit being 1, do the unitary.)
We can see intuitively why this circuit works by verifying the first two qubits. For the top
qubit, one Hadamard gates makes the output |0βŒͺ + (βˆ’1)π‘₯0 |1βŒͺ = |0βŒͺ + 𝑒 2πœ‹π‘–π‘₯0 /2 |1βŒͺ = |π‘§π‘›βˆ’1 βŒͺ.
𝑠π‘₯
(Note that we used the fact that 𝑒 2πœ‹π‘–2
π‘˜
= 1 for all 𝑠 β‰₯ 0 and π‘₯π‘˜ ∈ {0,1}.) Now look at
the second qubit. After the Hadamard gate, it is |0βŒͺ + 𝑒 2πœ‹π‘–π‘₯1 /2 |1βŒͺ. The controlled-𝑅2 gate
further puts a phase 𝑒 2πœ‹π‘–π‘₯0 /4 on |1βŒͺ, thus the final output on this qubit is |0βŒͺ +
π‘₯1 π‘₯0
𝑒 2πœ‹π‘–( 2 + 4 ) |1βŒͺ = |π‘§π‘›βˆ’2 βŒͺ. Using the same way one can verify the rest qubits.
3. Tool – Phase Estimation
One important application of QFT on 𝑍𝑁 is Phase Estimation. Suppose that there is a unitary
operation π‘ˆ and we are given the ability of applying controlled-π‘ˆπ‘— operations for j =
2, 22 , 23 , … We are also given an eigenstate |𝑒βŒͺ, which corresponds to an eigenvalue πœ‘π‘’ .
The task is to get an estimate of πœ‘π‘’ . (Recall the spectral decomposition of normal matrices.)
Here is a simple algorithm using QFT.
To get an intuition why the above algorithm is correct, consider the case that the eigenvalue has an
𝑛-bit binary representation. Then the inverse Fourier transform in Step 4 above will give exactly the
eigenvalue πœ‘π‘’ . (Recall the definition of Fourier transform: |πœ‘βŒͺ β†’ βˆ‘π‘¦βˆˆπ‘π‘ 𝑒2πœ‹π‘–πœ‘π‘— |𝑗βŒͺ.)
4. Quantum algorithm for Factoring
First, Factoring is known to be equivalent to another problem called Order Finding. In Order
Finding, we are given two positive integers π‘₯ and 𝑁 that are co-prime to each other. We
want to find the smallest π‘Ÿ s.t. π‘₯ π‘Ÿ = 1 mod 𝑁. For example, when π‘₯ = 5 and 𝑁 = 21,
then it is not hard to verify that the powers of π‘₯ are 5, 4, 20, 16, 17, 1 (all mod 21), thus the
order is 6.
Algorithm for Order Finding. Consider the unitary matrix π‘ˆ|𝑦βŒͺ = |π‘₯𝑦 mod 𝑁βŒͺ for each
𝑦 ∈ [0, 𝑁 βˆ’ 1]. Note that for different 𝑦’s, π‘ˆ|𝑦βŒͺ’s are also different. (Suppose π‘₯𝑦1 ≑ π‘₯𝑦2 ,
then π‘₯(𝑦1 βˆ’ 𝑦2 ) ≑ 0, impossible because π‘₯ is co-prime with 𝑁.) Thus π‘ˆ is indeed a
unitary matrix.
For each 𝑠 ∈ [0, π‘Ÿ βˆ’ 1], consider state |𝑒𝑠 βŒͺ =
1
βˆšπ‘Ÿ
βˆ’π‘ π‘˜ π‘˜
βˆ‘π‘Ÿβˆ’1
π‘˜=0 πœ”π‘Ÿ |π‘₯ mod 𝑁βŒͺ. It is actually an
eigenvector of π‘ˆ with respect to eigenvalue πœ”π‘Ÿπ‘  :
π‘ˆ|𝑒𝑠 βŒͺ =
1
π‘Ÿβˆ’1
βˆ‘ πœ”π‘Ÿβˆ’π‘ π‘˜ |π‘₯ π‘˜+1 mod 𝑁βŒͺ =
βˆšπ‘Ÿ π‘˜=0
1
π‘Ÿβˆ’1
βˆ’π‘ (π‘˜βˆ’1)
βˆ‘ πœ”π‘Ÿ
βˆšπ‘Ÿ π‘˜=0
|π‘₯ π‘˜ mod 𝑁βŒͺ = πœ”π‘Ÿπ‘  |𝑒𝑠 βŒͺ.
Thus we can run the Phase Estimation algorithm on |𝑒𝑠 βŒͺ and we’ll get 𝑠/π‘Ÿ.
Some issues: We don’t have |𝑒𝑠 βŒͺ; after all it needs information of π‘Ÿ. But note that
1
π‘Ÿβˆ’1
βˆ‘ |𝑒𝑠 βŒͺ =
βˆšπ‘Ÿ 𝑠=0
1
π‘Ÿβˆ’1
βˆ‘
1
π‘Ÿβˆ’1
βˆ‘ πœ”π‘Ÿβˆ’π‘ π‘˜ |π‘₯ π‘˜ mod 𝑁βŒͺ = |1βŒͺ.
βˆšπ‘Ÿ 𝑠=0 βˆšπ‘Ÿ π‘˜=0
(For π‘˜ β‰  0, βˆ‘s πœ”π‘Ÿβˆ’π‘ π‘˜ = 0.) So if we prepare |1βŒͺ and run the Phase Estimation algorithm,
then we will get
1
βˆšπ‘Ÿ
βˆ‘π‘Ÿβˆ’1
𝑠=0 |𝑠/π‘ŸβŒͺ|𝑒𝑠 βŒͺ. Measuring the first register gives 𝑠/π‘Ÿ. Using a simple
procedure called the continued fraction, one can get 𝑠′ and π‘Ÿ β€² s.t.
𝑠′
π‘Ÿβ€²
𝑠
= π‘Ÿ. π‘Ÿ β€² may not be π‘Ÿ,
but π‘Ÿ β€² is at least a factor of π‘Ÿ. Doing this a couple of times and get π‘Ÿ β€²β€² , π‘Ÿ β€²β€²β€² , … and take the
least common multiple of π‘Ÿ β€² , π‘Ÿ β€²β€² , π‘Ÿ β€²β€²β€² , … would give us π‘Ÿ. (Actually, a careful analysis shows
that most likely the least common multiple of π‘Ÿ β€² and π‘Ÿ β€²β€² is already π‘Ÿ.)
𝑗
Another issue is that in Phase Estimation, we need controlled-π‘ˆ 2 operations.
5. Hidden Subgroup Problem (HSP)
Definition of HSP. Order Finding and many other problems fall into the framework of Hidden
Subgroup Problem (HSP). In HSP, there is a function 𝑓: 𝐺 β†’ 𝑆 on a group 𝐺, which contains a
subgroup 𝐻. 𝐻 partitions 𝐺 by (left) cosets. We have the promise that 𝑓 is constant on each coset,
and distinct on different cosets. The goal is to identify 𝐻 efficiently. In quantum algorithms, we can
access 𝑓 by controlled-𝑓 gates. In particular, we can make the following transform: |π‘₯βŒͺ|0βŒͺ β†’
|π‘₯βŒͺ|𝑓(π‘₯)βŒͺ.
HSP for finite Abelian groups. Any finite Abelian group 𝐺 is isomorphic to 𝑍𝑛1 × β‹― ×
π‘π‘›π‘˜ . For each element π‘Ž = (π‘Ž1 , … , π‘Žπ‘˜ ) ∈ 𝑍𝑛1 × β‹― × π‘π‘›π‘˜ , define a character function
π‘Ž π‘₯1
πœ’π‘Ž : 𝐺 β†’ 𝐢 by πœ’π‘Ž (π‘₯1 … π‘₯π‘˜ ) = πœ”π‘›11
1
√|𝐺|
π‘Ž π‘₯
… πœ”π‘›π‘˜π‘˜ π‘˜ |π‘Ž1 … π‘Žπ‘˜ βŒͺ, and define the QFT by |π‘₯βŒͺ β†’
βˆ‘π‘Ž πœ’π‘Ž (π‘₯)|π‘ŽβŒͺ. It is easily checked that each πœ’π‘Ž is a homomorphism: πœ’π‘Ž (π‘₯𝑦) =
πœ’π‘Ž (π‘₯)πœ’π‘Ž (𝑦). The set of the πœ’π‘Ž ’s is denoted by 𝐺̂ , which is isomorphic to 𝐺 itself. One
property for 𝐺̂ is that any two distinct characters are orthogonal. In particular, if π‘Ž β‰ 
(0, … ,0), then βˆ‘π‘₯∈𝐺 πœ’π‘Ž (π‘₯) = 0.
Algorithm.
1
√|𝐺|
βˆ‘π‘₯∈𝐺 |π‘₯βŒͺ
query 𝑓
β†’
1
√|𝐺|
βˆ‘π‘₯∈𝐺|π‘₯βŒͺ|𝑓(π‘₯)βŒͺ
measure |𝑓(π‘₯)βŒͺ
β†’
1
√|𝐻||𝐺|
π‘šπ‘’π‘Žπ‘ π‘’π‘Ÿπ‘’
β†’
1
√|𝐻|
QFT
β†’
// prepare a uniform superposition
βˆ‘π‘¦βˆˆπ»|𝑠 + 𝑦βŒͺ for an unknown and random 𝑠 ∈ 𝐺
βˆ‘πœ’βˆˆπΊΜ‚ βˆ‘π‘¦βˆˆπ» πœ’(𝑠 + 𝑦)|πœ’βŒͺ
a random πœ’ with πœ’(𝑦) = 1, βˆ€π‘¦ ∈ 𝐻.
Do this for 𝑑 = 𝑂(log|𝐺|) times, and obtain πœ’1 , … , πœ’π‘‘ . For a character πœ’, define its
kernel as ker(πœ’) = {𝑔 ∈ 𝐺: πœ’(𝑔) = 1}, and it is easily seen that kernel is a subgroup of 𝐺.
Claim. For some 𝑇 = log 2 |𝐺|, it holds that 𝐻 = ⋂𝑖=1,…,𝑇 ker(πœ’π‘– ) with high probability.
Proof. First, there is a fact that 𝐻 βŠ₯ ≝ {πœ’: πœ’(𝑦) = 1, βˆ€π‘¦ ∈ 𝐻} = {πœ’: 𝐻 ≀ ker(πœ’)} is a group
and it’s isomorphic to the quotient group 𝐺/𝐻. Thus |𝐻 βŠ₯ | = |𝐺|/|𝐻| . Similarly |𝐾𝑑 βŠ₯ | =
|𝐺|/|𝐾𝑑 |. Suppose that after 𝑑 times, 𝐾𝑑 = ⋂𝑑𝑖=1 ker(πœ’π‘– ) is still strictly larger than 𝐻. The
next iteration gives a random πœ’ ∈ 𝐻 βŠ₯ . Since 𝐾𝑑+1 ≀ 𝐾𝑑 , we know that
|𝐾𝑑+1 |
|𝐾𝑑 |
1
≀ 2 unless
𝐾𝑑+1 = 𝐾𝑑 . Since 𝐾𝑑+1 = 𝐾𝑑 ∩ ker(πœ’), it suffices to show that PrβŠ₯[𝐾𝑑 βŠ† ker(πœ’)] ≀ 1/2.
πœ’βˆˆπ»
Note that 𝐾𝑑 βŠ† ker(πœ’) means πœ’ ∈ 𝐾𝑑βŠ₯ . Therefore,
|𝐾 βŠ₯ |
PrβŠ₯[𝐾𝑑 βŠ† ker(πœ’)] = |𝐻𝑑βŠ₯ | =
πœ’βˆˆπ»
|𝐺|/|𝐾𝑑 |
|𝐺|/|𝐻|
=
|𝐻|/|𝐾𝑑 |. This ratio is at most 1/2 since we assumed that 𝐻 is a proper subgroup of 𝐾𝑑 .
Note
There are many explanations of Shor’s algorithm, see the wiki page. We basically followed [NC00],
Chapter 5 and [CvD10] Section III.
For the Hidden Subgroup Problem part, see [CvD10], Section IV-C.
Reference
[NC00] Michael Nielsen and Isaac Chuang, Quantum Computation and Quantum Information,
Cambridge University Press, 2000.
[CvD10] Andrew M. Childs and Wim van Dam, Quantum algorithms for algebraic problems, Reviews
of Modern Physics, Volume 82, January–March 2010.
Exercise
1. Verify that the QFT operator 𝐹𝑁 is unitary.
2. Write down the QFT for 𝑍2 , 𝑍3 , 𝑍4 , 𝑍5 .
3. Suppose 𝑁 = 2𝑛 . We want a uniform superposition
1
βˆ‘π‘ |π‘₯βŒͺ.
βˆšπ‘ π‘₯=1
Prove that we can obtain it by
simply preparing 𝑛 qubits all in state |0βŒͺ, and then applying a Hadamard gate on each qubit.