Three-vertex graph-state wire (source code)

= Three-vertex graph-state wire
{title2=$X^sZ^rU(\beta)U(\alpha)$}

A path <graph state> on three <qubits> simulates two successive gates $U(\theta)=H\operatorname{diag}(1,e^{-i\theta})=J(-\theta)$. Measure vertex one in the <equatorial qubit measurement> basis $|v_r(\alpha)\rangle=(|0\rangle+(-1)^re^{i\alpha}|1\rangle)/\sqrt2$, then vertex two at angle $(-1)^r\beta$, obtaining bits $r,s$. Two <one-bit teleportations> and $U(\theta)X=e^{-i\theta}ZU(-\theta)$ leave vertex three in $X^sZ^rU(\beta)U(\alpha)|+\rangle$, up to <global phase>. A computational output bit $z$ is corrected to $z\oplus s$; the $Z$ factor affects only phase. Adaptive sign choice is required for general angles, although the final bit correction is purely classical.