2

I understand how the outcome of each is supposed to be different, but in matrix form are these gates not the same? The CNOT matrix negates the second bit regardless of the input of the first.

Sam J
  • 21
  • 1

1 Answers1

1

The controlled NOT gate is represented by the matrix $$ \begin{pmatrix} 1&0&0&0\\ 0&1&0&0\\ 0&0&0&1\\ 0&0&1&0 \end{pmatrix} $$ In contrast, the matrix corresponding to negating the second bit is $$ \begin{pmatrix} 0&1&0&0\\ 1&0&0&0\\ 0&0&0&1\\ 0&0&1&0 \end{pmatrix} $$

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514