brucefan1983 / GPUMD

Graphics Processing Units Molecular Dynamics
https://gpumd.org/dev
GNU General Public License v3.0
454 stars 115 forks source link

typewise cutoffs #660

Closed brucefan1983 closed 3 months ago

brucefan1983 commented 3 months ago

pseudo code:

rc_radial[i][j] = min(rc_radial_global,  (covalent_radius[i] + covalent_radius[j]) * 2.5)
rc_angular[i][j] = min(rc_angular_global,  (covalent_radius[i] + covalent_radius[j]) * 2.0)
rc_zbl_outer[i][j] = min(rc_zbl_global,  (covalent_radius[i] + covalent_radius[j]) * 0.6)

Usage example for nep.in:

cutoff 8 6 # global NEP cutoff
zbl      2    # global ZBL cutoff
use_typewise_cutoff # enable this feature for NEP cutoff
use_typewise_cutoff_zbl # enable this feature for ZBL cutoff

For C-C we will have

rc_radial = 5
rc_angular = 4
rc_zbl_outer = 1.2

For O-H we will have

rc_radial = 3.1667
rc_angular = 2.5333
rc_zbl_outer = 0.76

Potential benefits compared to using large global cutoffs only:

elindgren commented 3 months ago

@brucefan1983 interesting! Can one still set a custom global cutoff? That might be nice in cases where one uses dummy species for e.g. excited states or similar in the NEP model, and want more control over the cutoffs. Maybe one can make these species-dependent cutoff the default if one does not specify a cutoff value? Edit: I saw that one toggles this feature on, so my comment is irrelevant :sweat_smile:

Also, would are these fixed values then? Would it make sense to have the cutoffs also trainable (like the c_ijkl coefficients?

brucefan1983 commented 3 months ago

@brucefan1983 interesting! ~Can one still set a custom global cutoff? That might be nice in cases where one uses dummy species for e.g. excited states or similar in the NEP model, and want more control over the cutoffs. Maybe one can make these species-dependent cutoff the default if one does not specify a cutoff value?~ Edit: I saw that one toggles this feature on, so my comment is irrelevant 😅

Also, would are these fixed values then? Would it make sense to have the cutoffs also trainable (like the c_ijkl coefficients?

1)The global cutoffs are still needed, as in the expressions below:

rc_radial[i][j] = min(rc_radial_global,  (covalent_radius[i] + covalent_radius[j]) * 2.5)
rc_angular[i][j] = min(rc_angular_global,  (covalent_radius[i] + covalent_radius[j]) * 2.0)
rc_zbl_outer[i][j] = min(rc_zbl_global,  (covalent_radius[i] + covalent_radius[j]) * 0.7)

2) It is not easy to make these cutoffs trainable, because this will make the memory allocation too dynamic and slow down GPU calculation and complicate the implementation. Even without this problem, training them would be not a good idea I think. The idea here is to put physics/chemistry in by hand and make the training more smooth, the model more stable, and more efficient.