# Metropolis simulation of thermal field theory

I try to simulate thermal version of 1D $(x, t)$ sine-Gordon field model with Lagrangian:

$$L = \frac{1}{2} \partial_{\mu} \phi \partial^{\mu} \phi - 1 + \cos \phi$$

I am interested in static solution $\phi(x)$ which minimizes energy functional $E$:

$$E = \int dx \left( \frac{1}{2} \phi' ^2 + 1 - \cos \phi \right) \ ,$$

where $\phi' = \partial_x \phi$

What is very confusing that acceptance ratio of Metropolis algorithm is too high - more than $0.95$, so almost every new proposed configuration is accepted. On each Metropolis step I change field value at one spatial point and calculate difference in energy. To propose new configurations uniform sampling is used with step parameter $\delta = 0.5$, i.e.

$$\phi_{new} = \phi_{old} + r \ ,$$

where $r$ is random number from $\phi_{old} - \delta$ to $\phi_{old} + \delta$.

How can I decrease acceptance ratio? Increasing of step parameter $\delta$ does not change situation remarkably. It seems to me that if acceptance ratio is too high then algorithm does not work correctly. However, such algorithm is perfectly applied to the ground state harmonic oscillator (via path integral Monte Carlo).

• You have almost certainly made an error with your implementation. So you'll need to post your code for further help. However, physics SE is not intended for code debugging, so you should post the question (with code) in the computational science SE instead. – lemon Aug 23 '16 at 14:28
• I have to agree with @lemon about the likelyhood of bugs. Every experienced programmer suspects their code first. And second. And third. I am reminded of Knuth's famously dry comment "Beware of bugs in the above code; I have only proved it correct, not tried it.". – dmckee Aug 23 '16 at 17:00
• @lemon Thank you. I went there, if you are interested: scicomp.stackexchange.com/questions/24804/… – newt Aug 23 '16 at 17:03
• @dmckee I don't know, I checked it. And it works for harmonic oscillator... – newt Aug 23 '16 at 17:04