1 Introduction

Large sums appear everywhere in nature; our macroscopic world is composed of microscopic particles whose interaction forces determine the properties of the world we live in. Sums with singularities describe discrete long-range interacting systems in condensed matter and quantum physics [1], with examples ranging from the computation of forces and energies in atomic crystals [2] to the study of charge transfer in DNA strings [3]. Making predictions about these sums is however in general a difficult task. In many cases, the evaluation of an integral is easier than the evaluation of a sum, either because there are more tools available on the analytical side or because on the numerical side, efficient quadrature schemes are known. The question arises how sums and integrals are related and how we can approximate one by the other.

A part of the answer to this question was given independently by Leonard Euler in 1736 and by Colin Maclaurin in 1742 [4]. Consider Fig. 1, which provides an illustration for the approximation of a sum (rectangles) by an integral (blue region). In the red parts, the sum dominates the integral, whereas in the green parts, the integral is larger than the sum. The Euler–Maclaurin (EM) expansion describes this difference between sum and integral of a sufficiently differentiable function in terms of derivatives evaluated at the limits of integration plus a remainder integral.

Fig. 1
figure 1

Illustration of the approximation of a sum by an integral. Red parts indicate where the integral underestimates the sum, green parts display the opposite case where the integral dominates the sum (Color figure online)

Before we state the EM expansion, we introduce the following standard notation: The set of integers is denoted by \(\mathbb {Z}\), \(\mathbb {N} = \{0,1,2,\dots \}\) are the nonnegative integers, and \(\mathbb {N}_+ = \mathbb {N} {\setminus } \{ 0 \}\) are the positive integers. Similarly, \(\mathbb {R}\) are the real numbers and \(\mathbb {R}_+\) denotes the set of positive real numbers. Finally, \(\mathbb {C}\) are the complex numbers. In this work, we consider function spaces that are based on differentiable functions. For an open interval \(I \subseteq \mathbb {R}\) and \(\ell \in \mathbb {N}\), the vector space \(C^\ell (I)\) consists of functions \(f : I \rightarrow \mathbb {C}\) being \(\ell \) times differentiable and whose \(\ell \)th derivative \(f^{(\ell )}\) is continuous. The derivatives of functions in \(C^\ell (\bar{I})\), a subspace of \(C^\ell (I)\), additionally have continuous extensions from I to the closure \(\bar{I}\). Finally, we define \( C^\infty (I) = \bigcap \nolimits _{\ell = 0}^\infty C^\ell (I), \) the space of infinitely differentiable functions on I and analogously \(C^\infty (\bar{I})\). The vector space \(C^{-1}(I)\) is the space of regulated functions \(f:I\rightarrow \mathbb {C}\) for which the left and right sided limits \(\lim \limits _{y \nearrow y_0}\) and \(\lim \limits _{y \searrow y_0}\) exist for all \(y_0\in I\). The vector space \(C^{-1}(\bar{I})\) is defined analogously, where only the existence of the corresponding one-sided limit is needed at the end points. Regulated functions are continuous up to a countable number of points.

For \(a,b \in \mathbb {Z}\), \(a<b\), \(\delta \in (0,1]\), \(\ell \in \mathbb {N}\), and for a function \(f\in C^{\ell +1}[a+\delta ,b+\delta ]\), the EM expansion reads [4, 5]

$$\begin{aligned} \sum _{n=a+1}^b f(n)=\int \limits _{a+\delta }^{b+\delta } f(y)\,\mathrm d y&- \sum _{k=0}^ {\ell } (-1)^k\frac{B_{k+1}(1+y-\lceil y \rceil )}{(k+1)!} f^{(k)}(y)\bigg \vert ^{y=b+\delta }_{y=a+\delta } \nonumber \\&+ \int \limits _{a+\delta }^{b+\delta } (-1)^{\ell } \frac{B_ {\ell +1}(1+y-\lceil y \rceil )}{(\ell +1)!} f^{(\ell +1)}(y)\,\mathrm d y, \end{aligned}$$
(1.1)

where \(\lceil y \rceil \) is the smallest integer larger than or equal to y. The functions \(B_\ell \) are the Bernoulli polynomials, which are uniquely defined by the recurrence relation

$$\begin{aligned} \begin{aligned} B_0(y) =1, \quad B'_\ell (y)=\ell B_ {\ell - 1}(y),\quad \int \limits _0^1 B_\ell (y)\, \mathrm d y=0,\quad \ell \ge 1. \end{aligned} \end{aligned}$$
(1.2)

For a derivation of the EM expansion as well as a brief introduction to its history we refer to [4].

The applicability of the EM expansion for the approximation of a particular sum is determined by the scaling of the remainder integral on the right hand side of (1.1) with the expansion order \(\ell \). The remainder integral cannot be evaluated in a numerically feasible way, as the integrand is a piecewise defined function. In the numerical application, an order \(\ell \) is chosen, the remainder integral is discarded and the error made by discarding the remainder integral is estimated. If the addend is based on an entire function whose derivatives in addition satisfy certain bounds (more details in the next section), the remainder integral decreases exponentially with \(\ell \). This is the ideal case for the EM expansion. For most functions however, even for smooth functions, the error begins to diverge after a certain threshold value of \(\ell \) is reached, thus limiting the precision that the EM expansion can offer.

There have been a number of valuable extensions of the classic works of Euler and Maclaurin, which make the expansion applicable to a larger set of functions. Important progress has been made by Navot [6], where the EM expansion is generalised to functions with an algebraic singularity at the boundaries of the integration interval. Further generalisations have been developed by Monegato and Lyness [5] and Sidi [7, 8], where divergent integrals are regularised by the use of Hadamard finite part integrals. Furthermore, a higher dimensional generalisation of the EM for simple lattice polytopes has been found [9]. We also mention here a recent alternative approach to the EM expansion where the difference between sum and integral is written in terms of integrals only [10].

One particular set of functions, for which the EM expansion fails to converge and which are extremely important in practice are functions that involve an asymptotically smooth singularity, see Definition 2.1. Unfortunately, these functions are of strong practical interest as all physical interactions belong to this kind. In this work, we present the singular Euler–Maclaurin expansion (SEM), which makes the classic expansion applicable to functions that involve an asymptotically smooth singularity.

This paper targets a wide range of different audiences. Therefore it is organised as follows. Section 2 concludes the main results regarding the SEM, offering all the tools needed for application. Section 3 covers details to apply the SEM as a numerical tool. We discuss its numerical performance and apply it to a macroscopic long-range interacting crystal as a physically relevant example. Note that a basic implementation of the SEM in Mathematica is provided along with the article.Footnote 1 Section 4 provides the main derivation of the SEM. It includes the proofs of the most important theorems and propositions. Finally, in Sect. 5, we make our concluding remarks.

2 Main Result and Notation

In this chapter, we formulate the SEM expansion for intervals \([a+\delta ,b+\delta ]\), with \(a,b \in \mathbb {Z}\), \(\delta \in (0,1]\), which is in particular applicable, if the function

$$\begin{aligned} f: [a+\delta , b+\delta ] \rightarrow \mathbb {C}, \end{aligned}$$

splits into two factors

$$\begin{aligned} f(y)=s(y-x)g(y), \quad y \in [a+\delta , b+\delta ], \end{aligned}$$
(2.1)

where \(x \in \mathbb {Z}\), \(s\in C^\infty (\mathbb {R}{\setminus } \{0\})\) has a singularity at 0 and \(g: [a+\delta , b+\delta ] \rightarrow \mathbb {C}\) is a sufficiently differentiable function. We apply the following general strategy: singularities at x or other smooth functions whose derivatives increase quickly with the derivative order are included in s. The function s limits the applicability of the standard EM expansion to f and therefore requires a special treatment. In practice, the function s often represents a pairwise long-ranged interaction potential or the one-dimensional forces generated by such a potential. We refer to s in the following as the interaction. The remaining factor g includes well-behaved functions, whose derivatives increase sufficiently slowly with the derivative order. The slower the derivatives increase, the better are the convergence rates.

We briefly outline our presentation of the SEM expansion. We first discuss the properties of the function s that are required for the expansion. The interaction is subsequently made integrable by introducing an exponential regularisation. We then make use of the integrability of the regularised interaction and define the Bernoulli–\(\mathcal A\) functions, a generalisation of the periodised Bernoulli polynomials in which we encode s. These functions then form the coefficients of the differential operator of the SEM, replacing the Bernoulli polynomials in the standard EM expansion (1.1). The differential operator acts on g only, avoiding the fast increase in the derivatives of s that causes the breakdown of the standard EM expansion. A finite-order approximation of this differential operator leads to the finite-order SEM expansion. For smooth g, whose derivatives fulfil certain bounds, we take the order of the expansion to infinity, leading to the infinite order SEM.

Before moving on to the formulation of the SEM expansion, we need to specify the admissible set of functions for the interaction: the function s has to be asymptotically smooth [11, Sec. 3.2].

Definition 2.1

(Asymptotically smooth functions) A function \(s \in C^\infty (\mathbb {R}{\setminus } \{0\})\) of at most polynomial growth is called asymptotically smooth if there exist \(c>0\) and \(\gamma \ge 1\) such that for the \(\ell \)th derivative \(s^{(\ell )}\),

$$\begin{aligned} |s^{(\ell )}(y)|\le c \, \ell ! \, \gamma ^\ell \, |y|^{-\ell } \, |s(y)|, \end{aligned}$$
(2.2)

for all \(y \in \mathbb {R}{\setminus } \{0\}\) and \(\ell \in \mathbb {N}\). We denote the vector space of all asymptotically smooth functions by S. It is the union of the linear subspaces \(S_\alpha \), \(\alpha \in \mathbb R\), where \(s \in S_\alpha \) if and only if for all \(\xi > 0\) there is \(c_\xi > 0\) such that

$$\begin{aligned} |s(y)| \le c_\xi |y|^{\alpha }, \quad |y| \ge \xi . \end{aligned}$$

This set includes entire functions like polynomials, but also a broad set of functions with singularities. Typical examples for asymptotically smooth functions are

$$\begin{aligned} s(y)=|y|^{-\nu }, \quad y \in \mathbb {R}{\setminus } \{0\}, \end{aligned}$$
(2.3)

for \(\nu \in \mathbb {R}\) which are singular for \(\nu >0\).

From 2.1, we find that the \(\ell \)th derivative of the interaction may scale with the factorial of \(\ell \). It is this fast increase in the derivatives that causes the breakdown of the EM expansion, and therefore, taking derivatives of s has to be avoided. It turns out that we can integrate s instead. However, s is in general not integrable on \([1,\infty )\); take for instance \(\nu =1\) in (2.3). This challenge is overcome by using an exponentially decaying regularisation of the interaction.

Notation 1

Let \(s\in S\). The exponentially weighted interaction reads

$$\begin{aligned} s_\beta (y)=s(y)e^{-\beta |y|}, \quad y \in \mathbb {R}{\setminus } \{0\}, \end{aligned}$$
(2.4)

with \(\beta \ge 0\).

For \(\beta \searrow 0\), the weighting is gradually removed and the interaction regains its original range. It is crucial here that the reduction of the interaction range is introduced not as a sharp cut-off, but in a smooth way, such that \(s_\beta \) remains asymptotically smooth.

We now use regularised differences between sums and integrals in order to define a replacement for the Bernoulli polynomials (1.1). We call this replacement the Bernoulli-\(\mathcal A\) functions, in which we encode all information about the interaction s. In the following, calligraphic symbols indicate an explicit dependence on the interaction.

Definition 2.2

(Bernoulli–\(\mathcal A\) functions) Suppose \(s \in S\). The Bernoulli–\(\mathcal A\) functions are defined as

$$\begin{aligned} \mathcal A_\ell (y) = \lim _{\beta \searrow 0} \frac{1}{\ell !} \Bigg ( \sum _{n=\lceil y \rceil }^\infty (y-n)^\ell s_\beta (n)-\int \limits _{y}^\infty (y-z)^\ell s_\beta (z)\, \mathrm d z\Bigg ), \quad y \in \mathbb {R}_+, \end{aligned}$$

for \(\ell \in \mathbb {N}\).

The shifted monomials in sum and integral guarantee that the Bernoulli-\(\mathcal A\) functions are subsequent antiderivatives, \(\mathcal A_{\ell +1}'=\mathcal A_\ell \). A special role is assigned to the function \(\mathcal A_0\) that exhibits jump discontinuities at the positive integers. Both the size of the jump discontinuities and the left sided derivative of \(\mathcal A_0\) are equal to value of the interaction,

$$\begin{aligned} \lim _{\varepsilon \searrow 0} \big (\mathcal A_0(n)-\mathcal A_0(n+\varepsilon )\big )&= s(n),\quad n\in \mathbb {N}_+,\\ \lim _{\varepsilon \searrow 0} \frac{\mathcal A_0(y)-\mathcal A_0(y-\varepsilon )}{\varepsilon }&= s(y),\quad y\in \mathbb {R}_+. \end{aligned}$$

The properties of the Bernoulli-\(\mathcal A\) functions are discussed in detail in Proposition 4.2.

Fig. 2
figure 2

Generalised Bernoulli functions \(\mathcal A_\ell \) for \(s(y)=|y|^{-1}\)

A different recursive definition of generalised Bernoulli functions on bounded intervals [ab] starting from a bounded function by iterated integration on [ab] is presented in [12]. Due to the chosen normalisation, requesting that the integrals of these functions over [ab] to vanish, the generalisation to nonintegrable singularities and unbounded domains is not possible. Our definition is more general and, in particular, allows for arbitrary algebraic singularities at the origin.

The Bernoulli–\(\mathcal A\) functions replace the periodic extension of the Bernoulli polynomials in the differential operator part and the remainder of the EM expansion. We display them for \(s(y)=|y|^{-1}\) in Fig. 2. For a constant interaction \(s=1\), we recover a rescaled version of the periodised Bernoulli polynomials,

$$\begin{aligned} \mathcal A_\ell (y)=\frac{B_{\ell +1}(1+y-\lceil y \rceil )}{(\ell +1)!}, \end{aligned}$$

a proof of which is given in “Appendix 1”.

We now define the SEM differential operator as follows:

Definition 2.3

(SEM operator) For \(s\in S\) and \(y \in \mathbb {R}_+\), we define the differential operator of infinite order

$$\begin{aligned} {\mathcal D}_y = \sum _{\ell =0}^\infty \mathcal A_\ell (y)\, (-D)^\ell , \end{aligned}$$
(2.5)

where D is the derivative operator. We call \(\mathcal D_y \) the SEM operator. For \(\ell \in \mathbb {N}\) the finite order approximations \({\mathcal D}_y^{(\ell )}\) are given by

$$\begin{aligned} {\mathcal D}_y^{(\ell )} =\sum _{k=0}^\ell \mathcal A_k (y)\, (-D)^k. \end{aligned}$$

Finally, we move on to the formulation of the new expansion.

Theorem 2.1

(Singular Euler–Maclaurin (SEM) expansion) For \(x,a,b\in \mathbb {Z}\), with \(x\le a< b\), and \(\delta \in (0,1]\), let f factor into

$$\begin{aligned} f(y)=s(y-x)g(y), \end{aligned}$$

where \(s\in S\) and \(g\in C^{\ell +1}[a+\delta ,b+\delta ]\), \(\ell \in \mathbb {N}\). Then,

$$\begin{aligned} \begin{aligned} \sum _{n=a+1}^b f(n)&=\int \limits _{a+\delta }^{b+\delta } f(y)\, \mathrm d y - \Big ({\mathcal D}^{(\ell )}_{y-x} g\Big ) (y)\bigg \vert _{y=a+\delta }^{y=b+\delta } +(-1)^\ell \int \limits _{a+\delta }^{b+\delta } \mathcal A_ {\ell } (y-x) g^{(\ell +1)}(y) \,\mathrm d y. \end{aligned} \end{aligned}$$

The SEM operator only acts on g, not on f, and therefore differentiation of s is avoided.

In order to perform the limit \(\ell \rightarrow \infty \) in Theorem 2.1, the function g has to belong to the set of functions of exponential type. This restricts the growth of its derivatives.

Definition 2.4

(Band-limited functions) Let \(g \in C^\infty (\mathbb {R})\). We say that g is band-limited with bandwidth \(\sigma \) and write \(g \in E_\sigma \), if for every bounded interval \(I\subset \mathbb {R}\), there exists \(M>0\) such that

$$\begin{aligned} \big |g^{(\ell )}(y)\big | \le M\, \sigma ^{\ell },\quad \ell \in \mathbb {N},\quad y\in I. \end{aligned}$$

The admissible range for \(\sigma \) depends on s, in particular on \(\gamma \) from Definition 2.1.

Theorem 2.2

(SEM error scaling) Assume the conditions of Theorem 2.1 and let \(g\in E_\sigma \), \(\sigma >0\). Then the remainder in the SEM expansion,

$$\begin{aligned} \mathcal R_{\ell +1}=(-1)^\ell \int \limits _{a+\delta }^{b+\delta } \mathcal A_ {\ell } (y-x) g^{(\ell +1)}(y), \end{aligned}$$

fulfils

$$\begin{aligned} \big | \mathcal R_{\ell + 1} \big | \le P(\ell ) \big (\sigma / \tau \big )^{\ell + 1} \end{aligned}$$

for \(\tau = 2 \pi / (\gamma + 1)\) and a polynomial P whose degree only depends on s.

For \(\sigma <\tau \), the approximation error of a sum by means of the SEM expansion falls off exponentially in the expansion order \(\ell \) and polynomially in the parameter \(\sigma \). In particular, the limit \(\ell \rightarrow \infty \) is well-defined. Hence our new expansion succeeds in providing a reliable approximation where the standard EM expansion, which does not converge for singular functions, fails.

Remark 2.1

For simplicity, we have formulated Theorem 2.1 such that x is positioned to the left of the interval \([a+1,b]\). Of course, the theorem can also be applied in case that x is positioned to the right of this interval by simply reflecting the interval about x. Consider \(a<b<x\). Then the reflected interval is \([\tilde{a}+1,\tilde{b}]\), where

$$\begin{aligned} \tilde{a}= 2x-(b+1),\quad \tilde{b}= 2x-(a+1), \end{aligned}$$

and thus \(x\le \tilde{a} < \tilde{b}\). Using the reflected interval, we can transform the sum as follows

$$\begin{aligned} \sum _{n=a+1}^b s(n-x)g(n)=\sum _{n=\tilde{a}+1}^{\tilde{b}}\tilde{s}(n-x)\tilde{g}(n), \end{aligned}$$
(2.6)

with the functions \(\tilde{s} \in S\) and \(\tilde{g}\) such that

$$\begin{aligned} \tilde{s}(y)=s(-y),\quad \tilde{g}(y)=g(2x-y). \end{aligned}$$

Thus the SEM becomes applicable to the right hand side of (2.6).

3 Application: Long-Range Forces in Crystal Lattices

3.1 Model Description

We demonstrate the numerical performance of the SEM expansion by applying it to the calculation of long-range forces in a macroscopic one-dimensional crystal lattice of charged particles. The SEM expansion naturally provides the answer to the question how to correctly include the discreteness of the lattice within a continuum formulation that avoids discrete sums and is therefore efficiently computable for all asymptotically smooth interaction forces. We consider a particularly difficult scenario, the case where the interaction potential is the Coulomb repulsion, which decays algebraically with an exponent equal to the system dimension. Then the discreteness of the crystal has an observable effect on the forces at all scales, which makes a continuum approximation challenging [2].

We consider a one-dimensional crystal of \(2N+1\) particles, \(N\in \mathbb {N}\), and denote the particle positions as \(x_j\in \mathbb {R},~j=-N,\dots ,N\). The particles are displaced from an equidistant grid with lattice constant \(h>0\),

$$\begin{aligned} x_j=j h+u(jh),\quad j\in \{-N,\dots ,N\}, \end{aligned}$$
(3.1)

through a smooth displacement function u.

If the interaction energy \(V\in S\) between two particles decays algebraically with their distance x,

$$\begin{aligned} V(x)=c_\nu |x|^{-\nu }, \quad \nu >0, \end{aligned}$$
(3.2)

the force acting on the particle with reference position x reads

$$\begin{aligned} F(x)=-\sum _{\begin{array}{c} n=-N\\ n \ne x/h \end{array}}^{N} V'\Big ((x-h n)+u(x)-u(hn)\Big ), \quad x\in h\{-N,\dots , N \}. \end{aligned}$$
(3.3)

All physical dimensions are from now on removed, where we write positions in units of h and forces in units of \(V''(h)h\). Then the forces follow as

$$\begin{aligned} F(x)=\sum _{n=-N}^{x-1} f(n)+ \sum _{n=x+1}^N f(n),\quad x\in \{-N,\dots ,N\}, \end{aligned}$$
(3.4)

where the function f factors into \( f(y)=s(y-x)g(y)\) with \(s\in S\) and g smooth such that

$$\begin{aligned} s(y)=\mathrm {sgn}(y)~|y|^{-(\nu +1)},\quad g(y)=-\frac{1}{\nu + 1}\bigg (1+\frac{u(y)-u(x)}{y-x}\bigg )^{-(\nu +1)}. \end{aligned}$$
(3.5)

We now have determined a suitable factorisation for the summand function. In order to subsequently apply the SEM expansion to above sum, we only need to determine the corresponding SEM operator, which amounts to computing its coefficient functions \(\mathcal A_\ell \).

3.2 Bernoulli-\(\mathcal A\) Functions for Physical Interactions

We move on to the computation of the Bernoulli–\(\mathcal A\) functions for the algebraic interaction \(\vert \cdot \vert ^{-\nu }\), which is of high relevance in physical systems. In case of \(\nu = 1\), it either describes the Coulomb interaction between charged or the gravitational interaction between massive particles. For \(\nu = 3\), it describes the dipole interaction between spins. The Bernoulli–\(\mathcal A\) functions determine the SEM differential operator and hence provide the tool needed for the efficient computation of large singular sums. It turns out that the coefficient functions can be compactly written in terms of the Hurwitz zeta function. A proof is given in Appendix A.

Theorem 3.1

For \(s=\vert \cdot \vert ^{-\nu }\) and \(\nu \in \mathbb {R}{\setminus } \mathbb {N}_+\), the Bernoulli-\(\mathcal A\) functions read

$$\begin{aligned} \mathcal A_\ell (y)=\frac{1}{\ell !}\sum _{k=0}^\ell (-1)^k \left( {\begin{array}{c}\ell \\ k\end{array}}\right) y^{\ell -k} \bigg (\zeta (\nu -k,\lceil y \rceil )-\frac{y^{-(\nu -k-1)}}{\nu -k-1}\bigg ), \quad \ell \in \mathbb {N}, \end{aligned}$$
(3.6)

with \(\zeta \) the Hurwitz zeta function,

$$\begin{aligned} \zeta (\mu ,q)=\sum _{n=0}^\infty \frac{1}{(n +q)^\mu },\quad \mu>1,~q>0. \end{aligned}$$

For \(\nu \in \mathbb {N}_+\), the coefficients are well-defined,

$$\begin{aligned} \lim \limits _{\nu \rightarrow k+1} \left( \zeta (\nu - k, \lceil y \rceil ) - \frac{y^{-(\nu - k - 1)}}{\nu - k -1} \right) = \gamma _e - H_{\lceil y \rceil - 1} + \log y, \quad k \in \mathbb {N}, \end{aligned}$$

where \(\gamma _e\) is the Euler–Mascheroni constant and \(H_k\) denotes the kth harmonic number,

$$\begin{aligned} H_k = \sum _{j=1}^k \frac{1}{j}. \end{aligned}$$

After having determined analytic formulas for the Bernoulli–\(\mathcal A\) functions for a large set of physically relevant interaction functions, we proceed by demonstrating that the SEM expansion is able to describe long-range interactings systems in a very precise way, where, in contrast, standard integral approximations fail.

3.3 Numerical Results

For our numerical study, we investigate a chain of particles interacting via the Coulomb repulsion. The displacement function is chosen as the integral of a normalised Lorentzian

$$\begin{aligned} u(y)=\int \limits _{-\infty }^{y/\lambda } \frac{1}{\pi }\frac{1}{1+z^2}\, \mathrm d z, \end{aligned}$$
(3.7)

which describes the simplified profile of a kink, a domain wall in the crystal, with the asymptotic behaviour \(\lim _{y\rightarrow \infty } u(y)=1\) and \(\lim _{y\rightarrow -\infty } u(y)=0\). Kinks typically arise when an additional nonlinear potential is applied to the crystal. The parameter \(\lambda >0\) controls the width of the kink. When adjusting the Definition 2.4 of band-limited functions such that only up to \(\ell +1\) derivatives need to fulfil the estimate then the error estimates for the SEM expansion in Theorem 2.2 continue to hold. The function u is thus effectively band-limited with a band-width \(\sigma \) proportional to \(1/\lambda \). For further details regarding kinks in condensed matter physics, see [13]. A schematic depiction of a kink is displayed in Fig. 3. In the following, we compute the Coulomb force that is exerted on an arbitrary particle (red circle) by all other particles (black circles).

Fig. 3
figure 3

Kink of width \(\lambda \) in a 1D chain that displaces the particles (black circles) from an equidistant grid (dotted circles). The long-range forces acting on a particular particle, e.g. in red, are computed (Color figure online)

Fig. 4
figure 4

Forces F as a function of distance x in centre of a kink for different choices of the kink width \(\lambda \) and the particle number N. The red line shows the first order approximation of the singular Euler–Maclaurin expansion, the blue dots display the exact forces. a The approximation error in the maximum norm over the whole chain is smaller than \(3\times 10^{-7}\) and the relative error is smaller than \(8\times 10^{-5}\). The black line shows the approximation of the discrete sum by an integral only (Color figure online)

We compute the Coulomb forces in (3.4) by exact summation and subsequently compare the result to the integral approximation, which is standard in condensed matter physics,

$$\begin{aligned} F_{\text {approx}}(x)= \int \limits _{-N}^{x-1} f(y)\,\mathrm d y + \int \limits _{x+1}^{N} f(y)\,\mathrm d y, \end{aligned}$$

choosing the integral offset \(\delta = 1\). For a mesoscopic chain with \(N=10^3\) and a kink width \(\lambda = 10\), the resulting forces are displayed in the left panel of Fig. 4, where the blue dots show the exact results and the black curve shows the integral approximation. The integral approximation in the mesoscopic system reproduces the correct qualitative behaviour, showing that the particles are drawn towards the kink, as it constitutes a delocalised particle hole. However, it strongly underestimates the absolute value of the forces and thus cannot be used for reliable quantitative predictions. We can now improve significantly upon the precision of the integral approximation by using the SEM expansion of order \(\ell = 1\). The result for the SEM expansion is shown in red, which is visually indistinguishable from the result obtained by exact summation.The SEM reproduces the exact forces very precisely both at the chain edges as well as inside the kink in the centre with an absolute error smaller than \(3\times 10^{-7}\) for all particles with 4 digits of precision. Moreover, the runtime for the adaptive numerical integration and for the computation of the derivatives is essentially independent of N and \(\lambda \) for a single force evaluation. The SEM expansion thus combines the precision of exact summation with the \(\mathcal O(1)\) scaling of the integral approximation.Footnote 2

In the next step, we can now apply the SEM expansion to the computation of the full nonlinear long-range Coulomb forces in a crystal of macroscopic size, where the computation of the exact forces has become infeasible. We choose \(\lambda =10^5\) and \(N=10^{10}\), which for a typical lattice constant \(h\approx 10^{-10}\,\mathrm {m}\), corresponds to a crystal with a total length of two metres. The first order SEM (red line) is compared to the integral approximation (black line). Even at the macro scale, the SEM shows a visible difference to the integral approximation. This difference can be highly relevant if we want to compute material properties ab-inito. The finite-size effects in the crystal remain relevant even in for the macroscopic system. We have therefore demonstated that the often made claim, that a lattice sum may be replaced by an integral if the underlying charge distribution is sufficiently broad, see e.g. the discussion around Eq. (5.3) in [14], is not correct in case of \(\nu =1\) in one dimension.

Fig. 5
figure 5

Maximum absolute error for \(N=200\) as a function of \(\lambda \) for different orders \(\ell \) of the singular Euler–Maclaurin expansion

We now analyse the scaling of the absolute error in the maximum norm for different SEM orders \(\ell \) and kink widths \(\lambda \) for \(N=200\). The results are displayed in Fig. 5. The smaller particle number is chosen, such that the exact forces can still be computed efficiently for all particles. We find that in case of the integral approximation (black dots), the maximum absolute error does not scale with \(\lambda \). The maximum error occurs at the chain edges, the error in the centre scales as \(\lambda ^{-2}\). Note that the inclusion of the zero order SEM contribution already compensates the error at the edges, with the maximum error now appearing close to the kink centre, in the region where the derivatives of u are large. For \(\ell =1\) (red dots), the first order SEM, the error scales approximately as \(\lambda ^{-4}\). For odd orders \(\ell \) we find that the error scaling coefficient is approximately \(\ell +3\). The exact scaling coefficients calculated from a linear fit of the last 5 data point is given in Fig. 5. For \(\ell = 7\) (purple dots) and \(\lambda =25\), the SEM offers an absolute error smaller than \(10^{-17}\) which corresponds to at least 13 digits of precision for all forces. In conclusion, we find that the SEM expansion yields an error that falls off exponentially in the expansion order and polynomially in the width \(\lambda \), reproducing the theoretically predicted error scaling.

4 Derivation of the Singular Euler–Maclaurin Expansion

We begin the derivation of the new expansion by showing the well-definedness of the Bernoulli-\(\mathcal A\) functions, on which it is based.

Proposition 4.1

For \(\ell \in \mathbb {N}\), the function \(\mathcal A_\ell \) is well-defined and obeys the estimate

$$\begin{aligned} \vert \mathcal A_{\ell } (y)\vert \le P(\ell ) \tau ^{-(\ell +1)} \vert y\vert ^{\alpha },\quad y\ge \xi , \end{aligned}$$

with \(\tau = 2\pi /(1+\gamma )\) and P a polynomial that depends only on s and \(\xi \).

For the proof of above proposition, we need two lemmata that provide estimates on the derivatives of functions that involve the interaction function s.

Lemma 4.1

Let \(s \in S\) with constants \(c > 0, \gamma \ge 1\). Then

$$\begin{aligned} \left| s_\beta ^{(\ell )}(z)\right| \le c \, \ell ! \, \gamma ^\ell \, |z|^{-\ell } \, |s(z)| \end{aligned}$$

for all \(z > 0\), \(\ell \in \mathbb {N}\) and \(\beta > 0\).

Proof

For \(\ell \in \mathbb {N}\) and \(y > 0\), we compute

$$\begin{aligned} |s_\beta ^{(\ell )}(z)|&\le \sum \limits _{k=0}^\ell \frac{\ell !}{(\ell -k)!\, k!} |s^{(k)}(z)| \beta ^{\ell - k} e^{-\beta z} \\&\le c \, \ell ! \, \gamma ^\ell \, z^{-\ell } |s(z)| \left( \sum \limits _{k=0}^\ell \frac{1}{(\ell - k)! } z^{\ell - k} \beta ^{\ell - k}\right) e^{-\beta z} \\&\le c \, \ell ! \, \gamma ^\ell \, z^{-\ell } |s(y)| e^{\beta z} e^{-\beta z} =c \, \ell ! \, \gamma ^\ell \, z^{-\ell } |s(z)|. \end{aligned}$$

\(\square \)

The behaviour of the derivatives of the integrand

$$\begin{aligned} s_{y,\ell ,\beta }(z)=\frac{1}{\ell !}(y-z)^\ell s_\beta (z) \end{aligned}$$

in Definition 2.2 of the Bernoulli-\(\mathcal A\) functions is investigated in the following.

Lemma 4.2

Let \(s \in S_\alpha \) with \(\gamma \ge 1\). For \(y>0\) and all \(z>y\), there exists \(C>0\) such that

$$\begin{aligned} \left| s_{y,\ell ,\beta }^{(k)}(z)\right| \le C \, (\gamma k)^{k-\ell } \big (\gamma +1\big )^\ell \, |z|^{\ell +\alpha -k},\quad k\ge \ell , \end{aligned}$$

and for \(z=y\),

$$\begin{aligned} \left| s_{y,\ell ,\beta }^{(k)}(y)\right| \le \left\{ \begin{matrix} C\,(\gamma k)^{k-\ell }\,|y|^{\ell +\alpha -k}, &{}k\ge \ell ,\\ 0, &{} k<\ell . \end{matrix} \right. \end{aligned}$$

Proof

For \(y>0\) we compute

$$\begin{aligned} s_{y,\ell ,\beta }^{(k)}(z)&= \frac{1}{\ell !}\sum \limits _{j=0}^k \left( {\begin{array}{c}k\\ j\end{array}}\right) (-1)^j \frac{\ell !}{(\ell -j)!} (y-z)^{\ell -j} s_{\beta }^{(k-j)}(z)\nonumber \\&=\frac{k!}{\ell !} \sum \limits _{j=0}^k \left( {\begin{array}{c}\ell \\ j\end{array}}\right) (-1)^j (y-z)^{\ell -j} \frac{s_\beta ^{(k-j)}(z)}{(k-j)!}. \end{aligned}$$

In case of \(z=y\), only the term with \(j=\ell \) contributes and we can insert the estimate from 4.1. For \(z >y\) and \(k\ge \ell \), we can set the upper limit of the sum to \(\ell \) and find

$$\begin{aligned} \Big |s_{y,\ell ,\beta }^{(k)}(z)\Big |&\le C \, \frac{k!}{\ell !} \,\gamma ^{k-\ell } \,|z|^{\ell +\alpha -k} \sum \limits _{j=0}^\ell \left( {\begin{array}{c}\ell \\ j\end{array}}\right) \big (\vert y/z-1\vert \gamma \big )^{\ell -j} \nonumber \\&=C \,\frac{k!}{\ell !} \, \gamma ^{k-\ell } |z|^{\ell +\alpha -k} \Big ( \vert y/z-1\vert \gamma +1\Big )^\ell , \end{aligned}$$

with \(C=c\, c_\xi \) with \(\xi =y\) and the lemma follows after noticing that \(\vert y/z -1 \vert \gamma <\gamma \) and that \(k!/\ell !\le k^{k-\ell }\) for \(k\ge \ell \). \(\square \)

With above lemma, we now prove the well-definedness of the Bernoulli-\(\mathcal A\) functions and provide a bound.

Proof

(Proposition 4.1) For \(\beta >0\), we first introduce the auxiliary function

$$\begin{aligned} \mathcal A_{\ell ,\beta } (y) =\sum _{n=\lceil y \rceil }^\infty s_{y,\ell ,\beta }(n) - \int \limits _y^\infty s_{y,\ell ,\beta }(z) \,\mathrm d z, \quad y > 0, \end{aligned}$$

and subsequently prove the existence of the limit \(\beta \searrow 0\) using the standard EM expansion, which takes the simplest form for the integral offset \(\delta =1+y-\lceil y \rceil \), namely

$$\begin{aligned} \mathcal A_{\ell ,\beta } (y)= \sum _{k=0}^{m} (-1)^k \frac{B_{k+1}(1+y-\lceil y \rceil )}{(k+1)!} s_{y,\ell ,\beta }^{(k)}(y)+\mathcal R_{m,\beta }, \end{aligned}$$
(4.1)

with the remainder

$$\begin{aligned} \mathcal R_{m,\beta }=(-1)^{m} \int \limits _{y}^\infty \frac{B_ {m+1}(1+z-\lceil z \rceil )}{(m+1)!} s^{(m+1)}_{y,\ell ,\beta }(z)\,\mathrm d z. \end{aligned}$$

Clearly, the limit \(\beta \searrow 0\) is well defined for the sum over k. Moreover, setting the expansion order

$$\begin{aligned} m=\ell + \max \{0,\lceil \alpha + 1 \rceil \}, \end{aligned}$$

garantees, by Lemma 4.2, that a \(\beta \)-independent and integrable majorant for the integrand in the remainder can be established. Hence, the limit and thus \(\mathcal A_\ell \) is well-defined by the dominated convergence theorem.

We now use above representation in order to provide a bound to \(\mathcal A_\ell \) that falls off exponentially in \(\ell \). To this end, we first recall the following bound of the Bernoulli polynomials, see e.g. Eq. (19) and following discussion in [15],

$$\begin{aligned} \max _{y\in [0,1]} \left| \frac{B_k(y )}{k!}\right| \le \frac{4}{(2\pi )^k},\quad k\in \mathbb {N}. \end{aligned}$$

Inserting this bound as well as the estimate from Lemma 4.2 into (4.1), we find

$$\begin{aligned} \vert \mathcal A_{\ell ,\beta } (y)\vert\le & {} 4 C\sum _{k=\ell }^{\ell +m_\alpha } (2\pi )^{-(k+1)} (\gamma k)^{k-\ell } \vert y \vert ^{\ell +\alpha -k} \\&\quad +\, 4 C \bigg ( \frac{2\pi }{\gamma +1} \bigg )^{-(\ell +1)} \int \limits _{y}^\infty \big (\gamma (\ell +m_\alpha +1)\big )^{m_\alpha +1}\vert z \vert ^{\alpha -(m_\alpha +1)}\,\mathrm d z, \end{aligned}$$

with \(m_\alpha =\max \{0,\lceil \alpha \rceil +1\}\) and \(C=c\, c_\xi \). Thus,

$$\begin{aligned} \vert \mathcal A_{\ell } (y)\vert&\le P(\ell ) \tau ^{-(\ell +1)} \vert y\vert ^{\alpha },\quad y\ge \xi , \end{aligned}$$

with \(\tau = 2\pi /(1+\gamma )\), and a constant \(C>0\) and a polynomial P that depend only on \(\xi >0\) and s. \(\square \)

Using above estimates, we are now in the position to prove the properties of the Bernoulli-\(\mathcal A\) functions.

Proposition 4.2

(Properties of \(\mathcal A_\ell \)) Let \(\ell \in \mathbb {N}\). Then \(\mathcal A_{\ell }\) is smooth on \(\mathbb {R}_+{\setminus } \mathbb {N}_+\) and \(\mathcal A_\ell \in C^{\ell -1}(\mathbb {R}_+{\setminus } \mathbb {N}_+)\). \(\mathcal A_{\ell +1}\) is an antiderivative of \(\mathcal A_\ell \) . Finally, the function \(\mathcal A_0\) obeys the jump relation

$$\begin{aligned} \lim _{\varepsilon \searrow 0} \big (\mathcal A_0(n)-\mathcal A_0(n+\varepsilon )\big ) = s(n),\quad n\in \mathbb {N}_+, \end{aligned}$$

and the derivative relation

$$\begin{aligned} \lim _{\varepsilon \searrow 0} \frac{\mathcal A_0(y)-\mathcal A_0(y-\varepsilon )}{\varepsilon } = s(y),\quad y\in \mathbb {R}_+. \end{aligned}$$

Proof

The binomial theorem yields the following representation of the Bernoulli-\(\mathcal A\) functions,

$$\begin{aligned} \mathcal A_\ell (y) = \frac{1}{\ell !} \sum _{k=0}^\ell (-1)^k\left( {\begin{array}{c}\ell \\ k\end{array}}\right) y^{\ell -k} \lim _{\beta \searrow 0}\Bigg (\sum _{n=\lceil y \rceil }^\infty n^k s_\beta (n)-\int \limits _{y}^\infty z^k s_\beta (z)\, \mathrm d z\Bigg ), \end{aligned}$$

where we have used that the limit in \(\beta \) on the right hand side exists due to asymptotic smoothness of \(y^k s_\beta (y)\). Using that the \(\beta \)-limit is well-defined, we already find that the \(\beta \)-limit is uniform in y on any compact subset of \(\mathbb {R}_+\) by choosing \(m\in \mathbb {N}_+\) with \(m>\lceil y \rceil \) and writing

$$\begin{aligned} \lim _{\beta \searrow 0} \Bigg (\sum _{n=\lceil y \rceil }^\infty n^k s_\beta (n)-\int \limits _{y}^\infty z^k s_\beta (z)\, \mathrm d z\Bigg )= \sum _{n=\lceil y \rceil }^m n^k s(n)-\int \limits _{y}^m z^k s(z)\,\mathrm d z + \lim _{\beta \searrow 0} I_\beta , \end{aligned}$$

with \(I_\beta \) the y-independent remaining regularised difference between sum and integral.

We now show that \(\mathcal A_\ell \in C^0(\mathbb {R}_+)\) for all \(\ell \ge 1\). Above representation implies smoothness of \(\mathcal A_\ell \) on \(\mathbb {R}_+{\setminus } \mathbb {N}_+\), hence we only need to investigate \(y\in \mathbb {N}_+\). As \(\lceil \cdot \rceil \) is left continuous, it is sufficient to study the finite difference from the right, finding

$$\begin{aligned} \lim _{\varepsilon \searrow 0} (\mathcal A_\ell (n)-\mathcal A_\ell (n+\varepsilon )) = \frac{1}{\ell !} \sum _{k=0}^\ell (-1)^k\left( {\begin{array}{c}\ell \\ k\end{array}}\right) n^{\ell -k} (-n)^k s(n) = \frac{1}{\ell !}(n-n)^\ell s(n), \end{aligned}$$

which vanishes for \(\ell \ge 1\). For \(\ell = 0\), we obtain the jump condition

$$\begin{aligned} \lim _{\varepsilon \searrow 0} (\mathcal A_\ell (n)-\mathcal A_\ell (n+\varepsilon )) = s(n). \end{aligned}$$

We now consider differentiability of \(\mathcal A_\ell \). For \(y\in \mathbb {R}_+{\setminus } \mathbb {N}_+\), the function \(\mathcal A_\ell \) is smooth as the composition of smooth functions. With the same argument, it is left differentiable on \(\mathbb {R}_+\). We now compute the left-handed difference quotient of \(\mathcal A_{\ell }\). We find

$$\begin{aligned}&\lim _{\varepsilon \searrow 0} \frac{\mathcal A_{\ell }(y)-\mathcal A_{\ell }(y-\varepsilon )}{\varepsilon } \\&=\frac{1}{\ell !}\sum _{k=0}^{\ell -1} (-1)^k \left( {\begin{array}{c}\ell \\ k\end{array}}\right) (\ell -k) y^{\ell -1-k}\lim _{\beta \searrow 0}\Bigg (\sum _{n=\lceil y \rceil }^\infty n^k s_\beta (n)-\int \limits _{y}^\infty z^k s_\beta (z)\, \mathrm d z\Bigg ) + \frac{\delta _{0, \ell }}{\ell !}s(y), \end{aligned}$$

where \(\delta _{0, \ell }\) denotes the Kronecker delta. For \(\ell \ge 1\), the first term on the right hand side equals \(\mathcal A_{\ell -1}\) and the second term vanishes, showing that \(\mathcal A_{\ell }\) is an antiderivative of \(\mathcal A_{\ell -1}\). Thus, \(\mathcal A_{\ell }\in C^{\ell -1}(\mathbb {R}_+)\). For \(\ell = 0\) on the other hand, the first term vanishes and the second term yields the derivative relation.

$$\begin{aligned} \lim _{\varepsilon \searrow 0} \frac{\mathcal A_{0}(y)-\mathcal A_{0}(y-\varepsilon )}{\varepsilon } =s(y),\quad y\in \mathbb {R}_+, \end{aligned}$$

which extends to the undirected limit \(\varepsilon \rightarrow 0\) on \(y\in \mathbb {R}_+{\setminus } \mathbb {N}_+\) as \(\mathcal A_0\) is smooth outside of integers. \(\square \)

Using Proposition 4.2, we can now formulate the zero order SEM expansion.

Proposition 4.3

(Zero order SEM expansion) Let \(x,a,b\in \mathbb {Z}\) with \(x\le a<b\) and \(\delta \in (0,1]\). Let f factor into \(f(y)=s(y-x) g(y)\) with \(s \in S\) and \(g \in C^{1}[a+\delta ,b+\delta ]\). Then,

$$\begin{aligned} \sum _{n=a+1}^b f(n)- \int \limits _{a+\delta }^{b+\delta } f(y)\, \mathrm d y = - \mathcal A_0 (y-x)g(y)\Big \vert _{y=a+\delta }^{y=b+\delta }+\int \limits _{a+\delta }^{b+\delta } \mathcal A_0 (y-x) g'(y) \,\mathrm d y. \end{aligned}$$
(4.2)

Proof

By the jump relation in Proposition 4.2, we can write the sum on the left hand side of (4.2) as

$$\begin{aligned} \sum _{n=a+1}^b f(n)=\sum _{n=a+1}^b \lim _{\varepsilon \rightarrow 0} \Big (\mathcal A_0 (n-x-\varepsilon )-\mathcal A_0 (n-x+\varepsilon )\Big ) g(n). \end{aligned}$$
(4.3)

Subsequently (4.3) is divided into two separate sums. On the right hand side, an index shift is performed in the sum that includes the terms \(\mathcal A_0 (n-x-\varepsilon )\) resulting in the expression

$$\begin{aligned} \lim _{\varepsilon \rightarrow 0}\sum _{n=a}^{b-1} \mathcal A_0 (n+1-x-\varepsilon )g(n+1)-\lim _{\varepsilon \rightarrow 0}\sum _{n=a+1}^{b} \mathcal A_0 (n-x+\varepsilon ) g(n). \end{aligned}$$

A recombination of the two sums yields

$$\begin{aligned} \sum _{n=a+1}^b f(n) =\lim _{\varepsilon \rightarrow 0} \Bigg (\sum _{n=a+1}^{b} \mathcal A_0 (y-x) g(y) \Big \vert _{y=n+\varepsilon }^{y=n+1-\varepsilon } -\mathcal A_0 (y-x) g(y)\bigg \vert _{y=a+1-\varepsilon }^{y=b+1-\varepsilon }\Bigg ), \end{aligned}$$
(4.4)

where the second term results from an adjustment of the differing summation intervals. Going back to the integral on the left hand side of (4.2), we use the derivative property in Proposition 4.2 and find

$$\begin{aligned} \int \limits _{a+\delta }^{b+\delta } f(y)\, \mathrm d y= & {} \lim _{\varepsilon \rightarrow 0}\bigg (\sum _{n=a+1}^b \int \limits _{n+\varepsilon }^{n+1-\varepsilon } \mathcal A_0' (y-x)\, g(y) \,\mathrm d y \\&\quad +\,\int \limits _{a+\delta -\varepsilon }^{a+1-\varepsilon } \mathcal A_0' (y-x) g(y) \,\mathrm d y-\int \limits _{b+\delta -\varepsilon }^{b+1-\varepsilon } \mathcal A_0' (y-x) g(y)\, \mathrm d y\bigg ). \end{aligned}$$

Integration by parts on all integrals in (4.5) in order to remove the derivatives of \(\mathcal A_0\) from the expression yields

$$\begin{aligned}&\int \limits _{a+\delta }^{b+\delta } f(y)\, \mathrm d y =\lim _{\varepsilon \rightarrow 0} \Bigg ( \sum _{n=a+1}^{b} \mathcal A_0 (y-x) g(y) \Big \vert _{y=n+\varepsilon }^{y=n+1-\varepsilon } + \mathcal A_0 (y-x) g(y)\Big \vert _{y=a+\delta -\varepsilon }^{y=a+1-\varepsilon } \nonumber \\&-\mathcal A_0 (y-x) g(y)\Big \vert _{y=b+\delta -\varepsilon }^{y=b+1-\varepsilon }\Bigg )-\int \limits _{a+\delta }^{b+\delta } \mathcal A_0 (y-x) g'(y)\, \mathrm d y , \end{aligned}$$
(4.5)

where the integrals have been combined to a single one by taking the limit \(\varepsilon \rightarrow 0\). Subtracting (4.5) from (4.4), we obtain

$$\begin{aligned} \sum _{n=a+1}^b f(n)- \int \limits _{a+\delta }^{b+\delta } f(y)\, \mathrm d y= -\lim _{\varepsilon \rightarrow 0} \mathcal A_0 (y-x)g(y)\Big \vert _{y=a+\delta -\varepsilon }^{y=b+\delta -\varepsilon }+\int \limits _{a+\delta }^{b+\delta } \mathcal A_0 (y-x) g'(y) \,\mathrm d y. \end{aligned}$$
(4.6)

As \(\mathcal A_0\) is left continuous (\(\lceil \cdot \rceil \) is left continuous), the proposition follows after performing the limit \(\varepsilon \rightarrow 0\). \(\square \)

We proceed with the proof of the main theorem.

Proof

(Proof of 2.1 (SEM expansion)) For \(\ell \in \mathbb {N}\), we show that

$$\begin{aligned} \sum _{n=a+1}^b f(n)-\int \limits _{a+\delta }^{b+\delta } f(y)\,\mathrm d y = -\sum _{k=0}^\ell (-1)^k \mathcal A_k (y-x)g^{(k)}(y) \Big \vert ^{y=b+\delta }_{y=a+\delta } \\ +\int \limits _{a+\delta }^{b+\delta }(-1)^\ell \mathcal A_ {\ell } (y-x) g^{(\ell +1)}(y) \,\mathrm d y. \end{aligned}$$

The case \(\ell = 0\) is proved in Proposition 4.3. The case of higher expansion orders \(\ell \ge 1\) readily follows via iterated integration by parts, where successive antiderivatives of \(\mathcal A_0\) are given by \((\mathcal A_k)_{k \in \mathbb {N}}\), see Proposition 4.2. \(\square \)

Finally, the bound on the remainder formulated in Theorem 2.2 is a direct consequence of the bound on \(\mathcal A_\ell \) from Proposition 4.1 and the defining property of the band-limited function g, see Definition 2.4.

5 Outlook

In this work, we have developed the singular Euler–Maclaurin (SEM) expansion that, first, allows for the precise and efficient evaluation of large sums with singularities and, second, provides precise quadrature rules for singular integrals. With the new method, we can quantify finite-size effects in condensed matter systems with nonlinear long-range interactions, improving upon standard approximations in the field. Using the forces in a domain wall in a crystal of charged particles as a physically relevant example, we have shown that the method provides an approximation to the force sum in a runtime that does not depend on the particle number and with an approximation error that falls of exponentially with the expansion order and algebraically in the characteristic lengthscale of the function. Hence we are able to provide reliable predictions about the properties of solids even for macroscopic particle numbers. As a first important result, we have shown that the often-used integral approximation tends to underestimate the absolute value of forces inside a domain wall if the particles interact via the Coulomb repulsion. We expect that the SEM expansion will serve as an important tool in condensed matter and quantum physics, helping us to replace qualitative estimates by reliable predictions. It would for instance be interesting to determine precise time evolutions and stationary states through the solution of the integro-differential equations that arise from the application of the SEM.