xnn.ffnn.models.amoeba_ewald.mesh_self_moments#

xnn.ffnn.models.amoeba_ewald.mesh_self_moments(cell, alpha, mesh, order, kind, max_rank=4)[source]#

Moments of the spurious, position-averaged mesh self-interaction.

A multipole spread on the mesh interacts with itself through the mesh sum; the spline interpolation makes that interaction differ from the exact reciprocal-space self term by an amount that, averaged over the position of the atom within a mesh cell, is S0 q^2 - 2 q Q:S2 + d.S2.d + Q:S4:Q with the moments returned here (the alias sums of the squared spline transform minus the exact term). They vanish as the mesh is refined. Subtracting the spurious part removes the mean discretisation error of the self-interaction from the energy, the field and the dispersion sum (Ballenegger, Cerda and Holm, Comput. Phys. Commun. 182, 1919, 2011).

Parameters:
  • cell (Tensor) – Lattice vectors as rows (3, 3).

  • alpha (float) – Ewald coefficient.

  • mesh (list of int) – Mesh dimensions.

  • order (int) – B-spline order.

  • kind (str) – "coulomb" or "r6" (dispersion, scalar moment only).

  • max_rank (int, optional) – Highest moment wanted: 0 (charges), 2 (dipoles) or 4 (quadrupoles).

Returns:

S0 (scalar), S2 (3, 3) and S4 (3, 3, 3, 3) in Cartesian components (None beyond max_rank), in the units of the energy per squared multipole.

Return type:

tuple of Tensor