mir-group / flare

An open-source Python package for creating fast and accurate interatomic potentials.

Home Page:https://mir-group.github.io/flare

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple cutoffs

dft4py opened this issue · comments

Describe the bug
Only a single cutoff for twobody and threebody is used when multiple cutoffs are requested with whatever I try.

To Reproduce
I define multiple kernels in the Parameter helper and use twobody0, twobody1 etc to set multiple hyperparameters and cutoffs as found on the https://flare.readthedocs.io/en/latest/flare/utils/mask_helper.html page.

>>> pm = ParameterHelper(species=['C', 'H', 'O'],
...                      kernels={'twobody':[['*', '*'], ['O','O']],
...                      'threebody':[['*', '*', '*'],
...                          ['O','O', 'O']]},
...                      parameters={'twobody0':[1, 0.5, 1], 'twobody1':[2, 0.2, 2],
...                            'threebody0':[1, 0.5], 'threebody1':[2, 0.2],
...                            'cutoff_threebody':1},
...                      constraints={'twobody0':[False, True]})
>>> hm = pm.as_dict()
>>> kernels = hm['kernels']
>>> cutoffs = hm['cutoffs']

Expected behavior
I expected this to make multiple cutoffs for twobody and threebody

I can confirm that I saw the same as you. working on this now.

in fact, the code should be right. The twobody_cutoff_list contains multiple cutoffs. Please use the mask as suggested in the tutorial: https://flare.readthedocs.io/en/latest/flare/kernels/mc_sephyps.html

Is it possible for you to supply an example of this? I am still unable to get this to work. Say I have the following structure. How do I go about assigning one cutoff / hyperparameter set to C-C interactions and a different cutoff / hyperparameter to all other interactions? I cannot find a good example page to work from.

21
Properties=species:S:1:pos:R:3 energy:=T -192.981567559399=T gnorm:=T 0.000042964155=T xtb:=T 6.4.1=T (060166e)=T pbc="F F F"
O 17.84795456 20.22352591 25.23558327
O 17.37821963 25.39937452 20.33147262
O 18.86528389 25.60566185 21.98003719
O 14.57096186 19.94252503 21.52618341
O 14.56483923 21.52645763 19.93293773
O 19.10124663 22.06250625 25.37291770
C 17.59750519 21.90424435 23.56391328
C 17.48558059 23.66436558 21.92584130
C 16.04033856 21.75337074 21.73541977
C 18.17188722 21.29475783 24.79365130
C 17.99223833 24.97590223 21.44088833
C 14.96176963 21.00752082 21.00016543
C 16.59310158 21.21457332 22.88967318
C 16.48354878 22.97765237 21.24847502
C 18.04371632 23.12935113 23.08330181
H 16.24890593 20.26314485 23.26640451
H 16.04748550 23.38322438 20.34912173
H 18.82170839 23.67525621 23.59512108
H 19.44639268 21.62578366 26.16767677
H 17.74448477 26.25367645 20.05301528
H 13.97096186 19.24252503 20.62618341