# Formulate Controlled-Not as mapping (including modulo-2 addition)

We often see that the controlled-not gate is written as $$CNOT |x y \rangle = |x\rangle |x \oplus y\rangle$$. Now, would it be possible to further expand this to get a general equation?

$$(\alpha_0 |0\rangle + \beta_0 |1\rangle) \otimes \left((\alpha_0 |0\rangle + \beta_0 |1\rangle) \oplus (\alpha_1 |0\rangle + \beta_1 |1\rangle) \right) \ ,$$

where $$\oplus$$ is XOR or modulo-2 addition.

However, expanding this to $$(\alpha_0 |0\rangle + \beta_0 |1\rangle) \otimes \left((\alpha_0 |0\rangle + \beta_0 |1\rangle) + (\alpha_1 |0\rangle + \beta_1 |1\rangle) \!\! \mod 2\right)$$ does not seem right. Would this operator distribute? Does it behave the same way as in 'standard' algebra, i.e.

$$(\alpha_0 |0\rangle + \beta_0 |1\rangle) \otimes ((\alpha_0 + \alpha_1\!\!\!\mod 2)|0\rangle) + (\beta_0 + \beta_1 \!\!\! \mod 2) |1\rangle) \ ?$$

As you point out, you have an $$\oplus$$ of ket vectors, which isn't well-defined, so we will need to define this operation somehow.

You definitely can't have $$\beta_0+\beta_1\mod 2$$ in a coefficient, since a quantum operator must be $$\mathbb{C}$$-linear, and there is no non-zero homomorphism from $$\mathbb{C}$$ to $$\mathbb{F}_2$$.

Whatever your operator is, its action is completely defined by any 4 basis vectors, such as $$\vert 00\rangle, \vert 01\rangle, \vert 10\rangle$$, and $$\vert 11\rangle$$. Thus, we want to have some sort of map that sends: \begin{align} \vert 00\rangle \mapsto& \vert 0\rangle(\vert 0\rangle \oplus \vert 0\rangle)\\ \vert 01\rangle \mapsto& \vert 0\rangle(\vert 0\rangle \oplus \vert 1\rangle)\\ \vert 10\rangle \mapsto& \vert 1\rangle(\vert 1\rangle \oplus \vert 0\rangle)\\ \vert 11\rangle \mapsto& \vert 1\rangle(\vert 1\rangle \oplus \vert 1\rangle)\\ \end{align} for whatever you define $$\oplus$$ to be.

Since the operator must be unitary, and the original basis was orthogonal, we require $$\vert 0\rangle \oplus \vert 0\rangle$$ to be orthogonal to $$\vert 0\rangle \oplus \vert 1\rangle$$. In my mind, the only sensible way to way to define $$\vert 0\rangle \oplus \vert 0\rangle$$ would be as $$\vert 0\rangle$$. This forces $$\vert 0\rangle \oplus \vert 1\rangle=\vert 1\rangle$$.

From there, we ought to have that $$\oplus$$ is commutative, so $$\vert 1\rangle \oplus \vert 0\rangle = \vert 0\rangle \oplus \vert 1\rangle = \vert 1\rangle$$. Orthogonality then forces $$\vert 1\rangle \oplus \vert 1\rangle= \vert 0 \rangle$$ as well.

But, this means the operator is the CNOT operator. Basically, the CNOT is the most general form of the CNOT.

This reminds me of no-cloning: The no-cloning theorem states that you can't clone arbitrary states, but you can clone any given basis. However, once the action is defined on this basis, it's action on all other states is fixed.