# Ewald sum

The Ewald sum technique [1] was originally developed by Paul Ewald to evaluate the Madelung constant [2]. It is now widely used in order to simulate systems with long range interactions (typically, electrostatic interactions). Its aim is the computation of the interaction of a system with periodic boundary conditions with all its replicas. This is accomplished by the introduction of fictitious "charge clouds" that shield the charges. The interaction is then divided into a shielded part, which may be evaluated by the usual means, and a part that cancels the introduction of the clouds, which is evaluated in Fourier space.

## Derivation

In a periodic system one wishes to evaluate the internal energy ${\displaystyle U}$ (Eq. 1.1 [3]):

${\displaystyle U={\frac {1}{2}}{\sum _{\mathbf {n} }}^{'}\left[\sum _{i=1}^{N}\sum _{j=1}^{N}\phi \left({\mathbf {r} }_{ij}+L{\mathbf {n} },{\mathbf {\Omega } _{i}},{\mathbf {\Omega } _{j}}\right)\right]}$

where one sums over all the simple cubic lattice points ${\displaystyle {\mathbf {n} }=(l,m,n)}$. The prime on the first summation indicates that if ${\displaystyle i=j}$ then the ${\displaystyle {\mathbf {n} }=0}$ term is omitted. ${\displaystyle L}$ is the length of the side of the cubic simulation box, ${\displaystyle N}$ is the number of particles, and ${\displaystyle {\mathbf {\Omega } }}$ represent the Euler angles.

This internal energy is partitioned into four contributions:

${\displaystyle U_{\mathrm {t} otal}=U_{\mathrm {r} eal~space}+U_{\mathrm {r} eciprocal~space}+U_{\mathrm {s} elf~energy}+U_{\mathrm {s} urface}}$

#### Real-space term

The real space contribution to the electrostatic energy is given by [4][5] (Eq. 7a and 7b [6]):

${\displaystyle {\widehat {\frac {1}{r}}}={\frac {\mathrm {erfc} (\alpha r)}{r}}}$

where ${\displaystyle {\mathrm {erfc} }()}$ is the complementary error function, and ${\displaystyle \alpha }$ is the Ewald screening parameter. Also,

${\displaystyle {\widehat {\frac {1}{r^{2n+1}}}}=r^{-2}\left[{\widehat {\frac {1}{r^{2n-1}}}}+{\frac {(2\alpha ^{2})^{n}}{{\sqrt {\pi }}\alpha (2n-1)!!}}\exp(-\alpha ^{2}r^{2})\right]}$

## Particle mesh

#### Smooth particle mesh (SPME)

SPME[10]. Optimisation [11] [12].