xnn.common.models.dispersion_fast.cpu.d4_direct#

xnn.common.models.dispersion_fast.cpu.d4_direct(term, data)[source]#

D4 of a batch (molecules and cells of the dense EEQ regime) on the C++ kernels with its forces and stress: the energies per atom and per structure (B, 4) (total, two-body, three-body, tail = 0; eV), the D4 coordination numbers, the EEQ charges and the dynamic polarizabilities (N, 23) in the model dtype, the forces (N, 3) (eV / A) and dE / d(strain) (B, 3, 3) (eV) in the dtype of the positions. A cell’s EEQ matrix is the reference’s Ewald sum; its derivative in the positions and the cell, contracted with the adjoint vector and the charges the kernels return, is the one autograd pass, over that matrix alone.

Return type:

Tuple[Tensor, …]