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.
class CompiledComponent
class CompiledProgram
class CompiledScalarGraphs
ScalarPrefactor (global phase, floatfactor, 2^power2,
optional approximate complex floatfactor). All arrays are static-shaped so
the whole struct can be traced under jax.jit.
class ConnectedComponent
class SamplingGraph
- Parsed from stim format
- Converted to a ZX graph
- Doubled (composed with adjoint)
- Reduced via zx.full_reduce
- Had its error basis transformed (Gaussian elimination: e → f)
classify_direct
f parameter and a constant phase of either 0
(no flip) or π (flip).
Parameters:
component(ConnectedComponent) — A connected component to classify.
tuple[int, bool] | None—(f_index, flip)if the fast path applies, otherwiseNone.
compile_program
- Split the graph into connected components
- For each component:
- Plug outputs according to mode (sequential or joint)
- Reduce each plugged graph
- Perform stabilizer rank decomposition
- Compile into CompiledScalarGraphs objects
- Assemble into CompiledProgram with output ordering
prepared(SamplingGraph) — The prepared graph from prepare_graph().mode(DecompositionMode) — Decomposition mode: - “sequential”: For sampling - creates [0, 1, 2, …, n] circuits - “joint”: For probability estimation - creates [0, n] circuitsstrategy(DecompositionStrategy) — Stabilizer rank decomposition strategy. Must be one of “cat5”, “bss”, “cutting”.
CompiledProgram— A CompiledProgram ready for sampling.
compile_scalar_graphs
g_list(list[BaseGraph]) — List of ZX-graphs to compile (must be scalar graphs with no vertices)params(list[str]) — List of parameter names used by this circuit. Each parameter will correspond to columns in the jax.Arrays of the compiled circuit.
CompiledScalarGraphs— CompiledScalarGraphs with all data in static-shaped JAX arrays
connected_components
g as its own ZX subgraph.
Each component is packaged inside a :class:ConnectedComponent that contains
the subgraph and a list of output indices matching the original output indices.
find_stab
graph(BaseGraph) — The ZX graph to decompose.strategy(DecompositionStrategy) — Decomposition strategy. Must be one of “cat5”, “bss”, “cutting”.
list[BaseGraph]— A list of scalar graphs whose sum equals the original graph.
get_params
- Vertex phases (g._phaseVars)
- Scalar phase variables (phasevars_pi, phasevars_pi_pair, phasevars_halfpi)
- Scalar phase pairs (phasepairs with paramsA, paramsB)
- Scalar phase nodes (phasenodevars)
g(BaseGraph) — A ZX graph with parametrized phases
set[str]— Set of all variable names (e.g., {‘f0’, ‘f2’, ‘m1’}) that appear in the graph