xnn.dnn.fast.acsf_cpu#

Optional CPU kernels of the HDNNP symmetry functions (C++ and OpenMP, off by default).

RuNNer evaluates the symmetry functions in loops over the atoms, their neighbors and their neighbor pairs, without storing anything per triplet. These kernels do the same: one OpenMP loop over the centers, each walking its own edges (radial functions) and the pairs of its edges inside the angular cutoff (angular functions), evaluating only the functions of its element and the pair’s neighbor species (the lane tables of xnn.dnn.fast.acsf_kernels.tables()) and summing them into its own row. The derivative with respect to the edge vectors (the forces) walks the same loops and adds into the center’s own edges, so no two threads write the same memory. Types 1, 2, 3 and 9 with at most two cosine or tanh cutoffs, as the GPU kernels; the derivative is not differentiable again, so the kernels serve evaluation.

They are turned on and built through xnn.common.models.cpu_extension.

Functions

available()

Whether the C++ kernels build here (checked once).

symmetry_functions(vec, edge_index, sp, n, ...)

The raw symmetry functions (n, d) of a graph on the C++ kernels (sp the atoms' species indices; tables from _Tables).

Classes

ACSFCpuFunction(*args, **kwargs)

The symmetry functions (N, D) from the edge vectors in center order (ptr the centers' edge ranges, sn each edge's neighbor species, sp the atoms' species); the gradient is not differentiable again.