Using uv (recommended)
We recommend usinguv for dependency management.
Using pip
Apple GPUs
On an Apple-silicon Mac, the default strategy ("active_statevector") samples on the GPU
through Metal; the plain install includes PyObjC’s Metal bindings for it. Where it samples is
the device argument of compile_sampler and compile_detector_sampler:
samples on metal or samples on cpu), and so does
sampler.stats.device.
The GPU computes outcome probabilities in float32, so a sample follows the CPU’s distribution
to within float32 rounding. Float32 cannot tell a measurement outcome of probability below
about 1e-11 from rounding error, so the GPU never draws one; a circuit with a rotation small
enough to make such an outcome (an angle within about 6e-5 π of a multiple of π/2) samples on
the CPU (or raises, with device="metal").
A seed’s samples on the GPU differ from the CPU’s and depend on batch_size, so with
device="auto" a seed reproduces its samples only on the same kind of machine. Use
device="cpu" to reproduce samples across machines.
Agent skill
Tsim ships an agent skill that teaches coding agents (Claude Code, Codex, Cursor and others) how to judge whether a circuit is feasible, sample and postselect it, run logical error rate studies, and port published Stim circuits. Install it with Ion:npx skills:
/.well-known/skills/.
Docs MCP server
This site runs an MCP server athttps://bloqade.quera.com/tsim/mcp that lets agents search
and read these docs. Add it to Claude Code with:
~/.cursor/mcp.json: