xnn.ffnn.models.amoeba_ewald.mesh_self_energy#

xnn.ffnn.models.amoeba_ewald.mesh_self_energy(q, d, Q, moments)[source]#

Per-atom spurious mesh self-interaction of the multipoles, S0 q^2 - 2 q Q:S2 + d.S2.d + Q:S4:Q, to be subtracted from the mesh energy in addition to the analytic self energy.

Parameters:
  • q (Tensor) – Multipoles (N,), (N, 3), (N, 3, 3) (Q may be None).

  • d (Tensor) – Multipoles (N,), (N, 3), (N, 3, 3) (Q may be None).

  • Q (Tensor) – Multipoles (N,), (N, 3), (N, 3, 3) (Q may be None).

  • moments (tuple of Tensor) – From mesh_self_moments() with kind="coulomb".

Returns:

(N,) in e^2 / Angstrom.

Return type:

Tensor