In textbook, it states that the CNOT gate with the X gate applied on second qubit is \begin{array}{cccc} 1&0&0&0\\ 0&1&0&0\\ 0&0&0&1\\ 0&0&1&0 \end{array} However, By tensor products, wouldn't it be $I$ $\otimes$ $U_{x}$ , which gives \begin{array}{cccc} 0&1&0&0\\ 1&0&0&0\\ 0&0&0&1\\ 0&0&1&0 \end{array}
1 Answer
The way that we can write controlled-not operation explicitly algebraically with the control on the first qubit is as follows: $$ \mathit{CNOT} \;=\; \def\ket#1{\lvert #1 \rangle}\def\bra#1{\langle #1 \rvert}\ket{0}\!\bra{0} \!\otimes\! \mathbf 1 \,+\, \ket{1}\!\bra{1} \!\otimes\! \: \sigma_x$$ where $\mathbf 1$ is an identity matrix of $2\times2$ order.
You can now see why it should give the desired answer.
-
$\begingroup$ Thanks that works out. can you explain thought why we cannot switch the order of the tensor products(I know tensor products are generally not commutative), but why does the CNOT operator happen to have the outer proudct on the left side? is there a specific reason? $\endgroup$ Feb 12, 2019 at 9:11
-
-
$\begingroup$ As you stated, tensor products are not commutative. Kronecker products are written in the order the gates are applied. $\endgroup$– exp ikxFeb 12, 2019 at 17:35
-
$\begingroup$ BY same logic, if x gate was now acting on first qubit, control on second, then wouldn't it be $$ \mathit{CNOT} \;=\; \def\ket#1{\lvert #1 \rangle}\def\bra#1{\langle #1 \rvert}\ket{0}\!\bra{0} \!\otimes\! \sigma_x \,+\, \ket{1}\!\bra{1} \!\otimes\! \: \mathbf 1$$, which gives incorrect operator matrix? $\endgroup$ Feb 13, 2019 at 6:55
-
$\begingroup$ Yes, but how is it incorrect? You have changed the control to second qubit and the action on the first will be negated, which is to say you have reversed the control and the operating qubits and the corresponding matric is what you have written. $\endgroup$– exp ikxFeb 13, 2019 at 16:01