Solution (source code)

= Solution

The physical angle takes values on a circle, so it is defined modulo $2\pi$. Around a closed curve enclosing a <phase vortex>,
$$
\oint\nabla\theta\cdot d\mathbf l=2\pi n,\qquad n\in\mathbb Z.
$$
The integer <winding number> cannot change through a smooth single-valued deformation unless a defect crosses the curve. Thus a globally smooth Gaussian <spin wave> field omits whole topological sectors of the <XY model>.

Outside a vortex core of radius $a$, an isolated charge-$n$ <phase vortex> has $\theta=n\varphi$ and $|\nabla\theta|=|n|/r$. Its dimensionless energy in a sample of size $L$ is
$$
\beta E_n=\frac{\bar K}{2}\int_a^L2\pi r\,dr\,\frac{n^2}{r^2}
=\pi\bar Kn^2\log(L/a)+\beta E_{\rm core}.
$$
There are of order $(L/a)^2$ positions for its core, so the positional <entropy> contributes $2\log(L/a)$. The competition for unit charge is therefore $(\pi\bar K-2)\log(L/a)$, apart from core terms. Opposite charges have a logarithmic attraction and form a <vortex Coulomb gas>.

At low temperature, <vortex-antivortex binding> leaves no free charges on large scales. <Spin waves> still destroy true <long-range order>, but the <correlation function> decays algebraically with the renormalized <phase stiffness>. At the <Berezinskii–Kosterlitz–Thouless transition>, pairs unbind; free vortices screen the interaction and produce a finite <correlation length> and exponential decay above the transition. The energy-entropy estimate identifies the threshold stiffness $K_R=2/\pi$, where $K_R$ is the long-distance dimensionless stiffness, not necessarily the bare $\bar K$. It agrees with the <universal stiffness jump> and the limiting algebraic exponent $1/(2\pi K_R)=1/4$. \b[The two-dimensional transition is vortex unbinding between quasi-long-range order and disorder, rather than the onset of nonzero spontaneous magnetization.]