Skip to content

Allow for backwards compatibility in filters when `free_energy` is not present

Andrew Rosen requested to merge rosen-force-consistent into master

Checklist

This closes #1376 (closed) to address the general problem where third-party calculators often do not have free_energy implemented as a property, either because it does not make physical sense for that type of simulation or because it was not deemed viable or important. The concept of a "force-consistent energy" is only applicable to a subtype of simulations supported by ASE, and enforcing its presence on all calculators is problematic. There are additional complications associated with the chosen name; for instance, the concept of a "free_energy" is not the same as a force consistent energy in molecular DFT codes.

For these reasons, we should not rely on the fact that all calculators have a free_energy property. However, the filters class requires it. This MR falls back to regular energy if free_energy is not present.

Related: https://github.com/tblite/tblite/issues/137. There are a whole suite of third-party calculators that break due to the current behavior.

Edited by Andrew Rosen

Merge request reports