Posted on

Melchior and I are doing a course offered by KAIST on coursera.org. This web notes has solutions to some problems from the course. Weβre pretty new to this so the solutions might contain errors. If you do find an error in the solution please write to [email protected].

(2) Suppose that a qubit is prepared in state $β£0β©$. Then, a measurement is performed in the basis $β£Β±β©=2β(β£0β©Β±β£1β©)β$. What is the probability of the outcome +?

(A) The probability of the outcome + can be calculated with the rule $P(+)=β¨Οβ£M_{+}β£Οβ©$, also known as the Bornβs rule, where for this particular question, we can see that $β£Οβ©=β£0β©$, $β¨Οβ£=β¨0β£$, $β£+β©=2β1ββ£0β©+2β1ββ£1β©$, and $M_{+}=β£+β©β¨+β£$.

$P(+)β=β¨Οβ£M_{+}β£Οβ©=β¨0β£ββ£+β©ββ¨+β£ββ£0β©=[1β0β]β[1/2β1/2ββ]β[1/2ββ1/2ββ]β[10β]=21ββ$

(3) Suppose that a qubit is prepared in a state $β£+β©=(β£0β©+β£1β©)/2β$. A measurement is performed in the computation basis ${β£0β©,β£1β©}$. Find the expectation value of an observable $Z=β£0β©β¨0β£ββ£1β©β¨1β£$.

(A) We know that the expectation value of $Z$ with respect to $β£+β©$ can be calculated as $β¨Zβ©_{β£+β©}=β¨+β£Zβ£+β©$. Here simplifying and computing $Z=β£0β©.β¨0β£ββ£1β©.β¨1β£$ would simply make it equal to $0.$ Therefore the answer would be $0.$

(5) For a state $β£+β©=(β£0β©+β£1β©)/2β$, suppose that a phase operation $P(Ο)=β£0β©β¨0β£+e_{iΟ}β£1β©β¨1β£$ is applied. When a measurement is performed in the basis $β£Β±β©=(β£0β©Β±β£1β©)/2β$, find the angle $Ο$ such that the probability of obtaining out $+$ is zero.

(A) Wow, this question is really good. The idea is that weβll need to first apply $P(Ο)$ to $β£+β©$, and get a new state, say, $β£Οβ©$, and then solve for the equation $β¨Οβ£M_{+}β£Οβ©=0$, or $β¨Οβ£M_{β}β£Οβ©=1$.

$β£Οβ©=P(Ο)ββ£+β©β¨Οβ£M_{β}β£Οβ©βe_{iΟ}βΟβ=2β1β(β£0β©+e_{iΟ}ββ£1β©)=[2β1β2βe_{iΟ}β]β[1/2ββ1/2ββ]β[2β1ββ2β1β]β[1/2β2βe_{iΟ}ββ]=1=β1=Οβ$

In Week 2, I use a bit of the wonderful `sympy`

library for some matrix algebra calculations instead of hand-calculating things.

(2) For a Hadamard gate H and a Pauli matrix Z, compute ZHZ.

```
>>> import sympy
>>> from sympy.matrices import Matrix
>>> x = 1/sympy.sqrt(2)
>>> H = Matrix([[x, x], [x, - x]])
>>> Z = Z = Matrix([[1, 0], [0, -1]])
>>> Z * H * Z
Matrix([
[ sqrt(2)/2, -sqrt(2)/2],
[-sqrt(2)/2, -sqrt(2)/2]])
```

As we see, the answer is $βH$.

(3) For Pauli matrices X, Y, Z, compute $tr[X+Y+Z]$.

```
>>> from sympy import I, Trace
>>> X = Matrix([[0, 1], [1, 0]])
>>> Y = Matrix([[0, -I], [I, 0]])
>>> Trace(X+Y+Z).simplify()
0
```

The answer is $0$.

We ended up getting a certificate (in my name below because we did it from my Coursera account):

In addition, weβve come to learn that Scott is doing the course too, but unfortunately weβre not really aware of his progress at the moment.

Readings: