In this section we revise properties of matrices and vectors. We use informal definitions for the purposes of this site, so some of the statements in this section are true only for the scenarios we encounter in quantum computing and not for mathematics in general.
To represent the CNOT gate as a matrix, we must use the Kronecker product to describe the combined state of our two qubits:
The CNOT gate then has the matrix:
We can see that the CNOT gate switches the amplitudes of the |10⟩ and |11⟩ states. It is clear to see how the CNOT gate acts on classical states, but what if we pass it qubits in superposition? If we first apply a H-gate to the control qubit we can create an interesting state:
The control qubit enters the CNOT gate in the state |+⟩ and the target in the state |0⟩:
We see that the states |01⟩ and |10⟩ both have zero amplitudes, this means we have no probability of measuring them. When we measure these qubits we will always measure either both |0⟩ or both |1⟩. We say these qubits have become entangled; we can no longer write their states as separate 2D vectors and measuring one qubit destroys the superposition of the other!