Ewald summation¶
Overview¶
This section describes the Ewald summation implementation used for computing long-range electrostatic interactions in periodic systems. The code is organized into multiple Fortran modules that handle both real-space and reciprocal-space contributions.
The Ewald method splits the Coulomb potential into two components:
Real-space sum (short-range): rapidly decaying interactions computed directly between particles.
Reciprocal-space sum (long-range): Fourier-space computation using precomputed structure factors and k-vectors.
A self-interaction correction ensures that each particle does not interact with its own periodic images.
Short range¶
The short-range (real-space) contribution for a pair of charges \(q_i\) and \(q_j\) separated by distance \(r_{ij}\) is given by:
where \(\alpha\) is the Ewald screening parameter.
The total real-space energy for a single molecule or residue is obtained by summing over all unique atom pairs within the molecule:
Self-interactions (when \(i=j\)) are excluded to prevent unrealistic contributions.
Long-range¶
The long-range (reciprocal-space) contribution is computed in Fourier space. For a reciprocal lattice vector \(\mathbf{k}\) with components \(k_x, k_y, k_z\), the structure factor amplitude is:
The reciprocal-space energy is then computed as:
where
\(W(\mathbf{k}) = \frac{\exp(-|\mathbf{k}|^2 / 4\alpha^2)}{|\mathbf{k}|^2}\) is the precomputed reciprocal-space weight,
\(f_\text{sym}(\mathbf{k})\) accounts for symmetry between \(\mathbf{k}\) and \(-\mathbf{k}\).
All structure factors \(A(\mathbf{k})\) and weights \(W(\mathbf{k})\) are precomputed and stored, allowing efficient energy evaluation without repeatedly looping over all atoms for each k-vector.
Self-interaction correction¶
Each charge interacts with its periodic images, including itself. This unrealistic self-energy is subtracted:
Total energy¶
The total Coulomb energy is the sum of the real-space, reciprocal-space, and self-interaction terms: