MCPcopy Create free account
hub / github.com/SINGROUP/dscribe / soap_integration

Function soap_integration

tests/testutils.py:257–288  ·  view source on GitHub ↗

Used to numerically calculate the inner product coeffientes of SOAP with polynomial radial basis.

(system, centers, args, rbf_function)

Source from the content-addressed store, hash-verified

255
256
257def soap_integration(system, centers, args, rbf_function):
258 """Used to numerically calculate the inner product coeffientes of SOAP
259 with polynomial radial basis.
260 """
261 n_max = args["n_max"]
262 l_max = args["l_max"]
263
264 positions = system.get_positions()
265 atomic_numbers = system.get_atomic_numbers()
266 species_ordered = sorted(list(set(atomic_numbers)))
267 n_elems = len(species_ordered)
268
269 p_args = []
270 p_index = []
271 for i, ipos in enumerate(centers):
272 for iZ, Z in enumerate(species_ordered):
273 indices = np.argwhere(atomic_numbers == Z).flatten()
274 elem_pos = positions[indices]
275 # This centers the coordinate system at the soap center
276 elem_pos -= ipos
277 for n in range(n_max):
278 for l in range(l_max + 1):
279 for im, m in enumerate(range(-l, l + 1)):
280 p_args.append((args, n, l, m, elem_pos, rbf_function))
281 p_index.append((i, iZ, n, l, im))
282
283 results = Parallel(n_jobs=8, verbose=1)(delayed(integral)(*a) for a in p_args)
284
285 coeffs = np.zeros((len(centers), n_elems, n_max, l_max + 1, 2 * l_max + 1))
286 for index, value in zip(p_index, results):
287 coeffs[index] = value
288 return coeffs
289
290
291def integral(args, n, l, m, elem_pos, rbf_function):

Callers 2

coefficients_gtoFunction · 0.85
coefficients_polynomialFunction · 0.85

Calls 2

get_atomic_numbersMethod · 0.80
rangeFunction · 0.50

Tested by

no test coverage detected