# I don't understand the rewriting of the controlled phase shift gate

What I don't understand about this is how can a gate that acts on a single qubit affects both of them? Is this assume to work only for entangled ones? I appreciate any help because this seams like an important chapter.

• Just try to write down matrix representation of both gates. The right circuit is simply tensor product of the gate on the upper qubit and identity operator. After writing it down, you will see that effectively it is controlled global phase gate depicted in the left circuit. Nov 25, 2022 at 22:04
• Thank you! I don't know how I didn't just write down the matrix from the start, it seems so logical now. Nov 25, 2022 at 23:13
• You are welcome. I had similar problem, at the first glance it almost doesn't make sense that controlled gate is realized without connection between the qubits! Nov 26, 2022 at 6:59

What Fig. 4.5 illustrates is that a global phase factor in the definition of a single-qubit gate translates into a relative phase factor between the states associated with different computational basis states $$|0\rangle$$ and $$|1\rangle$$ of the control-qubit once this single-qubit gate is turned into its controlled version. The phase factor $$e^{i \alpha}$$ was immaterial when we applied the single-qubit gate to a qubit alone, which is to say that the $$2 \times 2$$ unitary representation of this gate could be represented up to a global phase factor. Upon controlling this single-qubit gate, this $$e^{i \alpha}$$ factor acquires a physical significance and has to be accounted for by applying a $$R_z(\alpha)$$ gate to the control-qubit. This is true regardless of the nature of the input state (entangled or not).