## Quantum Country exercise 12

This is one in a series of posts working through the exercises in the Quantum Country online introduction to quantum computing and related topics. The exercises in the original document are not numbered; I have added my own numbers for convenience in referring to them.

Exercise 12. Show that the inverse of the CNOT gate is just the CNOT gate.

Answer: Since CNOT is a quantum gate it is equivalent to some unitary matrix $M$, and the result of applying it to a quantum state $\vert \psi \rangle$ is the product $M \vert \psi \rangle$. The result of applying CNOT twice is then given by $M \left( M \vert \psi \rangle \right) = \left ( MM \right) \vert \psi \rangle = Q \vert \psi \rangle$ where $Q = MM$.

If the quantum state $\vert \psi \rangle = \alpha \vert 00 \rangle + \beta \vert 01 \rangle + \gamma \vert 10 \rangle + \delta \vert 11 \rangle$, then applying CNOT twice to $\vert \psi \rangle$ produces a final state $Q \vert \psi \rangle = Q \left( \alpha \vert 00 \rangle + \beta \vert 01 \rangle + \gamma \vert 10 \rangle + \delta \vert 11 \rangle \right)$ $= Q \left( \alpha \vert 00 \rangle \right) + Q \left( \beta \vert 01 \rangle \right) + Q \left( \gamma \vert 10 \rangle \right) + Q \left( \delta \vert 11 \rangle \right)$ $= \alpha Q \vert 00 \rangle + \beta Q \vert 01 \rangle + \gamma Q \vert 10 \rangle + \delta Q \vert 11 \rangle$

As discussed in the text, if we take the result of CNOT and apply CNOT again, this takes $\vert 00 \rangle$ to $\vert 00 \rangle$ and then to $\vert 00 \rangle$, because CNOT does not do anything when the value of the control bit is zero. Similarly applying CNOT twice takes $\vert 01 \rangle$ to $\vert 01 \rangle$ and then to $\vert 01 \rangle$ again.

Applying CNOT twice to $\vert 10 \rangle$ produces $\vert 11 \rangle$ upon applying the first CNOT, and then applying CNOT again produces $\vert 10 \rangle$, the same as the starting state. Similarly, applying CNOT twice to $\vert 11 \rangle$ produces $\vert 10 \rangle$ upon applying the first CNOT and then $\vert 11 \rangle$ upon applying the second, the same state as the starting state.

So applying CNOT twice to each of the four basis states leaves each of those states unchanged. Stated another way, we have $Q \vert 00 \rangle = \vert 00 \rangle$ $Q \vert 01 \rangle = \vert 01 \rangle$ $Q \vert 10 \rangle = \vert 10 \rangle$ $Q \vert 11 \rangle = \vert 11 \rangle$

We thus have $Q \vert \psi \rangle = \alpha Q \vert 00 \rangle + \beta Q \vert 01 \rangle + \gamma Q \vert 10 \rangle + \delta Q \vert 11 \rangle$ $= \alpha \vert 00 \rangle + \beta \vert 01 \rangle + \gamma \vert 10 \rangle + \delta \vert 11 \rangle = \vert \psi \rangle$

Since $Q \vert \psi \rangle = \vert \psi \rangle$ for any state $\vert \psi \rangle$ we have $Q = I$, and since $Q = MM$ where $M$ is the matrix corresponding to applying the CNOT gate twice, we have $MM = I$. Thus the CNOT gate is its own inverse.

This entry was posted in quantum country. Bookmark the permalink.