# Understanding how control gates are written in tensor notation

I'm very confused about the tensor representation of Control gates. I had thought that all control gates were of the form $$P_0 \otimes I+P_1\otimes \hat{A}$$, where this does nothing to the first qubit and acts with the operator $$A$$ on the second, but that there was a conditional implication involved. And I thought that $$I\otimes A$$ just meant that you act on the second and not the first but there was no implication of of conditionality?

Could someone please clear this up for me?

• Hmm I didn't know control gates were decomposable as a tensor product. Where are you getting that from? Commented Aug 15, 2019 at 7:37
• @psitae I think that's quite well known Commented Aug 15, 2019 at 10:57
• Please give a source. That's standard practice for this website. Commented Aug 15, 2019 at 12:43
• @psitae I didn't think a source was necessary every book I've read on quantum computing involves tensor notation and it's thought that way in college. If you know that you can describe a circuit using matrices then tensor notation is just away of describing adjoining matrices. You'll see it here quantiki.org/wiki/quantum-gates or here en.wikipedia.org/wiki/Quantum_logic_gate. Commented Aug 15, 2019 at 19:47
• @psitae although I suppose that maybe it's more of a theoretical description so maybe if the books were more practically inclined they wouldn't discuss it as much. But this is $|0\rangle \otimes |0 rangle =|00\rangle$ is a tensor description of $|00\rangle$. It just means that we put the entries of $|0\rangle$ is two matrices $1.|0\rangle$ $0,|1\rangle$ . Some good books that talk about it are quantum computing explained by Derak macmahon and also Cohen and Tanouji Commented Aug 15, 2019 at 20:08

The idea behind a controlled gate is that nothing (i.e. $$I$$) is performed on the control qubit, but the action on the target qubit depends on the state of the control qubit.
Therefore, you can't write the action on the target qubit as a unitary operation on only that qubit. That is to say, the controlled operation can not be of the form $$I_{c} \otimes A_{t}$$.
However, the different specific actions on the target qubit can be 'entangled' to the different states of the control qubit. This is exactly where your notation comes in. Consider the $$CNOT$$ operation: if the control qubit's state is $$|0\rangle$$, we perform $$I$$ on the target qubit, and if the state is $$|1\rangle$$, we perform $$X$$. This becomes: $$$$CNOT = |0\rangle\langle0|\otimes I + |1\rangle\langle1|\otimes X,$$$$
so in this case $$P_{0} = |0\rangle\langle0|$$ and $$P_{1} = |1\rangle\langle1|$$.
Note that we always have $$\sum_{i} P_{i} = I$$ if we sum over a whole basis. Therefore, the action on the control qubit, without any regard to the target qubit, is indeed always $$I$$, i.e. nothing.
Edit: as an added note, keep in mind that these projector operators $$P_{i}$$ can never correspond to unitary operations.