xnn.krnn.models.sgdml#

Gradient-domain machine learning (GDML) and its symmetrized form (sGDML).

A global force field for one molecule in a fixed atom order (Chmiela et al., Sci. Adv. 3, e1603015, 2017; Nat. Commun. 9, 3887, 2018; Comput. Phys. Commun. 240, 38, 2019). The molecule is described by its inverse interatomic distances x; the energy is a kernel expansion whose gradient interpolates the training forces:

E(x) = c + s sum_j sum_q [ g(|D|) (D . P_q w_j) + k(|D|) a_j ], D = x - P_q x_j

with k a Matern kernel, g = -k'/r, the training descriptors x_j, their weights w_j = J_j alpha_j (the force coefficients through the descriptor Jacobian), the optional energy coefficients a_j, the atom permutations P_q of the molecule’s symmetries (sGDML; the identity alone is GDML), the scale s of the training forces and the integration constant c. Forces are the negative gradient of this energy, so the model is conservative.

The coefficients cancel to many digits, so the model keeps them, and evaluates the kernel expansion, in float64 whatever its dtype: a float32 model rounds only its inputs and outputs.

Module Attributes

CHUNK

elements of the (B, M, Q, D) differences formed at once on a CPU, per thread (2 MB in float64: the passes over them stay in the cache)

CHUNK_GPU

the same on a GPU (128 MB in float64), where small chunks leave the device waiting on launches

Functions

kernel_energy(x, xp, wp, ec, kernel[, gradient])

sum_{j,q} g(r) (D.w) + k(r) a_j for descriptors x (B, D) (paper eq.

kernel_energy_gradient(x, xp, wp, ec, kernel)

(B, D) gradient of kernel_energy() by the descriptors (paper eq.

Classes

GDML(species[, sigma, kernel_order, ...])

Gradient-domain machine learning without symmetries (Chmiela et al., 2017).

SGDML(species[, sigma, kernel_order, ...])

Symmetrized gradient-domain machine-learning force field.