xnn.common.models.electrostatics.ewald_reciprocal#
- xnn.common.models.electrostatics.ewald_reciprocal(charges, pos, cell, alpha, k_cutoff, budget=100000000)[source]#
Per-atom reciprocal-space energies
q_i phi_i / 2of one periodic structure.phi_i = (4 pi / V) sum_{k != 0} exp(-k^2 / 4 alpha^2) / k^2 [cos(k r_i) Re S(k) + sin(k r_i) Im S(k)]with the structure factorS(k) = sum_j q_j exp(i k r_j); the sum over the atoms is(2 pi / V) sum_k ... |S(k)|^2. Phases and sums are formed in float64, in blocks of lattice vectors when the phase table exceedsRECIPROCAL_BUDGET.- Parameters:
charges (Tensor) – Charges
(N,).pos (Tensor) – Positions
(N, 3).cell (Tensor) – Lattice vectors as rows
(3, 3).alpha (float) – Splitting parameter.
k_cutoff (float) – Spherical reciprocal cutoff.
budget (int, optional) – Entries of the phase table formed at once, by default
RECIPROCAL_BUDGET.
- Returns:
(N,)ine^2 / Angstrom, float64.- Return type:
Tensor