= Phase-corrected exchange network for a CNOT gate
{title2=$\mathrm{CNOT}_{1\to2}=P_1X_2H_2SZ_1SP_2H_2$}
With $S=P_++iP_-$ the conventional <square root of the SWAP gate>, $P=\operatorname{diag}(1,i)$ the <S gate>, and operators acting rightmost first, $SZ_1S=\operatorname{diag}(1,i,-i,-1)$. Therefore $H_2SZ_1SP_2H_2=|0\rangle\langle0|\otimes X-i|1\rangle\langle1|\otimes I$. Appending $X_2$ changes the zero-controlled flip into a one-controlled flip, and $P_1$ removes the control-dependent phase. This proves the displayed exact <CNOT gate> identity. Both the exchange branch and the <phase gate> square-root convention matter; changing either requires recalculating the correction.
Back to article page