The Replot Server (bragi_quantum.gui)#
bragi_quantum.gui is an on-demand re-analysis and visualization server. It lets you regenerate and explore calibration plots from previously saved sessions without re-running the experiments — invaluable for post-hoc analysis, presentations and debugging.
How it works#
bragi_quantum.gui operates on a replay and re-render principle:
Session persistence. Every session (produced by bragi_quantum.api) saves a
session_timeline.json— metadata for each step, including the analysis class name and its parameters — alongside the raw HDF5 datasets.On-demand re-analysis. When you request a plot, bragi_quantum.gui loads the timeline, finds the step, re-imports and re-instantiates the recorded analysis class with the original data, re-runs the analysis, and returns the plot as a PNG.
No re-execution. Quantum experiments are never re-run — it is pure re-analysis of saved data, so it is fast and costs no QPU time.
Note
bragi_quantum.gui instantiates the analysis class by the name recorded at calibration time. If the class was renamed, the replot cannot find it. If the analysis logic changed but the name stayed the same, the new analysis runs: it works if the saved data format is still compatible, and fails otherwise.
Note
For safety, timeline-driven imports are restricted by an allowlist
(bragi_quantum.gui.registry) to the bragi_quantum.experiments., bragi_quantum.api., bragi_quantum.datalayer. and
bragi_quantum.gui. package roots.
Running the server#
Point qc2-show at your directory of timestamped run folders (e.g.
calibration_outputs/):
qc2-show calibration_outputs/ [--host 127.0.0.1] [--port 9999] [--log-level info]
This starts a local FastAPI server and opens a browser showing the archive
browser: a sidebar of every run (newest first, updating live as new runs
appear), each run’s sessions, on-demand plots, and a whole-pipeline view. The CLI
picks a free port if the requested one is taken, and writes
replot_endpoint.txt into each session folder so its HTML report can find the
server automatically.
Tip
Running qc2-show in a VS Code terminal auto-forwards the browser session
to your local machine.
Key features#
Fast iteration — regenerate plots in seconds, no calibration run required.
Multi-session — serve and compare many runs at once.
Whole-pipeline view — cross-session QoI trends and a clickable node DAG.
HTML & PDF reports — the same reports bragi_quantum.api writes, served interactively.
REST API — programmatic access to plots and session data.
REST API#
The server exposes routes at three levels. Archive-level routes list and search
runs; per-session routes (prefix /session/{key}) serve one session; pipeline
routes (prefix /pipeline/{run_ts}) serve a whole run.
Method |
Endpoint |
Purpose |
|---|---|---|
|
|
Archive sidebar page (all runs) |
|
|
JSON list of runs (drives the live sidebar) |
|
|
Search runs by qubit |
|
|
Aggregate stats / server version |
|
|
Liveness + session paths |
|
|
List the calibration steps in a session |
|
|
Available plot names for a (step, element) |
|
|
Render a specific plot (returns PNG); body =
|
|
|
Full HTML device report for a session |
|
|
Whole-pipeline HTML page for a run |
|
|
QoI trend plot across sessions (PNG) |
Programmatic replay#
The same replay engine is available as a small Python API — handy for scripting or notebooks.
See bragi_quantum.gui API for the full reference.