Fig. 2: Abstract example of simulating a quantum protocol with discrete events.
From: NetSquid, a NETwork Simulator for QUantum Information using Discrete events

When setting up the simulation, protocol actions are defined to occur when a specific event occurs, as in the setup of a real system. Instead of performing a continuous time evolution, the simulation advances to the next event, and then automatically executes the actions that should occur when the event takes place. Any action may again define future events to be triggered after a certain (stochastic) amount of time has elapsed. For concreteness a simplified quantum teleportation example is shown where a qubit, shown as an orange circle with arrow, is teleported between the quantum memories of Alice and Bob. Here, entanglement is produced using an abstract source sending two qubits, shown as blue circles with arrows, to Alice and Bob. Once the qubit has traversed the fibre and reaches Alice’s lab, an event is triggered that invokes the simulation of Alice’s Bell state measurement (BSM) apparatus. The simulation engine steps from event to events defined by the next action, which generally occur at irregular intervals. This approach allows time-dependent physical non-idealities, such as quantum decoherence, to be accurately tracked.