How to best sample elements with few atoms in the cell during MLFF training

Queries about input and output files, running specific calculations, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
xiaolin_liu1
Newbie
Newbie
Posts: 8
Joined: Thu Mar 20, 2025 6:28 pm

How to best sample elements with few atoms in the cell during MLFF training

#1 Post by xiaolin_liu1 » Tue May 27, 2025 7:32 pm

Dear all,

I encountered unphysical behavior when using MLFF for NVT production runs at 300 K to 500 K. For details, please see forum/viewtopic.php?t=20198. After inspection of the trajectories, I found that it's always caused by the close contact of two Mg atoms in my system, followed by close contact with other elements. The composition of my system can be roughly seen as Mg4A10B50C100. I tried to do heating from 500 K to 800 K during 60 ps with ML_MB = 4000. The A, B, and C elements are well sampled, each having an LCONF > 3700. However, the Mg only has an LCONF of 1868. I also tried to repeat the training with POMASS of Mg reduced to 8.0. But the LCONF only increased to 1902. The newly trained force field still fails, causing a short contact of Mg atoms. What's the best way to sample elements with few atoms in the cell during MLFF training, such as in this case?


henrique_miranda
Global Moderator
Global Moderator
Posts: 555
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: How to best sample elements with few atoms in the cell during MLFF training

#2 Post by henrique_miranda » Wed May 28, 2025 8:42 am

Do you have a plot of the number of configurations for the Mg atom as a function of the MD step during training?
It might be useful to inspect if you are already in a plateau (i.e. number of configurations are not increasing) or if you simply have to make a longer training run.


xiaolin_liu1
Newbie
Newbie
Posts: 8
Joined: Thu Mar 20, 2025 6:28 pm

Re: How to best sample elements with few atoms in the cell during MLFF training

#3 Post by xiaolin_liu1 » Wed May 28, 2025 8:23 pm

Hi Henrique,

Thanks for your reply. These are errors and LCONF of Mg of a heating run from 500 K to 800 K done in three segments, with 20 ps each and a time step of 1 fs.

ML_500_800_MgReducedMass_mlff_training_err.png
ML_500_800_MgReducedMass_mlff_training_lconf.png
You do not have the required permissions to view the files attached to this post.

henrique_miranda
Global Moderator
Global Moderator
Posts: 555
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: How to best sample elements with few atoms in the cell during MLFF training

#4 Post by henrique_miranda » Wed May 28, 2025 9:04 pm

OK, I see.
At what temperatures do you want to do the production run calculation and what temperatures are you running your training?


xiaolin_liu1
Newbie
Newbie
Posts: 8
Joined: Thu Mar 20, 2025 6:28 pm

Re: How to best sample elements with few atoms in the cell during MLFF training

#5 Post by xiaolin_liu1 » Wed May 28, 2025 9:16 pm

I want to run my production calculations at 300 K to 500 K, and I'm training while heating from 500 K to 800 K. I reduced the mass of Mg to 8.0 in the training.

What I'm trying now is training at 800 K with Mg mass reduced to 6.0. So far, it looks good. Here is the LCONF from the latest training:

800K_POMASS_6_mlff_training_lconf.png
You do not have the required permissions to view the files attached to this post.

henrique_miranda
Global Moderator
Global Moderator
Posts: 555
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: How to best sample elements with few atoms in the cell during MLFF training

#6 Post by henrique_miranda » Wed May 28, 2025 9:56 pm

If you want to run from 300K to 500K I think you should do the training from a low temperature for example 50K up to 650K following the recommendation on this paragraph:

If possible, heat the system gradually using the temperature ramp (set TEEND higher than TEBEG). Start with a low temperature (not zero) and increase it to a temperature about 30% above the desired application temperature. This will help "on-the-fly" training to explore a larger portion of the phase space and will result in more stable force fields.

from this page:
wiki/index.php/Best_practices_for_machi ... rce_fields

I would not change the Mg mass.


xiaolin_liu1
Newbie
Newbie
Posts: 8
Joined: Thu Mar 20, 2025 6:28 pm

Re: How to best sample elements with few atoms in the cell during MLFF training

#7 Post by xiaolin_liu1 » Thu May 29, 2025 5:38 pm

Hi Henrique,

What I did previously was training from 300 K to 500 K. However, the force field failed at 300 K production run, generating short contacts of Mg-Mg. May I ask why the Mg mass shouldn't be changed?


henrique_miranda
Global Moderator
Global Moderator
Posts: 555
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: How to best sample elements with few atoms in the cell during MLFF training

#8 Post by henrique_miranda » Thu May 29, 2025 8:40 pm

Sure!
By changing the mass of an element you are changing the dynamics of the system.
Depending on what quantity you want to obtain in your production run you might need to check how much it changes with the mass of Mg.
That is why I would avoid doing it. But I don't necessarily want to say that it should not be changed.


xiaolin_liu1
Newbie
Newbie
Posts: 8
Joined: Thu Mar 20, 2025 6:28 pm

Re: How to best sample elements with few atoms in the cell during MLFF training

#9 Post by xiaolin_liu1 » Thu May 29, 2025 9:18 pm

I'm calculating the diffusivities of another element, and I plan to change the mass back when doing a production run. I don't really care about anything about Mg now. But it's ruining my simulations, and I have to do something to prevent it.


henrique_miranda
Global Moderator
Global Moderator
Posts: 555
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: How to best sample elements with few atoms in the cell during MLFF training

#10 Post by henrique_miranda » Fri May 30, 2025 7:25 am

My suggestion would be to do a longer training run (more MD steps) starting from a lower temperature (50K up to 650K) and not change the Mg mass.
But if you prefer changing the Mg mass then go ahead an try that. It might work too.


Post Reply