xnn.ffnn.models.classical_kernels#
Fused Triton kernels of the nonbonded pair terms of the classical force fields (OPLS, AMBER, CHARMM, DREIDING).
One program handles a block of pairs of a half neighbor list: the squared distance, the van der Waals energy from a table per pair of atom types, the Coulomb energy, the quintic switch, the exclusion weight and the cutoff, written as the per-atom halves of both energies with atomic adds into a float64 buffer. The backward kernel forms the gradient with respect to the pair vectors from the incoming per-atom gradients (no atomic adds), so forces and stress follow through the pair vectors’ own graph. The forms are those of the eager functions of the models:
FORM 0(12-6):A (x^2 - B x)withx = (R^2 / (r^2 + tiny))^3: OPLS withA = 4 epsilon,B = 1andR = sigma; AMBER, CHARMM and DREIDING withA = epsilon,B = 2andRthe minimum-energy distance.FORM 1(exponential-6):a exp(-c r) - b / (r^6 + tiny)withr = sqrt(r^2 + tiny)(DREIDING X6).
The Coulomb term is k q_i q_k / r; the switch 1 - x^3 (10 - 15 x + 6 x^2) over
[cutoff - width, cutoff] multiplies both terms.
Imported only on CUDA devices, so that triton is needed only there.
Functions
|
Whether the kernels can run (a CUDA device and Triton). |
|
The per-atom energies |
|
Whether each pair |
|
The per-atom van der Waals and Coulomb energies |
Classes
|
The per-atom energies |
|
The van der Waals and Coulomb energies per atom |