2
$\begingroup$

I have tried to run simulation for Ising model of large-size square lattices at the critical point. Mostly I use Python optimized with numba decorator for $L=256$ it takes approx 2.5 min with Metropolis algorithm. With C++ codes that I have found, Wolff algorithm oddly took even more time. Does anybody know how much should it takes normally? and Can you tell if is there any open source reliable code for this task?

Thank you in advance for your attention.

$\endgroup$
5
  • 2
    $\begingroup$ How do you determine when to stop your algorithm? It's 2.5 minutes until what happens? $\endgroup$ Commented Dec 27, 2021 at 8:49
  • $\begingroup$ Efficient Monte Carlo steps for a system with linear size L, is L^(z*d) which 'z' is dynamic exponent of algorithm (e.g. for Metropolis is 2) and 'd' is the dimension. This 2.5 minutes is for both L^4 Monte Carlo steps to reach the equilibrium state and some additional linear algebraic calculation on the result spin configurations. (The last part is done by numpy library and I don't think it can get more efficient) $\endgroup$ Commented Dec 27, 2021 at 12:10
  • 1
    $\begingroup$ Then it should be much faster. On my average pc with my amateur code implementing a perfect simulation version of the Swendsen-Wang algorithm (that is, the algorithm outputs a configuration sampled exactly, without approximation, from the Gibbs measure), it takes about 1 second to sample a 500x500 configuration at the critical temperature. $\endgroup$ Commented Dec 27, 2021 at 18:18
  • $\begingroup$ What programming language did you use? and do have any kind of repository for your codes which I could compare with mine to find the flaws? that would be a great help. $\endgroup$ Commented Dec 27, 2021 at 20:30
  • $\begingroup$ c++. My code has not been uploaded anywhere, it is messy. It's something I wrote long ago to create pictures for some classes I teach. If you wish, I can send it to you (send me an email, see my personal page, which is available from my user page here), but note that it relies on the Qt library, so you'll need to have it installed if you wish to compile it. Also, as I said, it implements a perfect simulation algorithm, which makes the code more complicated than basic Monte Carlo. The algorithm I used is this one. $\endgroup$ Commented Dec 28, 2021 at 8:41

0