Stabilizer states are determined by their generators. If is abelian, and has independent generators, the dimension theorem with says that fixes a one-dimensional subspace, so it determines a unique state up to phase. Moreover the normalizer equals : in the binary representation, the span of the generators is isotropic of dimension , and has dimension and contains , so . Hence a Pauli operator that commutes with all of is for some , and since only one of lies in .
Initial state. is stabilized by .
Gates. If then , so is the stabilizer state with generators . These are again Pauli operators, independent and commuting because conjugation is an automorphism. For a gate on at most two qubits, each differs from only on those qubits and in its sign, and the new entries and sign follow from a fixed table (for , , CNOT, the table in the Clifford group record). Updating all generators costs .
Measurement of , random case. Suppose some generator, say , anticommutes with . Multiplying every other generator that anticommutes with by gives a generating set of the same group in which only anticommutes with ; this costs per generator, in all. Then
so and each outcome , , has probability . The post-measurement state is proportional to . It is fixed by and, because commutes with , by every . These operators commute, are independent (the are independent, and the vector of is not in their span because anticommutes with whereas every element of commutes with ), and their group does not contain because they fix a nonzero vector. So the simulator draws a fair random bit and replaces by .
Measurement of , deterministic case. Suppose commutes with every generator. By the first paragraph for exactly one , so and the outcome is with certainty; the state does not change. To find , solve over for the binary vector of by Gaussian elimination, operations, then multiply the generators with in order, tracking the overall phase; each product of two Pauli operators and its phase costs , so this step costs . The resulting product is .
Classical control and sampling. A conditional gate is simulated by evaluating the condition on the outcomes already sampled and applying the gate update if required. Processing the operations in order, each measurement outcome is drawn from its exact conditional distribution given all previous outcomes, so the joint distribution of the sampled outcomes is the quantum one. The total cost is per gate and per measurement.
Measuring a general Pauli operator reduces to the same two cases with in place of : it is random exactly when anticommutes with a generator. The argument is that of Gottesman, presented as in section 10.5 of Nielsen and Chuang; Aaronson and Gottesman replace the Gaussian elimination by maintaining destabilizer generators, which gives per measurement.