Skip to main content

Crate tk_pg_canonical_form

Crate tk_pg_canonical_form 

Source
Expand description

Pass to convert a Pauli graph into canonical form.

Structsยง

CanonicalFormPass
Transform a Pauli graph into canonical form: non-Clifford gates are rewritten as Pauli rotations, while Clifford gates are commuted towards the end of the circuit (or the start, if the forward flag is false), merging into a tableau whenever they reach the boundary or an obstruction such as a BlackBox. The resulting graph may therefore contain multiple tableaux, interleaved with any obstructions and the non-Clifford ops (rotations, measures, resets, conditional operations) that are conjugated through and left in place. cliff_eval controls whether rotations with a Clifford angle are folded into the tableau (true) or kept as explicit rotations (false). When enabled, it also extracts Clifford corrections from unconditional rotations, leaving their angles strictly between -0.5 and 0.5 half turns.