0% found this document useful (0 votes)
44 views11 pages

M1522.002500 - 양자 컴퓨팅 및 정보의 기초 (Prof. Taehyun Kim)

This document describes a homework assignment on topics in quantum computing and information theory. It provides instructions on submitting the homework, notes that only handwritten work will be accepted, and lists 4 problems covering Deutsch-Josza algorithm, quantum Fourier transform, phase estimation, and extending the phase estimation circuit.

Uploaded by

Ezekiel Elliott
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views11 pages

M1522.002500 - 양자 컴퓨팅 및 정보의 기초 (Prof. Taehyun Kim)

This document describes a homework assignment on topics in quantum computing and information theory. It provides instructions on submitting the homework, notes that only handwritten work will be accepted, and lists 4 problems covering Deutsch-Josza algorithm, quantum Fourier transform, phase estimation, and extending the phase estimation circuit.

Uploaded by

Ezekiel Elliott
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

M1522.

002500 - 양자 컴퓨팅 및 정보의 기초

(Prof. Taehyun Kim)

Homework #4
Due date: June. 14, Sun 2020 12:00 pm

If you submit after the due date, your score will be deducted by 20%.

No more submission will be accepted after June. 16, 2020. 12:00pm

Towon’t
reduce
be the grading burden of TA, the homework will be graded all-or-nothing style. We will
graded.
grade just a few problems randomly sampled from the homework and renormalize the total
grading according to the relative weight of each problem. Also, within each problem, there
may be several sub-problems, but we will grade only a few sub-problems within each problem,
and the score of each problem will be determined by the graded sub-problems proportionally.

For example, if problem 1 is composed of 5 sub-problems, we will decide which sub-problems


will be graded later, and if you solved that sub-problems correctly, you will get the full credit
of problem 1. In the worst case, you might have solved all other sub-problems correctly, but
got the wrong answers in all the graded sub-problems. That is an unfortunate situation, but
the score for that entire problem will become 0. Without this policy, we cannot grade so much
homework efficiently.

The homework should be hand-written, converted into a pdf file, and uploaded to ETL. The
pdf file may either be a scanned-copy or camera-taken picture of your homework. If you solve
the homework problems using digital pen on a tablet, it will be considered as your hand-
writing, but make sure that your hand-writing is legible. Please make sure you denote the
number of the problems correctly. We will post solutions for every homework and announce
the problems and sub-problems to be graded after the hard deadline.

The homework should be written with your hand-writing either on


a paper or a tablet. Computer-typed homework won’t be accepted!
Note)

1. Please read through chapters 1.4.3~1.4.4, 5.1 ~ 5.3 of the textbook for details if necessary.

2. Some problems contain lengthy explanation. The questions that you should answer are underlined,
so please read thoroughly.

Deutsch-Josza algorithm

1. (20 points) The Deutsch-Josza problem can be stated as follows.

Input: A black-box for computing an unknown function 𝑓: {0,1}𝑡 → {0,1}

Constraint: 𝑓 is either a constant or a balanced function

Problem: Determine whether 𝑓 is either constant or balanced by making queries to 𝑓.

{0,1}𝑡 indicates an t-bit bit string. It is the computational basis of an t-qubit system. 𝑓 is constant
if 𝑓 maps to either 0 or 1 for all input, whereas it is balanced if exactly half of the inputs map to 0
and the other half to 1.

Classically, we would have to make 2𝑡−1 + 1 queries in order to solve this problem. The following
circuit, on the other hand, requires just one query.

The slashed line indicates a multi-qubit channel. There is one Hadamard gate per one-qubit line in
the first register.

The operator 𝑈𝑓 is defined as follows.

𝑈𝑓 |𝑗⟩|𝑘⟩ = |𝑗⟩|𝑘 ⊕ 𝑓(𝑗)⟩

The indices 𝑗, 𝑘 for the computational basis may either be decimal ( |0⟩, |1⟩, … ) or binary
(|0. .00⟩, |0. .01⟩, ..) representations depending on the context.
Show that the states at stages (a) – (c) are given as follows.

1 𝑡 |0⟩−|1⟩ 1 |0⟩−|1⟩
(a) (3 points) ∑2𝑗=0
−1
|𝑗⟩ ( )= ∑𝑗∈{0,1}𝑡|𝑗⟩ ( )
√2𝑡 √2 √ 2𝑡 √2

(Hint: This is just an equally weighted superposition of the computational basis in the first register.
Two equivalent expressions are presented to show how the decimal and binary representations
differ.)

1 |0⟩−|1⟩
(b) (7 points) ∑𝑗∈{0,1}𝑡(−1)𝑓(𝑗) |𝑗⟩ ( )
√ 2𝑡 √2

(Hint: First try proving this for 𝑡 = 1.)

Notice that the work that has been performed by 𝑈𝑓 on the qubit in the second register appears
to have been encoded in the phase of qubits in the first register. For this reason, this scheme is
known as the phase kick-back. Such schemes are frequently employed throughout quantum
algorithms.

1 |0⟩−|1⟩
(c) (7 points) ∑𝑙∈{0,1}𝑡(∑𝑗∈{0,1}𝑡 (−1) 𝑓(𝑗)+𝑗⋅𝑙 ) |𝑙⟩ ( )
2𝑡 √2

𝑗 ⋅ 𝑙 = 𝑗1 𝑙1 + 𝑗1 𝑙1 + ⋯ 𝑗𝑡 𝑙𝑡 is defined as the bit-wise inner product, modulo 2.

(Hint: You may want to first prove the following identity:

1
𝐻 ⨂𝑛 |𝑗⟩ = ∑ (−1) 𝑗⋅𝑙 |𝑙⟩
√2𝑡 𝑙∈{0,1}𝑡

Or, to make it more transparent,

1
𝐻 ⨂𝑛 |𝑗1 𝑗2 … 𝑗𝑡 ⟩ = ∑ (−1) 𝑗1𝑙1+𝑗1𝑙1 +⋯𝑗𝑡𝑙𝑡 |𝑙1 𝑙2 … 𝑙𝑡 ⟩
√2𝑡 𝑙∈{0,1}𝑡

Double hint: In the case of a single qubit, it is easy to show that,

1
𝐻|𝑗⟩ = ∑ (−1) 𝑗𝑙 |𝑙⟩
√2 𝑙∈{0,1}

The state that we measure in the first register in (c) is thus a superposition of computational basis
|𝑙⟩ each with coefficients ∑𝑗∈{0,1}𝑡 (−1)𝑓(𝑗)+𝑗⋅𝑙 . Consider the state |𝑙⟩ = |00. . .0⟩. The coefficient is
then ∑𝑗∈{0,1}𝑡 (−1) 𝑓(𝑗) . If 𝑓 is constant, all (−1)𝑓(𝑗) add up constructively to 2𝑡 (𝑓(𝑗) = 0) or
−2𝑡 (𝑓(𝑗) = 0). Since the coefficient of |00. . .0⟩ is either ±1, the t-qubit state is uniquely determined
as |00. . .0⟩. On the other hand, if 𝑓 is balanced, ∑𝑗∈{0,1}𝑡 (−1) 𝑓(𝑗) sums to zero, so the coefficient
of |00. . .0⟩ is exactly zero.

Based on such observations, what would your criterion be for determining whether 𝑓 is constant
or balanced? (3 points)
Quantum Fourier transform and phase estimation

2. (10 points) The quantum Fourier transform and its inverse are defined as follows.

1 2𝑡 −1
𝑈𝑄𝐹𝑇 |𝑗⟩ = ∑ 𝑒 2𝜋𝑖𝑗𝑘/𝑁 |𝑘⟩
√2𝑡 𝑘=0

1 2𝑡 −1
−1 |𝑗⟩
𝑈𝑄𝐹𝑇 = ∑ 𝑒 −2𝜋𝑖𝑗𝑘/𝑁 |𝑘⟩
√2𝑡 𝑘=0

The circuit that implements 𝑈𝑄𝐹𝑇 is given in slide 3, lecture 15. Draw the circuit that performs 𝑈𝑄𝐹𝑇
−1
.
(Hint: You will need the inverse of 𝑅𝑘 )

3. (15 points) Suppose a unitary operator 𝑈 has an eigenvector |𝑢⟩ with eigenvalue 𝑒 2𝜋𝑖𝜑 . For
simplicity, let 𝜑 = 0. 𝜑1 𝜑2 … 𝜑𝑡 in binary representation. We would like to construct a circuit that
𝑗
can measure 𝜑 exactly. It can be easily shown that 𝑈 𝑚 |𝑢⟩ = 𝑒 2𝜋𝑖(𝑚𝜑) |𝑢⟩. The gates 𝑈 2 represent
an operator that act 𝑈 on an input qubit state 2𝑗 times. Show that the circuit below produces the
states,

1 2𝑡 −1 1 𝑡−1 𝜑) 𝑡−2 𝜑) 0 𝜑)
∑ 𝑒 2𝜋𝑖𝜑𝑘 |𝑘⟩ = (|0⟩ + 𝑒 2𝜋𝑖(2 |1⟩)⨂(|0⟩ + 𝑒 2𝜋𝑖(2 |1⟩)⨂ ⋯ ⨂(|0⟩ + 𝑒 2𝜋𝑖(2 |1⟩)
√2𝑡 𝑘=0 √2𝑡
1
= (|0⟩ + 𝑒 2𝜋𝑖(0.𝜑𝑡) |1⟩)⨂(|0⟩ + 𝑒 2𝜋𝑖(0.𝜑𝑡−1𝜑𝑡) |1⟩)⨂ ⋯ ⨂(|0⟩ + 𝑒 2𝜋𝑖(0.𝜑1𝜑2…𝜑𝑡) |1⟩)
√2𝑡

for an input 𝑡-qubit state |00 ⋯ 0⟩ in the first register. The first equality has been covered in class.

Notice that the eigenvalues of 𝑈 have been encoded into the relative phases of the qubits in the
first register using the phase kick-back scheme.
4. (10 points) Now we act 𝑈𝑄𝐹𝑇
−1
on the 𝑡-qubit output state derived in problem 3. That is, the total
circuit looks like the following.

𝑗
The operator 𝑈𝑗 represents the series of operations 𝑈 2 in problem 3. Show that the 𝑡-qubit state
in the first register just before measurement is, |𝜑̃⟩ ≡ |𝜑1 𝜑2 … 𝜑𝑡 ⟩. The tilde denotes that it is an
estimator. That is, we measure a bit string 𝜑1 𝜑2 … 𝜑𝑡 and recover 𝜑 = 0. 𝜑1 𝜑2 … 𝜑𝑡 .

This circuit allows us to exactly measure the eigenvalue of the 𝑈. But since we read the information
encoded in the phases of the qubits in the first register, it is often known as the circuit for phase
estimation. Note that the result would not be exact if the expression for the true value of 𝜑 requires
more than 𝑡 bits in binary representation. In that case, we would have to increase the number of
qubits in the first register.

Typically, how we choose 𝑡 depends on 1) the number of digits of accuracy we wish to have in our
estimate for 𝜑, and 2) with what probability we wish the phase estimation procedure to be
successful.

The circuit can easily be extended to the case where 𝑈 has multiple eigenvalues. In that case, the
input state of the second register would be a superposition of the eigenstates of 𝑈, and the output
in the first register will contain a superposition of the estimates for each eigenvalue.
Factorization and Shor’s algorithm

Definitions: GCD – greatest common divisor, LCM – least common multiplier, order – the smallest
period 𝑟 that satisfies 𝑥 𝑟 ≡ 1 𝑚𝑜𝑑 𝑁 for a given 𝑥 and 𝑁.

The generic algorithm for factorizing a product of two prime numbers 𝑁 = 𝑝1 𝑝2 developed in
number theory may be listed as follows. They are presented without proof.

1. Select a number 𝑥 < 𝑁 at random and verify if 𝐺𝐶𝐷(𝑥, 𝑁) = 1.

2. Find the order 𝑟 of 𝑥 𝑚𝑜𝑑 𝑁.

3. Check if 𝑟 is even, and 𝑥 𝑟/2 + 1 ≢ 0 𝑚𝑜𝑑 𝑁. If not, go back to step 1.


𝑟 𝑟
4. Compute 𝑝1 = 𝐺𝐶𝐷 (𝑥 2 − 1, 𝑁) , 𝑝2 = 𝐺𝐶𝐷 (𝑥 2 + 1, 𝑁)

Steps 1, 3, 4 are best processed through classical computers. Especially, step 4 is efficiently
implemented by the extended Euclidean algorithm. It is step 2 for which no efficient classical
algorithm is known to exist.

The insight in Shor’s algorithm contrived in 1994 was to apply the quantum Fourier transform and
the phase estimation scheme in order to achieve exponential speedup in the sampling of orders in
the modular arithmetic of step 2. Although we work with a quantum circuit based on the textbook
which is slightly different from that of the original circuit invented by Peter Shor, we emphasize that
they share the same spirit.

5. (5 points) Factor 𝑁 = 21 using the generic algorithm (in the classical way).

6. (21 points) We define the unitary operator 𝑈𝑚𝑜𝑑 and its eigenstate |𝑢𝑠 ⟩ as follows.

𝑈𝑚𝑜𝑑 |𝑦⟩ ≡ |𝑥𝑦 𝑚𝑜𝑑 𝑁⟩ (0 ≤ 𝑦 ≤ 𝑁 − 1)


1 𝑟−1 2𝜋𝑖𝑠𝑘
|𝑢𝑠 ⟩ ≡ ∑ 𝑒− 𝑟 |𝑥 𝑘 𝑚𝑜𝑑 𝑁⟩
√𝑟 𝑘=0

where 𝑟 is the order that we wish to estimate and 𝑠 is an integer and 0 ≤ 𝑠 < 𝑟. 𝑥 is randomly
chosen in step 1. Prove the following.

(a) (7 points)

2𝜋𝑖𝑠
𝑈𝑚𝑜𝑑 |𝑢𝑠 ⟩ = 𝑒 𝑟 |𝑢𝑠 ⟩

2𝜋𝑖𝑠 2𝜋𝑖𝑠
(Hint: 𝑒 −𝑟
𝑟
|𝑥 𝑟 𝑚𝑜𝑑 𝑁⟩ = 𝑒 −𝑟
0
|𝑥 0 𝑚𝑜𝑑 𝑁⟩)
2𝜋𝑖𝑠𝑛
(b) (3 points) ∑𝑟−1
𝑠=0 𝑒

𝑟 = 𝑟𝛿𝑛0.

(Hint: Geometric series. To get an intuitive understanding for this, try drawing a unit circle in the
complex plane and represent the complex numbers as vectors on the unit circle. The angle or phase
will determine the spacing of these vectors. Summation of the complex numbers is just the
summation of these vectors. You will notice that they add up only when they are in phase. This
means that they point towards the same direction or have an angular spacing that is a multiple of
2𝜋. Otherwise, they cancel to zero.)

(c) (7 points)

1 𝑟−1 2𝜋𝑖𝑠𝑗
∑ 𝑒 𝑟 |𝑢𝑠 ⟩ = |𝑥 𝑗 𝑚𝑜𝑑 𝑁⟩
√𝑟 𝑠=0

(Hint: Use (b))

(c) (4 points)

1 𝑟−1
∑ |𝑢𝑠 ⟩ = |1⟩
√𝑟 𝑠=0

Note, (c) is an important identity in that, which will become clear in problem 7, it does not require
knowledge about 𝑟 in order to prepare such a state. The state |1⟩ will simply be a superposition
of 𝑟-|𝑢𝑠 ⟩ states.

7. (10 points) Recall the circuit for phase estimation in problem 4. To construct the order-finding
𝑗
circuit, we simply replace the unitary operator 𝑈𝑗 with 𝑈𝑚𝑜𝑑 , which is basically a series of 𝑈𝑚𝑜𝑑
𝑗 2

1
operators as in problem 3. We also substitute |1⟩ = 𝑠=0 |𝑢𝑠 ⟩ for |𝑢⟩ in the second register.
∑𝑟−1
√𝑟

This circuit performs order-finding for step 2 in the generic factorization algorithm. At (a), the state
is just a uniform superposition of the computational basis in the first register.
1 𝑡
(a) ∑2𝑗=0
−1
|𝑗⟩|1⟩
√2𝑡

Assuming that 2𝑡 is a multiple of 𝑟, show that the states at the stages (b) and (c) are as follows.
2𝜋𝑖𝑠𝑗
1 𝑡 1 𝑡
(b) (5 points) ∑2𝑗=0
−1
|𝑗⟩|𝑥 𝑗 𝑚𝑜𝑑 𝑁⟩ = ∑𝑟−1 2 −1
𝑠=0 ∑𝑗=0 𝑒 𝑟 |𝑗⟩|𝑢𝑠 ⟩
√ 2𝑡 √𝑟2𝑡

(Hint: Use the identities proven in problem 6. This equality is exact because we have assumed that
2𝑡 is a multiple of 𝑟. This simplifies our estimation. In general, this will not be the case and lead to
more complicated number theoretical analysis regarding the accuracy of estimation, such as the
continued fractions algorithm etc. We will not go into that here.)

1 𝑠
(c) (5 points) ∑𝑟−1 𝑡
𝑠=0 |2 ⟩ |𝑢𝑠 ⟩
√𝑟 𝑟

(Hint: Use the definition of the quantum Fourier transform in slide 4, lecture 15)

Note that we can define |̃⟩ ≡ |2𝑡 ⟩ as the estimator for a multiple of
𝑠 𝑠 1
in the sense that when we
𝑟 𝑟 𝑟
𝑠 𝑠 𝑘 𝑠
measure |2𝑡 ⟩, we obtain a number 𝑘 = 2𝑡 from which we can compute = and obtain a
𝑟 𝑟 2𝑡 𝑟

sample of 𝑟.

It can be observed in (c) that we perform measurements on states that are in a uniform
superposition of 𝑟-states with each state containing partial or complete information about the value
𝑟, or the order. We can repeat measurements and keep a list of the estimated orders {𝑟1 , 𝑟2 , 𝑟3 , … }
where the subscript denotes the repetition number. When we have found a 𝑟𝑖 that satisfies 𝑥 𝑟𝑖 ≡
1 𝑚𝑜𝑑 𝑁, we can move on to step 3 in the factorization algorithm. This will make more sense once
we have gone through a specific example in the following problem.

8. (15 points) In class we have applied the order-finding circuit to factor 𝑁 = 15. Here we repeat
the problem using a different 𝑥. We pick 𝑥 = 8. It can be easily shown that the order is 𝑟 = 4. That
is, 84 ≡ 1 𝑚𝑜𝑑 15. Let us see how this value is returned to us by the circuit. We use 𝑡 = 11 qubits.

The state in stage (b) in the circuit will be,

1 211 −1 1 3 211 −1 2𝜋𝑖𝑠𝑗


∑ |𝑗⟩|8𝑗 𝑚𝑜𝑑 15⟩ = ∑ ∑ 𝑒 4 |𝑗⟩|𝑢𝑠 ⟩
√211 𝑗=0 √4 ∙ 211 𝑠=0 𝑗=0

In stage (c) the state is,

1 3 𝑠 1
∑ |211 ⟩ |𝑢𝑠 ⟩ = (|0⟩|𝑢0 ⟩ + |512⟩|𝑢1 ⟩ + |1024⟩|𝑢2 ⟩ + |1536⟩|𝑢3 ⟩)
√4 𝑠=0 4 √4

Measurement on the first register will yield the numbers 0, 512, 1024, 1536 with uniform probability.
0 512 1 1024 1 1536 3
Based on these measurements, we compute = 0, = , = , = from which we
2048 2048 4 2048 2 2048 4
obtain the list of sampled 𝑟′𝑠 for each number, {𝑢𝑛𝑑𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑒𝑑, 4, 2, 4}. From this list we can choose
the largest number 4 as the estimator for the order and check if 84 ≡ 1 𝑚𝑜𝑑 15. If it is true, then
we can move onto step 3.

When the period is so large that we are uncertain that we have sampled the largest 𝑟, we can also
try estimating the order as 𝐿𝐶𝑀(𝑟1 , 𝑟2 ) for two different 𝑟1 , 𝑟2 . In our simple example, suppose we
have performed two measurements and obtained {2, 4}. Then 𝐿𝐶𝑀(2, 4) = 4 is a strong candidate
for 𝑟.

Using the values 𝑥 and 𝑟 that you found in problem 5 with 𝑁 = 21, show how the order-finding
circuit would return 𝑟. Write down what the states would look like through steps (a) – (c) as in
the explanation above. You may choose your own qubit number 𝑡. (This may be awkward, since
we already know 𝑟, but hopefully it will helpful in emulating the inner workings of the circuit for
a particular example.)
Quantum search and Grover’s algorithm

In the below problems, |𝜓⟩=H ⊗n |0⟩

9. (15 points) Consider the Grover search algorithm in the


lecture.

Prove the followings.

(a) (5 points) For O|𝑥⟩ = (−1) 𝑓(𝑥) |𝑥⟩ , O(𝑎|𝛼⟩ + 𝑏|𝛽⟩ ) = 𝑎|𝛼⟩ −
𝑏|𝛽⟩ (which means O is reflection about |𝛼⟩)

(b) (5 points) H ⊗n (2|0⟩⟨0| − 𝐼) H ⊗n is reflection about |𝜓⟩

𝑀
(c) (5 points) For N ≫ M, θ ≃ 2√
𝑁

1, 𝑥 = 102
10. (10 points) Consider f: {0,1}2 → {0,1}, 𝑓(𝑥) = { .
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Calculate (in the computational basis) the followings.

(a) (2 points) |x⟩ ≡ H ⊗2 |00⟩

(b) (2 points) |y⟩ ≡ O|x⟩

(c) (2 points) |z⟩ ≡ (2|𝜓⟩⟨𝜓| − I)|y⟩

(d) (4 points) Probability distribution of measurement of |z⟩ (in computational basis).

11. (10 points) Show that the operation (2|𝜓⟩⟨𝜓| − I) applied to a general state
∑k αk |𝑘⟩ produces

∑(−𝛼𝑘 + 2〈𝛼〉)|𝑘⟩,
k

where 〈𝛼〉 ≡ ∑k 𝛼/𝑁 is the mean value of the αk . For this reason, (2|𝜓⟩⟨𝜓| − I) is sometimes referred
to as the inversion about mean operation.
Example of modular exponentiation

12. (10 points) Shor’s algorithm requires a “modular exponentiation” circuit. The following circuits
are circuit diagrams for basic components for modular exponentiation with mod 15, i.e., circuits for
multiplying positive integers A (left) and B (right) with mod 15. Guess A & B from the circuits.

SWAP gate

|𝑝3 𝑝2 𝑝𝑞 𝑝0 ⟩ = |𝐴 ∗ 𝑞3 𝑞2 𝑞1 𝑞0 𝑚𝑜𝑑 15⟩ |𝑝3 𝑝2 𝑝𝑞 𝑝0 ⟩ = |𝐵 ∗ 𝑞3 𝑞2 𝑞1 𝑞0 𝑚𝑜𝑑 15⟩

Note, here 𝑝3 𝑝2 𝑝𝑞 𝑝0 and 𝑞3 𝑞2 𝑞1 𝑞0 are binary representations of some integers. You must
convert them to decimal values to make the arithmetic make sense.

You might also like