# The use of modulo 2 in state representation after CNOT

The following circuit with a CNOT gate has the following effect on a computational basis state $$|a, b\rangle$$, where all additions are done modulo 2.

Why is the state of the second qubit changed to $$a\oplus b$$ after CNOT is applied?

$$0 \oplus b = b \\ 1 \oplus b = \neg b$$
where $$\neg$$ denotes bit-flip and $$\oplus$$ denotes addition modulo $$2$$. In other words, $$a\oplus b$$ does nothing to $$b$$ if $$a=0$$ and it flips $$b$$ if $$a=1$$. This is what one would expect a controlled-NOT gate to do.
• Hi! Would you mind explaing why $1 \oplus b = \neg b$? I totally understand everything else in your answer! Thank you! Aug 5 at 0:04
• Just check all (i.e. both) possibilities: $1\oplus 0 = 1 = \neg 0$ and $1\oplus 1 = 0 = \neg 1$. Aug 5 at 0:06