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)|^2with 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 weightsw(m)(0where a vector is excluded) runs on the mesh.- Parameters:
charges (Tensor) –
(N,)or(N, C).pos (Tensor) – As in
spread_charges().cell (Tensor) – As in
spread_charges().mesh (List[int]) – As in
spread_charges().order (int) – As in
spread_charges().weight (Tensor) –
w(m)over the mesh in FFT order,(K_1, K_2, K_3).
- Returns:
The scalar sum.
- Return type:
Tensor