Exam SS21
Exam SS21
Department of Informatics
Technical University of Munich
Note:
Ecorrection • During the attendance check a sticker containing a unique code will be put on this exam.
Place student sticker here
• This code contains a unique number that associates this exam with your registration number.
• This number is printed both next to the code and to the signature field in the attendance check
list.
n
Exam: IN2381 / Final Exam Date: Tuesday 20th July, 2021
Examiner: Time:
tio
Christian Mendl 14:15 – 15:45
lu
So
es
Working instructions
e
ot
– Page 1 / 10 –
Problem 1 (20 credits)
In this problem, you will build a quantum version of a half adder – the basic building block of addition on a classical
computer. The most important part of such a circuit is the half-adder:
n
where A and B are classical bits, S = A ⊕ B is the sum modulo two and C = A · B is ordinary multiplication of A and
tio
B called the carry. The carry is the part of the summation that adds to the next digit (it is only 1 if both A = 1 and
B = 1).
0 a) Assume you start in the arbitrary two-qubit state |AB i. Provide a quantum gate / series of quantum gates that
performs the operation:
lu
1
2
|A i |A i
3 ?
So
|B i |A ⊕ B i
es
|A i |A i
e
ot
|B i |A ⊕ B i
N
p l
on
m
|A i |A i
re
2
Sa
|B i |B i
3
or
|0i |A · B i
4
C
6 Verify that the circuit below performs that operation up to a global phase constant.
7
8 |A i |A i
9 |B i |B i
|0i H Rz (π/2) Rz (−π/2) Rz (π/2) H |A · B i
Hint: Follow the state of each qubit through the circuit for all 4 possible input basis states |00i, |01i, |10i and |11i separately.
– Page 2 / 10 –
We account for the activated controlled gates:
Input |00i:
|0i |0i
|0i |0i
|0i H H |0i
1 credit
Input |01i:
|0i |0i
|1i |1i
|0i H Rz (π/2) Rz (−π/2) H |0i
n
2 credits
Input |10i:
tio
|1i |1i
|0i X X |0i
|0i H Rz (−π/2) Rz (π/2) H |0i
2 credits
lu
Input |11i:
|1i |1i
|1i X X |1i
|0i H Rz (π/2) Rz (π/2) H |1i
So
Here we have used that HRz (π/2)Rz (π/2)H = HRz (π )H = −iHZH = −iX , so there is a global phase constant
of −i . 4 credits
es
e
ot
c) Build a quantum half-adder using the Toffoli gate and the result from a): i.e. find the circuit that performs the 0
operation:
1
N
l
|A i |A i
p
|B i |A ⊕ B i 2
?
on
|0i |A · B i 3
m
4
i
|A i |A i
Sa
|B i |A ⊕ B i
or
|0i |A · B i
C
– Page 3 / 10 –
0 d) Given |A ⊕ B i and |A · B i, is it possible to determine |A i and |B i in all cases? Provide reasoning for your answer.
1
It is not possible because both |01i and |10i result in |A ⊕ B i = |1i and |A · B i = |0i. This operation is only
2 reversible with an extra qubit.
4 credits for complete correct answer. 2 credits if this is shown in only one case.
3
n
tio
lu
So
es
e
ot
N
p l
on
m
i
ct
re
Sa
or
C
– Page 4 / 10 –
Problem 2 (20 credits)
Consider an ensemble of quantum states {pi , |ψi i}, where the quantum system is in state |ψi i with probability pi .
Recall from the lecture that the density operator ρ of such an ensemble is defined as:
X
ρ= pi |ψi i hψi |
i
n o
1 |0i√
+|1i |0i+i |1i
a) Given the ensemble 2
, 2
, 21 , √2 , compute ρ and write it in the form: 0
1 1
ρ= I + αx X + αy Y + αz Z.
2 2
What is the connection of α
~ = (αx , αy , αz ) with the Bloch sphere representation?
n
3
4
Simply by plugging in, expanding and rearranging:
tio
5
1 (|0i + |1i) (h0| + h1|) 1 (|0i + i |1i) (h0| − i h1|)
ρ= √ √ + √ √
2 2 2 2 2 2 6
1 1
= |0i h0| + |0i h1| + |1i h0| + |1i h1| + |0i h0| − i |0i h1| + i |1i h0| + |1i h1|
4 4
1 1 1
|0i h0| + |1i h1| + |0i h1| + |1i h0| + −i |0i h1| + i |1i h0|
lu
=
2 4 4
1 1 1
= I+ X+ Y
2 4 4
1 1
So
which means that (αx , αy , αz ) = , ,0
4 4
. Recall that a density operator can be represented as
I + ~r · ~
σ
ρ= ,
2
, |0i , , |1i , 1
i
2 2
ct
and compute its density matrix ρ. Draw a Bloch sphere, clearly labeling |0i and |1i, and indicate the position of this 2
ensemble within the sphere.
re
Sa
3
or
1 1 4
ρ= |0i h0| + |1i h1| = I
2 2
C
This means that the Bloch vector of this ensemble is (0, 0, 0), i.e., it is located at the origin of the Bloch
sphere.
1 credit for correct ρ, 2 credits for correct location of ensemble, 1 credit for correct drawing of a Bloch sphere
– Page 5 / 10 –
0 c)* The unitary operation
1
√ 0 0√ 0
1 0 −λ
1√ − i λ 0
U= √ ,
0 −i λ 1−λ 0
2
0 0 0 1
3
where 0 ≤ λ ≤ 1, acts on a system of two qubits. The first qubit is initially in an arbitrary state ρ and the second
4 one is initialized at |0i. Trace out the second qubit to obtain the two operators E0 and E1 which represent the action
of U on the first one.
n
2 credits for these or related formulas which show recognition of this being a quantum operation.
Therefore, √
1 √ 0 0 −i λ
tio
E0 = and E1 =
0 1−λ 0 0
Full credits if these two matrices are correct, even if no explanation.
1
their action on the Bloch sphere.
lu
d) Compute the effect of the operators you found on the general density matrix ρ = 12 I + αx X + αy Y + αz Z . Interpret
So
2 One possible solution is by writing E0 and E1 in terms of the Pauli matrices:
√ √ √
3 1 1−λ 1+ 1−λ 1− 1−λ
E0 = (I + Z) + (I − Z) = I+ Z = aI + bZ
2 2 2 2
4
es
√ √ √
5 λ −i λ λ
E1 = (−iX + Y ) = X+ Y = cX + dY
2 2 2
e
ot
6
For a general ρ, E (ρ) = 21 E (I) + αx E (X ) + αy E (Y ) + αz E (Z). We compute each term:
N
l
√
i
= a 2 X − b 2 X + |c |2 X − d 2 X = 1 − λ
ct
re
√
= a 2 Y − b 2 Y − | c |2 Y + d 2 X = 1 − λ
or
– Page 6 / 10 –
Problem 3 (20 credits)
We consider a quantum system of n qubits, and use the notation Xj , Yj , Zj to denote that one of the Pauli matrices
acts on the j th qubit; e.g., X1 Z3 ≡ X ⊗ I ⊗ Z for n = 3.
Conjugation by U refers to the transformation UgU † of a quantum gate g by a unitary operation U . The following
table summarizes several conjugation transformations:
U Z Z Z H H H S S S
g X Y Z X Y Z X Y Z
UgU † −X −Y Z Z −Y X Y −X Z
1 0
Here S = 0 i is the phase gate.
g1 = Z ⊗ Y ⊗ X ⊗ X , 1
n
g2 = X ⊗ Z ⊗ I ⊗ Y .
2
Based on this representation, show that g1 anti-commutes with g2 .
tio
3
5
r(g1 ) 0 1 1 1 1 1 0 0
= .
r(g2 ) 1 0 0 1 0 1 0 1
lu
(3 credits)
Now we recall that elements of the Pauli group either commute or anti-commute. (0.5 credits) According to
exercise 12.2 (e), g1 commutes with g2 precisely if r(g1 )Λr(g2 )T = 0 mod 2, with
So
0 I
Λ= .
I 0
(0.5 credits)
Λ effectively interchanges the first with the second half of a check row. We obtain
es
T
r(g1 )Λr(g2 )T = 0
1 1 1 1 1 0 0 0 1 0 1 1 0 0 1 = 3 = 1 mod 2,
e
ot
b)* Given a square lattice, a qubit is associated with each edge of the lattice (dots in the figure below). We define 0
re
logical Pauli operators XL and ZL as tensor products of strings of X and Z operators: XL = X13 X14 X15 X16 and
Sa
ZL 2
=
3
C
29
Z30 31 32
4
25 26 27 28
21
Z22 23 24
5
Z
17 18 19 20
Z
XL = X 13 X 14 X 15 X 16
9 10 11 12
5 6
Z7 8
Z
1 2 3 4
Show that XL and ZL anti-commute, i.e., XL ZL = −ZL XL . How can one define a logical YL operator such that
XL , YL , ZL satisfy the anti-commutation relations of the Pauli-matrices?
– Page 7 / 10 –
One observes that XL and ZL share only a single qubit which they both act on, namely qubit 15 . Since Xj
always commutes with Zk for j 6= k , we obtain
3 credits
The Pauli-Y matrix can be expressed in terms of X and Z via Y = iXZ . We can use this relation to analogously
define YL = iXL ZL . Then YL anti-commutes with XL since XL commutes with itself and anti-commutes with ZL ,
as we have just shown. Likewise, YL anti-commutes with ZL .
2 credits; alternative solutions possible
n
tio
lu
So
0 c)* The subgroup R = hX1 Y2 Z3 , Y1 Y2 Y3 i of the Pauli group G3 stabilizes the subspace VR = span{|χ0 i , |χ1 i} with
1 1 1
|χ0 i = |000i + |001i + i |110i − i |111i , |χ1 i = |010i + |011i − i |100i + i |101i .
2 2
2
(A proof of this statement is not required here.) Determine the result (eigenvalue) when measuring the operator
es
3 Y1 Y2 Y3 with respect to the quantum state (S ⊗ H ⊗ (SH)) |χ0 i, where S is the phase gate.
e
4
ot
In general, an eigenvalue equation M |ψi = λ |ψi is equivalent to UMU † U |ψi = λU |ψi for any unitary matrix U .
5
Setting U = S ⊗ H ⊗ (SH) here, we search for an operator M such that UMU † = Y1 Y2 Y3 , with formal solution
N
l
Here we have already used that H † = H . From the above conjugation table, we see that SXS † = Y , i.e.,
S † YS = X , as well as HYH = −Y and HS † YSH = HXH = Z . In summary,
m
i
ct
M = X ⊗ (−Y ) ⊗ Z = −X1 Y2 Z3 .
Since R stabilizes |χ0 i and X1 Y2 Z3 ∈ R , the state |χ0 i is an eigenstate of M with eigenvalue (−1). In
re
Sa
– Page 8 / 10 –
d)* We consider the two qubit code C = span{|0L i , |1L i} with |0L i = |00i and |1L i = |01i. It is affected by a 0
simultaneous bit flip noise process described by the operation elements E0 = √12 I4 and E1 = √12 X ⊗ X , where In the
n × n identity matrix. Show that this noise process is error-correctable. 1
2
We make use of the quantum error-correction conditions (see lecture). The projector onto C in the present
3
case is P = |00i h00| + |01i h01|. The code is error-correctable precisely if
† 4
PEk E` P = αk ` P
5
for all k , ` ∈ {0, 1} and some Hermitian matrix (αk ` ) of complex numbers. We first note that Ek† Ek = 21 I4 for
k ∈ {0, 1} since X 2 = I2 . Thus the condition is satisfied via αkk = 12 in the case k = `.
We now explicitly compute
† † 1
n
PE0 E1 P = PE1 E0 P = P(X ⊗ X )P = (|00i h00| + |01i h01|)(|11i h00| + |10i h01|) = 0,
2
i.e., the condition is satisfied via α01 = α10 = 0 for k 6= `. In summary, the quantum error-correction conditions
tio
hold true for all combinations of k , ` ∈ {0, 1}.
lu
So
es
e
ot
N
p l
on
m
i
ct
re
Sa
or
C
– Page 9 / 10 –
Additional space for solutions–clearly mark the (sub)problem your answers are related to and strike out
invalid solutions.
n
tio
lu
So
es
e
ot
N
p l
on
m
i
ct
re
Sa
or
C
– Page 10 / 10 –