> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/cuda/cupotential/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/cuda/cupotential/_mcp/server.

# Splitting the interaction

> Separate a singular pair potential into a short-range contribution and a smooth long-range contribution.

A long-range interaction connects every particle to every other particle and
to its periodic images. Splitting makes that calculation practical: evaluate
nearby interactions directly and evaluate a smooth, collective contribution
in Fourier space.

The discussion below uses the Coulomb kernel $u(r)=1/r$. Charges supply the
pair weight $q_iq_j$; the Coulomb unit-conversion factor is omitted from the
equations and multiplies the resulting energies and forces.

## One interaction, two contributions

Choose a long-range function $u_{\mathrm{lr}}$ and define its complement:

$$
u(r)=\frac{1}{r}
=u_{\mathrm{sr}}(r)+u_{\mathrm{lr}}(r),
\qquad
u_{\mathrm{sr}}(r)=\frac{1}{r}-u_{\mathrm{lr}}(r).
$$

The two parts have different jobs:

| Contribution                   | Desired behavior                                                                                  | How it is evaluated                                            |
| ------------------------------ | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| Short range, $u_{\mathrm{sr}}$ | Contains the singularity at zero separation and becomes zero or negligible beyond a cutoff $r_c$. | Direct pair calculations over nearby particles.                |
| Long range, $u_{\mathrm{lr}}$  | Is finite at the origin, varies smoothly, and carries the far field.                              | A Fourier-space calculation, accelerated with a mesh and FFTs. |

This complementary split is an identity. Applying a cutoff or shifting either
part can change the interaction it represents. Approximating its evaluation
with finite Fourier sums, a mesh, or finite precision introduces further error.
[Error Analysis](/cuda/cupotential/theory/error-analysis) distinguishes these contributions.

The long-range part still contributes at short distances. Nearby pairs
therefore contribute to both calculations: directly through $u_{\mathrm{sr}}$
and through the collective long-range calculation for $u_{\mathrm{lr}}$.

## An example: Ewald splitting

The classical Ewald choice uses the error function and complementary error
function:

$$
u_{\mathrm{sr}}(r)=\frac{\operatorname{erfc}(\alpha r)}{r},
\qquad
u_{\mathrm{lr}}(r)=\frac{\operatorname{erf}(\alpha r)}{r},
\qquad \alpha>0.
$$

Their sum is $1/r$ because $\operatorname{erfc}(x)+\operatorname{erf}(x)=1$.
The inverse length $\alpha$ controls the split. The long-range function has
the finite limit

$$
u_{\mathrm{lr}}(0)=\frac{2\alpha}{\sqrt{\pi}}.
$$

For a nonzero angular wavevector $\mathbf{k}$, with $k=|\mathbf{k}|$, its
Fourier kernel is

$$
K_{\mathrm{lr}}(k)=\frac{4\pi}{k^2}
\exp\!\left(-\frac{k^2}{4\alpha^2}\right).
$$

Increasing $\alpha$ makes the short-range term decay faster, so fewer distant
pairs matter. It also makes the Fourier kernel decay more slowly, requiring
more reciprocal modes. Decreasing $\alpha$ reverses the tradeoff. Ewald's
short-range term approaches zero continuously but is not exactly zero at any
finite cutoff; discarding its tail introduces a truncation error. See the
[OpenMM Ewald description](https://docs.openmm.org/latest/userguide/theory/02_standard_forces.html#coulomb-interaction-with-ewald-summation)
for the corresponding energy sums.

## cuPotential's Prolate splitting

The prolate approach to Ewald summation is described by Liang, Lu, Barnett,
Greengard, and Jiang in
[*Accelerating molecular dynamics simulations using fast Ewald summation with prolates*](https://www.nature.com/articles/s41467-026-73232-8),
*Nature Communications* **17**, 6681 (2026). The paper introduces ESP, which
uses prolate spheroidal wave functions for splitting and spreading.

The OpenMM integration selects **Prolate** by default, using cuPotential's
**C2 Prolate** splitting.

Inside the cutoff, write the long-range kernel in terms of a dimensionless
function $\ell$:

$$
u_{\mathrm{lr}}(r)=
\begin{cases}
r_c^{-1}\ell(r/r_c), & 0\leq r<r_c,\\
r^{-1}, & r\geq r_c.
\end{cases}
$$

The function is finite and even at the origin. At the cutoff, it matches the
Coulomb kernel through two derivatives:

$$
\ell(1)=1,\qquad \ell'(1)=-1,\qquad \ell''(1)=2.
$$

Consequently, the short-range part satisfies

$$
u_{\mathrm{sr}}(r)=0\quad(r\geq r_c),
\qquad
u_{\mathrm{sr}}(r_c)=u'_{\mathrm{sr}}(r_c)
=u''_{\mathrm{sr}}(r_c)=0.
$$

Matching at the cutoff reduces high-frequency Fourier content. The prolate
construction concentrates the reciprocal contribution at low frequencies
while making the short-range contribution compact. Its Fourier kernel has a
nonzero, oscillatory tail, so truncating reciprocal modes still introduces
error.

## Fourier and periodic conventions

Let $\Omega$ be one periodic cell of volume $V$, and let $\mathbf{k}$ range
over its reciprocal lattice. For a cubic cell of side $L$,
$\mathbf{k}=2\pi\mathbf{m}/L$ with integer vector $\mathbf{m}$.
These guides use cell-integral Fourier coefficients:

$$
\widehat f(\mathbf{k})
=\int_\Omega f(\mathbf{r})e^{-i\mathbf{k}\cdot\mathbf{r}}\,d\mathbf{r},
\qquad
f(\mathbf{r})=\frac{1}{V}\sum_{\mathbf{k}}
\widehat f(\mathbf{k})e^{i\mathbf{k}\cdot\mathbf{r}}.
$$

The point-charge density and its transform, called the **structure factor**,
are

$$
\rho(\mathbf{r})=\sum_j q_j\delta_{\mathrm{per}}(\mathbf{r}-\mathbf{r}_j),
\qquad
S(\mathbf{k})=\widehat\rho(\mathbf{k})
=\sum_j q_j e^{-i\mathbf{k}\cdot\mathbf{r}_j}.
$$

Here $\delta_{\mathrm{per}}$ is the periodic delta distribution. In Fourier
formulas, $K_{\mathrm{lr}}=\widehat u_{\mathrm{lr}}$ refers to the periodic long-range
kernel under the boundary convention below. For Coulomb interactions,
periodization is understood in the Ewald sense; an unregularized sum of
positive $1/r$ image kernels is not a convergent definition.

## Self energy and the zero mode

For a neutral Coulomb system with conducting, or tin-foil, boundaries, the
uncorrected long-range energy is

$$
E_{\mathrm{lr}}^{\mathrm{raw}}=\frac{1}{2V}\sum_{\mathbf{k}\ne\mathbf{0}}
K_{\mathrm{lr}}(k)|S(\mathbf{k})|^2.
$$

The factor $1/2$ prevents counting pairs twice. This smooth sum includes each
particle interacting with its own finite long-range contribution at zero
separation. Remove that central self interaction with

$$
E_{\mathrm{self}}=-\frac{u_{\mathrm{lr}}(0)}{2}\sum_i q_i^2.
$$

For the Ewald example, this becomes
$E_{\mathrm{self}}=-\alpha\sum_iq_i^2/\sqrt{\pi}$.
Interactions with a particle's periodic images remain part of the energy.

The Coulomb kernel is singular at $\mathbf{k}=\mathbf{0}$, so that mode is
omitted rather than evaluated. This also fixes the potential's arbitrary
constant. A non-neutral cell requires a matching uniform neutralizing
background and its split-dependent energy correction; omitting the zero mode
alone does not supply that correction. cuPotential's Coulomb splitting plan
provides both the self and net-charge corrections. Direct, reciprocal, self,
background, and any exclusion corrections must use the same split.

Continue with [Spreading](/cuda/cupotential/theory/spreading) for the mesh calculation.
The [convergence plots](/cuda/cupotential/theory/error-analysis) show how numerical errors
change as the calculation is refined.