Padding-Invariant Ewald Message Passing for Isolated Molecules

Graph neural networks that predict molecular energies usually let each atom exchange information only with neighbors within about 5 Å. To capture long-range electrostatics and dispersion, several recent models add an Ewald-style channel, borrowed from physics, that splits an interaction into a short-range part handled in real space and a smooth long-range part handled in frequency space. For an isolated molecule, which has no natural periodic cell, this requires an artificial step: the molecule is placed in a padded box, and a set of plane waves (Fourier modes) up to a frequency cutoff is chosen. Two hand-picked numbers, the padding factor and the frequency cutoff, then set the cost and behavior of the long-range channel. Those numbers are normally chosen by heuristics. Reported gains from such channels are 16% on OE62 for Ewald message passing (Kosmala et al.) and 22% for Neural P³M. Both were measured against baselines tuned by their authors, not under a shared tuning protocol.

This note argues that a padded-box plane-wave basis evaluated at atom positions is a Fourier extension: an overcomplete, redundant set of functions, as in numerical approximation theory. Fourier extensions have a known structure. Once the truncated singular value decomposition (TSVD) is fixed, the extension ratio stops mattering. TSVD keeps only the directions of a matrix whose singular values exceed a tolerance $\tau$, which here means a fixed conditioning tolerance. Adcock and Ruan call this the invariance phenomenon. If it carries over, the long-range channel can be reparameterized by a tolerance instead of a padding factor. That makes its cost independent of padding and shrinks the hyperparameter space. The smaller space makes a fair, equal-budget hyperparameter search affordable, and that search can test whether the long-range gains on OE62 are architectural at all.

Core Claim

In Ewald message passing, atom features $h \in \mathbb{R}^{N}$ (one channel, $N$ atoms) are mixed globally as $h' = S\,F\,S^{H} h$. Here $S \in \mathbb{C}^{N \times K}$ has entries $e^{i k \cdot r_j}$ for atom positions $r_j$ and the $K$ allowed frequencies $k$. $F$ is a diagonal learned filter over frequencies, and $S^H$ is the conjugate transpose, which computes the structure factors.

Padding the box by a factor $T$ shrinks the frequency-lattice spacing as $1/T$. The number of frequencies below a fixed cutoff $k_{\max}$ therefore grows as $T^3$. The atoms, however, still occupy a region of extent $L$. Functions that are both confined to extent $L$ and limited to frequencies below $k_{\max}$ span a space whose dimension scales roughly as $(k_{\max} L)^3$, independent of $T$. This is the classical count of space- and band-limited functions. So the numerical rank of $S$ at tolerance $\tau$ should saturate in $T$, while the cost of computing $S F S^H h$ keeps growing.

We therefore replace $S$ by its rank-$r$ truncation $U_r \Sigma_r V_r^{H}$, where $r$ is the number of singular values above $\tau\,\sigma_{\max}$. The global mixing then becomes

$$h' = U_r \Sigma_r \left(V_r^{H} F V_r\right) \Sigma_r U_r^{H} h .$$

The learned filter $F$ now acts only through an $r \times r$ matrix. The three claims are that this compressed channel matches the uncompressed one, that its accuracy and cost are invariant to the padding factor $T$, and that its hyperparameters reduce to $(k_{\max}, \tau)$ plus the real-space cutoff.

Prior Work and How This Differs

The method comes from two numerical-analysis papers. Adcock and Ruan solve 1D Fourier-extension least squares with TSVD. They show that, at fixed condition threshold, the extension ratio is offset by oversampling and does not affect error. Huybrechs et al. show that for Gaussian least-squares radial basis function approximations, the TSVD threshold sets a saturation error floor. We borrow the invariance prediction from the first and the floor prediction from the second. Neither paper touches three-dimensional atom positions or learned filters.

Shelley is the closest bridge between Ewald summation and SVD: it uses a backward-stable SVD to precompute an Ewald-derived periodic operator in the fast multipole method. That SVD is a static solver for a fixed operator. Ours is a per-structure, trainable compression whose tolerance is a model hyperparameter.

The work is motivated by three long-range models whose frequency-space hyperparameters are set by hand. These are Ewald message passing, which uses a spherical frequency cutoff with box padding for molecules, Neural P³M, and LOREM, which reports that competing long-range models need dataset-specific manual tuning.

The torch-pme autotuner of Loche et al. chooses Ewald parameters against an analytic error target. That target is well defined for physical point charges in periodic cells but not for a learned filter on a padded molecule. Our tolerance gives a parameter that remains meaningful in that setting.

MCGM explicitly gives up on frequency space because of its tuning burden and replaces it with clustering. Our proposal makes the opposite bet: the burden is an artifact of an unnecessary parameterization.

The evaluation design is constrained by results from hyperparameter optimization. Rao et al. found, across 12.5 million tuned runs, that molecular model rankings are task-dependent and that undertuned baselines inflate claims. Wiemerslage et al. showed that tuning gaps can invert architecture rankings. Loshchilov et al. show that tuning components in isolation misses interactions between them. Together these mean any claimed long-range gain must survive equal-budget joint tuning of backbone and long-range channel.

Research Program

Numerical study (no training). For a sample of OE62 molecules, we compute singular-value spectra of $S$ across padding factors $T$ from 1.2 to 3 and several $k_{\max}$ values. We test two predictions. First, the numerical rank at tolerance $\tau$ should plateau in $T$. Second, it should scale with molecular extent times $k_{\max}$ rather than with $K$. If rank keeps growing with $T$, the premise fails and the project stops here.

Building the compressed channel. We implement the compressed channel inside the Ewald message passing code path for SchNet, PaiNN, and DimeNet++ backbones. Gradients through the SVD are numerically fragile where singular values nearly coincide. We therefore compute the decomposition from the small $N \times N$ Gram matrix $S S^H$ with eigenvalue-gap safeguards.

Hard versus smooth truncation. Hard truncation changes rank discontinuously as atoms move, which harms forces. We compare it against a smooth filter that weights each direction by $\sigma_i^2/(\sigma_i^2+\tau^2\sigma_{\max}^2)$. That smooth filter is mathematically the ridge alternative, applied to the frame rather than to $F$. This comparison decides whether hard truncation is usable beyond energies.

Equal-budget search. We run a single Bayesian-optimization protocol, with an identical trial count, multi-fidelity schedule, and seeds, over three search spaces. The first is the backbone alone. The second is the backbone plus the original channel, searched over $(r_c, T, k_{\max})$ and filter width. The third is the backbone plus the compressed channel, searched over $(r_c, k_{\max}, \tau)$. We record final error, the budget needed to reach within a fixed margin of each space's best error, and the spread of error across trials.

Baselines

The naive reference is each backbone with no long-range channel, tuned with the same search budget as everything else. Without it, any long-range gain is confounded with tuning effort, which is exactly the failure Rao et al. document. Beating it means a lower OE62 energy mean absolute error under identical trials.

The direct competitor is Ewald message passing with padded boxes and a spherical frequency cutoff, run in the same code base with its own search space and the same budget. Kosmala et al. report a 16% average reduction in OE62 energy error across four backbones under their tuning. The compressed channel beats this baseline if it matches its tuned error at equal or lower wall-clock time and shows lower error variance across padding factors. Matching accuracy while removing a hyperparameter and cutting cost counts as success; we do not need it to be more accurate.

The strongest existing number in the file on this benchmark is DimeNet++-MCGM at 38.7 meV OE62 energy error (MCGM). MCGM also reports a 26.2% average reduction across five backbones. Neural P³M reports 22%, and SE3Set reports 51.7 meV. We rerun DimeNet++-MCGM under our shared search budget, then compare against both its reported figure and our rerun. Beating it is not required for the core claim. Landing within its tuned error, with a physically interpretable channel, would mean the case against frequency-space methods is about parameterization, not capability.

Two ablations isolate the key ingredient. The first, a "compressed channel at fixed T" ablation, varies the padding factor with everything else frozen and tests invariance directly. The second applies the same compression to a periodic control on OC20. There, no padding exists, so the invariance argument predicts no benefit beyond plain cost reduction. A benefit appearing on OC20 would indicate we are measuring something other than the Fourier-extension effect.

Why not just…?

Why not just run Bayesian optimization over the existing padding and cutoff parameters? This is the real threat, and the equal-budget search is designed to settle it. If the original space reaches the same final error within the same number of trials, the reparameterization only buys runtime. We would report it that way. The invariance argument predicts more than that: one of the original search dimensions is nearly flat, so an optimizer spends trials on it while the compute cost of large $T$ inflates each trial. We will measure both trials-to-target and total GPU-hours.

Why not just use a small fixed padding and a lower frequency cutoff? Small padding brings back interactions between periodic images, which is exactly the artifact padding exists to suppress. Lowering $k_{\max}$ discards real frequency content uniformly across molecules of very different sizes. The numerical study will show whether the rank TSVD keeps varies strongly with molecular extent. If it does, a single geometric cutoff is a poor substitute for a structure-adaptive one. If it barely varies, this alternative is adequate and we will say so.

Why not ridge-style smoothing instead of hard truncation? LoRanPAC found TSVD far more stable and less tuning-sensitive than ridge regression. That evidence comes from continual-learning readouts with $10^5$ random features, not from molecules, so we do not rely on it. The smooth-filter variant in our program is the ridge alternative. Given the force-smoothness concern, it may well win. The proposal's claim survives either way, because invariance depends on the tolerance, not on hard thresholding.

Why not drop frequency space and use clustering or virtual nodes? MCGM and Neural Atoms do this and report strong OE62 numbers. Their gains were also measured under author tuning, so including MCGM in the shared search is what makes the comparison meaningful.

Why not randomized SVD for speed? LoRanPAC reports randomized SVD to be less stable than exact truncation in ill-conditioned settings. Our matrices are small anyway, with $N$ in the hundreds, so exact decomposition of the $N \times N$ Gram matrix is cheap.

Decisive Checks

The project lives or dies on four measurements. First, on OE62 geometries, numerical rank at fixed $\tau$ must plateau as padding grows; if it does not, the idea is wrong. Second, the trained compressed channel's energy error, across padding factors 1.2 to 3, must vary less than the original channel's error, while its per-step time stays flat instead of growing with $T^3$. Third, under equal-budget Bayesian optimization, the compressed space must reach the original space's best error in fewer GPU-hours. Fourth, after equal tuning of backbone-only models, the remaining long-range improvement must be reported honestly, even if it is much smaller than the published 16–26%.

For forces, we use MD22. We compare force error between hard and smooth truncation, and check energy conservation in short constant-energy simulations, where discontinuities from changes in rank would show up as drift.