HomeArticlesTopological Defects

Topological Defects: Vortex Dynamics in the XY Model

Tiny whirlpools in a field of arrows attract, repel and annihilate in pairs, driving one of the strangest phase transitions in physics.

mysimulator teamUpdated June 2026≈ 8 min read▶ Open the simulation

A field of arrows on a grid

The 2D XY model places a small arrow — a two-dimensional unit vector, or spin, characterized by just an angle — on every site of a lattice. Neighbouring arrows prefer to point the same direction, with an energy cost for misalignment, in direct analogy to how neighbouring magnetic moments in a real magnet prefer to align. Unlike the simpler Ising model, where each spin can only point up or down, an XY spin can point in any direction in the plane, which is exactly the extra freedom that makes vortices possible.

Vortices: a whirlpool with a topological charge

Walk around a small closed loop of spins and track how the arrows' angle changes. In a smooth, well-aligned region, the angle returns to where it started with zero net rotation. Around a vortex, though, the arrows sweep through one full 360-degree rotation as you go around the loop — a whirlpool pattern frozen into the field. That total rotation, divided by 360 degrees, is the vortex's winding number, and it can only take specific discrete values (a full integer for a system like this XY model, or a half-integer for a nematic liquid crystal, where a 180-degree-rotated arrow is physically indistinguishable from the original), because the field has to come back to a consistent value once the loop closes.

winding number  w = (1 / 2π) * Σ Δθ    around a closed loop of spins

w = +1   vortex        (arrows rotate once, same sense as the loop)
w = -1   antivortex    (arrows rotate once, opposite sense)
w = ±1/2 disclination  (half-integer defects, e.g. in nematic liquid crystals)

A defect with winding number ±1 is a vortex or antivortex; the ±1/2 case is a disclination, seen in systems where the order parameter has a two-fold rather than one-fold symmetry. Because this winding number can only take discrete values that cannot change under any smooth, continuous deformation of the arrow field around it, it is a genuine topological quantity — a vortex cannot simply be smoothed away by wiggling the field slightly; it can only be destroyed by colliding with an antivortex of opposite sign.

live demo · vortex-antivortex pairs drifting, colliding and annihilating● LIVE

Attraction, repulsion and annihilation

A single vortex sitting alone in the XY model distorts the whole surrounding field, and its elastic distortion energy actually grows with the size of the system — a real cost the model must pay for hosting an isolated defect. Bring two vortices close together and their distortion fields interact just like the fields around like or opposite electric charges: two vortices of the same sign repel, since forcing more total twisting into a small shared region raises the energy further; two of opposite sign attract, because their fields partially cancel outside the pair, lowering the total energy the closer they sit. Let an opposite pair collide and they annihilate, smoothing the field back to zero net winding and releasing the energy that had been stored in their combined distortion — the same qualitative behaviour seen in the particle-antiparticle language used for topological defects in cosmology and condensed matter more broadly.

The Berezinskii-Kosterlitz-Thouless transition

Vortices are also the key to one of the most celebrated phase transitions in statistical physics. At low temperature, the energy cost of an isolated vortex is prohibitive, so vortices exist only as tightly bound pairs of opposite sign, whose combined, largely cancelling field decays fast enough with distance that the system retains a form of long-range order — not perfect, uniform alignment, but a slowly, power-law decaying correlation between distant spins, called quasi-long-range order. Raise the temperature past a critical value, and thermal energy becomes enough to rip these bound pairs apart into a gas of independently wandering free vortices; each free vortex's slower-decaying, uncancelled field then destroys even that quasi-order, and correlations between distant spins fall off exponentially instead. This Berezinskii-Kosterlitz-Thouless (BKT) transition is unusual among phase transitions because it is driven entirely by the unbinding of topological defects, rather than by the more familiar spontaneous symmetry breaking of a conventional order-disorder transition — work recognized with the 2016 Nobel Prize in Physics for Kosterlitz and Thouless (with Haldane, for related work).

The same defects, many materials

The XY model's vortices are not just an abstract curiosity — the same mathematics of winding numbers, attraction-repulsion and BKT unbinding describes the vortex lines in a type-II superconductor threaded by magnetic flux, the quantized vortices that appear in a rotating superfluid helium or a Bose-Einstein condensate, the disclinations that organize the texture of a nematic liquid crystal display, and the domain structures of thin magnetic films. Wherever a physical system is described by an order parameter with a continuous, circular symmetry, this same family of topological defects and this same style of defect-driven transition tends to reappear.

Frequently asked questions

Why can a vortex's winding number only be a half-integer or integer, not any value?

The winding number counts how many full rotations the order parameter completes on a loop around the defect, and because the field must return to a consistent value after one full trip around a closed loop, that count is forced to be a whole number of full turns, or a half turn for a system like a nematic liquid crystal where a 180-degree-rotated state is physically indistinguishable from the original. Nothing in between is topologically allowed once the loop closes.

Why do same-sign vortices repel while opposite-sign vortices attract?

Two vortices of the same winding sign both twist the surrounding field in the same rotational sense, and bringing them closer forces more total twisting into a smaller region, which costs more elastic energy, so the system pushes them apart. Opposite-sign vortices twist in opposite senses, and bringing them together lets their twisting fields partially cancel outside the pair, lowering the total energy, so the system pulls them together until they annihilate.

What actually happens at the Berezinskii-Kosterlitz-Thouless transition?

Below the transition temperature, vortices exist only as tightly bound pairs of opposite sign whose combined field decays fast enough to leave long-range order intact. Above the transition, thermal energy is enough to unbind these pairs into a gas of free vortices whose individually slower-decaying fields destroy that order, converting the system from quasi-long-range order with power-law correlations to a genuinely disordered phase with exponentially decaying correlations.

Try it live

Everything above runs in your browser — open Topological Defects and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Topological Defects simulation

What did you find?

Add reproduction steps (optional)