A method to compute periodic sums

Nail A. Gumerov, Ramani Duraiswami · DOI

Introduction

In computational physics and chemistry, particularly in molecular dynamics, researchers often simulate particles within a finite box. To approximate an infinite system, periodic boundary conditions (PBC) are imposed, effectively surrounding the primary simulation box with infinite copies of itself. Calculating the total potential at any point requires summing contributions from all particles in the original box and all their periodic images. This is a computationally intensive task.

Historically, Ewald summation has been the standard solution, utilizing Fast Fourier Transforms (FFTs) to handle long-range interactions. However, FFTs face scaling challenges on massive parallel architectures and are often restricted to simple cubic domains. While the Fast Multipole Method (FMM) offers a powerful alternative for free-space sums, adapting it for periodicity typically requires extensive code modification. This paper introduces a "kernel-independent" method that treats any standard, free-space fast summation algorithm (FSA) as a black box to solve periodic problems.

Methodology: The Black Box Approach

The proposed "periodization" wrapper operates in two primary stages, allowing researchers to utilize highly optimized, hardware-specific FMM libraries without internal modifications.

Near-Field and Far-Field Decomposition

The method splits the potential calculation into two components:

  1. The Near-Field Sum: A region (typically a sphere) is defined to enclose the simulation box and its immediate neighbors. The potential from particles within this region is calculated using a standard free-space FSA.
  2. The Far-Field Correction: The influence of all periodic images outside this enclosing sphere is approximated using a local expansion, such as spherical harmonics or Radial Basis Functions.
Schematic of the near-field and far-field decomposition. The central box $\Omega_0$ is enclosed by a sphere $S_0$, while the far-field correction accounts for images beyond the boundary.

Least-Squares Collocation

The core of the method lies in determining the coefficients for the far-field expansion. Instead of complex analytical derivations, the authors employ least-squares collocation. "Check points" are placed on the boundary of the box, and the condition of periodicity is enforced. By solving a relatively small, overdetermined linear system, the algorithm finds coefficients that ensure the total field (Near + Far) satisfies the periodic boundary conditions.

Different point distributions—Random, Gauss, and Fliege—can be used for collocation on the sphere to optimize accuracy and stability.

The algorithm is divided into a "Set" phase, where matrix decompositions based on box geometry are precomputed, and a "Get" phase, which performs the actual calculation during simulation steps.

Performance and Results

The method was evaluated using standard numerical benchmarks, including the Madelung constant for NaCl and large-scale synthetic distributions of up to $10^7$ particles.

  • Efficiency: For large systems, the periodic calculation incurs an overhead of approximately twice the cost of a standard free-space calculation. This is highly competitive given the added complexity of periodicity.
  • Accuracy: In the NaCl test, the method recovered the Madelung constant with an error as low as $10^{-14}$, demonstrating the robustness of the least-squares fitting.
  • Scalability: The algorithm maintains the $O(N)$ or $O(N \log N)$ scaling of the underlying FSA. Furthermore, the "Get" phase can be fully offloaded to GPUs for significant acceleration.
  • Flexibility: Unlike Ewald-based methods, this approach naturally handles non-cubic boxes by adjusting check-point locations and the enclosing sphere geometry.

Discussion and Future Work

While the method is robust, it faces challenges with extremely high aspect ratio boxes (e.g., thin slabs), where the enclosing sphere becomes disproportionately large, increasing the "geometric factor" and computational cost. Additionally, high-precision requirements can lead to significant memory overhead for precomputed matrices.

Future research directions include exploring more "conformal" check-point distributions to better accommodate non-cubic boxes and extending the method to other kernels, such as Helmholtz or Stokes flow. By decoupling the periodicity logic from the summation algorithm, this approach provides a flexible and efficient path for large-scale periodic simulations across various physical domains.

Summary updated

BibTeX
@article{gumerov2014method,
  author = {Nail A. Gumerov and Ramani Duraiswami},
  title = {{A method to compute periodic sums}},
  journal = {Journal of Computational Physics},
  year = {2014},
  doi = {10.1016/j.jcp.2014.04.039},
}
Figure