Loop-soup simulations

Numerical experiments with random-walk loop soups: from planar loop configurations and split-merge dynamics to intersection clusters and small-loop sprinkling in three dimensions.

01Planar loop soups

Random walks on a square lattice generate a soup of loops through a Wilson-type construction with a wired boundary. These saved carpet pictures are labelled $N=1000$.

Loop-soup carpet on a square lattice
Square lattice
Square loop-soup carpet conformally mapped to a disk
Conformal disk image

The disk carpet is conformally mapped from the square image. The circular views below instead clip square-lattice paths to a disk; they are not separate disk-domain samples.

02Diameter cutoffs

Retain only loops whose spatial size is at least $\varepsilon$. In the 2D code, size is the maximum coordinate span divided by $N$. Decreasing the cutoff reveals progressively smaller loops.

Square loop soup with diameter cutoff 0.1
ε = 0.1
Square loop soup with diameter cutoff 0.01
ε = 0.01
Square loop soup with diameter cutoff 0.001
ε = 0.001
Four square loop-soup panels comparing diameter cutoffs
Square cutoff comparison
Four circular views comparing diameter cutoffs
Circular cutoff comparison

Circular view at $\varepsilon=0.01$

03Split-merge rewiring

The chain $M^\varepsilon$ splits a loop at a self-intersection or merges two loops at a shared lattice site. Both children of a split must satisfy the diameter cutoff. The animations follow the resulting loop configurations.

Rewiring on the square
Open video
Rewiring in a circular view
Open video
Square: comparison across cutoffs
Open video
Circular view: comparison across cutoffs
Open video

04Distance during rewiring

For a fixed observation point $z$, measure the distance to the nearest vertex of each loop, then take the largest of those distances:

$D(t)=\max_{L\in\mathcal{L}_t}\min_{p\in L}\left\|p/(N-1)-z\right\|_2.$

This tracks an observable of the individual loops as the rewiring chain evolves.

Square configuration and D(t)
Open video
Circular view and D(t)
Open video
Distance comparison across cutoffs
Open video

05Starting from one loop

Start the same rewiring chain from a single large loop and follow its splitting and merging descendants. The current source selects the largest loop among those retained by the initial diameter filter.

Single-loop initial condition
Open video

06Loop soups in three dimensions

The construction extends to a wired $N\times N\times N$ cube. Saved runs use $N=30,50,100,200$ and $c=0.5$. The $N=200$ sample contains 492,614 loops; its viewer displays a filtered subset of 2,905.

N = 200: three-dimensional loop soup

07Intersection clusters

Loops belong to the same cluster when a chain of shared lattice vertices connects them. These $N=200$ views use loops of at least eight steps. One view isolates two clusters; the other identifies a closest pair, separated by one lattice unit.

Two intersection clusters
Closest pair of clusters

08Sprinkling and gluing

Select two clusters formed by loops above a cutoff $L$, then add independent smaller loops in decreasing order of size. The experiment records whether these loops connect the selected clusters and the cutoff at which the first connection appears.

Recorded outcomes. The macro soup has $c=0.5$ in each run.
Run Dust c Cutoff window Outcome
N = 80 0.5 Diameter: 2 ≤ d < 8 No connection
N = 100 0.5 Diameter: 1 ≤ d < 8 No connection
N = 100 1.0 Diameter: 1 ≤ d < 8 One-loop bridge at d ≈ 7.07
N = 200 1.0 Diameter: 1 ≤ d < 8 One-loop bridge at d ≈ 7.07
N = 80, local cube 1.0 Time length: 2 ≤ ℓ < 8 One-loop bridge at ℓ = 2

Spatial sizes here are bounding-box diagonal lengths in lattice units. The local-cube run uses time length instead. These are individual sample outcomes, not estimates of connection probabilities.

N = 200: a bridge formed by independent dust
N = 80: sprinkling in a local cube

Additional archived runs

Earlier exports of the rewiring and distance experiments, including longer runs and alternative cutoff comparisons. Original filenames identify each recording; complete parameter records were not saved for these variants.

12 additional recordings and figures

Code and reproduction

Download the complete Python source bundle (24 scripts), or browse the source on GitHub.

The bundle includes the generators, analysis scripts, exporters, and local Streamlit and Flask apps. Export paths are portable; the stochastic logic and parameter defaults are preserved.

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt

python rwls3d/RWLS_3D.py --N 20 --c 0.5 --seed 11
python rwls3d/app.py --host 127.0.0.1 --port 5055

Full setup and run instructions · Python requirements

For 2D scripts, parameters are constants in each file; start with a small grid. Current source defaults need not match archived runs. In this implementation, $c$ enters a loop-label probability: values above one in some legacy 2D controls saturate. The 3D command-line sampler accepts $0\leq c\leq1$.