Hence the whole circuit implements the composed unitary
so that
The rightmost gate acts first. A gate drawn earlier in the circuit appears further to the right in the algebraic product.
Gates on Part of a Register
A gate may be drawn on only one wire of a circuit, but mathematically it must act on the whole quantum register. This section explains how a local one-qubit gate is embedded into the larger state space.
acts on one qubit state space. To make it an operator on the whole two-qubit register, tensor it with the identity operator on the qubit that should remain unchanged.
To apply to the first qubit, use
To apply to the second qubit, use
On a product state, this means
So acts on the first qubit state and acts on the second qubit state. For general superpositions, the same rule extends by linearity.
Why the identity appears
A one-qubit gate is too small for the whole two-qubit register: it only has type .
The full register has type
Tensoring with fills the missing slot. The identity says: “leave this qubit state as it is, but keep it inside the full register.”