# Partition function for 2D classical XY model

Studying the classical XY model (https://en.wikipedia.org/wiki/Classical_XY_model), I wish to compute the partition function: $$\begin{equation} Z=\int \mathrm{d}\mathbf{s}\; e^{-\beta H(\mathbf{s})} \end{equation}$$ Where $$H$$ is: $$\begin{equation} H(\mathbf{s})=-\sum_{i \neq j} J_{i j} \mathbf{s}_{i} \cdot \mathbf{s}_{j}-\sum_{j} \mathbf{h}_{j} \cdot \mathbf{s}_{j} \end{equation}$$

The model assumes that $$\mathbf{s}_{j}$$ are unit vectors: $$\mathbf{s}_{j}=\left(\cos \theta_{j}, \sin \theta_{j}\right)$$.

From wikipedia and various articles, it seems that integrating over all possible angles $$\theta_j$$ is the way to go about it.

• Why can't we uncouple the spins and then integrate directly over $$(\mathbf{s}_i)_x\in [-1,1]$$?
• Wikipedia's article integrates over angles, why isn't there an extra factor $$-\sin(\theta_i)\mathrm{d} \theta_i$$ in front of the exponential due to the change of variables? Since $$\mathrm{d} s_i=-\sin(\theta_i)\mathrm{d} \theta_i$$. Wikipedia does not include this term:

$$Z=\int_{[-\pi, \pi]^{\Lambda}} \prod_{j \in \Lambda} d \theta_{j} e^{-\beta H(\mathbf{s})}$$

You can integrate over $$\mathbf{s}$$, but you also have to impose the constraint that $$\|\boldsymbol{s}\|=1$$, which does not seem to be presented in your partition function:$$Z=\int \mathrm{d}\mathbf{s}\; e^{-\beta H(\mathbf{s})}$$. For example, you can probably add the constraint using the Dirac delta function like $$Z=\int \mathrm{d}\mathbf{s}\; \delta(\mathbf{s}^2-1) e^{-\beta H(\mathbf{s})}$$, but I wouldn't bother to do that.