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 Diagram
class GateLabel
parse_stim_circuit
stim_circuit(stim.Circuit) — The stim circuit to convert.track_classical_wires(bool) — Whether to track classical wires.
GraphRepresentation— A GraphRepresentation containing the ZX graph and all auxiliary data.
placeholders_to_t
svg_string(str) — The SVG string from stim’s diagram() method containing I_ERROR placeholder gates whose p-value are used as identifiers.placeholder_id_to_labels(dict[float, GateLabel]) — Mapping from identifier (float), i.e. the p values of I_ERROR gates, to GateLabel.
str— Modified SVG string with I_ERROR gates replaced by the actual gate names.
render_pyzx_d3
stim_circ(stim.Circuit) — The stim circuit to render.kwargs(dict[str, Any]) — Additional keyword arguments passed to the underlying diagram renderer.
GraphS— A pyzx ZX diagram.
render_svg
scale_horizontally
scale.
Parameters:
g(BaseGraph) — A ZX graphscale(float) — The factor to scale the graph by
tagged_gates_to_placeholder
circuit(stim.Circuit) — The stim circuit to replace tagged gates with I_ERROR placeholder gates.
stim.Circuit— A tuple containing the modified circuit and a dictionary mapping the p-valuesdict[float, GateLabel]— of the I_ERROR placeholder gates to the actual gate names.
wrap_svg
svg(str) — Raw SVG markup.width(float | None) — Width of the container in pixels.height(float | None) — Height of the container in pixels (unused, kept for API symmetry with :func:wrap_svg_zoomable).
wrap_svg_zoomable
None
the container fills the available width. Users can pan by scrolling
and zoom with pinch-zoom (trackpad) or Ctrl/Cmd + wheel. Zoom is
anchored at the cursor position.
Parameters:
svg(str) — Raw SVG markup.width(float | None) — Pixel width of the container, orNonefor full width.height(float) — Pixel height of the container.