We address the efficient computation of power-law-based interaction potentials of homogeneous $d$-dimensional bodies with an infinite $n$-dimensional array of copies, including their higher-order derivatives. This problem forms a serious challenge in micromagnetics with periodic boundary conditions and related fields. Nowadays, it is common practice to truncate the associated infinite lattice sum to a finite number of images, introducing uncontrolled errors. We show that, for general interacting geometries, the exact infinite sum for both dipolar interactions and generalized Riesz power-law potentials can be obtained by complementing a small direct sum by a correction term that involves efficiently computable derivatives of generalized zeta functions. We show that the resulting representation converges exponentially in the derivative order, reaching machine precision at a computational cost no greater than that of truncated summation schemes. In order to compute the generalized zeta functions efficiently, we provide a superexponentially convergent algorithm for their evaluation, as well as for all required special functions, such as incomplete Bessel functions. Magnetic fields can thus be evaluated to machine precision in arbitrary cuboidal domains periodically extended along one or two dimensions. We benchmark our method against known formulas for magnetic interactions and against direct summation for Riesz potentials with large exponents, consistently achieving full precision. In addition, we identify new corrections to the asymptotic limit of the demagnetization field and tabulate high-precision benchmark values that can be used as a reliable reference for micromagnetic solvers. The techniques developed are broadly applicable, with direct impact in other areas such as molecular dynamics.
翻译:暂无翻译