2.2 Measuring a quantum bit

We now know that any qubit state is of the form |ψ(θ)\left|\psi(\theta)\right\rangle. Let’s say you get your hands on a state |ψ(θ)\left|\psi(\theta)\right\rangle and you would like to know the value of θ\theta. Unfortunately, quantum mechanics does not allow you to learn it! This seems like a big problem – what is a quantum computer good for if you cannot get out the answer? Well, not so fast! Recall from Eq. 1.32 that the same was true for probabilistic bits as well – if you measure a probabilistic bit with distribution (p0p1)\bigl{(}\begin{smallmatrix}p_{0}\\ p_{1}\end{smallmatrix}\bigr{)}, you do not learn p0p_{0} or p1p_{1}. All you get is a single bit of information: 0 with probability p0p_{0} and 11 with probability p1p_{1}.

The quantum measurement is very similar and is described by what is known as Born rule. If you have a qubit in state (ψ0ψ1)=ψ0|0+ψ1|1\bigl{(}\begin{smallmatrix}\psi_{0}\\ \psi_{1}\end{smallmatrix}\bigr{)}=\psi_{0}\left|0\right\rangle+\psi_{1}\left|1\right\rangle and you measure it, you also obtain just a single bit: you get 0 or 11 with probabilities

p0=ψ02,p1=ψ12.p_{0}=\psi_{0}^{2},\qquad p_{1}=\psi_{1}^{2}. (2.6)

While the square might seem surprising, note that p0+p1=ψ02+ψ12=1p_{0}+p_{1}=\psi_{0}^{2}+\psi_{1}^{2}=1. Thus, the square is precisely what guarantees that (p0p1)\bigl{(}\begin{smallmatrix}p_{0}\\ p_{1}\end{smallmatrix}\bigr{)} is a valid probability distribution, so the above rule makes sense! After the measurement, the qubit is gone and all you are left with is a single bit containing the measurement outcome you observed. In other words, the measurement process converts a qubit into a regular bit whose value is determined probabilistically by Eq. 2.6:

(2.7)

As you can see from Eqs. 1.32 and 2.7, the measurement rule for probabilistic bits and qubits is very similar. In both cases, the original state is gone and all you are left with is a single bit whose value depends probabilistically on the original state you measured. (In particular, if you measure the state more than once then you will always get the same outcome as the first time – so repeated measurements do not give any additional information about what the original state was.) The only difference is that for qubits you need to square the amplitudes to get the probabilities, as in Eq. 2.6, while for probabilistic bits you get them directly and hence don’t need to square anything. While this may seem like a small difference, it does have significant impact on the allowed states, as the amplitudes of a qubit are allowed to be negative whilst the probabilities of a probabilistic bit are always positive (see Fig. 2.2).

Well, actually there is another, even more subtle difference. Namely, that nobody can predict the outcome of a quantum measurement in advance. This is subtle because it seems that the same should be true also for probabilistic bits. What is the difference? In short, the answer is that probabilistic bits appear random because of our lack of knowledge about their state, while quantum bits are random even if we know all there is to know about their state. For example, imagine that your friend tosses a fair coin and immediately covers it once it lands. You would normally describe the state of such coin as uniformly random, see Eq. 1.29. However, if you were filming the coin with a high-speed camera, you might be able to accurately predict on which side it landed from your footage. In this sense, the randomness of probabilistic bits has to do with our ignorance. For quantum bits, however, randomness arises on a more fundamental level. Whatever prior knowledge we may have, it is in general impossible to perfectly predict the outcome of a quantum measurement. On the flipside, this means that the outcomes of quantum measurements can be used as a good source of randomness!

Homework 2.1 (Generating a random bit quantumly).

Problem: Alice’s donkey robot is running low on power again and needs to find its way to a charging station. Unfortunately, this time Eve’s hacking skills have improved – she has figured out how to hack the donkey’s random number generator and reprogram it so that it generates any sequence of numbers she wants! Luckily, Alice is aware of this since Eve bragged about it on a hacker forum recently. To counteract Eve’s evil plan, Alice decided to install a miniature single-qubit quantum computer inside her donkey robot. Using the inherent unpredictability of quantum measurement outcomes, Alice wants to generate uniformly random bits that Eve cannot guess.

Question: Alice is able to produce any qubit state |ψ(θ)\left|\psi(\theta)\right\rangle, and she wants to generate a uniformly random bit by measuring it.

  1. 1.

    When measuring the state |ψ(θ)\left|\psi(\theta)\right\rangle, what is the probability to get measurement outcome 0? What is the probability for measurement outcome 11?

  2. 2.

    Alice wants to find an angle θ\theta such that both probabilities equal 1/21/2. What θ\theta should she choose? (There might be more than one option!)

Hack.

When we apply U(θ)U(\theta) to the state |0\left|0\right\rangle, we obtain the following state:

U(θ)|0=(cosθsinθ).U(\theta)\left|0\right\rangle=\begin{pmatrix}\cos\theta\\ \sin\theta\end{pmatrix}.

When we measure this state, then by Eq. 2.6 the probability of measuring 0 is cos2(θ)\cos^{2}(\theta) and similarly the probability of measuring 11 is sin2(θ)\sin^{2}(\theta). We want these to be equal, hence:

cos2(θ)=sin2(θ),implyingcos(θ)=±sin(θ).\cos^{2}(\theta)=\sin^{2}(\theta),\quad\text{implying}\quad\cos(\theta)=\pm% \sin(\theta).

We can rewrite the right-hand side as follows:

±sin(θ)=sin(±θ)=cos(π2±θ)\pm\sin(\theta)=\sin(\pm\theta)=\cos\left(-\frac{\pi}{2}\pm\theta\right)

Note that cosα=cosβ\cos\alpha=\cos\beta implies that either α=β+2kπ\alpha=\beta+2k\pi or α=β+2kπ\alpha=-\beta+2k\pi, for some integer kk. So, we find that all solutions can be written in the following form:

θ=π2±θ+2kπorθ=π2±θ+2kπ.\theta=-\frac{\pi}{2}\pm\theta+2k\pi\qquad\text{or}\qquad\theta=\frac{\pi}{2}% \pm\theta+2k\pi.

Choosing the sign to be “++” does not produce meaningful equations, hence we replace the “±\pm” with “-” and merge the two cases to obtain the following concise form:

2θ=π2+kπ.2\theta=\frac{\pi}{2}+k\pi.

This reduces to:

θ=(14+k2)π.\theta=\left(\frac{1}{4}+\frac{k}{2}\right)\pi.

Hence, there are 44 values of kk that yield a θ\theta in the interval [0,2π)[0,2\pi), precisely:

θ=π4orθ=3π4orθ=5π4orθ=7π4.\theta=\frac{\pi}{4}\qquad\text{or}\qquad\theta=\frac{3\pi}{4}\qquad\text{or}% \qquad\theta=\frac{5\pi}{4}\qquad\text{or}\qquad\theta=\frac{7\pi}{4}.