The delivery route is a small travelling-salesman problem turned into a QUBO (quadratic unconstrained binary optimisation) — the exact encoding used to submit routing problems to a real quantum annealer such as D-Wave. Each binary variable xi,t means "stop i is visited at position t":
H = A·Σᵢ(1 − Σₜ xᵢ,ₜ)² + A·Σₜ(1 − Σᵢ xᵢ,ₜ)²
+ B·Σₜ Σᵢ≠ⱼ dᵢⱼ · xᵢ,ₜ · xⱼ,ₜ₊₁
The first two terms penalise breaking the "each stop once, each slot once" constraints; the last term is the travelled distance. A real annealer doesn't search this landscape by flipping bits one at a time — it exploits quantum tunnelling through energy barriers via a transverse field Γ. This sim reproduces that with Path-Integral Monte Carlo (PIMC), the standard classical proxy for simulated quantum annealing: the spin lattice is duplicated into P imaginary-time "Trotter replicas" (the stacked grids on the left of the canvas), coupled to their neighbours in imaginary time by
J⊥ = ½T·ln coth(Γ / (P·T))
As Γ(s) is ramped down over the schedule, J⊥ grows and the replicas lock into agreement — replica 0 is then read out as the classical answer. A spin can flip against its own local field early on because a *different* replica already sits in the favourable state and drags it along — the lattice analogue of tunnelling rather than climbing over the barrier thermally. (Checked numerically: J⊥→0 as Γ→∞, decoupling replicas, and J⊥→∞ as Γ→0, locking them into the classical limit — the formula behaves exactly as the theory text says.)
- Anneal speed — Monte-Carlo sweeps executed per second.
- T₀ / Γ₀ — starting temperature and transverse field; both decay linearly to a small floor over the schedule.
- Constraint penalty A — how strongly a broken "visit-once" constraint is punished relative to distance.
- Route — decoded from replica 0 each sweep; turns green once it is a valid permutation (every stop visited exactly once). Drag or scroll on the route panel (right) to pan/zoom it.