Q2NSViz 0.1.0
Q2NS trace visualizer
Loading...
Searching...
No Matches
q2nsviz.ui.panels.InfoPanel Class Reference

Tabbed panel with event log, statistics, entangled states, and charts. More...

Inheritance diagram for q2nsviz.ui.panels.InfoPanel:
[legend]
Collaboration diagram for q2nsviz.ui.panels.InfoPanel:
[legend]

Public Member Functions

 update_log (self, list[dict[str, Any]] log_events, int visible)
 Show the first visible entries of the trace's traceText log.
 
 update_stats (self, int nodes, int events, float max_time, int qubits=0, int entangled=0, int measured=0, int lost=0, int discarded=0)
 Refresh the statistics table with the given snapshot values.
 
 update_entanglement (self, dict[str, tuple[str,...]] states)
 Refresh the entanglement-states tab.
 
 update_charts (self, state_manager, snap)
 Forward chart data to ChartCanvas if the Charts tab is visible.
 
 apply_theme (self)
 Re-apply the active color palette to all styled elements.
 

Public Attributes

 tabs
 
 log_text
 
 stats_table
 
 entangle_table
 
 chart_canvas
 

Detailed Description

Tabbed panel with event log, statistics, entangled states, and charts.

Definition at line 203 of file panels.py.

Member Function Documentation

◆ apply_theme()

q2nsviz.ui.panels.InfoPanel.apply_theme (   self)

Re-apply the active color palette to all styled elements.

Call after toggle_dark() to update the info panel's appearance.

Definition at line 515 of file panels.py.

References q2nsviz.ui.panels.ControlPanel._apply_stylesheet(), and q2nsviz.ui.panels.InfoPanel._apply_stylesheet().

Referenced by q2nsviz.ui.window.QuantumVisualizerWindow.load_file().

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

◆ update_charts()

q2nsviz.ui.panels.InfoPanel.update_charts (   self,
  state_manager,
  snap 
)

Forward chart data to ChartCanvas if the Charts tab is visible.

Stores (state_manager, snap) so the charts can be redrawn lazily when the user switches to the Charts tab.

Parameters
state_managerShared SimulationStateManager instance.
snapSnapshot at the current simulation time, queried by the controller.

Definition at line 501 of file panels.py.

References q2nsviz.ui.panels.InfoPanel._last_chart_state, q2nsviz.ui.panels.InfoPanel.chart_canvas, q2nsviz.ui.panels.InfoPanel.tabs, and q2nsviz.ui.panels.InfoPanel.update_charts().

Referenced by q2nsviz.ui.panels.InfoPanel.update_charts().

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

◆ update_entanglement()

q2nsviz.ui.panels.InfoPanel.update_entanglement (   self,
dict[str, tuple[str, ...]]  states 
)

Refresh the entanglement-states tab.

Rows are sorted by descending component size, then alphabetically, so the largest entangled states appear at the top.

Parameters
statesMulti-qubit entanglement groups from Snapshot.entangled_states.

Definition at line 483 of file panels.py.

References q2nsviz.ui.panels.InfoPanel.entangle_table.

◆ update_log()

q2nsviz.ui.panels.InfoPanel.update_log (   self,
list[dict[str, Any]]  log_events,
int  visible 
)

Show the first visible entries of the trace's traceText log.

The log only grows as the clock advances, so stepping forward appends the new lines instead of re-rendering the whole document; the view is rebuilt only when the user scrubs backward or loads a new trace.

Parameters
log_eventsSimulationStateManager.log_events – every traceText event of the trace, in time order.
visibleNumber of leading entries to display, from SimulationStateManager.log_count_at().

Definition at line 405 of file panels.py.

References q2nsviz.ui.panels.InfoPanel._format_log_line(), q2nsviz.ui.panels.InfoPanel._log_lines, q2nsviz.ui.panels.InfoPanel._log_source, q2nsviz.ui.panels.InfoPanel._log_visible, and q2nsviz.ui.panels.InfoPanel.log_text.

Here is the call graph for this function:

◆ update_stats()

q2nsviz.ui.panels.InfoPanel.update_stats (   self,
int  nodes,
int  events,
float  max_time,
int   qubits = 0,
int   entangled = 0,
int   measured = 0,
int   lost = 0,
int   discarded = 0 
)

Refresh the statistics table with the given snapshot values.

Parameters
nodesTotal number of network nodes in the simulation.
eventsTotal number of events in the loaded trace.
max_timeSimulation duration in microseconds.
qubitsNumber of live qubits at the current time.
entangledNumber of entangled multi-qubit states.
measuredNumber of measured qubits.
lostNumber of lost qubits (removed, neither measured nor discarded).
discardedNumber of qubits removed with reason == "discarded".

Definition at line 446 of file panels.py.

References q2nsviz.ui.panels.InfoPanel.stats_table.

Member Data Documentation

◆ chart_canvas

q2nsviz.ui.panels.InfoPanel.chart_canvas

Definition at line 344 of file panels.py.

Referenced by q2nsviz.ui.panels.InfoPanel.update_charts().

◆ entangle_table

q2nsviz.ui.panels.InfoPanel.entangle_table

Definition at line 330 of file panels.py.

Referenced by q2nsviz.ui.panels.InfoPanel.update_entanglement().

◆ log_text

q2nsviz.ui.panels.InfoPanel.log_text

Definition at line 310 of file panels.py.

Referenced by q2nsviz.ui.panels.InfoPanel.update_log().

◆ stats_table

q2nsviz.ui.panels.InfoPanel.stats_table

Definition at line 317 of file panels.py.

Referenced by q2nsviz.ui.panels.InfoPanel.update_stats().

◆ tabs

q2nsviz.ui.panels.InfoPanel.tabs

Definition at line 306 of file panels.py.

Referenced by q2nsviz.ui.panels.InfoPanel.update_charts().


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