13
13
TT_damping_qq_c6_kernel ,
14
14
generate_pairwise_interaction ,
15
15
slater_disp_damping_kernel ,
16
- slater_sr_kernel ,
16
+ slater_sr_kernel , ## no Hard Core Potential
17
+ slater_sr_hc_kernel , ## added Hard Core Potential
17
18
TT_damping_qq_kernel ,
18
19
)
19
20
from ..admp .pme import ADMPPmeForce
@@ -759,20 +760,21 @@ def createPotential(
759
760
760
761
topdata ._meta [self .name + "_map_atomtype" ] = map_atomtype
761
762
762
- pot_fn_sr = generate_pairwise_interaction (slater_sr_kernel , static_args = {})
763
+ pot_fn_sr = generate_pairwise_interaction (slater_sr_hc_kernel , static_args = {})
764
+ #slater_ex_sr_kernel: added Hard Core Potential
763
765
764
766
has_aux = False
765
767
if "has_aux" in kwargs and kwargs ["has_aux" ]:
766
768
has_aux = True
767
769
768
- def potential_fn (positions , box , pairs , params , aux = None ):
770
+ def potential_fn (positions , box , pairs , params , aux = None ):
769
771
positions = positions * 10
770
772
box = box * 10
771
773
params = params [self .name ]
772
774
a_list = params ["A" ][map_atomtype ]
773
775
b_list = params ["B" ][map_atomtype ] / 10 # nm^-1 to A^-1
774
776
775
- energy = pot_fn_sr (positions , box , pairs , self .mScales , a_list , b_list )
777
+ energy = pot_fn_sr (positions , box , pairs , self .mScales , a_list , b_list )
776
778
if has_aux :
777
779
return energy , aux
778
780
else :
@@ -790,6 +792,7 @@ def getJaxPotential(self):
790
792
_DMFFGenerators ["SlaterExForce" ] = SlaterExGenerator
791
793
792
794
795
+
793
796
# Here are all the short range "charge penetration" terms
794
797
# They all have the exchange form with minus sign
795
798
class SlaterSrEsGenerator (SlaterExGenerator ):
@@ -798,7 +801,6 @@ def __init__(self, ffinfo: dict, paramset: ParamSet, default_name=None):
798
801
super ().__init__ (ffinfo , paramset , default_name = "SlaterSrEsForce" )
799
802
else :
800
803
super ().__init__ (ffinfo , paramset , default_name = default_name )
801
-
802
804
def createPotential (
803
805
self , topdata : DMFFTopology , nonbondedMethod , nonbondedCutoff , ** kwargs
804
806
):
@@ -812,14 +814,14 @@ def createPotential(
812
814
813
815
topdata ._meta [self .name + "_map_atomtype" ] = map_atomtype
814
816
815
- pot_fn_sr = generate_pairwise_interaction (slater_sr_kernel ,
816
- static_args = {})
817
+ pot_fn_sr = generate_pairwise_interaction (slater_sr_kernel , static_args = {})
818
+ ## slater_sr_others_kernel: no Hard Core Potential
817
819
818
820
has_aux = False
819
821
if "has_aux" in kwargs and kwargs ["has_aux" ]:
820
822
has_aux = True
821
823
822
- def potential_fn (positions , box , pairs , params , aux = None ):
824
+ def potential_fn (positions , box , pairs , params , aux = None ):
823
825
positions = positions * 10
824
826
box = box * 10
825
827
params = params [self .name ]
@@ -934,10 +936,7 @@ def __init__(self, ffinfo: dict, paramset: ParamSet):
934
936
for node in self .ffinfo ["Forces" ][self .name ]["node" ]
935
937
if node ["name" ] in ["Multipole" , "Atom" ]
936
938
]
937
- c0 , dX , dY , dZ , qXX , qYY , qZZ , qXY , qXZ , qYZ , oXXX , oXXY , oXYY , oYYY , oXXZ , oXYZ , oYYZ , oXZZ , oYZZ , oZZZ = (
938
- [],
939
- [],
940
- [],
939
+ c0 , dX , dY , dZ , qXX , qYY , qZZ , qXY , qXZ , qYZ = (
941
940
[],
942
941
[],
943
942
[],
@@ -948,13 +947,6 @@ def __init__(self, ffinfo: dict, paramset: ParamSet):
948
947
[],
949
948
[],
950
949
[],
951
- [],
952
- [],
953
- [],
954
- [],
955
- [],
956
- [],
957
- []
958
950
)
959
951
kxs , kys , kzs = [], [], []
960
952
multipole_masks = []
@@ -997,29 +989,6 @@ def __init__(self, ffinfo: dict, paramset: ParamSet):
997
989
qXY .append (0.0 )
998
990
qXZ .append (0.0 )
999
991
qYZ .append (0.0 )
1000
- if self .lmax >= 3 :
1001
- oXXX .append (float (attribs ["oXXX" ]))
1002
- oXXY .append (float (attribs ["oXXY" ]))
1003
- oXYY .append (float (attribs ["oXYY" ]))
1004
- oYYY .append (float (attribs ["oYYY" ]))
1005
- oXXZ .append (float (attribs ["oXXZ" ]))
1006
- oXYZ .append (float (attribs ["oXYZ" ]))
1007
- oYYZ .append (float (attribs ["oYYZ" ]))
1008
- oXZZ .append (float (attribs ["oXZZ" ]))
1009
- oYZZ .append (float (attribs ["oYZZ" ]))
1010
- oZZZ .append (float (attribs ["oZZZ" ]))
1011
- else :
1012
- oXXX .append (0.0 )
1013
- oXXY .append (0.0 )
1014
- oXYY .append (0.0 )
1015
- oYYY .append (0.0 )
1016
- oXXZ .append (0.0 )
1017
- oXYZ .append (0.0 )
1018
- oYYZ .append (0.0 )
1019
- oXZZ .append (0.0 )
1020
- oYZZ .append (0.0 )
1021
- oZZZ .append (0.0 )
1022
-
1023
992
mask = 1.0
1024
993
if "mask" in attribs and attribs ["mask" ].upper () == "TRUE" :
1025
994
mask = 0.0
@@ -1077,8 +1046,6 @@ def __init__(self, ffinfo: dict, paramset: ParamSet):
1077
1046
n_mtps = 4
1078
1047
elif self .lmax == 2 :
1079
1048
n_mtps = 10
1080
- elif self .lmax == 3 :
1081
- n_mtps = 20
1082
1049
Q = np .zeros ((n_atoms , n_mtps ))
1083
1050
1084
1051
# TDDO: unit conversion
@@ -1096,19 +1063,6 @@ def __init__(self, ffinfo: dict, paramset: ParamSet):
1096
1063
Q [:, 8 ] = qXZ
1097
1064
Q [:, 9 ] = qYZ
1098
1065
Q [:, 4 :10 ] *= 300
1099
- if self .lmax >= 3 :
1100
- Q [:, 10 ] = oXXX
1101
- Q [:, 11 ] = oXXY
1102
- Q [:, 12 ] = oXYY
1103
- Q [:, 13 ] = oYYY
1104
- Q [:, 14 ] = oXXZ
1105
- Q [:, 15 ] = oXYZ
1106
- Q [:, 16 ] = oYYZ
1107
- Q [:, 17 ] = oXZZ
1108
- Q [:, 18 ] = oYZZ
1109
- Q [:, 19 ] = oZZZ
1110
- # TO DO: To be decided
1111
- Q [:, 10 :20 ] *= 15000
1112
1066
1113
1067
# add all differentiable params to self.params
1114
1068
Q_local = convert_cart2harm (jnp .array (Q ), self .lmax )
@@ -1138,18 +1092,6 @@ def overwrite(self, paramset):
1138
1092
node ["attrib" ]["qXY" ] = Q_global [n_multipole , 7 ] / 300.0
1139
1093
node ["attrib" ]["qXZ" ] = Q_global [n_multipole , 8 ] / 300.0
1140
1094
node ["attrib" ]["qYZ" ] = Q_global [n_multipole , 9 ] / 300.0
1141
- if self .lmax >= 3 :
1142
- node ["attrib" ]["oXXX" ] = Q_global [n_multipole , 10 ] / 15000.0
1143
- node ["attrib" ]["oXXY" ] = Q_global [n_multipole , 11 ] / 15000.0
1144
- node ["attrib" ]["oXYY" ] = Q_global [n_multipole , 12 ] / 15000.0
1145
- node ["attrib" ]["oYYY" ] = Q_global [n_multipole , 13 ] / 15000.0
1146
- node ["attrib" ]["oXXZ" ] = Q_global [n_multipole , 14 ] / 15000.0
1147
- node ["attrib" ]["oXYZ" ] = Q_global [n_multipole , 15 ] / 15000.0
1148
- node ["attrib" ]["oYYZ" ] = Q_global [n_multipole , 16 ] / 15000.0
1149
- node ["attrib" ]["oXZZ" ] = Q_global [n_multipole , 17 ] / 15000.0
1150
- node ["attrib" ]["oYZZ" ] = Q_global [n_multipole , 18 ] / 15000.0
1151
- node ["attrib" ]["oZZZ" ] = Q_global [n_multipole , 19 ] / 15000.0
1152
-
1153
1095
if q_local_masks [n_multipole ] < 0.999 :
1154
1096
node ["mask" ] = "true"
1155
1097
n_multipole += 1
0 commit comments