Ising Model, Monte Carlo Method, and the Metropolis Algorithm
A breezy intro to the Ising model, Monte Carlo method, and Metropolis algorithm — just enough to say you've heard of them once.
This time let’s take a quick look at the Ising Model and move on.
This one I won’t cover in detail either. Just “let’s at least hear about it once.” is the main purpose of this posting.
This model is apparently the simplest model used in the study of magnetic materials.
If it’s a field that studies magnetism, it’ll be related to spin.
The super-simple spin-related model that got cooked up — that’s the Ising model, apparently whipped up by Ernst Ising
How simple did he make it
The spin-related interaction

should be written like this,
but the Ising model says “first let’s just look in one direction!”
So ignore x, y!!!!!
And on top of that

it adds the assumption that each of these can only take +1 or -1.
And and and and and and and on top of all of that
the spin interaction is only between the nearest atoms!!!!! it sticks this on too.
So

For an actual material, particle G would be influenced by multiple particles 1, 2, 3, 4, 5, 6, 7, 8.
No, even more, 9, 10, 11, 12, 13, 14, 15, 16, 17…. an infinite number of particles would affect it.
This is probably what’s actually true
The Ising model is a model that ‘assumes’ it’s only influenced by the nearest particle
i.e., as a picture it would be expressed like this

Ignoring everything else, the nearest atoms are only particles 2, 4, 5, 7!!!!
Alright, since we said there’s only the z direction, now let’s drop the z subscript and write it out.
The Hamiltonian for spin would be like this.

It’s expressed as the sum over neighboring sites i, j, and S can only be +1, -1~~~
Then what is J… J….
J can be said to be a property of the material, the substance.

these will interact in the direction that minimizes the Hamiltonian.
If J is positive, to minimize H

needs to be 1 to be a minimum, and

being 1 means we can say there’s an interaction making them have “the same direction”.
But on Earth there are also things with J < 0.
Then to minimize the Hamiltonian

it becomes minimized when there are lots of things turning to -1.
That is,

there’s pressure to align “in opposite directions” to each other.
So when J is positive, it represents a ferromagnetic — super-magnet — interaction,
and when J is negative, it represents an antiferromagnetic (ferromagnetic) — super-No-magnet — interaction.
Then let’s explore the Ising model for 4 atoms.
Ising model for ferromagnetic interaction (J > 0),
let’s consider 4 spins located at the corners of an interacting square.
Let’s think about how many cases there are for the Energy it can take
For E = -4J there are exactly two cases


These exactly two cases would be E = -J.
Why this is -4J — taking only these neighboring ones gives -J four times
so the total energy is -4J.
Let’s also think about E = 4J
Since J > 0, for E = 4J
all neighboring spins have to be in opposite directions to each other.
That is, this too has exactly 2 possible cases.


And every other case is E = 0.
↑↑
↑↑
if you flip just one spin from this,
↑↓
↑↑
if you work it out it’s 0, and
if you flip a different one it stays the same
Then since we know all the Energy states and we know the counts,
let’s work out the partition function Z.

Oho, the partition function comes out like this.
Since we’ve derived Z, now we can easily pull out the state functions.

If we plot this graph,

something like this is what you get, and apparently there are 4 really important facts here.
- When T→∞,
= 0
Since the probability of going to every state becomes equal, it goes to the state with the highest entropy~
- When T→0,
= -4J!!!
That is, the lower the temperature gets, the more “ordered”
i.e., it means it becomes a state where entropy is not large!!!!
- The graph shows extreme changes in
, but if you increase N further
you can see even more extreme changes, apparently.
This in turn means a phase transition.
- Here there are 2 possible ground states.
↑↑
↑↑
or
↓
↓
But if we think in terms of the concept of “thermal equilibrium”, whether they go back and forth between the two or not,
just the equilibrium being
but in reality at T→0, does it make any sense that with that tiny bit of energy the thing would wholesale go from up-up-up-up to wholesale down-down-down-down or whatever changes??????
In reality No they won’t overlap, and this means for this system the thermal statistical mechanical approach has to be dropped.
That’s why the complex-systems-like method of Monte-Carlo Method gets introduced!!!!
What is the Monte-Carlo Method….
I happened to hear someone explain Monte-Carlo method to a high-school student,
let me repeat that simply.

It’s one of the computer simulation methods.
You use a computer to randomly splatter points like crazy.
Just tell it to blast away. A computer can make random points
If we run this quickly,
when the computer dots 5000 points,
it counts the number of points that fell inside that square. About 1917 were marked, apparently
Now then, what points are being counted,

we count the number of points dotted inside this circle of radius r.
If we count, 1503 get caught, apparently
And if we take this ratio

this comes out, and what this means we’ve just computed is…..

we’ve computed this…..
Whoa then if we multiply by 4 let’s see what happens……?

Yep…. apparently we can also compute π this way.
Right now it didn’t get to 3.14, but if we increase the number of trials more more more more more more, we can compute π to an amazingly surprising degree.
……..Monte-Carlo method — do you get a little sense of what it’s trying to do????????
Why is this Monte-Carlo method necessary right now…..???
In studying the Ising model,
in 2D and above, when N gets large,,,,, this is completely hopeless apparently.
And also in 2D and above it gets absurdly complicated apparently
(Above, there were only 4, so we could do it by hand….)
So in 1D with the existing

analysis is possible,
and what this ‘possible’ means is: suppose we have a 1D solid.
Since it’s a solid, let’s assume ΔV ~~ 0, i.e. almost no change in volume.
Then when finding equilibrium, rather than thinking in terms of minimizing the Gibbs free energy, whose variables are p, T,
it would be better to think in terms of minimizing the Helmholtz free energy, whose variables are T, V.
Let’s look at the 1D ground state.
The ground state, as we learned above, would have everything aligned in the same direction.
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
Here let’s arbitrarily flip one spin shyoom!!!
↑↑↑↑↑↑↑↑↑↑↑↑↑↓↑↑↑↑↑↑↑↑↑
We flipped it, so how much does the Helmholtz energy get minimized.
We use the F = U - TS function, and for S we use the statistical mechanics definition of entropy.


How much does it get minimized
First, the energy changes by 4J.
With the left neighbor it was -J, and it becomes +J so it changes by +2J
and with the right neighbor it was originally -J too, and it becomes +J so it changes by +2J
in total it changed by 4J
and

as for this guy, it changed by the number of atoms N.
Therefore

so the free energy change from putting one deformation on the chain
keeps going to negative infinity as N gets larger.
That is, the breaking of the chain happens spontaneously, and as long as T is positive there’s definitely a spontaneous change
and if T ≠ 0, i.e. if it’s not 0K, we arrive at the conclusion that ↑↑↑↑····↑↑↑↑↑ is impossible,
meaning the system is in a disordered state at all temperatures, and the critical temperature is T=0.
It can go to a conclusion similar to reality too!!!
But this kind of analysis is not possible in 2D
First, even if N gets a little bigger (for an N x N solid, the calculation is not possible.)

If we look at a 2x2 like this, the total number of cases is
per atom there are 2 possible spins, 4 atoms
so the total number of cases is

Then for a 3x3 solid the total number of cases is

For 4x4 the total number of cases is

Ugh…. since the number of cases grows at a rate beyond exponential,
expo-expo-expo-nennn-tiallyyy,
saying that counting

cases is impossible doesn’t seem wrong.
Also, another problem in 2D is,,,,

suppose there are 3 atoms like this.
And, two of the spins are determined

lollollollollollollollollollollollollollollollol
what state is the remaining one supposed to be in??????
it roughly ends up in a bind.

Which direction should it react to bring equilibrium to the system?????????
lollollollollollollollollol seriously this is absurd
(frustrated state — Koreans call it 좌절상태, literally “frustration state” lollollollol)
Alright alright alright alright so. that’s. why. computer simulation via the Monte-Carlo method is needed apparently.
Just run the same situation randomly a freakin’ lot of times and then look at the average…. something like that
There are a ton of algorithms used with the Monte-Carlo method, and the easiest one among them to introduce
is called the Metropolis algorithm.
What kind of algorithm is it: you pick any atom and flip its spin shyoong!!! and if it lowers the system’s energy you leave it alone
and if it raises the system’s energy by ΔE,

with this probability you flip it back to before,

and with this probability you leave it in the post-flipped high state
going through this process
you keep picking another arbitrary atom and flip it and again follow the above process
and if you keep doing that con~~~~~~~~~~~~~~~~~~~~~~~~~~~~~tinuously, apparently you reach equilibrium,
let’s look at the result after following this algorithm.
if up spin is black and down spin is white

At T ~~ 0 it converges to an al~most static state
At T ~~ T_c it shows enormous fluctuations
At T ~~ ∞ up and down exist in equal proportions…
This can predict such actual phenomena, apparently
so complex-systems research methods are essential in the physics domain
something like that………..
Ugh………..I don’t understand anything
pretending to know is freakin’ hard damn
ugh I’m pissed, let’s go to grad school damn I’m dead gonna smash everything
Originally written in Korean on my Naver blog (2016-07). Translated to English for gdpark.blog.