= Two-qubit parity phase gate
{title2=$G_\theta=\operatorname{diag}(1,e^{i\theta},e^{i\theta},1)$}
A <two-qubit parity phase gate> multiplies odd-parity computational <vectors> by $e^{i\theta}$ and fixes even-parity ones. With $R_\theta=\operatorname{diag}(1,e^{i\theta})$,
$$
G_\theta=\mathrm{CNOT}(I\otimes R_\theta)\mathrm{CNOT}.
$$
The first <controlled-NOT gate> computes $x\oplus y$ in the second wire, the <phase gate> multiplies by $e^{i\theta(x\oplus y)}$, and the last <controlled-NOT gate> restores the original bits. This <compute-phase-uncompute construction> leaves the data unchanged except for the desired phases. The more general <Pauli-string phase by parity computation> uses the same mechanism. In terms of the <Pauli Z gate>, $G_\theta=e^{i\theta/2}\exp[-i\theta(Z\otimes Z)/2]$; the scalar factor ensures equality as a <matrix>, rather than only up to <global phase>.
Back to article page