I'm trying to solve this problem for homework:
Now show that if the CNOT gate is applied in the Hadamard basis - i.e. apply the Hadamard gate to the inputs and outputs of the CNOT gate - then the result is a CNOT gate with the control and target qubit swapped.
So I've computed the truth table for $a/b$ with just a CNOT gate, but I'm not sure how to "apply the Hadamard gate". I know that applying Hadamard twice will leave the bit unchanged (verified this via matrix multiplication), but I'm stuck at this part:
Let's say $a$ and $b$ are qubits and both go through the Hadamard gate. Then they go into a CNOT, where $b$ is the control. If $a$ and $b$ started off at $|0 \rangle$, then their matrix version is $\frac{1}{\sqrt 2}$ $[ 1 1 ]$, but how do you apply that to a CNOT? Alternatively, if you leave them as kets, then how do you represent $H |0 \rangle $? It was straight forward just applying a CNOT since the states remain as either $|0 \rangle$ or $|1 \rangle$, but I don't understand what happens if you apply a Hadamard gate to a $0$ or $1$ qubit.