Solution (source code)

= Solution

Write the single-qubit gate as $R(\alpha)=HP(\alpha)H$, where $P(\alpha)=\operatorname{diag}(1,e^{i\alpha})$. Thus it is, up to <global phase>, a <rotation about the x-axis>, and it commutes with $X$. Compile it as a <Hadamard gate> followed by the <J gate> $J(\alpha)$. Compile each <CNOT gate> as before into $H_jE_{ij}H_j$. The usual wire-link construction yields a resource <graph state> for the fixed $|+\rangle$ inputs; the same frame algebra also works for logical input states supplied to an open resource.

The point is stronger than counting two gates per rotation: a long circuit must not acquire a new adaptive layer for every rotation. We show that every nonzero-angle basis depends only on outcomes of the angle-zero measurements.

For an $R(\alpha)$ gadget, let the incoming <Pauli frame> be $X^pZ^q$. Denote the angle-zero outcome by $s$, and the subsequent angle-$\theta$ outcome by $t$. The two <one-bit teleportations> give
$$
X^tJ(\theta)X^sHX^pZ^q\simeq X^{t\oplus p}Z^{s\oplus q}R(\alpha),\qquad \theta=(-1)^{s\oplus q}\alpha,
$$
where $\simeq$ omits a <global phase>. Consequently the rotation gadget updates
$$
\boxed{p'=p\oplus t,\qquad q'=q\oplus s.}
$$
Only its angle-zero outcome enters the new $Z$ frame. Its arbitrary-angle outcome enters only the $X$ frame, which commutes through all later $R$ gates.

For a <CNOT gate> from $i$ to $j$, call the outcomes of its two angle-zero target-wire measurements $r,u$, in that order. The <Pauli frame> update is
$$
p_i'=p_i,\qquad p_j'=p_j\oplus p_i\oplus u,\qquad q_i'=q_i\oplus q_j\oplus r,\qquad q_j'=q_j\oplus r.
$$
These follow by applying the preceding <Hadamard gate> and <Controlled-Z gate> frame updates twice. In particular, the new $Z$ frames depend on old $Z$ frames and angle-zero outcomes only; they never depend on old $X$ frames or arbitrary-angle outcomes. This is the measurement-level version of the given fact that a <CNOT gate> propagates $X$ operators into products of $X$ operators.

Starting with no frame, induction in the original circuit order now computes every $q$ solely from angle-zero results. Therefore every sign $(-1)^{s\oplus q}$ is known after one simultaneous layer containing \b[all angle-zero measurements], including those appearing late in the circuit. Compute those signs classically, and perform \b[all remaining equatorial measurements in a second simultaneous layer]. An angle zero that occurs accidentally among these remaining choices may stay in that layer. Reordering is valid because, once a branch's bases have been fixed, the projectors on different vertices commute; no second-layer result is needed to choose another second-layer basis.

The <two-layer measurement pattern for CNOT and x-axis rotations> thus has
$$
\boxed{\text{logical measurement depth}\le2,}
$$
independently of the number or order of gates. Fixed <computational-basis measurements> of classical outputs can be included in layer two, followed by relabelling $t_i\mapsto t_i\oplus p_i$. For quantum outputs the final <Pauli frame> gives the required correction. The depth statement excludes graph preparation and classical processing, as in the definition in the paper.