For the binary phase representation of a Pauli string, these local rules implement for the Hadamard gate and the phase gate . In particular , so the phase update differs in sign from forward conjugation. Use the old input bits, and reduce modulo four.
Store a tensor-product element of the Pauli group as
The phases of the original single-qubit factors can all be accumulated into . This binary phase representation of a Pauli string uses bits. It retains phases, which must not be dropped when computing probabilities later.
For the conjugation convention in the question, direct multiplication of the two-by-two matrices gives
and
These backward Pauli updates for Hadamard and phase gates use , not . On the affected line , the updates are
All phases are reduced modulo four and the updates use the old bits.
For a Controlled-Z gate on lines , its diagonal action gives
For the controlled-Z update in the binary phase representation, conjugation respects products, so these determine the rule for every Pauli operator on those lines. In the chosen ordered convention it is
The phase arises when a newly introduced is moved past . For instance becomes , so this sign matters.
The untouched factors are unchanged. Each Clifford operation therefore needs only a fixed number of local bit updates; reconstructing the requested full list takes time. Put the final phase into the first factor, which is permitted because the single-qubit Pauli group includes all multiples by . The classical cost is polynomial, despite the exponentially large matrix of the operation on the full state space.