Visualization guidelines
This project uses a layered visualization design to keep plotting code reusable and maintainable across packages.
Layering policy
- Put reusable, pure plotting utilities in
qxvisualizer. - Keep domain-specific plotting entry points (for example,
Pulse.plot()andMeasurementResult.plot()) in each domain package. - Domain packages should compose
qxvisualizerhelpers rather than re-implement shared style or figure setup.
API style
- Prefer pure builders:
make_*_figure(...) -> go.Figure- Keep display wrappers thin:
plot_*(...) -> None, implemented asmake_*_figure(...)+ show.- For shared utilities, accept NumPy arrays and simple Python types instead of domain objects.
Scope of qxvisualizer
qxvisualizeris Plotly-focused and should stay backend-agnostic.- Common examples:
- Generic scatter/line plots
- Bloch-vector timelines
- Density-matrix visualization
- External visualization backends (for example,
qctrl-visualizer) should be used directly by the package that needs them, not centralized inqxvisualizer.
Migration direction
- Move common visualization behavior from domain packages to
qxvisualizerincrementally. - Preserve existing public plot methods in domain packages while swapping internals to
qxvisualizerhelpers. - Avoid breaking changes in user-facing plotting APIs unless explicitly planned.