Force Error
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
where \(\Delta F_{\mathcal R}\) is the error obtained in the PP part of the force calculation and \(\Delta F_{\mathcal F}\) is the error obtained in the PM part, the subscripts \(\mathcal{R, F}\) stand for real space and Fourier space respectively. \(\Delta F_{\mathcal R}\) is calculated as follows
where \(\phi_{\mathcal R}( \mathbf r)\) is the short-range part of the chosen potential. In our example case of a Yukawa potential we have
where \(\kappa, \alpha\) are the dimensionless screening parameter and Ewald parameter respectively and, for the sake of clarity, we have a charge \(Q = Ze/\sqrt{4\pi \epsilon_0}\) with an ionization state of \(Z = 1\). Integrating this potential, and neglecting fast decaying terms, we find
On the other hand \(\Delta F_{\mathcal F}\) is calculated from the following formulas
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 \(-\nabla \phi(\mathbf r) = \delta( \mathbf r - \mathbf r')\) 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. \(G_{\mathbf k}\) is the optimal Green’s function which for the Yukawa potential is
where
\(\hat{U}_{\mathbf k}\) is the Fourier transform of the B-spline of order \(p\)
where \(M_{x,y,z}\) is the number of mesh points along each direction. Finally the \(\mathbf{m}\) refers to the triplet of grid indices \((m_x,m_y,m_z)\) that contribute to aliasing. Note that in the above equations as \(\kappa \rightarrow 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 \(r_c,\; \alpha\) given some desired errors \(\Delta F_{\mathcal {R,F}}\). While the equation for \(\Delta F_{\mathcal R}\) can be easily inverted for \(r_c\), such task seems impossible for \(\Delta F_{\mathcal F}\) without having to calculate a Green’s function for each chosen \(\alpha\). As you can see in the second part of the output the time it takes to calculate \(G_{\mathbf k}\) is in the order of seconds, thus, a loop over several \(\alpha\) values would be very time consuming. Fortunately researchers have calculated an analytical approximation allowing for the exploration of the whole \(r_c,\; \alpha\) parameter space [Dharuman et al., 2017]. The equations of this approximation are
where \(h = L_x/M_x\) and the coefficients \(C_m^{(p)}\) are listed in Table I of [Deserno and Holm, 1998].
Finally, by calculating
we are able to investigate which parameters \(r_c,\; \alpha\) are optimal for our simulation.