2.4.2 Composing quantum operations

We can always compose two given qubit operations MM and NN to obtain a new qubit operation. Indeed, if |ψ\left|\psi\right\rangle is the input state and we first apply MM, we get M(|ψ)=M|ψM(\left|\psi\right\rangle)=M\left|\psi\right\rangle. If we then apply NN, resulting state is N(M|ψ)N(M\left|\psi\right\rangle). We will denote this composite operation by NMNM, so that

NM|ψ=N(M|ψ).\displaystyle NM\left|\psi\right\rangle=N(M\left|\psi\right\rangle).

Be careful not to confuse the order of the two operations. If the composite operation is NMNM, this means that MM is applied first and NN is applied second! This is because MM stands next to |ψ\left|\psi\right\rangle, so it must be the first one to act on the state.

Exercise 2.4 (Linearity of a composed operation (optional)).

Verify that NMNM is again linear.

Hint: Use Eq. 2.20.

Solution. Take an arbitrary state ψ0|0+ψ1|1\psi_{0}\left|0\right\rangle+\psi_{1}\left|1\right\rangle, first use the linearity of MM and then the linearity of NN:
NM(ψ0|0+ψ1|1)\displaystyle NM(\psi_{0}\left|0\right\rangle+\psi_{1}\left|1\right\rangle) =N(M(ψ0|0+ψ1|1))\displaystyle=N\big{\lparen}M(\psi_{0}\left|0\right\rangle+\psi_{1}\left|1% \right\rangle)\big{\rparen}
=N(ψ0M|0+ψ1M|1)=ψ0NM|0+ψ1NM|1.\displaystyle=N\big{\lparen}\psi_{0}M\left|0\right\rangle+\psi_{1}M\left|1% \right\rangle\big{\rparen}=\psi_{0}NM\left|0\right\rangle+\psi_{1}NM\left|1% \right\rangle.
In the last step, we used Eq. 2.20.

We can similarly compose three and more qubit operations. We will write ONMONM and so on. In particular, we may obtain new qubit operations by composing rotations and reflections. We will discuss this in Section 2.4.3 below.

It is interesting to observe that all qubit operations that we discussed so far are invertible. This means that for any operation MM there exists another operation, which we write as M1M^{-1}, such that when we first apply MM and then M1M^{-1} (or the other way around) the state of the qubit is unchanged. 1111 11 This notation and Eq. 2.31 will remind you of the following: If xx is a nonzero number then x1=1xx^{-1}=\frac{1}{x} is its inverse, which means that xx1=x1x=1xx^{-1}=x^{-1}x=1. In formulas, we can write

M1M=MM1=I,\displaystyle M^{-1}M=MM^{-1}=I, (2.31)

where II is the identity operation which has the “trivial” property

I|0=|0,I|1=|1I\left|0\right\rangle=\left|0\right\rangle,\qquad I\left|1\right\rangle=\left|% 1\right\rangle (2.32)

(We could have also defined II as U(0)U(0), the rotation by an angle of zero.) Therefore I|ψ=|ψI\left|\psi\right\rangle=\left|\psi\right\rangle holds for any state |ψ\left|\psi\right\rangle when extended by linearity.

As an example, let’s look at the operation UU. It is geometrically clear that if we first rotate by β\beta and then by β-\beta then the quantum bit is unchanged. To see this more formally, we only need to use Eq. 2.29 twice:

U(β)U(β)|ψ(α)=U(β)|ψ(α+β)=|ψ(α+ββ)=|ψ(α)\displaystyle U(-\beta)U(\beta)\left|\psi(\alpha)\right\rangle=U(-\beta)\left|% \psi(\alpha+\beta)\right\rangle=\left|\psi(\alpha+\beta-\beta)\right\rangle=% \left|\psi(\alpha)\right\rangle

and similarly if we first rotate by β-\beta and then by β\beta. This means that the inverse operation U(β)1{U(\beta)}^{-1} is simply U(β)U(-\beta):

U(β)1=U(β).U(\beta)^{{-1}}=U(-\beta).

Similarly, since the NOT\mathrm{NOT} operation amounts to a reflection, it is clear that applying it twice leaves the qubit state invariant. Indeed, from Eq. 1.17

NOTNOT|0=NOT|1=|0andNOTNOT|1=NOT|0=|1.\displaystyle\mathrm{NOT}\,\mathrm{NOT}\left|0\right\rangle=\mathrm{NOT}\left|% 1\right\rangle=\left|0\right\rangle\quad\text{and}\quad\mathrm{NOT}\,\mathrm{% NOT}\left|1\right\rangle=\mathrm{NOT}\left|0\right\rangle=\left|1\right\rangle.

By linearity, this means that NOTNOT|ψ=|ψ\mathrm{NOT}\,\mathrm{NOT}\left|\psi\right\rangle=\left|\psi\right\rangle for any state |ψ\left|\psi\right\rangle, so NOT\mathrm{NOT} is not only invertible but its own inverse, i.e., NOT1=NOT\mathrm{NOT}^{-1}=\mathrm{NOT}.

Exercise 2.5 (Inverse of a composed operation).

Show that if MM and NN are invertible then so is NMNM. Express the inverse (NM)1(NM)^{-1} of the composed operation in terms of the individual inverses N1N^{{-1}} and M1M^{{-1}}.

Solution. We have (NM)1=M1N1(NM)^{-1}=M^{-1}N^{-1}, since for any |ψ\left|\psi\right\rangle we have
M1N1NM|ψ=M1(N1N(M|ψ))=M1(M|ψ)=M1M|ψ=|ψM^{-1}N^{-1}NM\left|\psi\right\rangle=M^{-1}(N^{-1}N(M\left|\psi\right\rangle)% )=M^{-1}(M\left|\psi\right\rangle)=M^{-1}M\left|\psi\right\rangle=\left|\psi\right\rangle
and
NMM1N1|ψ=N(MM1(N1|ψ))=N(N1|ψ)=NN1|ψ=|ψ.NMM^{-1}N^{-1}\left|\psi\right\rangle=N(MM^{-1}(N^{-1}\left|\psi\right\rangle)% )=N(N^{-1}\left|\psi\right\rangle)=NN^{-1}\left|\psi\right\rangle=\left|\psi% \right\rangle.

In fact, one can show that any linear operation that sends the qubit state space to itself is necessarily invertible. Indeed, this is the case for rotations U(θ)U(\theta) and will also be the case for reflections V(θ)V(\theta) that we will discuss next. This is in contrast to operations on probabilistic bits where, for example, the probabilistic flip operation F(1/2)F(1/2) maps any state to the uniform distribution (1/21/2)\bigl{(}\begin{smallmatrix}1/2\\ 1/2\end{smallmatrix}\bigr{)} (see 1.6) and hence is not invertible.