openkim / kliff

KIM-based Learning-Integrated Fitting Framework for interatomic potentials.
https://kliff.readthedocs.io
GNU Lesser General Public License v2.1
34 stars 20 forks source link

Two elemental species in Lennard-Jones potential #111

Closed lnnbig closed 1 year ago

lnnbig commented 1 year ago

Hi Mingjian,

I have a dataset for silica SiO2, with two species “Si” and “O”. Could you please give me a help about how to modify the LJ template which is for a single Si species at https://kliff.readthedocs.io/en/latest/auto_examples/example_lennard_jones.html?

Many thanks!

mjwen commented 1 year ago

The original implementation of LJ does not support multiple species -- but I just updated it to allow multiple species. ForSi-O systems, you need to modify two lines in the example:

model = LennardJones(species = ['Si', 'O'])

and

model.set_opt_params(sigma=[["default"], ["default"], ["default"]], epsilon=[["default"], ["default"],["default"]])

we need to set 3 "default" for sigma and epsilon now because for a binary Si-O system, the model assumes interactions between Si-Si, Si-O, and O-O. You can change the "default" to other numerical values as the initial guess.

See more of the model here: https://github.com/openkim/kliff/blob/68db8956f2b38bc0846ff37cf4b72832278066f5/kliff/models/lennard_jones.py#L167

Note, the model supporting multiple species currently only exists in the master branch, not on PyPI. So you will need to reinstall kliff from source. See https://kliff.readthedocs.io/en/latest/installation.html