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 , and the result of applying it to a quantum state is the product . The result of applying CNOT twice is then given by where .
If the quantum state , then applying CNOT twice to produces a final state
As discussed in the text, if we take the result of CNOT and apply CNOT again, this takes to and then to , because CNOT does not do anything when the value of the control bit is zero. Similarly applying CNOT twice takes to and then to again.
Applying CNOT twice to produces upon applying the first CNOT, and then applying CNOT again produces , the same as the starting state. Similarly, applying CNOT twice to produces upon applying the first CNOT and then 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
We thus have
Since for any state we have , and since where is the matrix corresponding to applying the CNOT gate twice, we have . Thus the CNOT gate is its own inverse.