Logical Hadamard convention for a phase-flip repetition code (source code)

= Logical Hadamard convention for a phase-flip repetition code

The codewords $|+++\rangle,|---\rangle$ have residual logical <Pauli X gate> after an uncorrectable two- or three-site phase error. Precede their encoding by a logical <Hadamard gate> and follow decoding by its inverse. Since $HXH=Z$, the same error now acts as a logical <Pauli Z gate>. Explicitly the encoded coefficients are $(\alpha+\beta)/\sqrt2$ and $(\alpha-\beta)/\sqrt2$ for an input $\alpha|0\rangle+\beta|1\rangle$. This convention matters when translating physical phase errors into a claimed decoded phase-error channel.