@@ -131,9 +131,80 @@ def generate_eigenvalue_coulomb_matrix(self, size = 23):
131
131
self .representation = generate_eigenvalue_coulomb_matrix (
132
132
self .nuclear_charges , self .coordinates , size = size )
133
133
134
- def generate_atomic_coulomb_matrix (self , size = 23 , sorting = "row-norm" ):
134
+ def generate_atomic_coulomb_matrix (self , size = 23 , sorting = "row-norm" ,
135
+ central_cutoff = 1e6 , central_decay = - 1 , interaction_cutoff = 1e6 , interaction_decay = - 1 ):
136
+ """ Creates a Coulomb Matrix representation of the local environment of a central atom.
137
+ For each central atom :math:`k`, a matrix :math:`M` is constructed with elements
138
+
139
+ .. math::
140
+
141
+ M_{ij}(k) =
142
+ \\ begin{cases}
143
+ \\ tfrac{1}{2} Z_{i}^{2.4} \\ cdot f_{ik}^2 & \\ text{if } i = j \\ \\
144
+ \\ frac{Z_{i}Z_{j}}{\\ | {\\ bf R}_{i} - {\\ bf R}_{j}\\ |} \\ cdot f_{ik}f_{jk}f_{ij} & \\ text{if } i \\ neq j
145
+ \\ end{cases},
146
+
147
+ where :math:`i`, :math:`j` and :math:`k` are atom indices, :math:`Z` is nuclear charge and
148
+ :math:`\\ bf R` is the coordinate in euclidean space.
149
+
150
+ :math:`f_{ij}` is a function that masks long range effects:
151
+
152
+ .. math::
153
+
154
+ f_{ij} =
155
+ \\ begin{cases}
156
+ 1 & \\ text{if } \\ |{\\ bf R}_{i} - {\\ bf R}_{j} \\ | \\ leq r - \Delta r \\ \\
157
+ \\ tfrac{1}{2} \\ big(1 + \\ cos\\ big(\\ pi \\ tfrac{\\ |{\\ bf R}_{i} - {\\ bf R}_{j} \\ |
158
+ - r + \Delta r}{\Delta r} \\ big)\\ big)
159
+ & \\ text{if } r - \Delta r < \\ |{\\ bf R}_{i} - {\\ bf R}_{j} \\ | \\ leq r - \Delta r \\ \\
160
+ 0 & \\ text{if } \\ |{\\ bf R}_{i} - {\\ bf R}_{j} \\ | > r
161
+ \\ end{cases},
162
+
163
+ where the parameters ``central_cutoff`` and ``central_decay`` corresponds to the variables
164
+ :math:`r` and :math:`\Delta r` respectively for interactions involving the central atom,
165
+ and ``interaction_cutoff`` and ``interaction_decay`` corresponds to the variables
166
+ :math:`r` and :math:`\Delta r` respectively for interactions not involving the central atom.
167
+
168
+ if ``sorting = 'row-norm'``, the atom indices are ordered such that
169
+
170
+ :math:`\\ sum_j M_{1j}(k)^2 \\ geq \\ sum_j M_{2j}(k)^2 \\ geq ... \\ geq \\ sum_j M_{nj}(k)^2`
171
+
172
+ if ``sorting = 'distance'``, the atom indices are ordered such that
173
+
174
+ .. math::
175
+
176
+ \\ |{\\ bf R}_{1} - {\\ bf R}_{k}\\ | \\ leq \\ |{\\ bf R}_{2} - {\\ bf R}_{k}\\ |
177
+ \\ leq ... \\ leq \\ |{\\ bf R}_{n} - {\\ bf R}_{k}\\ |
178
+
179
+ The upper triangular of M, including the diagonal, is concatenated to a 1D
180
+ vector representation.
181
+ The representation is calculated using an OpenMP parallel Fortran routine.
182
+
183
+ :param size: The size of the largest molecule supported by the representation
184
+ :type size: integer
185
+ :param sorting: How the atom indices are sorted ('row-norm', 'distance')
186
+ :type sorting: string
187
+ :param central_cutoff: The distance from the central atom, where the coulomb interaction
188
+ element will be zero
189
+ :type central_cutoff: float
190
+ :param central_decay: The distance over which the the coulomb interaction decays from full to none
191
+ :type central_decay: float
192
+ :param interaction_cutoff: The distance between two non-central atom, where the coulomb interaction
193
+ element will be zero
194
+ :type interaction_cutoff: float
195
+ :param interaction_decay: The distance over which the the coulomb interaction decays from full to none
196
+ :type interaction_decay: float
197
+
198
+
199
+ :return: nD representation - shape (:math:`N_{atoms}`, size(size+1)/2)
200
+ :rtype: numpy array
201
+ """
202
+
203
+
135
204
self .representation = generate_atomic_coulomb_matrix (
136
- self .nuclear_charges , self .coordinates , size = size , sorting = sorting )
205
+ self .nuclear_charges , self .coordinates , size = size ,
206
+ sorting = sorting , central_cutoff = central_cutoff , central_decay = central_decay ,
207
+ interaction_cutoff = interaction_cutoff , interaction_decay = interaction_decay )
137
208
138
209
def generate_bob (self , asize = {"O" :3 , "C" :7 , "N" :3 , "H" :16 , "S" :1 }):
139
210
""" Creates a Bag of Bonds (BOB) representation of a molecule.
0 commit comments