Page 1 of 1

Merging ML_AB Data from Magnetic and Non-Magnetic AIMD Simulations

Posted: Wed Dec 03, 2025 12:13 pm
by qingyu_wang

Hello,
I am writing to consult you regarding an issue encountered when merging the ML_AB files generated from ab initio molecular dynamics (AIMD) simulations (with machine-learning potentials enabled) for different structures using VASP, following the procedure described in the link you previously provided. During the structural optimization of each individual configuration, I found that some structures exhibit magnetic behavior. Accordingly, I enabled spin polarization and specified the relevant magnetic settings when performing the AIMD simulations with machine learning activated.
I would like to confirm whether it is feasible to merge ML_AB files obtained from spin-polarized (magnetic) AIMD simulations with those generated from non-magnetic AIMD simulations, and whether such a combination might introduce inconsistencies or errors in the resulting merged ML_AB file.


Re: Merging ML_AB Data from Magnetic and Non-Magnetic AIMD Simulations

Posted: Wed Dec 03, 2025 12:48 pm
by jonathan_lahnsteiner2

Dear Qingyu Wang,

You should definitely not mix calculations which you obtained from ab-initio calculations with different settings. Switching on spin-polarization in the ab-intio calculations is equivalent to changing the Hamiltonian of your ab-initio model. Machine learning approaches should be fitted to a certain Hamiltonian not a mixture of them. Mixing Hamiltonians might result in unexpected behavior of your machine learning model. One should also not change other ab-initio settings as ENCUT during the training procedure for the same reason.

All the Best Jonathan


Re: Merging ML_AB Data from Magnetic and Non-Magnetic AIMD Simulations

Posted: Thu Dec 04, 2025 4:50 am
by qingyu_wang

Dear Mr. Lahnsteiner,
Thank you very much for your reply!
Therefore, if magnetic configurations are present within my dataset of structures, should all configurations—including those that exhibit non-magnetic behavior—be subjected to spin-polarized calculations? Only under this consistent computational setup, I wonder if it is valid to merge the ML_AB files generated from all configurations?
Sincerely!


Re: Merging ML_AB Data from Magnetic and Non-Magnetic AIMD Simulations

Posted: Thu Dec 04, 2025 12:31 pm
by jonathan_lahnsteiner2

Dear Qingyu Wang,

If you want to merge your ML_AB files, I recommend repeating the calculations from the non-spin-polarized ML_AB file with spin polarization enabled. You can extract the structures from the ML_AB file, loop over them, and then fill in the results obtained with the spin-polarized Hamiltonian. If you did this consistent setup it is fine to merge the two files.

Alternatively, you could select some structures from the ML_AB file that were calculated with spin polarization turned off. Then, for these structures, compute the energy, forces, and stress tensor with spin polarization turned on. If the results are the same with spin polarization on or off, it may be safe to merge the two ML_AB files without recalculating all the structures in the ML_AB file.

All the best Jonathan