(D·L + κ²I) τ = s
One file, ~100 lines, standard library only, exact integer arithmetic. It builds a graph, feeds it two energy sources, solves the coherence field equation, and prints the field to your terminal:
python field.py .:-=+*#%@%*+=-:.
the field, as ASCII
The last line it prints is a checksum of the entire solved field. It is the same on every machine, every operating system, every run - because there is not a single float in the file. Determinism is not a goal here; it is a property.
This is the same equation, and the same integer solve, behind everything Coherence Energy Labs builds: it schedules instructions in our compiler, forecasts natural hazards, plans spacecraft trajectories, drives attention in our AI systems, and literally draws our organization's banner. Most of those systems are large. The idea is not. This file is the idea, small enough to read with your coffee.
Open field.py and:
- Move the sources. The glow follows.
- Raise
KAPPA2to 400. Influence dies fast; the world goes local; two sources become two islands. - Drop it to 5. Everything feels everything; two sources become one system.
- Replace the grid with your own graph - a road network, a dependency graph, a social graph. Nothing in the solve changes. That is the point.
MIT. Take it, teach with it, build on it.