This simulation visualizes a basic concept in physics: a U(1) field on a 2D grid. Think of it like a field of tiny compass needles that can point in any direction on a circle. The system naturally wants to minimize its energy, which causes neighboring arrows to align, leading to the fascinating patterns and ordering you observe.
The arrows represent the fundamental U(1) field itself, not particles. At every point in space, the field has a value (its phase or angle). Particles, like electrons or positrons, would emerge as stable, swirling patterns *in* this field, known as vortices (🌀), which you might see forming as defects when the system orders itself.
The simulation respects the circular nature (U(1) symmetry) of the arrows' phase. To find the direction an arrow "wants" to point, we don't just average the angles of its neighbors numerically. Instead, we treat each neighbor's direction as a vector, add all those vectors together, and find the angle of the resulting sum.
// Convert angles to vectors
let avgX = 0;
let avgY = 0;
for (const angle of neighbors) {
avgX += Math.cos(angle);
avgY += Math.sin(angle);
}
// Find angle of the sum vector
const targetAngle = Math.atan2(avgY, avgX);
This correctly handles the "wrap-around" nature of the circle – it's like spinning a wheel multiple times and seeing where the final mark lands (🛞). This vector averaging is the core logic driving the alignment.
The drive towards order comes from minimizing the system's internal energy, not from temperature. A random, chaotic state is high-energy because many neighboring arrows are misaligned. The alignment rule naturally reduces this "tension." Temperature (the random kicks) actually disrupts this process but also helps "melt" defects (like vortices) that get frozen in during rapid ordering.
Not perfectly. The random "kicks" we add violate a deeper principle called local gauge symmetry. In real physics (like electromagnetism), changes must be accounted for locally – phase can't just appear, it has to "flow" as part of a transaction. A more accurate simulation would introduce temperature via the spontaneous creation and annihilation of balanced vortex/anti-vortex pairs, conserving phase locally.
It's missing the strict local "accounting" mechanism enforced by gauge symmetry. This mechanism requires a "gauge field" (like the electromagnetic field) that lives on the connections *between* the arrows and ensures phase is conserved in every interaction. This local enforcement is what gives rise to force-carrying particles (gauge bosons, like the photon 💡) which are absent here. This simulation shows the field, but not the force governing its interactions in a locally symmetric way.
Related Project:
Interactive Ginzburg-Landau Simulation →
Find the source code on GitHub.