SSCHAcode / python-sscha

The python implementation of the Stochastic Self-Consistent Harmonic Approximation (SSCHA).
GNU General Public License v3.0
55 stars 21 forks source link

Added MTP support in Ensemble.py and Relax.py #159

Closed Kurufinve closed 8 months ago

Kurufinve commented 11 months ago

Dear SSCHA developers, I have added several lines of code at the end of files Ensemble.py and Relax.py. In these lines of code two new classes Ensemble_MTP and SSCHA_MTP along with several helping functions are added. Ensemble_MTP and SSCHA_MTP classes were inherited from Ensemble and SSCHA classes, respectively, in order to add minor changes into the get_energy_forces method of Ensemble class and relax and vc_relax methods of SSCHA class without modifying these classes. The functionality of the new classes and functions have been partially tested but further improvements (or refactoring) are possible.

mesonepigreco commented 11 months ago

Hi Daniil, Thanks a lot for the pull request. Could you briefly explain how the new implementation works and provide some examples? Does it also train the MTP, or does it use a model already trained?

Kurufinve commented 11 months ago

Yes, of course! This implementation works through the ase lammpsrun calculator, so the lammps with mtp support is required to be installed in the system. Briefly, within this implementation one can use trained mtp, train completely new mtp or retrain already pretrained mtp, and calculate energies, forces, and stresses in the ensemble with this mtp within SSCHA relaxation. All is designed to do these things automatically. I will provide documentation and examples a bit later, after more thorough testing. Also, a parallelization across the ab initio calculations for (re)training mtp is planned to be implemented in future.

Kurufinve commented 11 months ago

Maybe it is better to add the new classes and functions to the new .py module instead of adding them at the end of Ensemble.py and Relax.py modules?

mesonepigreco commented 10 months ago

Maybe it is better to add the new classes and functions to the new .py module instead of adding them at the end of Ensemble.py and Relax.py modules?

Hi, sorry for my late reply, I was very busy last month. Yes it would be better to have a separate module (maybe called mtp.py or something similar)

I'm looking forward to hear news :)

All the best, Lorenzo