xnn.ffnn.models.amoeba_valence#

The valence terms of AMOEBA and HIPPO on fused kernels: bonds, angles (in-plane included), stretch-bends, Urey-Bradley terms, out-of-plane bends and torsions of a step plan, from its bonded vectors.

One launch forms every term’s energy and adds it to the per-atom rows of its term; one launch forms the gradient of a weighted sum of those rows with respect to every bonded vector. Each vector belongs to one term, so the gradient is stored, not added. The arithmetic is float64 in either precision of the model, with the inexact constants from a float64 table (a Triton float literal is float32). The forms are those of _valence(); the kernels serve evaluations with first derivatives.

Module Attributes

TERMS

The rows of the output, in the order of the valence terms of the model.

SCALARS

The entries of the float64 table of constants.

Functions

energies_and_gradient(vec, table)

The per-atom rows (8, N) of the valence terms, the gradient of their sum with respect to the stacked bonded vectors vec (M, 3) and the sum of every vector times its gradient (3, 3) in float64 (no autograd).

Classes

ValenceTable(n_atoms, kinds, scalars, ...)

What the valence kernels read for the terms of a step plan: per kind, the count, the first row of every vector the kind uses in the plan's stacked bonded vectors, the atom (or atoms) its energy goes to and its parameters, plus the float64 constants and the switches of the forms.

ValenceTerms(*args, **kwargs)

The per-atom rows (8, N) of the valence terms (TERMS; the pi-torsion and torsion-torsion rows stay zero) from the stacked bonded vectors vec (M, 3) of a ValenceTable, differentiable once with respect to the vectors.