This repository contains implementations of agent-based modelling simulations using the quantum agents proposed in [1]. Quantum agents exploit quantum mechanical phenomena to achieve superior entropic memory efficiency over their classical counterparts.
The project implements three main quantum agent-based models:
-
Actively Perturbed Coin: A simple example described in [2] to illustrate the memory advantage provided by the quantum framework. The agent represents a single coin with states 0 and 1, receiving a binary input
$x\in\{0,1\}$ at each time step. In response, the agent flips the coin with probability$p$ if$x=1$ and with probability$q$ if$x=0$ , where$0 \lt p,q \lt 1$ . The agent then outputs the new state$y\in\{0,1\}$ of the coin. - Viral Infection Model: Simulates the spread and perpetuation of a viral infection (specifically, the Ebola virus) in a closed population with agents that can be in one of four states: sick, immune, healthy, or dead. The model is based on this model from NetLogo and includes mechanisms for infection spread, recovery, death, immunity loss, and reproduction.
- Traffic Intersection Model: Simulates the six-lane traffic intersection of figure 1 with quantum-encoded lane agents and a classical traffic light control system. The model handles vehicle queuing, traffic light timing, and vehicle flow through the intersection.
Figure 1: Intersection configuration.
- Quantum encoding of agent states using minimal memory requirements
- Hybrid quantum-classical approach for position-based simulations
- Efficient spatial querying using k-d trees for the viral infection model
- Probabilistic vehicle arrival and departure modeling for the traffic simulation
- Analysis tools for computing quantum and classical entropy metrics
- Visualization capabilities for simulation results
Parameter | Description | Default Value |
---|---|---|
Coin flip probability when |
||
Coin flip probability when |
Parameter | Description | Default Value |
---|---|---|
Daily probability of recovery | ||
Daily probability of death for infected | ||
Daily probability of losing immunity | ||
Probability of infection on contact | ||
Daily probability of random infection | ||
Daily probability of reproduction |
Parameter | Description | Default Value |
---|---|---|
Lane capacity | Maximum vehicles per lane | |
Light Durations | Available green light durations | |
Arrival Rates | Vehicle arrival rates per lane | |
Departure Std. | Standard deviation of departure distribution |
Figure 2 shows the theoretical and computed transition probabilities for the actively perturbed coin, confirming that the quantum encoding accurately replicates the classical
Figure 2: Computed and theoretical transition probabilities for the actvely perturbed coin.
Figure 3 shows the number of agents occupying each state throughout a 100-year simulation of the viral infection model. Outbreaks are clearly evident by the spikes in the population of sick agents and the corresponding drops in the number of healthy agents.
Figure 3: Agent counts through a 100-year simulation of the viral infection model.
Figure 4 shows the distributions of queue length and wait times between green lights for a 250,000-light cycle simulation of the intersection model. Each lane accumulates a similar queue length between green lights, however, the lower vehicle arrival rates of lanes 3 and 6 lead to higher wait times.
Figure 4: KDE distributions of maximal queue length and wait times between green lights for each lane configuration.
The entropy of the classical actively perturbed coin is
The traffic intersection model implementation demonstrates significant memory compression:
- 24.45% improvement for lanes 1 & 4
- 28.80% improvement for lanes 2 & 5
- 16.83% improvement for lanes 3 & 6
The viral infection model shows minimal quantum advantage (approximately 0.0015%) due to the near-orthogonality of its memory states.
[1] Thomas J. Elliott, Mile Gu, Andrew J. P. Garner, and Jayne Thompson. Quantum Adaptive Agents with Efficient Long-Term Memories. Phys. Rev. X, 12:011007, Jan 2022.
[2] Jayne Thompson, Andrew J. P. Garner, Vlatko Vedral, and Mile Gu. Using Quantum Theory to Simplify Input–Output Processes. npj Quantum Information, 3(1):6, Feb 2017.