Documentation Index
Fetch the complete documentation index at: https://tsim.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
expand_clifford_rotations
source with half-π parametric rotations expanded to Clifford gates.
REPEAT blocks are preserved structurally and expanded recursively.
is_clifford
source is Clifford.
Recurses into REPEAT block bodies.
parametric_to_clifford_gates
gate_name(str) — One of"R_X","R_Y","R_Z","U3".params(dict[str, Fraction]) — Dict as returned by :func:~tsim.core.parse.parse_parametric_tag.
list[str] | None— Stim gate names in circuit order,list[str] | None— orNonewhen the angles are not half-π multiples.
parse_parametric_tag
I[R_Z(theta=0.3*pi)]).
Supports gates: R_Z, R_X, R_Y, U3.
Parameters:
instruction(stim.CircuitInstruction) — The stim instruction whose tag will be parsed.
tuple[str, dict[str, Fraction]] | None— Tuple of (gate_name, params_dict) when the instruction’s tag is atuple[str, dict[str, Fraction]] | None— well-formed parametric tag, orNonewhen the tag is nottuple[str, dict[str, Fraction]] | None— parametric-looking (noname(...)shape, or empty).
ValueError— When the tag looks parametric (matchesname(...)) but is malformed: a parameter value does not parse, the gate name is unknown, or the parameter keys do not match the expected set for the gate.