Spectral Encodings from the Physical Laplacian for Learning DFT Hamiltonians

Graph Transformers find out where each node sits in a graph by computing the vibration patterns of the graph Laplacian, a matrix that measures how a value differs from its neighbours. Its slow-varying eigenvectors serve as global coordinates. Density functional theory (DFT), the standard method for computing the electronic structure of molecules and materials, already contains the physical original of that matrix. The kinetic-energy operator $-\tfrac12\nabla^2$, written in the atom-centred orbital basis, together with the matrix of overlaps between those orbitals, defines a generalized eigenproblem whose slow modes span the whole molecule. Every DFT code computes these matrices before its expensive iterative loop starts. We propose to turn smooth spectral filters of these one-electron operators into positional encodings for neural networks that predict the Kohn-Sham Hamiltonian. The Kohn-Sham Hamiltonian is the matrix whose diagonalization gives the electronic orbitals and energies. The encodings would carry long-range context into networks whose expensive symmetry-preserving layers stay strictly local.

The opportunity comes from a contradiction in the current Hamiltonian-learning literature. Local models get their accuracy and their ability to transfer to larger systems from short cutoffs. Yet when SPHNet let a learned gate prune atom pairs, the gate kept pairs separated by 16–25 Å. Long-range coupling matters, and pairing every atom with every other atom using rotation-equivariant tensor products costs too much. We argue that a small, cheap, physically grounded spectral signal can supply that coupling. If it does, the gain should appear specifically on long-range matrix blocks and on larger molecules.

Core Claim

Let $A$ be a cheap one-electron operator in the atomic-orbital basis. The candidates are the kinetic matrix $T$ and the core Hamiltonian $H_{\text{core}} = T + V_{\text{nuc}}$, which adds the electron–nucleus attraction. Let $S$ be the orbital overlap matrix. Solving $AC = SC\Lambda$ with $C^\top S C = I$ gives modes $c_k$ with "frequencies" $\lambda_k$. Instead of feeding raw eigenvectors, which have sign and degeneracy ambiguities, we feed matrix functions of the pencil:

$$K_g = C\, g(\Lambda)\, C^\top = \sum_k g(\lambda_k)\, c_k c_k^\top,$$

where $g$ is a smooth scalar filter. We use a small bank of them, such as soft low-pass windows $g_{\mu,\beta}(\lambda) = (1+e^{\beta(\lambda-\mu)})^{-1}$ at several cutoffs $\mu$ and widths $\beta$.

These features have three properties, and the first two come for free. First, a sign flip of $c_k$ cancels in $c_k c_k^\top$, and any rotation within a degenerate eigenspace leaves the sum unchanged. This removes the ambiguity that SAN and OGE-Aug needed dedicated architectures to handle. Second, rotating the molecule sends $A \to UAU^\top$ and $S \to USU^\top$, where $U$ is the block-diagonal rotation matrix for orbitals of each angular momentum. Hence $K_g \to U K_g U^\top$. Each atom-pair block of $K_g$ therefore transforms exactly like the corresponding block of the target Hamiltonian, so it can enter the network as a ready-made equivariant pair feature without any tensor products. Third, a smooth $g$ makes $K_g$ change smoothly with geometry, even where eigenvalues cross along a molecular-dynamics trajectory. This is the stability property OGE-Aug obtains through smooth masks, but here it holds automatically.

A low-pass filter of $H_{\text{core}}$ approximates a softened projector onto the low-lying orbitals, a delocalized object that couples distant atoms. A sharp step at the electron count reproduces the textbook core-guess density matrix. The filter bank is thus a family of multi-scale, smoothed versions of a known cheap guess. The novelty claim is narrow. It is not that physics-derived inputs help. It is that a sign-free, stable, equivariant spectral representation of the pre-SCF operators, placed on long-range pairs and summarized as per-atom global coordinates, recovers the long-range accuracy that local Hamiltonian networks lose, and does so at a fraction of the cost of extending tensor products.

Relation to Prior Work

Several papers motivate the gap. On the graph side, Benchmarking Graph Neural Networks introduced truncated Laplacian eigenvectors as node coordinates. GraphGPS showed that on molecules these combinatorial encodings often lose to random-walk encodings. OGE-Aug made eigenvector encodings stable and reached strong results on QM9 scalar targets. All three build the Laplacian from bond connectivity and predict scalars. We keep their insight about smooth spectral functions but take the operator from physics, and we predict the full Hamiltonian matrix. The GraphGPS finding is a constraint: it warns that a spectrum which ignores geometry is a weak signal. This is why topological LapPE appears as a baseline rather than as the method.

On the DFT side, three papers supply the base architectures we modify. DeepH and DeepH-E3 predict Hamiltonian blocks with strictly local equivariant message passing, justified by nearsightedness, the principle that electronic structure at a point depends mostly on its surroundings. SPHNet prunes tensor-product interactions for speed and contributes the long-range evidence above. We leave their local machinery intact and add a non-tensor-product channel for distant pairs.

Two further papers constrain the design and suggest where the encodings could also help. DEQHNet already feeds $S$ into a fixed-point Hamiltonian solver, but only through local filtering, and it reports weaker results on tiny systems. Self-consistency training shows that a physics loss reduces the need for labels but requires a cubic-cost eigensolve inside training.

For electron density, BOA found that larger cutoffs hurt transfer to bigger molecules. We take this as a direct warning. Our long-range channel must be a low-dimensional, physically fixed signal, not a wider learned receptive field, or it will repeat that failure. GPWNO handles the smooth part of the density with plane waves on a grid. Our spectral modes do the same job intrinsically on the orbital basis, without a box.

Research Program

We would build the encoding module and attach it to a QHNet-style local equivariant Hamiltonian network, using the SPHNet code path so that large basis sets fit on one GPU.

The module has two outputs. First, for atom pairs beyond the local cutoff, it supplies the blocks of $K_g$ across the filter bank. A learned linear mixing per angular-momentum channel maps them to Hamiltonian-shaped corrections. Because they are already equivariant, no Clebsch-Gordan products are needed. Second, for every atom it supplies rotation-invariant summaries, namely the traces and norms of each atom's diagonal block across filters. These act as global positional encodings that bias a linear-attention layer between atoms, as in GraphGPS.

The program then fixes the operator choice and the cost. On the operator side, we compare $T$, $H_{\text{core}}$, and the purely topological graph Laplacian as the source operator. On the cost side, for QH9-scale molecules we use dense diagonalization, which costs about one SCF step. For PubChemQH-scale systems, we replace diagonalization with a Chebyshev polynomial expansion of $g$ applied to the Löwdin-orthogonalized operator $S^{-1/2}AS^{-1/2}$. This uses only matrix products and its cost is reported explicitly. If the expansion's error or cost is not competitive, we will say so.

We also analyze the representation itself. Stratifying errors by pair distance shows whether the channel acts where SPHNet's gate says long-range information lives. We track $K_g$ along QH9-dynamic trajectories to confirm smoothness near eigenvalue crossings. A frozen-feature test measures how much of the target $H$ at long range is linearly predictable from $K_g$ alone.

Baselines

The naive reference point is the same local equivariant backbone with no long-range channel: QHNet, as used in SPHNet and DEQHNet, trained with identical data, schedule, and hyperparameter budget. Every gain is measured against this model. The file reports that DEQHNet cuts Hamiltonian MAE by nearly 50% relative to QHNet on QH9-dynamic, but it gives no absolute MAE value. No reported absolute result was found on Lacuna for QHNet on QH9, so we will rerun it ourselves.

The strongest existing competitors depend on the regime. On QH9-dynamic it is DEQHNet, reported at about 50% lower MAE than QHNet and cutting PySCF SCF iterations from 15 or more down to 2–3 when used as an initial guess. On large basis sets it is SPHNet, reported at a 7.1× training speedup, 75% less GPU memory, and about 2,900 orbitals on one GPU on PubChemQH, with no absolute MAE in the file. We run both from their released configurations on the same splits and the same GPU budget. Our module is added to SPHNet, and separately to DEQHNet's injection stage, so that each comparison differs in one ingredient only. Beating these models means lower Hamiltonian MAE and lower orbital-energy MAE at matched or lower memory, with the improvement concentrated on blocks beyond the cutoff. A uniform small gain would be weaker evidence.

The physics-input baseline is delta-learning. Here the network receives the raw blocks of $H_{\text{core}}$ (and, separately, of a superposition-of-atomic-densities Fock guess) as input features, or predicts the residual from them, with no spectral filtering. This isolates whether our gain comes from the spectral representation or merely from seeing a cheap Hamiltonian.

The graph-encoding baseline is OGE-Aug-style stable Laplacian eigenvector encodings of the bond graph, fed to the same attention layer. It reported strong QM9 scalar results, but nothing on Hamiltonians.

Two ablations isolate the key ingredient. The first restricts $K_g$ to pairs inside the cutoff, which tests whether the long-range placement matters. The second replaces matrix functions with raw truncated eigenvectors processed by a sign-invariant network, which tests whether the sign-free, stable form matters.

Why not just…?

Why not just use graph Laplacian encodings, which already work on QM9? OGE-Aug's QM9 results concern scalar targets, and GraphGPS found that topological LapPE often trails random-walk encodings on molecules. A bond-graph spectrum carries no information about orbital shape, distance, or angular momentum. It therefore cannot produce Hamiltonian-shaped pair features. The operator ablation, which swaps the graph Laplacian in for $T$ and $H_{\text{core}}$, tests this directly.

Why not just feed the core-Hamiltonian or atomic-density guess to the network and learn the correction? This is the real threat. A step-function filter of $H_{\text{core}}$ is a known cheap guess, and delta-learning from it may capture much of the benefit. We found no reported result on Lacuna for guess-conditioned Hamiltonian networks on QH9 or PubChemQH, so we cannot argue it away. The delta-learning baseline settles the question. If it matches our method, the honest conclusion is that the long-range signal lives in the guess itself, and the paper becomes a study of that fact. Our bet is that raw guess blocks at long range are tiny and noisy for a localized basis, while smooth low-pass filters concentrate the delocalized part. The distance-stratified error test shows which view is right.

Why not just widen the cutoff or keep more pairs, as SPHNet's gate does? Wider cutoffs pay the full tensor-product cost on every added pair, which grows with the sixth power of angular-momentum order according to SPHNet. BOA also found that larger receptive fields hurt transfer to bigger molecules. We compare against SPHNet with its long-range pairs retained, at equal memory. We also test size transfer within PubChemQH by training on smaller molecules and testing on larger ones, where a learned wide receptive field should degrade and a fixed physical signal should not.

Why not just use plane waves for the smooth part, as GPWNO does? GPWNO targets densities on grids and is strongest on periodic crystals. Isolated molecules in an orbital basis would require an artificial box. We do not test GPWNO on Hamiltonians, because its output is a different object. We note it as the closest analogue for the density case and leave a density-prediction comparison as a follow-up.

Proposed Experiments

The main experiments use QH9-stable and QH9-dynamic for accuracy and trajectory stability, MD17 for small-molecule sanity checks (where DEQHNet degraded on water), and PubChemQH for scale. Metrics are Hamiltonian MAE overall and binned by atom-pair distance, MAE of HOMO, LUMO and gap energies from diagonalizing the predicted $H$, orbital-coefficient cosine similarity, and the number of PySCF SCF iterations when the prediction is used as an initial guess. We also report wall-clock time and memory, including the cost of computing the encodings.

The decisive checks are three. First, on PubChemQH, does adding the channel to SPHNet reduce error on pairs beyond the cutoff by more than delta-learning from the same $H_{\text{core}}$ does? Second, does the gain grow with molecular size in the train-small/test-large split? This is the signature of a genuine long-range mechanism. Third, along QH9-dynamic trajectories, do predictions stay smooth across eigenvalue crossings, where the raw-eigenvector ablation should show jumps?

If none of the long-range bins improve, or if delta-learning matches us everywhere, the claim fails, and we will report it as such.