Two dimensional Ising model Monte Carlo matlab
no vote
Using Monte Carlo method and importance sampling method, that is to extract a state subset from the set of all States, to make the average of the states in the extracted subset as close as possible to the average of all States, so as to calculate the average value. The most basic is how to randomly select the initial value of spin S, and then skip the Monte Carlo sampling step for each spin variable on each lattice point in order to determine its next spin state. Here, the most basic and commonly used metropolis method is adopted. The steps are as follows: Step 1: randomly select the initial lattice configuration s = {S1, S2,..., Sn}; step 2: randomly select a lattice point I according to the equal probability of 1 / N, reverse the spin on it, and get a new configuration s' = {S1, S2,..., - Si,..., Sn}; step 3: calculate the energy difference △ e = e (s') - E (s), if △ e ≤ 0, the change is effective, take the spin change, the configuration change s → s'. This corresponds to the case of P (s') & gt; P (s) and w (s → s') = 1.