Q2NSViz 0.1.0
Q2NS trace visualizer
Loading...
Searching...
No Matches
q2nsviz.ui.charts.ChartCanvas Class Reference

Matplotlib canvas for time-series and summary charts. More...

Inheritance diagram for q2nsviz.ui.charts.ChartCanvas:
[legend]
Collaboration diagram for q2nsviz.ui.charts.ChartCanvas:
[legend]

Public Member Functions

 clear (self)
 Clear the figure and redraw an empty canvas.
 
 update_charts (self, state_manager, snap)
 Render all four chart panels for the given simulation time.
 

Public Attributes

 fig
 

Detailed Description

Matplotlib canvas for time-series and summary charts.

Definition at line 108 of file charts.py.

Member Function Documentation

◆ clear()

q2nsviz.ui.charts.ChartCanvas.clear (   self)

Clear the figure and redraw an empty canvas.

Definition at line 128 of file charts.py.

References q2nsviz.ui.charts.ChartCanvas._cached_entangled, q2nsviz.ui.charts.ChartCanvas._cached_live, q2nsviz.ui.charts.ChartCanvas._cached_measurements, q2nsviz.ui.charts.ChartCanvas._cached_operation_windows, q2nsviz.ui.charts.ChartCanvas._cached_time_array, q2nsviz.ui.charts.ChartCanvas.clear(), and q2nsviz.ui.charts.ChartCanvas.fig.

Referenced by q2nsviz.ui.charts.ChartCanvas.clear(), and q2nsviz.ui.charts.ChartCanvas.update_charts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_charts()

q2nsviz.ui.charts.ChartCanvas.update_charts (   self,
  state_manager,
  snap 
)

Render all four chart panels for the given simulation time.

Chart layout (top to bottom)

  1. Live qubit count over time (step function).
  2. Entangled states over time (step function).
  3. Total measurements over time (step function).
  4. Per-node qubit distribution at snap.t_ns (bar chart).

Cached series are rebuilt only when a new trace is loaded, detected by an identity change on state_manager.time_array. The shared state manager is never queried here: the controller performs the per-frame snapshot_at() call and passes the resulting Snapshot, which drives both the bar chart and the current-time marker.

Parameters
state_managerShared SimulationStateManager instance, read only for its event list and timeline.
snapSnapshot at the current simulation time.

Definition at line 204 of file charts.py.

References q2nsviz.ui.charts.ChartCanvas._cached_entangled, q2nsviz.ui.charts.ChartCanvas._cached_live, q2nsviz.ui.charts.ChartCanvas._cached_measurements, q2nsviz.ui.charts.ChartCanvas._cached_operation_windows, q2nsviz.ui.charts.ChartCanvas._cached_time_array, q2nsviz.ui.charts.ChartCanvas._rebuild_series(), q2nsviz.ui.charts.ChartCanvas.clear(), and q2nsviz.ui.charts.ChartCanvas.fig.

Here is the call graph for this function:

Member Data Documentation

◆ fig

q2nsviz.ui.charts.ChartCanvas.fig

The documentation for this class was generated from the following file: