Diagnostics Reports¶
The qsvt.reports module provides small helpers for reusing diagnostics
reports outside an interactive Python session.
Design and template diagnostics functions return dictionaries that include NumPy arrays. Those arrays are convenient for plotting and further numerical work, but they are not directly JSON serializable. The reports module converts those payloads into plain Python containers, writes JSON files, loads saved reports, and plots the sampled approximation curves.
Python workflow¶
from qsvt.design import design_sign_diagnostics
from qsvt.reports import (
plot_approximation_report,
save_report,
save_report_plot,
)
report = design_sign_diagnostics(gamma=0.2, degree=13)
save_report(report, "sign-report.json")
save_report_plot(report, "sign-report.png")
fig, axes = plot_approximation_report(report)
CLI workflow¶
qsvt design-report --kind sign --gamma 0.2 --degree 13 \
--output sign-report.json \
--plot sign-report.png
qsvt template-report --kind inverse --degree 7 --mu 0.3 \
--output inverse-report.json
The report commands print full JSON to standard output by default. When
--output or --plot is supplied, the CLI writes the full artifact to disk
and switches stdout to a compact write summary; add --print-report if you
also want the full JSON payload on stdout.
Report fields¶
field |
meaning |
|---|---|
|
CLI wrapper label for the selected report command |
|
Chosen report family, such as |
|
Underlying polynomial builder function |
|
Interval used to sample target-vs-polynomial error |
|
Interval used to sample QSVT-style boundedness |
|
Maximum sampled absolute fit error |
|
Root-mean-square sampled fit error |
|
Maximum sampled absolute polynomial value |
|
|
|
Whether the sampled polynomial values stayed within |
|
Generated polynomial coefficients |
|
Fit-domain samples |
|
Bounded-domain samples |
Public helpers¶
report_to_jsonable(report)save_report(report, path)load_report(path)plot_approximation_report(report, ax=None)save_report_plot(report, path)