stabrank
Stabilizer rank decomposition for non-Clifford ZX graphs.
find_stab
find_stab(
graph: BaseGraph, strategy: DecompositionStrategy
) -> list[BaseGraph]
Decompose a ZX-graph into a sum of stabilizer components.
This is the main entry point for stabilizer rank decomposition. It first removes U3 phases, then decomposes T gates via BSS decompositions, producing a sum of scalar graphs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph | BaseGraph | The ZX graph to decompose. | required |
strategy | DecompositionStrategy | Decomposition strategy. Must be one of "cat5", "bss", "cutting". | required |
Returns:
| Type | Description |
|---|---|
list[BaseGraph] | A list of scalar graphs whose sum equals the original graph. |
Source code in src/tsim/compile/stabrank.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
find_stab_magic
find_stab_magic(
graphs: Iterable[BaseGraph],
strategy: DecompositionStrategy,
) -> list[BaseGraph]
Recursively decompose ZX-graphs into stabilizer components via magic-state removal.
Source code in src/tsim/compile/stabrank.py
31 32 33 34 35 36 37 38 39 40 41 | |
find_stab_u3
find_stab_u3(
graphs: Iterable[BaseGraph],
strategy: DecompositionStrategy,
) -> list[BaseGraph]
Recursively decompose ZX-graphs by removing U3 phases.
Source code in src/tsim/compile/stabrank.py
44 45 46 47 48 49 50 51 52 | |