ACEsuit / mace

MACE - Fast and accurate machine learning interatomic potentials with higher order equivariant message passing.
Other
413 stars 157 forks source link

fix atom e0s being subtracted twice in mace calculator #425

Closed RokasEl closed 1 month ago

RokasEl commented 1 month ago

Fixed a bug when using the MACE calculator to calculate node interaction energies.

Previously, the isolated atom energy was being subtracted twice. Note, I had to modify the fitting_configs fixture to add E0s to the configs there, otherwise this bug was not being caught even with the old implementation.

Also, I added an additional helper function to the calculator to batchify the atoms since the exact same code was used in two places within the calculator.

Also, changed the name of the function _prepare_batch to _clone_batch to better reflect what it is doing.

This should also resolve the following discussion: https://github.com/ACEsuit/mace/discussions/417