Backward Pauli updates for Hadamard and phase gates
= Backward Pauli updates for Hadamard and phase gates
{title2=$H:(a,b,s)\mapsto(b,a,s+2ab),\quad S:(a,b,s)\mapsto(a,b\oplus a,s-a)$}
For the <binary phase representation of a Pauli string>, these local rules implement $P\mapsto U^\dagger P U$ for the <Hadamard gate> and the phase gate $S=\operatorname{diag}(1,i)$. In particular $S^\dagger XS=-iXZ$, so the phase update differs in sign from forward conjugation. Use the old input bits, and reduce $s$ modulo four.