Solution (source code)

= Solution

Replace every <CNOT gate> by $H_jE_{ij}H_j$. The resulting <quantum circuit> contains only <Hadamard gates> and <Controlled-Z gates>. Realize each <Hadamard gate> by a fresh <one-bit teleportation> link measured at angle zero, so every internal measurement is in the fixed $X$ basis. Insert a graph edge between the current wire vertices for each <Controlled-Z gate>. This gives a suitable <graph state> because the inputs are $|+\rangle$, and entangling gates can be moved to resource preparation: they commute with one another and with earlier measurements on vertices no longer used by the gate.

Track a <Pauli frame> $\bigotimes_iX_i^{p_i}Z_i^{q_i}$. An angle-zero <one-bit teleportation> with raw result $s$ updates the frame on that wire by
$$
(p,q)\longmapsto(s\oplus q,p),
$$
because $HX^pZ^q$ equals $X^qZ^pH$ up to <global phase>. A <Controlled-Z gate> updates $q_i\leftarrow q_i\oplus p_j$ and $q_j\leftarrow q_j\oplus p_i$, leaving the $p$ bits unchanged. These are classical binary updates; no measurement angle depends on them.

All the internal <quantum measurements> consequently have predetermined bases. Their projectors act on distinct resource <vertices> and commute, so \b[all internal measurements can be performed simultaneously: the logical measurement depth is at most one]. If the output is to be read in the <computational basis>, those fixed-basis measurements can occur in the same layer; a raw output $t_i$ is relabelled $t_i\oplus p_i$. If quantum outputs are retained, the same calculation gives the desired output in a known <Pauli frame>. This <nonadaptive Hadamard–CNOT measurement pattern> concerns measurement depth, not the depth of resource preparation or classical frame computation.