Show that surrounding a $CNOT$ with Hadamard gates switches the role of the control-bit and target-bit of $CNOT$

501 Views Asked by At

So I wish to show that surrounding a CNOT with Hadamard gates switches the role of the control-bit and target-bit of CNOT. Explicitly I want to show

($H\otimes H$)CNOT($H\otimes H$) is the 2-qubit gate where the second bit controls whether the first bit is negated.

I tried computing the above explicitly and gotten the matrix

\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 \end{bmatrix}

Assuming my computation is correct, I don't see how this reflects this "change of role". How do I see this easily ?

Cheers

2

There are 2 best solutions below

0
On

Showing that

enter image description here

is equivalent to computing the matrices of the circuits on each side of the equality and showing that they are the same. By checking how it acts on the basis states, you can see that the matrix of the circuit on the right hand side is

\begin{equation}\begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 0& 0&1\\0&0&1&0\\0&1&0&0 \end{pmatrix},\end{equation} and you have already shown that this is the same as the matrix corresponding to the circuit on the left hand side.

0
On

What you want to do is apply your matrix to each base state (|00>,|10>, |01> and |11>) and see how they change and compare to how they change with the original CNOT gate. When you use a base state with the second qubit in |1> the first qubit should be negated.