Harmonic-sector factor in periodic Villain duality (source code)

= Harmonic-sector factor in periodic Villain duality
{title2=$Z_V=Z_{\rm sw}\sum_{\sum q=0}e^{-2\pi^2\beta q^TGq}\mathcal W(q)$}

On a rectangular torus, an integer height for the <integer-current representation of the Villain model> may have twists $w_x,w_y\in\mathbb Z$. Subtract $w_xx/L_x+w_yy/L_y$ to get a periodic real height. Its Gaussian energy splits into the ordinary gradient energy and $(L_yw_x^2/L_x+L_xw_y^2/L_y)/(2\beta)$. Height <Poisson summation> supplies a phase with dipole moments $P_x=\sum q_xx$ and $P_y=\sum q_xy$. A further <Poisson summation> of the twists gives, up to a charge-independent factor,
$$
\mathcal W(q)=\sum_{W_x,W_y\in\mathbb Z}\exp\left[-2\pi^2\beta\left\{\frac{L_x}{L_y}\left(W_x-\frac{P_x}{L_x}\right)^2+\frac{L_y}{L_x}\left(W_y-\frac{P_y}{L_y}\right)^2\right\}\right].
$$
Here $G$ is the inverse lattice <Laplacian> on the mean-zero subspace. This keeps the smooth <spin wave> determinant separate, while correctly retaining the coupling between vortex dipole moments and global winding sectors at finite volume. Dropping those sectors without stating boundary conditions is not an exact torus duality.