Force Error#

The Force error is the error incurred when we cut the potential interaction after a certain distance. Following the works of [Dharuman et al., 2017, Kolafa and Perram, 1992, Stern and Calkins, 2008] we define the total force error for our P3M algorithm as

ΔFtot=ΔFR2+ΔFF2

where ΔFR is the error obtained in the PP part of the force calculation and ΔFF is the error obtained in the PM part, the subscripts R,F stand for real space and Fourier space respectively. ΔFR is calculated as follows

ΔFR=NV[rcd3r|ϕR(r)|2]1/2,

where ϕR(r) is the short-range part of the chosen potential. In our example case of a Yukawa potential we have

ϕR(r)=Q22r[eκrerfc(αrκ2α)+eκrerfc(αr+κ2α)],

where κ,α are the dimensionless screening parameter and Ewald parameter respectively and, for the sake of clarity, we have a charge Q=Ze/4πϵ0 with an ionization state of Z=1. Integrating this potential, and neglecting fast decaying terms, we find

ΔFR2Q2NVeα2rc2rceκ2/4α2.

On the other hand ΔFF is calculated from the following formulas

ΔFF=NVQ2χV1/3
χ2V2/3=(k0Gk2|k|2)n[(mU^k+m2Gk+mknkn+m)2(mU^kn+m2)2|kn|2].

This is a lot to take in, so let’s unpack it. The first term is the RMS of the force field in Fourier space obtained from solving Poisson’s equation ϕ(r)=δ(rr) in Fourier space. In a raw Ewald algorithm this term would be the PM part of the force. However, the P3M variant solves Poisson’s equation on a Mesh, hence, the second term which is non other than the RMS of the force obtained on the mesh. Gk is the optimal Green’s function which for the Yukawa potential is

Gk=4πe(κ2+|k|2)/(4α2)κ2+|k|2

where

k(nx,ny,nz)=kn=(2πnxLx,2πnyLy,2πnzLz).

U^k is the Fourier transform of the B-spline of order p

U^kn=[sin(πnx/Mx)πnx/Mx]p[sin(πny/My)πny/My]p[sin(πnz/Mz)πnz/Mz]p,

where Mx,y,z is the number of mesh points along each direction. Finally the m refers to the triplet of grid indices (mx,my,mz) that contribute to aliasing. Note that in the above equations as κ0 (Coulomb limit), we recover the corresponding error estimate for the Coulomb potential.

The reason for this discussion is that by inverting the above equations we can find optimal parameters rc,α given some desired errors ΔFR,F. While the equation for ΔFR can be easily inverted for rc, such task seems impossible for ΔFF without having to calculate a Green’s function for each chosen α. As you can see in the second part of the output the time it takes to calculate Gk is in the order of seconds, thus, a loop over several α values would be very time consuming. Fortunately researchers have calculated an analytical approximation allowing for the exploration of the whole rc,α parameter space [Dharuman et al., 2017]. The equations of this approximation are

ΔFF(approx)Q2NVAF1/2,
AF32π2m=0p1Cm(p)(h2)2(p+m)21+2(p+m)β(p,m),
β(p,m)=0dkGk2k2(p+m+2),

where h=Lx/Mx and the coefficients Cm(p) are listed in Table I of [Deserno and Holm, 1998].

Finally, by calculating

ΔFtot(apprx)(rc,α)=ΔFR2+(ΔFF(approx))2

we are able to investigate which parameters rc,α are optimal for our simulation.