Four-cycle graph-state simulation of an entangle-and-measure circuit (source code)

= Four-cycle graph-state simulation of an entangle-and-measure circuit

Label a four-cycle $0-1-2-3-0$. Measure <vertex> $0$ in the <computational basis> with result $r$, then <vertex> $1$ in the <equatorial qubit measurement> basis at angle $\alpha$ with result $s$. <Graph-state vertex deletion> and <one-bit teleportation> leave
$$
E_{23}X_2^{r\oplus s}J(\alpha)_2Z_3^r|++\rangle=X_2^{r\oplus s}Z_3^sE_{23}J(\alpha)_2|++\rangle.
$$
Final <computational basis> measurements with raw results $d_2,d_3$ therefore simulate the ideal circuit $E_{23}J(\alpha)_2$ on $|++\rangle$ after the classical correction $k=d_2\oplus r\oplus s$, $l=d_3$. The output <probability distribution> is correct in every prior branch; no physical <Pauli frame> correction is needed.