Page 1 of 1

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

Posted: Tue May 27, 2025 7:32 pm
by xiaolin_liu1

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?


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

Posted: Wed May 28, 2025 8:42 am
by henrique_miranda

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.


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

Posted: Wed May 28, 2025 8:23 pm
by xiaolin_liu1

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

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

Posted: Wed May 28, 2025 9:04 pm
by henrique_miranda

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


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

Posted: Wed May 28, 2025 9:16 pm
by xiaolin_liu1

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

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

Posted: Wed May 28, 2025 9:56 pm
by henrique_miranda

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.


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

Posted: Thu May 29, 2025 5:38 pm
by xiaolin_liu1

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?


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

Posted: Thu May 29, 2025 8:40 pm
by henrique_miranda

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.


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

Posted: Thu May 29, 2025 9:18 pm
by xiaolin_liu1

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.


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

Posted: Fri May 30, 2025 7:25 am
by henrique_miranda

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.