Nondegenerate phase-flip correction in the Steane code (source code)

= Nondegenerate phase-flip correction in the Steane code
{title2=$\langle\psi_a|Z(u)^\dagger Z(v)|\psi_b\rangle=\delta_{ab}\delta_{uv}$}

Write the <Steane code> basis as uniform <quantum superpositions> over a binary <linear code> $D$ and a disjoint coset $t+D$, where $D$ is the even-weight part of the length-seven <Hamming code>. For $Z(w)=\bigotimes_{j=1}^7Z_j^{w_j}$, diagonal <Pauli Z gates> cannot connect the two cosets. Within coset $t_a+D$, the overlap is
$$
\langle\psi_a|Z(w)|\psi_a\rangle=(-1)^{w\cdot t_a}|D|^{-1}\sum_{x\in D}(-1)^{w\cdot x}.
$$
If $w\notin D^\perp$, translation by a word $x_0\in D$ with $w\cdot x_0=1$ negates this sum, so it vanishes. Since the <dual code> $D^\perp$ is the length-seven <Hamming code> of minimum <Hamming distance> three, every nonzero $w$ of <Hamming weight> one or two has vanishing overlap. Taking $u,v$ from $\{0,e_1,\ldots,e_7\}$ proves the displayed identity. The eight two-dimensional error images are <orthogonal>, so their <projective measurement> determines the <error syndrome> without revealing the logical state; applying the identified <phase flip> again recovers every code state. This proves <nondegenerate quantum error-correcting code> behaviour for the identity and all single-site <phase flips>, including their coherent linear span.