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: 1. Real-space sum (short-range): rapidly decaying interactions computed directly between particles. 2. 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 :math:`q_i` and :math:`q_j` separated by distance :math:`r_{ij}` is given by: .. math:: E_{ij}^\text{real} = q_i q_j \frac{\text{erfc}(\alpha r_{ij})}{r_{ij}} where :math:`\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: .. math:: E_\text{real} = \sum_{i