uniqc.visualization.circuit_render.mpl module

matplotlib backend: draws the shared primitives onto a Figure.

Covers the mpl mode directly and serves as the PNG fallback when cairosvg is not installed. matplotlib is imported lazily so the module stays import-free until the mode is actually requested.

uniqc.visualization.circuit_render.mpl.render_mpl(draw, opts)[source]

Render to a matplotlib Figure (requires the [visualization] extra).

uniqc.visualization.circuit_render.mpl.render_png_bytes(draw, opts)[source]

Render to PNG bytes.

Prefers cairosvg (exact SVG rasterization); falls back to the matplotlib primitive plotter when cairosvg is not installed.