clifford
Mapping tables for converting parametric rotations with half-pi angles to Clifford gates.
expand_clifford_rotations
expand_clifford_rotations(source: Circuit) -> stim.Circuit
Return source with half-π parametric rotations expanded to Clifford gates.
REPEAT blocks are preserved structurally and expanded recursively.
Source code in src/tsim/utils/clifford.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
is_clifford
is_clifford(source: Circuit) -> bool
Return True iff every instruction in source is Clifford.
Recurses into REPEAT block bodies.
Source code in src/tsim/utils/clifford.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
parametric_to_clifford_gates
parametric_to_clifford_gates(
gate_name: str, params: dict[str, Fraction]
) -> list[str] | None
Convert a parametric gate with half-π angles to stim Clifford gate names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gate_name | str | One of | required |
params | dict[str, Fraction] | Dict as returned by :func: | required |
Returns:
| Type | Description |
|---|---|
list[str] | None | Stim gate names in circuit order, |
list[str] | None | or |
Source code in src/tsim/utils/clifford.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |