You are on page 1of 4

1

AP3421: Fundamentals of Quantum Information 2021-22 October 8, 2021

Homework Assignment #3
Due on BrightSpace on October 15, 2021
ORIGINAL VERSION

Problem 1: Using Grover’s to search a large database with k solutions. (30 points total)
In this problem, we consider the quantum Grover search of a large database of size N with k solutions.
In lecture, we derived that for the case k = 1, the probability |βm |2 of finding the solution and the
probability |αm |2 of finding a non-solution when performing m Grover iterations can be found using the
recursive relation:
√ !
1√− N2 −2 NN−1
  
αm αm−1
= .
βm 2 N −1 1 − 2
N N
βm−1

We used this recursive relation to further show that the smallest number of Grover iterations mopt that
locally maximizes the probability of finding the solution is given by the analytic (but approximate)
formula
π√
mopt ≈ N.
4
In this problem we consider now the quantum Grover search of a large database of size N known to have
k solutions, where 1 ≤ k  N . Let the probability of finding one of the k solutions using m Grover
iterations be |βm,k |2 , and the corresponding probability of finding a non-solution be |αm,k |2 .
a. Derive an analogous recursive relation connecting βm,k and αm,k to βm−1,k and αm−1,k .
b. Using this recursive relation, derive an analytic (but also approximate) expression for the opti-
mal number of Grover iterations mopt,k , defined as the smallest number of iterations that locally
maximizes the probability of finding one of the k solutions.
c. Can you provide an intuitive explanation of your result above using as little math as possible?
d. Imagine you are trying to search the funky TU Delft phonebook with N = 32768 entries sorted
by phone number and not by student/employee name to find a suitable phone number to contact
David. Further, suppose it is known that David has 3 phone numbers registered. How many Grover
iterations would you need to locally maximize the probability of finding one of David’s numbers?
e. Finally, imagine that you would rather prefer to use the smallest number of Grover iterations m̃
that makes the probability of finding one of the k solutions in a database of size N exceed 85%.
Give an analytic (but also approximate) expression for m̃.
2

Problem 2: Quantum phase estimation. (40 points total)


In this problem, we will explore a different application of the quantum Fourier transform (QFT) from
the one we saw on class. This application is quantum phase estimation (or QPE), which turns out to be
at the heart of several important quantum algorithms. Let us warm up by working out a related idea.
Consider the circuit below (Circuit 2.1) for the indirect measurement of an operator U . Suppose that
|φi satisfies U |φi = ei2πθ |φi. That is, |φi is an eigenstate of U with eigenvalue ei2πθ .

1 2 3
Z
|+i H ma

|φi U

Circuit 2.1

a. Write the joint state of the top and bottom registers at points 1 and 2 and show that the joint
state at point 3 is
   
I +U I −U
|0i |φi + |1i |φi .
2 2

1−cos(2πθ)
b. Show that the probability of outcome ma = −1 is 2 .

c. If we want to learn θ, we could repeat the circuit many times and extract if from the average value.
Describe the full procedure.

d. Find the number of times l that we would need to repeat the circuit if we want to learn θ with
precision  with probability greater than 1 − δ. (Hint: use the weak law of large numbers).

i times
z }| {
Let us denote by U i the gate that consists of applying i times the gate U . That is, U i = U · U . . . U . We
introduce the Cp − U gate, this gate allows to perform controlled U i rotations for i ∈ {0, . . . , 2p − 1}.
More precisely, it performs the transformation |ii |φi 7→ |ii U i |φi, for |ii an element of the computational
basis on p qubits. The following circuit implements the Cp − U gate:

Cp − U
...
...

|ii .. .. |ii
. .
...
...

|φi U2
0
U2
1 ... U2
p−2 p−1
U2 U i |φi

Circuit 2.2

We will now show how to use the Cp − U gate to implement a more precise phase estimation routine.
Consider the following circuit (Circuit 2.3):
3

1 2 Cp − U 3 4
Z
|0i H ...

Z
|0i H ...

.. .. .. .
. . . QF..TP†

Z
|0i H ...

Z
|0i H ...

|φi U2
0
U2
1 ... U2
p−2 p−1
U2

Circuit 2.3
where P = 2p and QF TP† is the adjoint (conjugate transpose) of the QFT of dimension P . We remind
you that QF TP is given (in the computational basis) by the matrix
0·(P −1) 
ωP0·0

... ωd
1  ..
QF TP = √  ,

P . ...
(P −1)·0 (P −1)·(P −1)
ωP . . . ωP

where ωP = ei P is the P -th root of unity.
Let |φi be a state such that U |φi = ωPl |φi, where l is a non-negative integer smaller than P .
e. Write the state at slices 1, 2 and 3 of the phase estimation circuit (Circuit 2.3) and show that the
state at slice 3 is of the form
P −1
1 X jl
√ ωP |ji |φi .
P j=0

f. Show that at slice 4 of Circuit 2.3, the joint state is |li |φi. That is, show that
P −1
1 X jl

QFT √ ωP |ji |φi = |li |φi .
P j=0
4

Problem 3: Quantum counting. (30 points total)


In Problem 1 above, we assumed that the number of solutions k in the database to search was known a
priori. You may be slightly bothered by that! How could we possibly use Grover’s algorithm with the
optimal number of Grover iterations if k is not known a priori? In this problem, we connect the dots
and learn how we can use the QPE of Problem 2 to first efficiently determine the number of solutions k,
so that then we could run Grover’s algorithm with the optimal number of Grover iterations to maximize
the probability of finding one of the solutions! The task of determining k goes by the name of quantum
counting.
In other words, the problem that we want to solve is as follows. There is some function f : {0, 1}n 7→
{0, 1} that marks the solutions to a problem. The number of solutions is k, i.e., |{x : f (x) = 1}| = k.
The task is to determine the value of k.
Let G be the circuit that implements one Grover iteration. Let |Ai = √N1−k x:f (x)=0 |xi, the nor-
P

malized equal superposition of all x that are not solutions; and |Bi = √1k x:f (x)=1 |xi, the normalized
P

equal superposition of all x that are solutions.

a. Show that there are two states of the form x |Ai + y |Bi that are eigenstates of any transformation
M such that M |Ai → i |Bi, and M |Bi → −i |Ai. Find these two states and their corresponding
eigenvalues.
b. Show that these two states are also eigenstates of G, and find their corresponding eigenvalues.
c. What should you insert as U in Circuit 2.3 for the task at hand?
d. Suppose that |φi is an eigenstate of G with eigenvalue eiθ and let us further assume that θ = aπ
2b
with a, b ∈ P. Explain how to choose the dimension P of the QFT such that after running QPE
as in Problem 2 we find the number of solutions k with probability 1.

You might also like