Closed JohanCarlsen closed 1 year ago
Hi! Writing from my phone, so will keep it short.
I think you are dividing by the wrong sample (cycle) count. After having done n cycles your average is a sum over the n (not nCycles) samples you have collected so far.
Thank you! That fixed it! 👍🏽
Hi! So I've implemented code to calculate the energy per spin after $n$ MCMC cycles. After 100.000 cycles, the energy is very close to the analytical expectation value. This is also the case for susceptibility.
When I try to plot this to visualize the convergence toward the analytical values, it seems the values per cycle are linear. I would think this should not be the case, but I can't figure out why it is this way. The code computing the values is as follows
Is it clear why this is linear? Link to full repo: https://github.com/Madssb/FYS3150_H22_4_pers/tree/johan/Project_4