(4.10) |

where

(4.11) | |||

(4.12) |

is the error function and the complementary one. Notice that the long range part has several important properties:

On the other hand the short range potential decays very fast in real space
and the sum converges very quickly. Since
in Eq.(4.9)
depends linearly on the potential, we can easily decompose two contributions:
a short-range and a long range one. Then the latter can be more easily
evaluated in Fourier space:

where is the volume of the unit cell and the sum over the momenta are on the discrete values allowed by the periodicity . In the latter expression we have used Eq.(4.15) and the fact that the charge neutrality implies that the term can be omitted in the sum for any . In this way the limit can be found consistently also for long range potentials by replacing expression (4.14) in the corresponding Fourier transform for . For a non neutral system instead the Ewald sum is divergent as expected.

For Coulomb interaction the potential energy becomes:

In the potential energy 4.16
the parameters
determines the convergence speed in the real and Fourier space series.
For a given choice of
we have chosen a real-space cutoff distance
and a
cutoff in the Fourier space. The cutoff
determines the total number of Fourier components,
, where
is a positive integer. This parameter has been choosen in such a way that the error on the Ewald summation is much smaller than the Quantum Monte Carlo statistical one.

A careful choice of the parameter
can minimize the error in the summation (see Ref. (80)). In our simulation we have chosen
, where
is the size of the simulation box. With this cutoff it is sufficient to sum the short range part in the eq. 4.16 only on the first image of each particle.
Notice that during each VMC or DMC simulation the ionic coordinates are fixed throughout the calculation. Therefore the contribution of the ion-ion Coulomb interaction in the short-range part can be evaluated only at the beginning of the simulation. As an electron
is moved during a VMC calculation the sum of the short range part of the eq. 4.16 is easily updated subtracting the old contribution electron-electron and electron-ion due to the electron
, and adding the new one.

The sum in Fourier space can be written as:

then for each vector all and are stored in such a way that when an electron moves, the sum can be easily updated without calculating all the elements from scratch.

It is easy to understand that the Ewald summation scales as . In fact the updating of the eq. 4.16 costs times the number of Fourier's components. Then the number of Fourier component goes as where is proportional and for a given density scales as . The Ewald sums are faster than the QMC sweep and so, even if nowadays other faster techniques exist, as for instance particle-mesh-based one, it was not necessary to adopt other more complicated methods in our calculation.