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.

enter image description here enter image description here

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


1 Answer 1


This is the definition of the CNOT gate. The definition has been chosen this way, because

$$ 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.

  • $\begingroup$ Hi! Would you mind explaing why $1 \oplus b = \neg b$? I totally understand everything else in your answer! Thank you! $\endgroup$
    – Claire
    Aug 5, 2021 at 0:04
  • 1
    $\begingroup$ Just check all (i.e. both) possibilities: $1\oplus 0 = 1 = \neg 0$ and $1\oplus 1 = 0 = \neg 1$. $\endgroup$ Aug 5, 2021 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.