uniqc.visualization.circuit_render.svg module

SVG primitives and the main graphical renderer.

The drawing pipeline is two-stage: build_primitives() emits style-agnostic geometric primitives in logical coordinates (x = time axis, y = wire axis); serialize_svg() maps them to SVG text, handling the optional vertical orientation (transpose) and scale. Keeping these separate is what lets the matplotlib backend (mpl/png) reuse the exact same drawing.

class uniqc.visualization.circuit_render.svg.RenderMeta[source]

Bases: dict

Render statistics (column count, band count, style).

uniqc.visualization.circuit_render.svg.build_primitives(draw, opts)[source]

Lay out draw and emit drawing primitives; returns (prims, W, H, meta, style).

uniqc.visualization.circuit_render.svg.render_svg(draw, opts)[source]

Render a DrawCircuit to SVG text; returns (svg, meta).

uniqc.visualization.circuit_render.svg.serialize_svg(prims, width, height, opts, *, defs='', css='')[source]

Serialize primitives to SVG text; transposes axes for vertical mode.