xnn.ffnn.models.amoeba_kernels.pairs_backward#

xnn.ffnn.models.amoeba_kernels.pairs_backward(i_, k_, r_vec, scales, keep, keep_d, per, q, d, Q, params, scalars, polar, expol, switch_modes, g_node, g_field_d=None, g_field_p=None, g_du=None, g_expol=None, count=None, mixed=False, select=None, tangents=None)[source]#

Launch the backward kernel: the gradients of sum(g_node * e_node) + sum(g_field_d * field_d) + sum(g_field_p * field_p) + sum(g_du * du) + sum(g_expol * expol) with respect to the pair vectors (M, 3) and the per-atom charges (N,), dipoles (N, 3) and quadrupoles (N, 3, 3). The inputs are those of pairs_forward() (count, mixed, select and tangents included: with tangents the gradients’ derivatives along them come back as <key>_t, the Hessian-vector products of a second derivative); a missing incoming gradient counts as zero.

Parameters:
Return type:

dict