Q2NSViz 0.1.0
Q2NS trace visualizer
Loading...
Searching...
No Matches
q2nsviz.logic.Snapshot Class Reference

Immutable view of the reconstructed network state at one instant. More...

Static Public Attributes

int t_ns
 
dict nodes [str, Node]
 
list channels [Channel]
 
dict qubits [str, Qubit]
 
dict cbits [str, ClassicalBit]
 
dict ent_graph [str, frozenset[str]]
 
dict entangled_states [str, tuple[str, ...]]
 
frozenset measured_qubits [str]
 
frozenset removed_qubits [str]
 
frozenset discarded_qubits [str]
 
frozenset lost_qubits [str]
 
frozenset live_qubit_labels [str]
 
frozenset inflight_qubits [str]
 
frozenset inflight_cbits [str]
 
frozenset gate_qubits [str]
 
frozenset measuring_qubits [str]
 
frozenset graph_measuring_qubits [str]
 
frozenset removed_cbits [str]
 

Detailed Description

Immutable view of the reconstructed network state at one instant.

Returned by SimulationStateManager.snapshot_at(). This is the unit of state that the QuantumVisualizerWindow controller dispatches to the views, and the object a script inspects after reconstructing a chosen simulation time. Dynamic containers are copies or immutable views; advancing the manager afterwards never mutates an already-returned Snapshot.

Parameters
t_nsSimulation timestamp this snapshot reflects.
nodesNode topology (label -> Node), built once at load time.
channelsChannel list, built once at load time.
qubitsEvery qubit created up to t_ns (label -> Qubit, with its current host node).
cbitsEvery classical bit created up to t_ns (label -> ClassicalBit).
ent_graphEntanglement-graph adjacency (label -> neighbor labels); vertices with no edges are omitted.
entangled_statesEntangled components of two or more qubits, keyed by the lexicographically smallest member (root -> sorted member tuple).
measured_qubitsQubits measured at or before t_ns.
removed_qubitsQubits explicitly removed from the simulation.
discarded_qubitsQubits removed with reason == "discarded".
lost_qubitsremoved_qubits - measured_qubits - discarded_qubits.
live_qubit_labelsQubits neither measured nor removed.
inflight_qubitsQubits in transit inside a sendQubit window.
inflight_cbitsClassical bits in transit inside a sendCbit window.
gate_qubitsQubits inside an entangle processing window ([t_ns - duration_ns, t_ns); the edges commit at t_ns).
measuring_qubitsQubits inside a measure duration_ns window.
graph_measuring_qubitsQubits inside a graphMeasure duration_ns window.
removed_cbitsClassical bits removed by removeCbit.

Definition at line 196 of file logic.py.

Member Data Documentation

◆ cbits

dict q2nsviz.logic.Snapshot.cbits [str, ClassicalBit]
static

Definition at line 234 of file logic.py.

Referenced by q2nsviz.logic.SimulationStateManager.snapshot_at().

◆ channels

list q2nsviz.logic.Snapshot.channels [Channel]
static

Definition at line 232 of file logic.py.

Referenced by q2nsviz.logic.SimulationStateManager.reset().

◆ discarded_qubits

frozenset q2nsviz.logic.Snapshot.discarded_qubits [str]
static

Definition at line 239 of file logic.py.

Referenced by q2nsviz.logic.SimulationStateManager.snapshot_at().

◆ ent_graph

dict q2nsviz.logic.Snapshot.ent_graph [str, frozenset[str]]
static

◆ entangled_states

dict q2nsviz.logic.Snapshot.entangled_states [str, tuple[str, ...]]
static

Definition at line 236 of file logic.py.

◆ gate_qubits

frozenset q2nsviz.logic.Snapshot.gate_qubits [str]
static

Definition at line 244 of file logic.py.

Referenced by q2nsviz.ui.canvas.NetworkCanvas.reset().

◆ graph_measuring_qubits

frozenset q2nsviz.logic.Snapshot.graph_measuring_qubits [str]
static

Definition at line 246 of file logic.py.

Referenced by q2nsviz.ui.canvas.NetworkCanvas.reset().

◆ inflight_cbits

frozenset q2nsviz.logic.Snapshot.inflight_cbits [str]
static

Definition at line 243 of file logic.py.

Referenced by q2nsviz.ui.canvas.NetworkCanvas.reset().

◆ inflight_qubits

frozenset q2nsviz.logic.Snapshot.inflight_qubits [str]
static

Definition at line 242 of file logic.py.

Referenced by q2nsviz.ui.canvas.NetworkCanvas.reset().

◆ live_qubit_labels

frozenset q2nsviz.logic.Snapshot.live_qubit_labels [str]
static

Definition at line 241 of file logic.py.

◆ lost_qubits

frozenset q2nsviz.logic.Snapshot.lost_qubits [str]
static

◆ measured_qubits

◆ measuring_qubits

frozenset q2nsviz.logic.Snapshot.measuring_qubits [str]
static

Definition at line 245 of file logic.py.

Referenced by q2nsviz.ui.canvas.NetworkCanvas.reset().

◆ nodes

dict q2nsviz.logic.Snapshot.nodes [str, Node]
static

Definition at line 231 of file logic.py.

Referenced by q2nsviz.logic.SimulationStateManager.reset().

◆ qubits

dict q2nsviz.logic.Snapshot.qubits [str, Qubit]
static

◆ removed_cbits

frozenset q2nsviz.logic.Snapshot.removed_cbits [str]
static

◆ removed_qubits

◆ t_ns

int q2nsviz.logic.Snapshot.t_ns
static

Definition at line 230 of file logic.py.


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