Thresholded Electron Densities Fail Between Grid Points

Machine-learned electron density models and grid-based density functional theory (DFT, the standard way of computing a molecule's electronic structure from its electron density rather than its full wavefunction) both store the density as numbers on a discrete grid. Both routinely zero out values that fall below a tolerance. They do this to skip empty vacuum regions, to keep probe sets sparse, and to cut the cost of later Fourier transforms. The usual reasoning is that dropping values smaller than $\delta$ can change the answer by at most about $\delta$. That reasoning is correct at the grid points and wrong between them. Signal-processing theory shows that for bandlimited signals, discarding small samples produces reconstruction errors between samples that are unbounded as the threshold shrinks. The size of the error is set not by $\delta$ but by how slowly the interpolation kernel decays.

This note proposes to carry that result into the finite-grid, three-dimensional setting that electronic structure codes actually use. On a finite grid the blow-up becomes an amplification factor that grows with grid size. The amplification is mild for density values but severe for density gradients, which every gradient-corrected exchange-correlation functional (the term in DFT that approximates electron-electron interaction effects) consumes. The fix is to change the interpolation kernel, not the threshold. That fix has an unavoidable accuracy price, and a known speed limit on stable Fourier reconstruction tells us what that price is.

Core Claim

The prior result is from Characterization of the pointwise and the peak value behavior of system approximation under thresholding. It shows that when thresholded samples pass through a linear filter with impulse response $h$, the error at a point $t$ diverges, for a generic set of signals, exactly when $\sum_k |h(t-k)| = \infty$. For plain sinc interpolation this holds at every non-grid point. Unboundedness of thresholding and quantization for bandlimited signals adds that on the grid the error never exceeds $\delta$. Low on-grid error is therefore exactly the regime in which off-grid failure is invisible.

On a periodic grid with $M$ points per dimension, the infinite sum becomes a finite sum $\Lambda_M(t)=\sum_{k}|h_M(t-k)|$. Here $h_M$ is the operator that maps stored grid values to the quantity actually used downstream. Examples are the density at an off-grid point, its gradient, or the Hartree (electrostatic) potential. The worst-case error from thresholding at level $\delta$ is then

$$ \sup_t |\Delta(t)| \le \delta \,\sup_t \Lambda_M(t), $$

where $\Delta(t)$ is the difference between the downstream quantity computed from the full grid and from the thresholded grid.

We expect the following growth rates for $\Lambda_M$, by direct estimation of the shift-sums of the periodic interpolation kernel, its derivative, and the inverse-Laplacian kernel.

For trigonometric (FFT) interpolation of values, $\Lambda_M$ grows like $\log M$ per dimension, which is the classical growth of the Lebesgue constant. For the FFT gradient it grows like $M\log M$ per dimension. For the Hartree potential, whose kernel is smoothing, it stays bounded.

The claim to test is that the gradient amplification, not the value error, is what limits accuracy. It should matter at realistic thresholds and grid sizes in exchange-correlation energies and in non-self-consistent DFT energies computed from predicted densities. The claim also says that replacing sinc/FFT interpolation by an oversampled, smoothly windowed kernel with bounded shift-sum removes the growth.

The price of that replacement is set by A Stability Barrier for Reconstructions from Fourier Samples. That paper proves that any reconstruction whose error amplification grows at most polynomially in the number of samples $m$ converges at best like $\exp(-c\sqrt{m})$ on non-periodic analytic functions. This bound is relevant here because density components cut off by sharp spatial masks are effectively non-periodic, and the only alternative to root-exponential convergence is exponential ill-conditioning. We therefore predict that stabilized pipelines trade exponential convergence for root-exponential convergence exactly where masks or cell boundaries break periodicity. Gaussian Plane-Wave Neural Operator for Electron Density Estimation (GPWNO), which zeroes its plane-wave component near nuclei, is the leading case.

Relation to Prior Work

The Boche–Mönich line of work supplies the mechanism but stays in one dimension, on infinite grids, with worst-case signals in $PW_\pi^1$. This includes the thresholding characterization above and Strong Divergence for System Approximations, which shows divergence that cannot be cured by choosing a subsequence. No-Go theorem for sampling-based signal processing constrains our design. It shows that changing sampling geometry or simply oversampling with the same kernel cannot remove the instability, which is why our remedy changes the kernel.

None of these papers asks whether physically realistic signals trigger the worst case. Electron densities decay exponentially and are close to analytic away from nuclei, so this is a real open question that the file itself flags as the "worst-case versus stochastic" gap.

On the DFT side, two learned models motivate the work. Equivariant graph neural networks for fast electron density estimation of molecules, liquids, and solids (DeepDFT) predicts density only at probe points and evaluates on the same kind of points. A Function-Centric Graph Neural Network Approach for Predicting Electron Densities (the Basis Overlap Architecture, BOA) found that truncating distant interactions helps generalization. Neither examines errors between grid points or the effect of dropping small values.

GPWNO introduces sharp masking with no convergence analysis. The rigorous analyses of the self-consistent field iteration constrain how errors propagate once they enter the iteration, but they do not address thresholding. These are On the Convergence of the Self-Consistent Field Iteration in Kohn-Sham Density Functional Theory and Mathematical Analysis and Numerical Approximations of Density Functional Theory Models for Metallic Systems.

What this proposal adds is threefold. It derives finite-grid amplification factors for each downstream operator. It tests them on real densities with exact off-grid ground truth. It also offers a stabilized reconstruction, priced against the root-exponential barrier.

Research Program

Theory. The theoretical part computes $\Lambda_M$ for four downstream operators: density value, density gradient, the Laplacian used for kinetic-energy terms, and the Hartree solve. It does so for the trigonometric kernel and for a family of oversampled windowed kernels. The family is parameterized by oversampling factor and window width. Following the impulse-response criterion of Boche and Mönich, its shift-sums stay bounded independently of $M$.

For the masked case we would prove a finite-dimensional analogue of the Adcock–Hansen–Shadrin barrier. The setting is a plane-wave component restricted outside spheres around nuclei, and the result says that bounded amplification forces at most root-exponential convergence in plane-wave count.

Empirical study. The empirical part needs exact densities at arbitrary points. QM9 densities computed with Gaussian orbitals in PySCF provide this, because a Gaussian-orbital density can be evaluated analytically anywhere. That gives true off-grid ground truth, which plane-wave data cannot.

We sample each molecule's density on grids of increasing $M$ and threshold at a range of $\delta$. We then reconstruct with each kernel and measure four kinds of error. The first is the maximum and $L^1$ error at random off-grid points. The second is the gradient error. The third is the exchange-correlation energy error under a standard gradient-corrected functional. The fourth is the total-energy error in non-self-consistent DFT.

We repeat the protocol with outputs of trained DeepDFT, BOA and GPWNO models in place of the exact density. This separates learned error from reconstruction error.

Baselines

The do-nothing reference is the current practice. Thresholded grid values are interpolated with FFT/sinc, and gradients are taken spectrally. Every variant uses the same grids, thresholds and molecules, so differences come only from the reconstruction step. Beating it means showing a measurable gradient or exchange-correlation energy error that grows with $M$ at fixed $\delta$ under this pipeline and is flat under ours.

The unthresholded full-grid FFT pipeline is the accuracy ceiling at a given $M$. It tells us how much of any observed error the threshold actually causes.

The strongest learned baselines are BOA and DeepDFT. On QM9, BOA reports a normalized mean absolute error (NMAE) of 0.116% on PySCF data and 0.134% on VASP data, according to A Function-Centric Graph Neural Network Approach for Predicting Electron Densities. DeepDFT reports a mean absolute error of 0.27% on QM9, and the GPWNO paper reports a 20% NMAE reduction relative to InfGCN. All of these are on-grid figures. We found no reported off-grid or gradient-error result on Lacuna for any of these models.

We will retrain each model with its published hyperparameters and an identical compute budget. We report its on-grid NMAE to confirm that we reproduce the published number, and then its off-grid and gradient errors. Beating these baselines does not mean lower NMAE. It means showing that a model's ranking or its suitability for downstream energies changes once off-grid and gradient error are measured. It also means showing that our kernel reduces the downstream energy error of the same trained model without retraining.

Three ablations isolate the key ingredient, which is bounded shift-sum. The first is oversampling with the sinc kernel unchanged, which theory predicts does not help. The second is the windowed kernel without oversampling. The third is soft thresholding in place of hard thresholding.

Why not just…?

Why not just stop thresholding? For dense reference DFT on small molecules, that is a fine answer. Thresholding exists because sparse probe sets and vacuum skipping are how density models scale to large systems, and grid-based DFT codes discard sub-tolerance values routinely. The full-grid baseline settles the question honestly. If thresholded and full-grid downstream errors coincide at practical $\delta$, the problem is negligible and we will report that.

Why not use soft thresholding or a smooth cutoff? The criterion of Boche and Mönich puts the cause of divergence in the non-summable kernel, not in the discontinuity of the threshold. Any rule that perturbs each sample by up to $\delta$ is amplified by the same $\Lambda_M$. The soft-thresholding ablation tests this directly. If soft thresholding alone flattens the growth with $M$, the kernel story is wrong and the paper becomes a negative result about the theory's relevance.

Why not train with off-grid loss points? That reduces the model's own interpolation error. It does nothing about values zeroed after prediction or about spectral differentiation of a stored grid. It is nonetheless a real competitor for the learned-model part of the study, so we include an off-grid-trained variant of each model. We then ask whether the kernel change still helps on top of it.

Why not just oversample? The no-go results predict that oversampling with an unchanged sinc kernel leaves the shift-sum unbounded. The oversampling-only ablation checks whether that prediction holds on realistic densities, which may be too smooth to trigger it.

Proposed Experiments

Experiment 1: scaling. On QM9 PySCF densities, we plot off-grid value error and gradient error against $M$ at fixed $\delta$, for FFT and for the stabilized kernel. The theory predicts gradient error growing roughly linearly in $M$ for FFT and staying flat for the stabilized kernel. It also predicts a much weaker logarithmic trend for values. A clear growth slope near one for gradients, absent for the stabilized kernel, confirms the claim. A flat curve under FFT means real densities avoid the worst case.

Experiment 2: energies. We propagate the reconstructions into exchange-correlation energies and non-self-consistent total energies. DeepDFT's per-atom energy errors set the scale against which a thresholding-induced shift would be judged meaningful. We also use BOA's reported 35% reduction in self-consistent iterations as a reference for whether stabilized starting densities preserve or improve that speedup.

Experiment 3: masking. We sweep the number of plane waves in GPWNO's plane-wave branch on the MD trajectories (ethanol, benzene, malonaldehyde), with and without its high-frequency mask. We fit error against $\exp(-c\sqrt{m})$ and $\exp(-cm)$ and track the condition number of the reconstruction. Root-exponential behavior that appears only with the mask, together with bounded conditioning, would connect a learned architecture to the stability barrier for the first time.