Module clifford

Module clifford 

Source
Expand description

Clifford gates (table-driven, branchless). See §6.

A Clifford G conjugates each single-qubit Pauli P to ± P' for some Pauli P'. We precompute the full lookup table at construction so apply is a single indexed read on the support qubit(s) — no runtime Pauli multiplication.

Encoding: a single-qubit Pauli is indexed by (x_bit | (z_bit << 1))I = 0, X = 1, Z = 2, Y = 3. The output Pauli uses the same packing.

Structs§

Clifford1Q
Single-qubit Clifford gate stored as a 4-entry conjugation table.
Clifford2Q
Two-qubit Clifford gate stored as a 16-entry conjugation table.