2.4 Operations on a quantum bit

Before we measure a state we might want to do some operation on it. But what kind of operations can we do on a qubit? For example, when we start our quantum computer, its quantum bit will always be in state |0\left|0\right\rangle, so we need to apply an operation to create some interesting state |ψ(θ)\left|\psi(\theta)\right\rangle. Whatever the operation is, it should produce another qubit state as an output. In other words, it should map the qubit state space to itself. Recall from Fig. 2.1 that this state space corresponds to a circle, so we are looking for ways of mapping the circle to itself.

Let us first consider the NOT operation, which we can define in exactly the same way as in Eq. 1.17 for probabilistic bits:

NOT|0=|1,NOT|1=|0.\mathrm{NOT}\left|0\right\rangle=\left|1\right\rangle,\qquad\mathrm{NOT}\left|% 1\right\rangle=\left|0\right\rangle.

How can we extend NOT\mathrm{NOT} to arbitrary qubit states? Just like we did for probabilistic bits in Section 1.2.1, we will use the idea of linearity. If an operation MM is defined on |0\left|0\right\rangle and |1\left|1\right\rangle then we can define it on an arbitrary qubit state by

M(ψ0|0+ψ1|1)=ψ0M|0+ψ1M|1.\displaystyle M\Big{\lparen}\psi_{0}\left|0\right\rangle+\psi_{1}\left|1\right% \rangle\Big{\rparen}=\psi_{0}\,M\left|0\right\rangle+\psi_{1}\,M\left|1\right\rangle. (2.8)

We can also write out Eq. 2.8 explicitly using the vector notation:

M(ψ0ψ1)=M(ψ0(10)+ψ1(01))=ψ0M(10)+ψ1M(01).\displaystyle M\begin{pmatrix}\psi_{0}\\ \psi_{1}\end{pmatrix}=M\Bigg{\lparen}\psi_{0}\begin{pmatrix}1\\ 0\end{pmatrix}+\psi_{1}\begin{pmatrix}0\\ 1\end{pmatrix}\Bigg{\rparen}=\psi_{0}\,M\begin{pmatrix}1\\ 0\end{pmatrix}+\psi_{1}\,M\begin{pmatrix}0\\ 1\end{pmatrix}. (2.19)

As mentioned earlier, in mathematics an operation MM that satisfies this condition is called linear, and extending an operation in this way is called extending “by linearity”. The key point is that if MM is linear and we know how it acts on |0\left|0\right\rangle and on |1\left|1\right\rangle, we can deduce how it acts on arbitrary qubit states!

In Eq. 2.8, we only considered the vectors |0\left|0\right\rangle and |1\left|1\right\rangle. However it is more generally true that

M(a|ψ+b|ϕ)=aM|ψ+bM|ϕ\displaystyle M\Big{\lparen}a\left|\psi\right\rangle+b\left|\phi\right\rangle% \Big{\rparen}=a\,M\left|\psi\right\rangle+b\,M\left|\phi\right\rangle (2.20)

for arbitrary vectors |ψ\left|\psi\right\rangle, |ϕ\left|\phi\right\rangle and numbers aa, bb. Can you see how (2.20) follows from (2.8)?

The laws of quantum mechanics guarantee that any linear operation MM is a possible qubit operation – provided it sends the entire qubit state space to itself! By this we mean that every qubit state (point on the circle) is mapped to some qubit state (point on the circle).

In the case of the NOT operation, the result of extending by linearity is

NOT(ψ0|0+ψ1|1)=ψ0|1+ψ1|0,orNOT(ψ0ψ1)=(ψ1ψ0).\displaystyle\mathrm{NOT}\Big{\lparen}\psi_{0}\left|0\right\rangle+\psi_{1}% \left|1\right\rangle\Big{\rparen}=\psi_{0}\left|1\right\rangle+\psi_{1}\left|0% \right\rangle,\quad\text{or}\quad\mathrm{NOT}\begin{pmatrix}\psi_{0}\\ \psi_{1}\end{pmatrix}=\begin{pmatrix}\psi_{1}\\ \psi_{0}\end{pmatrix}. (2.25)

Note that Eqs. 2.8, 2.19 and 2.25 look exactly like Eqs. 1.26 and 1.22 – except that now ψ0\psi_{0} and ψ1\psi_{1} can also be negative. In terms of Fig. 2.2, the NOT operation amounts to a reflection about the 45 degree axis (this is true also for probabilistic bits). This is visualized in Fig. 2.4. Clearly, NOT\mathrm{NOT} maps the qubit state space (circle) to itself. Thus, the NOT operation is a valid operation on a quantum bit.

Figure 2.4: The NOT operation on a qubit, defined in Eq. 2.25, amounts to a reflection about the 45 degree (or π/4\pi/4) axis (dotted).

In Quirky, the NOT\mathrm{NOT} operation on qubits looks like just like the NOT\mathrm{NOT} operation on bits, namely \bigoplus. Try now to build the following quantum computation:

[Uncaptioned image]

Now it looks like the measurement outcome will be ‘one’ 100% of the time. Indeed, the initial |0\left|0\right\rangle gets transformed to a |1\left|1\right\rangle state by the NOT operation, so that the outcome will always be ‘one’ according to the measurement rules in Eq. 2.7.


We can similarly define qubit operations by considering reflections through other axes. For example, the Z operation defined by

Z|0=|0,Z|1=|1,Z\left|0\right\rangle=\left|0\right\rangle,\qquad Z\left|1\right\rangle=-\left% |1\right\rangle, (2.26)

corresponds to a reflection about the horizontal |0\left|0\right\rangle-axis. Indeed, if we extend Z by linearity then it acts on an arbitrary qubit state as

Z(ψ0ψ1)=(ψ0ψ1),\displaystyle Z\begin{pmatrix}\psi_{0}\\ \psi_{1}\end{pmatrix}=\begin{pmatrix}\psi_{0}\\ -\psi_{1}\end{pmatrix},

which certainly maps qubit states to qubit states.

Homework 2.2 (Z operation).

Consider the following two states of a qubit:

|+\displaystyle\left|+\right\rangle =|0+|12,\displaystyle=\frac{\left|0\right\rangle+\left|1\right\rangle}{\sqrt{2}}, |\displaystyle\left|-\right\rangle =|0|12.\displaystyle=\frac{\left|0\right\rangle-\left|1\right\rangle}{\sqrt{2}}.
  1. 1.

    Compute Z|+Z\left|+\right\rangle and Z|Z\left|-\right\rangle.

  2. 2.

    Visualize the ZZ-operation graphically on the circle, as in Fig. 2.4.

Hack.
  1. 1.

    ZZ acts on the |+\left|+\right\rangle state as follows:

    Z|+=Z(12|0+12|1)=12Z|0+12Z|1=12|012|1=|,\displaystyle Z\left|+\right\rangle=Z\Bigg{\lparen}\frac{1}{\sqrt{2}}\left|0% \right\rangle+\frac{1}{\sqrt{2}}\left|1\right\rangle\Bigg{\rparen}=\frac{1}{% \sqrt{2}}Z\left|0\right\rangle+\frac{1}{\sqrt{2}}Z\left|1\right\rangle=\frac{1% }{\sqrt{2}}\left|0\right\rangle-\frac{1}{\sqrt{2}}\left|1\right\rangle=\left|-% \right\rangle,

    and similarly Z|=|+Z\left|-\right\rangle=\left|+\right\rangle.

  2. 2.

    ZZ acts as a reflection about the horizontal |0\left|0\right\rangle-axis!

Exercise 2.2 (Linearity is not enough (optional)).

Consider the operation MAD\mathrm{MAD} obtained by extending MAD|0=|0\mathrm{MAD}\left|0\right\rangle=\left|0\right\rangle and MAD|1=12(|0+|1)\mathrm{MAD}\left|1\right\rangle=\frac{1}{\sqrt{2}}\left(\left|0\right\rangle+% \left|1\right\rangle\right) by linearity. Find a state |ψ\left|\psi\right\rangle such that MAD|ψ\mathrm{MAD}\left|\psi\right\rangle is not a valid qubit state. Thus, MAD\mathrm{MAD} is not a valid operation on qubits!

Solution. Let |ψ=12(|0+|1)\left|\psi\right\rangle=\frac{1}{\sqrt{2}}\left(\left|0\right\rangle+\left|1% \right\rangle\right), which is a valid quantum state. Since MAD\mathrm{MAD} is obtained by extending by linearity, Eq. 2.8 implies that
MAD|ψ\displaystyle\mathrm{MAD}\left|\psi\right\rangle =MAD(12|0+12|1)=12MAD|0+12MAD|1\displaystyle=\mathrm{MAD}\Bigg{\lparen}\frac{1}{\sqrt{2}}\left|0\right\rangle% +\frac{1}{\sqrt{2}}\left|1\right\rangle\Bigg{\rparen}=\frac{1}{\sqrt{2}}% \mathrm{MAD}\left|0\right\rangle+\frac{1}{\sqrt{2}}\mathrm{MAD}\left|1\right\rangle
=12|0+12(|0+|1)=(12+12)|0+12|1.\displaystyle=\frac{1}{\sqrt{2}}\left|0\right\rangle+\frac{1}{2}\left(\left|0% \right\rangle+\left|1\right\rangle\right)=\left(\frac{1}{\sqrt{2}}+\frac{1}{2}% \right)\left|0\right\rangle+\frac{1}{2}\left|1\right\rangle.
But
(12+12)2+(12)2=1+121,\displaystyle\left(\frac{1}{\sqrt{2}}+\frac{1}{2}\right)^{2}+\left(\frac{1}{2}% \right)^{2}=1+\frac{1}{\sqrt{2}}\neq 1,
so MAD|ψ\mathrm{MAD}\left|\psi\right\rangle is not a valid qubit state.