xnn.common.models.pme.pme_weighted_sum#

xnn.common.models.pme.pme_weighted_sum(charges, pos, cell, mesh, order, weight)[source]#

sum_c sum_m w(m) |S_c(m)|^2 with the structure factors from the mesh.

The structure factors of every charge channel come from the transform of the spread charges, |S(m)|^2 = B(m) |F(Q)(m)|^2, so any reciprocal sum with per-vector weights w(m) (0 where a vector is excluded) runs on the mesh.

Parameters:
Returns:

The scalar sum.

Return type:

Tensor