Simulate – Parallelized quantum network simulation

class squanch.simulate.Simulation(*args)[source]

Bases: object

Simulation class for easily creating and running agent-based simulations. Includes progress monitors for terminal and Jupyter notebooks.

__init__(*args)[source]

Initialize the simulation

Parameters:args – unpacked list of agents, e.g. Simulation(alice, bob, charlie). All agents must share the same output dictionary using Agent.shared_output()
__weakref__

list of weak references to the object (if defined)

progress_monitor(poison_pill)[source]

Display a tqdm-style progress bar in a Jupyter notebook

Parameters:poison_pill (threading.Event) – a flag to kill the progressMonitor thread
run(monitor_progress=True)[source]

Run the simulation

Parameters:monitor_progress – whether to display a progress bar for each agent