xnn.dnn.featurizers.acsf#

Atom-centered symmetry functions of the HDNNP (Behler, J. Chem. Phys. 134, 074106, 2011).

Each element carries its own list of symmetry functions; every function has a central element, one neighbour element (radial) or an unordered pair of them (angular), its parameters and one of the declared cutoff functions. The descriptor of an atom is the vector of its element’s functions, optionally scaled with statistics of a training set. Usable on its own:

acsf = AtomCenteredSymmetryFunctions(
    species=[1, 8],
    cutoffs=[{"kind": "cosine", "r_cut": 6.0}],
    functions=[{"element": 1, "type": 2, "neighbors": [8], "eta": 0.5, "rs": 0.0},
               {"element": 8, "type": 3, "neighbors": [1, 1], "eta": 0.01,
                "lambda": 1.0, "zeta": 4.0}])
g = acsf(graph)          # (N, acsf.output_dim), zero-padded per element

Function types (r_ij, r_ik, r_jk the distances of a neighbour pair j < k of the central atom i, theta the angle at i, fc the function’s cutoff):

  • 1: sum_j fc(r_ij)^(2^(m-1)), m = 1 .. n_features (a coordination count).

  • 2: sum_j exp(-eta (r_ij - r_s)^2) fc(r_ij).

  • 3: 2^(1-zeta) sum_{j<k} (1 + lambda cos theta)^zeta exp(-eta (r_ij^2 + r_ik^2 + r_jk^2)) fc(r_ij) fc(r_ik) fc(r_jk), with 1 + lambda cos theta floored at zero.

  • 8: sum_{j<k} g(theta) fc(r_ij) fc(r_ik) fc(r_jk) with g the sum of four Gaussians exp(-eta (theta - t)^2) at t = theta_s, 360 - theta_s, -theta_s, 360 + theta_s (angles in degrees).

  • 9: type 3 without the r_jk terms (exp(-eta (r_ij^2 + r_ik^2)) fc(r_ij) fc(r_ik)).

The angular sums run over unordered neighbour pairs, so 2^(1-zeta) counts each pair twice as in the j != k double sum of the paper. These are the conventions of the RuNNer code; xnn.dnn.common.runner reads its input.nn and scaling.data files into this featurizer.

Cutoff functions (r_c the cutoff, r_i an inner radius, x = (r - r_i) / (r_c - r_i); every function is zero for r >= r_c):

  • cosine: 1 below r_i, else (cos(pi x) + 1) / 2.

  • tanh: tanh^3(1 - x) (tanh^3(1) below r_i).

  • tanh_approx: the same with tanh replaced by y (27 + y^2) / (27 + 9 y^2).

  • polynomial: (1 - r^2 / r_c^2)^n with integer n (exponent).

  • hard: 1.

Scaling (mode), with min, max and avg per element and function over the atoms of a training set (AtomCenteredSymmetryFunctions.fit_scaling()): "none" G; "scale" (G - min) / (max - min); "center" G - avg; "center_scale" (G - avg) / (max - min); "range" s_min + (s_max - s_min) (G - min) / (max - min). A function with max == min is not divided.

Module Attributes

CUTOFF_KINDS

cutoff function kinds and their RuNNer keywords

SCALING_MODES

scaling modes of the descriptor

Functions

cutoff_function(r, kind, r_cut[, r_inner, ...])

One cutoff function of acsf at distances r.

Classes

AtomCenteredSymmetryFunctions(species, ...)

Behler atom-centered symmetry functions, a separate list per element.