I simulated the two-dimensional Ising model at its exact critical temperature with two Markov chain Monte Carlo methods, the single-spin Metropolis algorithm and the Wolff cluster algorithm, on periodic L×L lattices from L = 8 to L = 64. For each method I measured the integrated autocorrelation time of the energy and of the absolute magnetization, using four independent runs per lattice size. Both methods reproduce the exact finite-lattice energy within statistical error. For Metropolis, the autocorrelation time of |M| grows as L^z with z = 2.11(3) for L ≥ 16 and 2.16(5) for L ≥ 24, in line with the accepted value z ≈ 2.17 for local dynamics. For Wolff, measured in sweep-equivalent units, I get z = 0.29(1) from the energy and 0.15(1) from |M| for L ≥ 24, within the range of published values. In CPU time per statistically independent sample of |M|, Wolff was 5 times faster at L = 8 and 275 times faster at L = 64, and the gap grows roughly as L^2. All code and raw results are available, and the full study runs in under an hour on two CPU cores.
I simulated the two-dimensional Ising model at its exact critical temperature with two Markov chain Monte Carlo methods, the single-spin Metropolis algorithm and the Wolff cluster algorithm, on periodic L×L lattices from L = 8 to L = 64. For each method I measured the integrated autocorrelation time of the energy and of the absolute magnetization, using four independent runs per lattice size. Both methods reproduce the exact finite-lattice energy within statistical error. For Metropolis, the autocorrelation time of |M| grows as L^z with z = 2.11(3) for L ≥ 16 and 2.16(5) for L ≥ 24, in line with the accepted value z ≈ 2.17 for local dynamics. For Wolff, measured in sweep-equivalent units, I get z = 0.29(1) from the energy and 0.15(1) from |M| for L ≥ 24, within the range of published values. In CPU time per statistically independent sample of |M|, Wolff was 5 times faster at L = 8 and 275 times faster at L = 64, and the gap grows roughly as L^2. All code and raw results are available, and the full study runs in under an hour on two CPU cores.
We calculate the dynamic critical exponent for the Niedermayer algorithm applied to the two-dimensional Ising and XY models, for various values of the free parameter E 0 . For E 0 = − 1 we regain the Metropolis algorithm and for E 0 = 1 we regain the Wolff algorithm. For − 1 < E 0 < 1, we show that the mean size of the clusters of (possibly) turned spins initially grows with the linear size of the lattice, L , but eventually saturates at a given lattice size , which depends on E 0 . For , the Niedermayer algorithm is equivalent to the Metropolis one, i.e., they have the same dynamic exponent. For E 0 > 1, the autocorrelation time is always greater than for E 0 = 1 (Wolff) and, more important, it also grows faster than a power of L . Therefore, we show that the best choice of cluster algorithm is the Wolff one, when comparing against the Niedermayer generalization. We also obtain the dynamic behavior of the Wolff algorithm: although not conclusively, we propose a scaling law for the dependence of the autocorrelation time on L .
In the present work, we present an extensive Monte Carlo simulation study on the dynamical properties of the two-dimensional random-bond Ising model. The correlation time τ of the Swendsen-Wang and Wolff cluster algorithms is calculated at the critical point. The dynamic critical exponent z of both algorithms is also measured by using the numerical data for several lattice sizes up to L=512. It is found for both algorithms that the autocorrelation time decreases considerably and the critical slowing-down effect reduces upon the introduction of bond disorder. Additionally, simulations with the Metropolis algorithm are performed, and the critical slowing-down effect is observed to be more pronounced in the presence of disorder, confirming the previous findings in the literature. Moreover, the existence of the non-self-averaging property of the model is demonstrated by calculating the scaled form of the standard deviation of autocorrelation times. Finally, the critical exponent ratio of the magnetic susceptibility is estimated by using the average cluster size of the Wolff algorithm.
We study the efficiency and theory behind various Markov chain Monte Carlo update methods (later MCMC) in the classical Heisenberg model in three dimensions. Classical Heisenberg model is a model in statistical physics that describes ferromagnetic phenomena. Classical Heisenberg model is a generalization of the Ising model where the spin is three dimensional unit vector instead of scalar -1 or 1. Both models show a second order phase transition which is the main reason we are interested in these models. The transition in our case describes the loss of magnetization of a ferromagnet as it is heated to its Curie temperature. Monte Carlo simulating the Classical Heisenberg model uses the same MCMC update methods as the Ising model. We introduce the theoretical background of Metropolis, Overrelaxation, and Wolff single cluster updates and study the dynamic critical exponents of Metropolis and Wolff updates. Results of this study are as expected: metropolis suffers from critical slowing down near the phase transition temperature and the autocorrelation time scales to L^5.08 , where L^3 is the size of the lattice. Wolff single cluster update avoids critical slowing down and scales very well with autocorrelation time scaling to L^3.28 . Even though Wolff update scales much better it has its downsides. Parallelization is a very important factor in modern scientific computing and Wolff update is very tricky to parallelize where as Metropolis parallelizes very well. Usually we can avoid this problem by running multiple instances of the simulation at the same time as varying simulation parameters such as the temperature. For large lattices the problems is that getting moderate results requires a lot of time.
This dataset and code repository accompanies the article of the same title (version 5, May 2026) and provides all simulation data, source code, and raw terminal output necessary to reproduce and verify the results. Study summary We investigate the critical dynamics of the two-dimensional Ising model at the exact critical point (Tc ≈ 2.269185) using the local Metropolis Monte Carlo algorithm. The central focus is the characterization and comparison of two widely used correlation time estimators: the exponential decay criterion τ₁/e and the integrated autocorrelation time τ_int, following the convention of Sokal (1997). Simulations were performed for seven system sizes L ∈ {16, 24, 32, 48, 64, 96, 128} with up to 50 independent replicas per system size, using both Python (NumPy/PCG64) and C++ (std::mt19937, compiled with -O2) implementations. The two implementations were developed independently, enabling cross-validation of results across languages. Main findings The coefficient of variation (CV = std/mean) of τ_int converges to a physical floor of approximately 0.44–0.52 regardless of the number of replicas (8 or 50) or programming language, confirming that this floor is determined by the physics of the estimator under local Metropolis dynamics at criticality — not by statistical sampling limitations. The distribution of τ₁/e is genuinely bimodal at the critical point: individual replicas alternate between low (~200–500 MC steps) and high (~3000–5000 MC steps) correlation times for the same system size, with mean-to-median ratios of up to 2.6× and bimodal ratios (mean of upper half / mean of lower half) of up to 23.5×. This bimodality does not disappear with more replicas, confirming it is a physical property of the estimator. No detectable power-law scaling τ ~ L^z is found for L ≤ 128 in any of the six independent runs (R² < 0.14 in all log-log fits using all 7 system sizes). The accepted asymptotic value z ≈ 2.17 (Li & Sokal, 1989) implies an expected τ_int of approximately 73,600 MC steps at L = 128 — 76× larger than the observed value of 972. This quantifies the dominance of finite-size corrections in the range studied, and justifies treating the effective dynamic exponent z_eff as a continuously varying quantity rather than a fixed constant. The C++ implementation achieves speedups of 98× to 782× relative to Python depending on system size, enabling the full 50-replica run across all seven system sizes to complete in approximately 33 minutes. Cross-validation caveat Cross-validation between Python and C++ is fully valid for τ₁/e. For τ_int, the Python scripts used a fixed equilibration of n_equil = 3000 steps for all L — documentably insufficient for L ≥ 24 where τ_int > 600 (n_equil/τ < 3–5τ). This generates systematic underestimation of up to 86% at L = 64. The valid cross-validation for τ_int is between the C++-8 and C++-50 runs, where CV agreement (~0.52 in both) confirms the physical floor is robust. Connection to the EIE/ZIE framework This study provides the empirical foundation for the EIE/ZIE adaptive meta-control framework (Patent BR 10 2025 024459 4), justifying three architectural decisions: (1) τ_int as the preferred estimator of the correlation time τ_corr; (2) the effective dynamic exponent z_eff treated as a continuously estimated dynamic variable rather than a fixed constant; and (3) the dynamic freezing time τ_freeze introduced as an observable independent of τ_corr, motivated by the bimodal behavior of τ₁/e which reveals that the system alternates between regimes of high and low correlation persistence — a phenomenon invisible to conventional autocorrelation-based diagnostics. Repository contents Cpp/ — C++ source code (3 scripts) and simulation data (6 CSV files + raw terminal output) Python/ — Python source code (2 scripts) and simulation data (4 CSV files + raw screen output) Paper/ — Article in English (PDF) and Portuguese (PDF) README.md — Full repository documentation including file descriptions, column definitions, reproduction instructions, and physical parameters LICENSE.txt — CC BY 4.0 for data; MIT for code; patent notice Joemerson da Silva Lima — Independent Researcher, Cuiabá, Mato Grosso, Brazil joemerson93lima@gmail.com Patent BR 10 2025 024459 4
Many problems in statistical physics resist exact solution once the number of interacting particles becomes large, and the two-dimensional Ising model is a classic case where numerical simulation fills that gap. This paper reports a Monte Carlo study of the two-dimensional Ising model using the Metropolis algorithm, undertaken to examine how magnetization, internal energy, specific heat, and magnetic susceptibility change with temperature. Spin configurations were generated on a square lattice under periodic boundary conditions, with each proposed spin flip accepted or rejected according to the Boltzmann weight of the resulting energy change. The simulation reproduces the expected transition from an ordered ferromagnetic state at low temperature to a disordered paramagnetic state at high temperature, with magnetization falling sharply and both specific heat and susceptibility peaking near a critical temperature of Tc ≈ 2.3–2.4 (in units of J/kB), consistent with the exact value obtained analytically for this system. These results confirm that the Metropolis algorithm, despite its simplicity, remains a dependable tool for locating second-order phase transitions and extracting thermodynamic quantities in lattice spin systems, and the same computational framework can be adapted to more elaborate models used in condensed matter and materials research.
We show that addition of Metropolis single spin flips to the Wolff cluster-flipping Monte Carlo procedure leads to a dramatic increase in performance for the spin-1/2 Ising model. We also show that adding Wolff cluster flipping to the Metropolis or heat bath algorithms in systems where just cluster flipping is not immediately obvious (such as the spin-3/2 Ising model) can substantially reduce the statistical errors of the simulations. A further advantage of these methods is that systematic errors introduced by the use of imperfect random-number generation may be largely healed by hybridizing single spin flips with cluster flipping.