0% found this document useful (0 votes)
0 views

Assignment 2

This document outlines Assignment 2 for a Quantum Algorithms course at IIIT Hyderabad, due on April 22, 2024, with a total of 40 marks. It consists of five main problems focusing on testing circuit constructors, finding minimum elements in an unsorted database, estimating averages and variances of functions, implementing quantum reflections, and analyzing analog Grover's search under noise. Each problem includes sub-questions that require the development of algorithms and proofs related to quantum computation concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Assignment 2

This document outlines Assignment 2 for a Quantum Algorithms course at IIIT Hyderabad, due on April 22, 2024, with a total of 40 marks. It consists of five main problems focusing on testing circuit constructors, finding minimum elements in an unsorted database, estimating averages and variances of functions, implementing quantum reflections, and analyzing analog Grover's search under noise. Each problem includes sub-questions that require the development of algorithms and proofs related to quantum computation concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Quantum Algorithms, Spring 2024, IIIT Hyderabad

Assignment 2
April 2, 2024

Total Marks: 40 Due date: April 22nd 2024

General Instructions: Submit handwritten or typed PDFs.

1. [6 points] Testing Circuit Constructor

You are provided access to a circuit constructor C that has a faulty counter. The circuit constructor takes
in two non-negative arguments (l, n) and provides the exact same circuit at request any number of times. The
circuit constructor makes an error in reading l and stores l′ instead which is also non-negative. Additionally, n
is always stored correctly, and n > 0. The circuit constructor produces a one-qubit circuit with the operation
Rz (1/n) repeated l′ times. Here the operation Rz (θ) is a single-qubit Z rotation by the angle of θ


(a) Construct an algorithm that will use C on input l, n and test the degree of error |l−l n
|
in the circuit
constructor. Note that your algorithm can only use the circuit provided to you by the constructor as a black-
box, part of a larger quantum circuit of your choice.
(b) How many ancilla qubits does your algorithm use to determine the error with the precision of ϵ? How many
copies of the same circuit does it require?

2. [10 points] Finding the minimum

Suppose that there exists an unsorted database A, of N = 2n elements represented by A[0], A[1], p.., A[N − 1].
We know that the quantum search algorithm, searches for one of M marked elements in time O( N/M ) with
probability at least 1/2. In fact, when the number of marked element is not known, there exists a randomized
quantum
p search algorithm (let us denote it by QSrand) that searches for one of the M marked elements in
O( N/M ) time. The QSrand algorithm is simple: it chooses an integer r and a timestep λ. It proceeds by
choosing uniformly at random, a non-negative integer j between 0 and r and applies j iterations of the standard
Grover’s algorithm. If the outcome is the solution we are looking for, the algorithm is completed. If not, then
r is modified to λr and the above procedure is repeated again.

(a) Write an algorithm that uses the QSrand algorithm in order to find the minimum element in this database.

(b) Let us allocate ranks to each element of the database. Let the rank of the rth minimum element be
r. That is the smallest element has rank one and so on. Let the probability that when t elements of the
database are marked (how and why they are marked will be determined by you while solving (a)), then the
probability that the element of rank r will ever be the outcome of the search algorithm be P (t, r). What is
P (r, r)? Prove that P (t, r) = 1/r.


(c) Using the result of part (b) prove that the expected running time of the algorithm is O( N ).

1
3. [10 points] Estimating average and variance of a function
We define a random variable X by a distribution over N outcomes with probabilities pi for the outcome i. We
define a function f that maps the outcomes of this random variable to some value between 0 and 1.

We define a quantum oracle F for the function f as follows:


p p
F |i⟩ |0⟩ → |i⟩ ( 1 − f (i) |0⟩ + f (i) |1⟩)

(a) Describe a manner in which this random variable can be modelled as a state vector from which the outcomes
can be sampled.
Hint: You will require log(N ) sized state

(b) Devise an algorithm that would allow you to use F and the above described state vector representation of
a random variable to calculate E[f (X)] to some ϵ precision.
Hint: Naively sampling would give an sub-optimal solution which suffices for this part.
(c) How would you use this to calculate E[X] and variance?

(d) Use amplitude estimation to approximate E[F (X)] with ϵ precision faster than a classical computer.

4. [4 points] Implementing reflection around zero



Consider the following quantum circuit where |ψ⟩ is any n-qubit quantum state while |−⟩ = (|0⟩ − |1⟩) / 2.
Observe that for the controlled operation, the control qubits are denoted by an open circle, instead of the usual
solid circle (e.g: the conventional CNOT gate). This indicates that the controlled operation is conditioned on
each of the control qubits being set to 0.

(a) What is the output of this quantum circuit when


1 X
|ψ⟩ = √ |j⟩?
2n j∈{0,1}n

(b) What is the matrix representation of the unitary operation being implemented? You don’t need to write
the whole unitary matrix, the operator sum representation would suffice.

5. [10 points] Analog Grover’s Search

This question is based on the analog version of Grover’s algorithm. Consider an N -dimensional Hamiltonian
with only one unknown eigenvector with eigenvalue 1, the rest have eigenvalue 0. The task is to find this
unknown eigenvector |w⟩. We define a driver Hamiltonian HD = |s⟩ ⟨s| where |s⟩ is the state of maximum
superposition.

Page 2
The total Hamiltonian is a sum of an oracular Hamiltonian and a driver Hamiltonian given by

H = |w⟩ ⟨w| + |s⟩ ⟨s| ,

where
1 X
|s⟩ = √ |i⟩ .
N i

By evolving |s⟩ according to H for a time scaling as N , we end up in the state |w⟩.
Here we will look at the robustness of this algorithm to some form of static disorder (randomness). Let us
assume, that due to some random noise, the marked element |w⟩, no longer has energy 1, but 1 + ϵ, where ϵ
is a random variable from a Gaussian distribution with mean µ = 0 and standard deviation σ such that i.e,
ϵ ∼ N (0, σ). The strength of the noise is determined by σ, the larger it is, the more is the spread of ϵ and
subsequently, ϵ fluctuates more. We can assume that 0 ≤ σ < 1. Since the error is random, you only have
knowledge of µ and σ (based on your experimental set up) of the error distribution and not the individual
instances of ϵ.

(a) What is the probability of the algorithm to measure the target |w⟩, Pw , as a function of ϵ, after time
t?

(b) What should be the measurement time (in terms of ϵ), so as to maximize Pw ? What is the success
probability?

(c) Remember that you do not actually have access to the individual instances of ϵ and so all you can do
is calculate the expected success probability as a function of the available parameters of the noise distribution,
i.e, µ and σ. Also, the time that you calculated in part (b) requires knowledge of ϵ, which is a random variable
and so it isn’t realistic to measure at that time. In fact, the experimentalist probably is not aware that this
error had occurred and so they would √
measure at the time that maximizes the success probability corresponding
to the zero noise case, i.e, at T = π 2N .
What is Pw at this time? Prove that the standard deviation of the noise distribution (Gaussian), σ < √1 , for
N
the algorithm to retain its optimality.

Page 3

You might also like