![]() |
Q2NSViz 0.1.0
Q2NS trace visualizer
|
Tabbed panel with event log, statistics, entangled states, and charts. More...
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 | |
Tabbed panel with event log, statistics, entangled states, and charts.
| 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().
| 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.
| state_manager | Shared SimulationStateManager instance. |
| snap | Snapshot 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().
| 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.
| states | Multi-qubit entanglement groups from Snapshot.entangled_states. |
Definition at line 483 of file panels.py.
References q2nsviz.ui.panels.InfoPanel.entangle_table.
| 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.
| log_events | SimulationStateManager.log_events – every traceText event of the trace, in time order. |
| visible | Number 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.
| 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.
| nodes | Total number of network nodes in the simulation. |
| events | Total number of events in the loaded trace. |
| max_time | Simulation duration in microseconds. |
| qubits | Number of live qubits at the current time. |
| entangled | Number of entangled multi-qubit states. |
| measured | Number of measured qubits. |
| lost | Number of lost qubits (removed, neither measured nor discarded). |
| discarded | Number of qubits removed with reason == "discarded". |
Definition at line 446 of file panels.py.
References q2nsviz.ui.panels.InfoPanel.stats_table.
| q2nsviz.ui.panels.InfoPanel.chart_canvas |
Definition at line 344 of file panels.py.
Referenced by q2nsviz.ui.panels.InfoPanel.update_charts().
| q2nsviz.ui.panels.InfoPanel.entangle_table |
Definition at line 330 of file panels.py.
Referenced by q2nsviz.ui.panels.InfoPanel.update_entanglement().
| q2nsviz.ui.panels.InfoPanel.log_text |
Definition at line 310 of file panels.py.
Referenced by q2nsviz.ui.panels.InfoPanel.update_log().
| q2nsviz.ui.panels.InfoPanel.stats_table |
Definition at line 317 of file panels.py.
Referenced by q2nsviz.ui.panels.InfoPanel.update_stats().
| q2nsviz.ui.panels.InfoPanel.tabs |
Definition at line 306 of file panels.py.
Referenced by q2nsviz.ui.panels.InfoPanel.update_charts().