evanberkowitz / supervillain

MCMC for modified Villain constructions
https://supervillain.readthedocs.io/
Other
0 stars 0 forks source link

Possible bug in InternalEnergyDensitySquared? #98

Closed evanberkowitz closed 8 months ago

evanberkowitz commented 8 months ago

On N=5 κ=0.5 W=1 I've run many many streams and InternalEnergyDensitySquared seems to consistently differ between the Worldline and Villain formulation by ~2σ. Not just once, but over ~10 independently-generated pairs of streams.

An example is below, which shows the discrepancy. Other observables are included to demonstrate that it is unlikely to be a sampling problem. I've run streams up to 1M samples for these parameters and the observables didn't converge.

Screenshot 2024-01-14 at 16 00 33

evanberkowitz commented 8 months ago

I don't know. I tried N=11 and it's compatible. But there really shouldn't be any finite-volume effect; the observables ought to match exactly.

Screenshot 2024-01-14 at 19 48 15

evanberkowitz commented 8 months ago

This is indeed a bug. The code implemented a formula for the InternalEnergyDensitySquared observable that contained a blunder.

The InternalEnergyDensitySquared worldline documentation previously read

Screenshot 2024-01-24 at 19 22 37

The issue of course is that $\partial_\kappa (\kappa^{-2}) = -2 \kappa^{-3}$ and not ${}^{-1}$. The correct formula is

Screenshot 2024-01-24 at 19 22 54

with a different coefficient for the first term in $\partial^2S$.