2.1 Metropolis update

In the sumulation we need to store only the phase of the field \(\theta\) as a double, and we update the configuration extracting a number \(-1<\delta(x)<1\) for each point \(x\) and considering the new configuration \[ \phi'(x)=e^{i(\theta(x)+\delta(x))}\,, \] then we compute the variation of the action

\[ \Delta S=S[\phi']-S[\phi] \]