libAtoms / matscipy

Materials science with Python at the atomic-scale
http://libatoms.github.io/matscipy/
GNU Lesser General Public License v2.1
188 stars 55 forks source link

Splitting BKS pair potential from Ewald summation #92

Closed prs513rosewood closed 2 years ago

prs513rosewood commented 2 years ago

This PR splits Ewald summation from the BKS pair interaction. It makes Ewald inherit from PairPotential so the short-range Coulomb can use the pair code, and adds the kspace contributions.

Arbitrary pair interactions can now be used with the Ewald summation thanks to ASE's SumCalculator. Getting properties like the hessian cannot be done with get_hessian if SumCalculator is used, but instead with the get_property method that subclasses of ase.Calculator should implement. For example, getting the hessian can now be done with atoms.calc.get_property('hessian').