Monte Carlo simulation with cooling

234 views
Skip to first unread message

Sophie Weber

unread,
Jun 10, 2024, 2:42:49 AM6/10/24
to Vampire Users
Sorry for spaming the forum with so many emails!
I am interesting in doing a plain Monte Carlo simulation where I gradually cool down from a high temperature (as opposed to the Curie Temp program, which starts at low temps) but the only option I see for this is the "field-cooled" program.
Is it possible to cool down with zero applied field? Moreover, is there a flag for performing equilibration steps before actually measurements steps (there must be, but I didn't see it in the manual)

Two final minor questions;
1. In general, do you always recommend adding a demagnetizing field (the MC program I used before did not allow for this readily) or can it be safely neglected in some cases?
2. Just to check my understanding, any direction for which you do not initiate periodic boundary conditions in the input file will have vacuum boundary conditions, is that right!

Thank you so much,
Sophie

gabo...@gmail.com

unread,
Jun 10, 2024, 7:40:20 AM6/10/24
to Vampire Users
See below.

Sorry for spaming the forum with so many emails!
I am interesting in doing a plain Monte Carlo simulation where I gradually cool down from a high temperature (as opposed to the Curie Temp program, which starts at low temps) but the only option I see for this is the "field-cooled" program.
Is it possible to cool down with zero applied field?

I've not tried it, but in the input file of the field cooling workshop example at [1], there is the line:

sim:applied-field-strength=4.0

I suppose you could try changing that to:

sim:applied-field-strength=0

 
Moreover, is there a flag for performing equilibration steps before actually measurements steps (there must be, but I didn't see it in the manual)

For Monte Carlo, if you have a look at [2], you can see there is sim:equilibration-time-steps and sim:loop-time-steps.

If after the field-cooled simulation, you for example want to follow it with a hysteresis loop simulation, the sim:load-checkpoint may be what you are looking for.  See [3,4] for more about that.
 

Two final minor questions;
1. In general, do you always recommend adding a demagnetizing field (the MC program I used before did not allow for this readily) or can it be safely neglected in some cases?

I don't know if you need the demagnetizing field or not.  That is the nice thing about simulations though.  You can run one simulation with it and one with out.  Then, see what effect it had on the results.  You can have a look at "dipole:solver=tensor" for enabling the demagnetizing field [5].

 
2. Just to check my understanding, any direction for which you do not initiate periodic boundary conditions in the input file will have vacuum boundary conditions, is that right!

That's likely the case.  The periodic boundary conditions help simulate bulk conditions.  For additional details, refer to [6].


Kind Regards,
Gavin
VAMPIRE user

Sophie Weber

unread,
Jun 10, 2024, 10:23:37 AM6/10/24
to gabo...@gmail.com, Vampire Users
Thank you. In addition to this, is it recommended not to use the field-cooled simulation with the monte carlo integrator?  The only example I have seen is with the llg-heun integrator.

Also, For the equilibration, if you don't set a temperature will it by default perform the equilibration steps at each temperature in the field-cooled setting, or only for the first temperature? In principle for. my simulation, I think it makes most sense to equilibrate at each temperature step if I'm looking for the ground state.

Thank you,
Sophie

--
You received this message because you are subscribed to a topic in the Google Groups "Vampire Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vampire-users/4fOcmN7F6Mc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vampire-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vampire-users/f7b67dd8-6453-4974-80fc-f7f711b55920n%40googlegroups.com.

gabo...@gmail.com

unread,
Jun 11, 2024, 2:26:41 AM6/11/24
to Vampire Users
See below.

Thank you. In addition to this, is it recommended not to use the field-cooled simulation with the monte carlo integrator?  The only example I have seen is with the llg-heun integrator.

My suspicion is the same as yours that since llg-heun is used in the example that it is the recommend one.  Though, you could try using the monte-carlo to see what happens and you could compare the results between the two.

There were references I came across mentioning monte-carlo being specified for equilibrium properties calculations and LLG for dynamics properties calculations.  The citations for those should be in the post at [1].

It is noted, though, that there was a conversation about monte-carlo and llg-heun for Curie temperature calculations at [2].  Perhaps, you could take some of the ideas from it to see if they are still applicable to the field cooling.

 
Also, For the equilibration, if you don't set a temperature will it by default perform the equilibration steps at each temperature in the field-cooled setting, or only for the first temperature? In principle for. my simulation, I think it makes most sense to equilibrate at each temperature step if I'm looking for the ground state.
 
When using "sim:program=field-cool", it looks like it is helpful set temperatures in the input file with keywords:

sim:equilibration-temperature
sim:minimum-temperature
sim:maximum-temperature
sim:cooling-function

If you leave those out of the input file, it looks like it sets them be default to:

sim:equilibration-temperature=300.0
sim:minimum-temperature=0.0
sim:maximum-temperature= 300.0
sim:cooling-function = exponential

Since in simulation/sim.cpp [3], it looks like the default values are set, respectively, with:

line 82: double Teq=300.0;
line 82: double Tmin=0.0;
line 81: double Tmax=300.0;
line 132: int cooling_function_flag=0; /// 0 = exp, 1 = gaussian, 2 = double-gaussian, 3 = linear

According to page 52 of the VAMPIRE manual [4], the sim:cooling-function can be set as exponential, gaussian, double-gaussian, or linear.

From the input file example at [5] for the 3b_skyrmions_in_built_dmi, it looks like is best to set the sim:equilibration-temperature and sim:maximum-temperature to the same value of 30.0.

As when running the simulation, it looks like the first temperature is writes to the output file is 30 K that comes from "sim:equilibration-temperature=30".  For the next temperature in the output file, it looks like it comes from the "sim:maximum-temperature=30.0", but it seems to not include the 30.0 but the temperature of 29.999 K as an incremented temperature based on a gaussian step (from sim:cooling-function = gaussian).  Then, it looks like it will continue to write decrements of the temperature until it hits the stopping point set by "sim:minimum-temperature=0.0".

Sophie Weber

unread,
Jun 11, 2024, 3:59:42 AM6/11/24
to Vampire Users
Ok, thank you! very much! It sounds like maybe then, that it is not possible with the field-cooled program to set equilibration steps at each temperature of the field cooling? Is there a reason that the simulation of the process makes more sense only with equilibration at the first temperature?

Final question for now; if I do use the Monte Carlo integrator, I read that at least for some version of Vampire, it is not possible to run Monte Carlo with the parallel version of vampire. Is this still the case with the newest version? It runs extremely slowly with just serial.

Thanks very much for your patient help, I appreciate it!

Best
Sophie

gabo...@gmail.com

unread,
Jun 11, 2024, 5:04:37 AM6/11/24
to Vampire Users
Ok, thank you! very much! It sounds like maybe then, that it is not possible with the field-cooled program to set equilibration steps at each temperature of the field cooling? Is there a reason that the simulation of the process makes more sense only with equilibration at the first temperature?

I suspect it does the equilibration at each temperature step with monte carlo, but I don't know for sure as I didn't develop the code for it nor have I tried to spend many hours or days analyzing was it does. The developer sometimes responds in the list, such that there is a chance they could respond later, but they may be busy.
 
Final question for now; if I do use the Monte Carlo integrator, I read that at least for some version of Vampire, it is not possible to run Monte Carlo with the parallel version of vampire. Is this still the case with the newest version? It runs extremely slowly with just serial.

You could try it to check what happens.  I believe it could be working if you are using VAMPIRE 6.0 or the develop version as long as it not the constrained-monte-carlo [1].

Richard Evans

unread,
Jun 11, 2024, 5:21:21 AM6/11/24
to gabo...@gmail.com, Vampire Users
Hi Gavin, Sophie,

Unlike the Curie temperature, the field cool program is a continuous process, with a linear or half-gaussian profile of T(time). Monte Carlo is usually best, and the standard version in develop branch works well in parallel.

Cheers,

Richard

--
You received this message because you are subscribed to the Google Groups "Vampire Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vampire-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vampire-users/f27bdfd7-38ee-4320-9c84-2e86b4100ad2n%40googlegroups.com.

Sophie Weber

unread,
Jun 11, 2024, 5:51:54 AM6/11/24
to Richard Evans, gabo...@gmail.com, Vampire Users
Dear Richard,

Thanks a lot, I appreciate it! I was able to set up a simulation with Monte Carlo using the parallel version where I just run a time series simulation at fix temperature and have an external bash script where I loop through temperature and copy the checkpoint files from the prior temperature to the new temperature (I thought this would be more transparent than the built-in-programs). It runs without errors, however, looking at the output something is clearly going wrong; the mean magnetization is printed for the first sublattice, (I have 12 inequivalent sublattices, of materials, in my system) and also the specific heat is printed, but for all temperature the values in the rest of the columns for the mean magnetization of the other sublattice is just zeros. This was not the case for running it in serial, nonzero values were printed for everything.
I attach the input files and bash script, as well as the directory for one temperature point, here, when I run in parallel. Is it easy for you to tell what is going wrong (am I just running across too many cores?)

Thank you again,
Sophie

vampire_cooling.tar

gabo...@gmail.com

unread,
Jun 11, 2024, 8:11:18 AM6/11/24
to Vampire Users
In your log file, I see:

11-06-2024 [11:37:25] Material 1 Cr makes up 100 % of all atoms ( 22000 atoms )
11-06-2024 [11:37:25] Material 2 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 3 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 4 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 5 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 6 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 7 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 8 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 9 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 10 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 11 Cr makes up 0 % of all atoms ( 0 atoms )
11-06-2024 [11:37:25] Material 12 Cr makes up 0 % of all atoms ( 0 atoms )

The issue might be that you have 0 atoms associated with materials 2 through 12.

You may need the unit-cell-category. Refer for example to:


Kind Regards,
Gavin
VAMPIRE user

Sophie Weber

unread,
Jun 13, 2024, 10:52:34 AM6/13/24
to Vampire Users
(I tried to send this message earlier,  but I don't think it sent properly) Thank you very much! Using unit-cell-category worked, then all the materials are recognized.
I did notice however, that when I copy the checkpoint files to another file to reload at another temperature, all output columns in the first printed timestep are "nan". This is only the case for the parallel version. By the second timestep that's printed, numbers are printed as normal.

Have you ever encountered this, and is it something to worry about?
Best wishes,
Sophie

Reply all
Reply to author
Forward
0 new messages