4.1.6 Measuring some of the qubits only

Naturally, we can also measure only a subset of the qubits. (We didn’t even discuss this for two qubits last week, since there was already plenty to talk about.) For example, assume that you have a three-qubit quantum state |ψ\left|\psi\right\rangle, like the one in Eq. 4.1, but instead of measuring all three qubits you measure only the first qubit. What is the probability pap_{a} of obtaining outcome a{0,1}a\in\{0,1\}? It is simply the sum of all probabilities in Eq. 4.6 that correspond to a string that starts with aa:

pa=ψa002+ψa012+ψa102+ψa112.p_{a}=\psi_{a00}^{2}+\psi_{a01}^{2}+\psi_{a10}^{2}+\psi_{a11}^{2}. (4.8)

For example, if we measure the first qubit of the state +

18|000+28|010+58|111\displaystyle\frac{1}{\sqrt{8}}\left|000\right\rangle+\sqrt{\frac{2}{8}}\left|% 010\right\rangle+\sqrt{\frac{5}{8}}\left|111\right\rangle

then we obtain outcome 0 with probability 1/8+2/8=3/81/8+2/8=3/8.

We can measure individual qubits using Quirky simply by adding only a single measurement on the wire that we are interested in. To view the probability of measurement outcomes, drag a probability display onto the circuit. Why don’t you give it a try right now? For example, the following sequence of operations prepares the state in Eq. 4.7 and measures only the first qubit:

[Uncaptioned image]
\href https://www.quantum-quest.org/quirky/QuirkyQuest4.html#circuit=%7B%22% cols%22%3A%5B%5B1%2C1%2C%22H%22%5D%2C%5B1%2C%22NOT%22%2C%22%E2%80%A2%22%5D%2C%% 5B%22NOT%22%2C1%2C%22%E2%80%A2%22%5D%2C%5B1%2C1%2C%22Measure%22%5D%2C%5B1%2C1%% 2C%22Chance1%22%5D%5D%7D
(4.9)

Indeed, following Eq. 4.8 we should obtain 0 and 11 with equal probability.

Once you measured the first qubit and obtained some outcome a{0,1}a\in\{0,1\}, what is the quantum state of the second and the third qubit? Following the same procedure as for probabilistic bits in Section 3.1.3, we first collect all terms of |ψ\left|\psi\right\rangle where the first qubit is in the state that corresponds to the outcome of interest:

ψa00|a00+ψa01|a01+ψa10|a10+ψa11|a11.\psi_{a00}\left|a00\right\rangle+\psi_{a01}\left|a01\right\rangle+\psi_{a10}% \left|a10\right\rangle+\psi_{a11}\left|a11\right\rangle.

Next, we leave out the first qubit in all four terms, since it was measured:

ψa00|00+ψa01|01+ψa10|10+ψa11|11.\psi_{a00}\left|00\right\rangle+\psi_{a01}\left|01\right\rangle+\psi_{a10}% \left|10\right\rangle+\psi_{a11}\left|11\right\rangle.

Finally, we normalize this so that we obtain a valid two-qubit state. For this, we want to find a number cc such that ψa00c|00+ψa01c|01+ψa10c|10+ψa11c|11\frac{\psi_{a00}}{c}\left|00\right\rangle+\frac{\psi_{a01}}{c}\left|01\right% \rangle+\frac{\psi_{a10}}{c}\left|10\right\rangle+\frac{\psi_{a11}}{c}\left|11\right\rangle is a qubit state, i.e.,

(ψa00c)2+(ψa01c)2+(ψa10c)2+(ψa11c)2=1.\left\lparen\frac{\psi_{a00}}{c}\right\rparen^{2}+\left\lparen\frac{\psi_{a01}% }{c}\right\rparen^{2}+\left\lparen\frac{\psi_{a10}}{c}\right\rparen^{2}+\left% \lparen\frac{\psi_{a11}}{c}\right\rparen^{2}=1.

The overall sign is not important, so we can simply use

c=ψa002+ψa012+ψa102+ψa112,c=\sqrt{\psi_{a00}^{2}+\psi_{a01}^{2}+\psi_{a10}^{2}+\psi_{a11}^{2}},

which is the square root of the probability in Eq. 4.8.

To summarize, if you measure the first qubit of a three-qubit state as in Eq. 4.1, you obtain outcome a{0,1}a\in\{0,1\} with probability

pa=ψa002+ψa012+ψa102+ψa112p_{a}=\psi_{a00}^{2}+\psi_{a01}^{2}+\psi_{a10}^{2}+\psi_{a11}^{2} (4.10)

and the resulting two-qubit state |ψa\left|\psi_{a}\right\rangle on the remaining two qubits is

|ψa=ψa00|00+ψa01|01+ψa10|10+ψa11|11ψa002+ψa012+ψa102+ψa112.\left|\psi_{a}\right\rangle=\frac{\psi_{a00}\left|00\right\rangle+\psi_{a01}% \left|01\right\rangle+\psi_{a10}\left|10\right\rangle+\psi_{a11}\left|11\right% \rangle}{\sqrt{\psi_{a00}^{2}+\psi_{a01}^{2}+\psi_{a10}^{2}+\psi_{a11}^{2}}}. (4.11)

What does this mean in the situation of (4.9), where we prepare the state 12|000+12|111\frac{1}{\sqrt{2}}\left|000\right\rangle+\frac{1}{\sqrt{2}}\left|111\right\rangle and then measure the first qubit? If the measurement outcome is 0 (which happens with probability 1/21/2), the remaining two qubits are in state

12|0012=|00.\displaystyle\frac{\frac{1}{\sqrt{2}}\left|00\right\rangle}{\sqrt{\frac{1}{2}}% }=\left|00\right\rangle.

If instead the outcome is 11 then the remaining qubits are similarly in state |11\left|11\right\rangle.

Since measuring one qubit out of many can be quite tricky, let us discuss another method for doing this. Consider again a general three-qubit state |ψ\left|\psi\right\rangle like the one in Eq. 4.1 and assume that we want to measure the first qubit. We can rewrite the eight terms in the expression of |ψ\left|\psi\right\rangle as follows:

|ψ\displaystyle\left|\psi\right\rangle =p0|0ψ000|00+ψ001|01+ψ010|10+ψ011|11p0\displaystyle=\sqrt{p_{0}}\left|0\right\rangle\otimes\frac{\psi_{000}\left|00% \right\rangle+\psi_{001}\left|01\right\rangle+\psi_{010}\left|10\right\rangle+% \psi_{011}\left|11\right\rangle}{\sqrt{p_{0}}} (4.12)
+p1|1ψ100|00+ψ101|01+ψ110|10+ψ111|11p1.\displaystyle+\,\sqrt{p_{1}}\left|1\right\rangle\otimes\frac{\psi_{100}\left|0% 0\right\rangle+\psi_{101}\left|01\right\rangle+\psi_{110}\left|10\right\rangle% +\psi_{111}\left|11\right\rangle}{\sqrt{p_{1}}}.

We can now rewrite this as

|ψ=p0|0|ψ0+p1|1|ψ1,\displaystyle\left|\psi\right\rangle=\sqrt{p_{0}}\left|0\right\rangle\otimes% \left|\psi_{0}\right\rangle\,+\,\sqrt{p_{1}}\left|1\right\rangle\otimes\left|% \psi_{1}\right\rangle, (4.13)

where the pap_{a} are probabilities (namely, the ones from Eq. 4.10) and the |ψa\left|\psi_{a}\right\rangle are quantum states (the two-qubit states from Eq. 4.11).

In fact, whenever you manage to write your quantum state in the form of Eq. 4.13 then you can simply read off the probabilities of the measurement outcomes in this way, and also see what the state on the remaining two qubits is after the measurement. For example,

12|000+12|111=12|0|00+12|1|11,\displaystyle\frac{1}{\sqrt{2}}\left|000\right\rangle+\frac{1}{\sqrt{2}}\left|% 111\right\rangle=\frac{1}{\sqrt{2}}\left|0\right\rangle\otimes\left|00\right% \rangle+\frac{1}{\sqrt{2}}\left|1\right\rangle\otimes\left|11\right\rangle,

This confirms that in our running example (4.9), both outcomes happen with probability 1/21/2 and that the state of the remaining qubits is either |00\left|00\right\rangle or |11\left|11\right\rangle, depending on the outcome. This method of first grouping terms and then normalizing them is rather intuitive and generally very useful. However, when using it you should be very careful not to forget to correctly normalize the states! That is, whatever constants pa\sqrt{p_{a}} you pull out in front of the two basis states in Eqs. 4.12 and 4.13, they should satisfy p0+p1=1p_{0}+p_{1}=1 and the states |ψ0\left|\psi_{0}\right\rangle and |ψ1\left|\psi_{1}\right\rangle on the remaining qubits should be properly normalized, see Eq. 4.3.

We can proceed completely analogously if we have more than three qubits, or we want to measure another qubit than the first, or if we want to measure more than a single qubit! For example, suppose we were to measure the first two qubits of a general three-qubit state |ψ\left|\psi\right\rangle from Eq. 4.1. Then the measurement outcome consists of two bits, aa and bb, occurring with probabilities

pa,b=ψab02+ψab12,\displaystyle p_{a,b}=\psi_{ab0}^{2}+\psi_{ab1}^{2}, (4.14)

and the remaining qubit after the measurement is in state

|ψa,b=ψab0|0+ψab1|1ψab02+ψab12.\displaystyle\left|\psi_{a,b}\right\rangle=\frac{\psi_{ab0}\left|0\right% \rangle+\psi_{ab1}\left|1\right\rangle}{\sqrt{\psi_{ab0}^{2}+\psi_{ab1}^{2}}}. (4.15)
Exercise 4.7 (Two out of three).

What are the probabilities of outcomes if you measure the first two qubits of the three-qubit state in Eq. 4.7? Use Quirky to confirm your result.

Solution. Following Eq. 4.14, we should obtain [00][00] and [11][11], with probability 50% each. Indeed:

[Uncaptioned image]

If we measure some of the qubits but not others, we will often want to use measurement outcomes to determine if an operation should be applied to the remaining qubits or not. For example, suppose that in the situation of (4.9) you want to reset the remaining two qubits to state |00\left|00\right\rangle. Now, if the measurement outcome is zero, nothing needs to be done. But if the measurement outcome is one, then we know that the two remaining qubits are in state |11\left|11\right\rangle and we would like to reset them back to |00\left|00\right\rangle. This can be done by applying a NOT\mathrm{NOT} operation to each of them. However, how do we know whether we should really apply this operation or not because this depends on the earlier measurement outcome on the first qubit. Hence, we would like to apply it only when the measurement outcome is 11. In other words, we want to apply a controlled-NOT gate, where the control is now a classical bit (the outcome of the measurement) but the target is still quantum.

In Quirky we can realize this as you would expect, namely by using a classical bit as the control and a quantum bit as the target, as in the following:

[Uncaptioned image]

Here, after the first qubit is measured, we apply two further controlled-NOT operations that are controlled by the measurement outcome and then we measure the remaining two qubits. The picture shows that we indeed successfully reset the two qubits, since measuring them yields [00][00] with 100% probability.

If we liked, we could describe these operations in terms of ‘hybrid’ states that consist of one bit and two qubits, e.g.,

CNOT12[a]|b,c=[a]|ab,c,\displaystyle\mathrm{CNOT}_{1\to 2}[a]\otimes\left|b,c\right\rangle=[a]\otimes% \left|a\oplus b,c\right\rangle,

but we will not need this level of formality.