# Inputting a superposition into a cNOT gate

I am unsure how to calculate what happens when you put a superposition as the control qubit into a cNOT gate or what happens when you put a superposition as the target qubit into a cNOT gate. I know what matrix represents the cNOT and I know that each superposition would be represented by $\alpha |00\rangle + \beta|01\rangle+\gamma|10\rangle+\delta|11\rangle$, but would you take these two four dimensional vectors and multiply them both by the cNOT matrix? If so, in what order? I just don't quite understand.

Any help would be appreciated. Thanks!

## 1 Answer

This is more of a question on linear algebra rather than a question about quantum computation. You should probably have a firm grip on basic linear algebra (vector spaces, linear operators, inner product, etc) before delving into quantum computation (there's no way around it).

CNOT is a linear operator in our vector space, $\mathbb{C}^4$ (were only dealing with linear transformations, specifically unitary). In order to specify how a linear transformation operates on an arbitrary vector, it is enough to specify how it operates on each member of a basis for our vector space. Suppose we apply some linear operator $T$ on an arbitrary superposition, then by linearity:

$T\left(\alpha |00\rangle + \beta|01\rangle+\gamma|10\rangle+\delta|11\rangle\right)= \alpha T|00\rangle+\beta T|01\rangle + \gamma T|10\rangle + \delta T|11\rangle$

$T|ij\rangle$ is the application of the operator $T$ on the vector $|ij\rangle$. The application of a linear operator in a finite dimensional vector space can be described by matrix multiplication, so this means multiplying the matrix representing $T$ by the vector $|ij\rangle$. The "order" you refer to does not matter, because addition in a vector space is commutative.

Since you know how to apply CNOT to the four basic states, the above equality shows you how to apply it on an arbitrary superposition.

When talking about matrix representation, the vector $\alpha |00\rangle + \beta|01\rangle+\gamma|10\rangle+\delta|11\rangle$ is represented by $\begin{pmatrix} \alpha\\ \beta\\ \gamma\\ \delta \end{pmatrix} \in\mathbb{C}^4$, so applying CNOT to this state means multiplying it's matrix by this vector, i.e.

$CNOT\left(\alpha |00\rangle + \beta|01\rangle+\gamma|10\rangle+\delta|11\rangle\right)= \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \end{pmatrix} \begin{pmatrix} \alpha\\ \beta\\ \gamma\\ \delta \end{pmatrix}= \begin{pmatrix} \alpha\\ \beta\\ \delta\\ \gamma \end{pmatrix}$.

This is obviously equivalent to applying CNOT to each of the four vectors in $\mathbb{C}^4$ and adding up the results.

• So, to see if I understand correctly: I have two four dimensional vectors, representing the target and control qubit. I multiply the target qubit by the cNOT matrix and multiply the control qubit by the cNOT matrix. Each of those give the result for what I get for the target and control qubit? Or do I misunderstand? – heather Oct 9 '16 at 13:50
• You misunderstand. The entire state of the system is described by a vector in $\mathbb{C}^4$. This state represents both the control & target qubits, so I cannot apply some operator on the control/target bit alone. You input the state of both qubits (described by four complex numbers), apply CNOT, and the output is again a vector in $\mathbb{C}^4$ which describes the new state of the two qubits. – Ariel Oct 9 '16 at 16:38
• Oh, the two qubits are represented by one vector? Then you apply the cNOT to that singular vector? – heather Oct 9 '16 at 16:39
• Yes. Read the answer carefully, an arbitrary superposition of two qubits $\alpha|00\rangle+\beta|01\rangle+\gamma|10\rangle+\delta|11\rangle$ is described by the column vector $(\alpha,\beta,\gamma,\delta)$. – Ariel Oct 9 '16 at 16:43