Neural networks can now skip the slowest part of density functional theory (DFT), the quantum-chemistry method whose cost grows with the cube of system size. DFT has to repeatedly build and diagonalize a matrix called the Kohn-Sham Hamiltonian until the electron density stops changing. These networks predict that matrix directly from atomic positions in one forward pass. Every such model treats each pair of nearby atoms as a fresh calculation: it runs expensive rotation-aware tensor operations and emits a dense block of floating-point numbers. Yet chemistry repeats itself. A C–H bond, an Hf–O pair in an oxide, or a carbon in an aromatic ring shows up thousands of times with nearly the same local electronic structure. We propose to learn, end to end, a small discrete dictionary of these recurring pairwise "orbital interaction motifs". The full Hamiltonian is then rebuilt from a code index per atom pair, a cheap continuous correction, and an exact rotation.
The core trick is to quantize only the part of each Hamiltonian block that is unaffected by rotating the molecule. That makes the discrete codes rotation-safe by construction. Ordinary vector quantization breaks under rotation, because a rotated feature vector snaps to a different codeword. Our quantization does not have this problem. The result is a learned, environment-dependent version of the classical Slater-Koster tight-binding table: a short list of bond-type integrals that physicists have tabulated by hand for decades. It comes with a measurable answer to an open question: how much of a DFT Hamiltonian is discrete, reusable structure, and how much is genuinely continuous?
Core Claim
Express the Hamiltonian block between atoms $i$ and $j$ in a frame whose $z$-axis points along the bond. Most of its content is then a block that is unchanged by spinning the frame about that bond. Physically, these are the familiar σ, π and δ two-center integrals, which depend on element pair, distance and local environment. We claim this part is highly compressible into a jointly learned codebook of a few thousand motifs. What remains, mainly three-center and environment-induced terms that do depend on orientation, is small enough for a lightweight continuous equivariant branch to handle. Concretely, we predict
$$ H_{ij} = D(\hat r_{ij})\,\big[\,C_{q_{ij}}(d_{ij}) + \Delta_{ij}\,\big]\,D(\hat r_{ij})^{\top}, $$
where $D(\hat r_{ij})$ is the Wigner rotation matrix taking the $z$-axis onto the bond direction $\hat r_{ij}$, and $d_{ij}$ is the bond length. $q_{ij}$ is a discrete code chosen by quantizing an invariant embedding of the pair's environment. $C_{q}(d)$ is a decoded block that is constrained to commute with rotations about $z$, so it holds only σ/π/δ-type entries. $\Delta_{ij}$ is the continuous equivariant residual.
Because $C$ is unchanged by rolls about the bond, the arbitrary choice of the frame's second axis never matters. The full prediction is therefore exactly equivariant under 3D rotation, even though $q_{ij}$ is discrete. On-site blocks are treated the same way, with an angular-momentum-diagonal coded part plus a residual.
This differs from every existing Hamiltonian network in two ways. First, it introduces a discrete bottleneck at all. Second, it places that bottleneck on a symmetry-invariant physical object rather than on generic hidden features.
Relation to Prior Work
The Hamiltonian-prediction line motivates the problem and supplies most of our machinery. QHNet cut the rotation-aware tensor-product work by 92% using gating and an expansion module. QHNetV2 projects features into local SO(2) frames, reducing tensor-product cost from $O(L_{\max}^6)$ to $O(L_{\max}^3)$, where $L_{\max}$ is the highest angular momentum carried. We reuse its local-frame idea but go one step further: we discard the roll-dependent part from the quantized path entirely. SPHNet learns gates that prune atom pairs and tensor-product paths. Its finding constrains us: long-range pairs at 16–25 Å cannot be pruned, and small molecules tolerate only about 30% sparsity. Our codebook aims to make the interactions that must be kept cheap, rather than deleting them. NextHAM shows that small real-space errors create unphysical "ghost states" in band structures, and that a joint real-space and reciprocal-space loss fixes this. We take that as a warning that rounding errors from quantization may be amplified the same way, and we adopt its spectral loss. HELM and the large-structure work of Xia et al. push to many elements, large basis sets and 3,000-atom amorphous solids. They supply both the scaling motivation and the repetitive, disordered test systems in which motif reuse should pay off. All of these models keep every intermediate and output block in continuous floating point.
The quantization line supplies the training method. Node Identifiers puts residual vector quantization (a stack of codebooks, each encoding what the previous one missed) inside graph message passing. It shows that node states compress to a handful of 4-bit codes that capture recurring structural motifs, and it documents the codebook collapse and loss-weight sensitivity we expect to fight. It works only on flat, rotation-free features. SAND trains molecular encoders jointly with product quantization and reports about 4x better compression than quantizing after training. That result motivates our choice of joint over post-hoc training. However, SAND compresses one global shape descriptor per molecule and never touches orbitals or symmetry. Anisotropic Additive Quantization and Deep Visual-Semantic Quantization document the mismatch that arises when frozen embeddings are quantized after the fact. The hybrid quantization scheme for quantum circuits shares only the word "quantization": it concerns first- versus second-quantized encodings on quantum hardware and is not a competitor.
Research Program
We will build the model on the open QHNet/QHNetV2 code in the AIRS library. It has three parts.
The first part is an invariant environment encoder. It produces a rotation-invariant embedding for each atom pair from element types, distance and neighborhood scalars. It is deliberately cheap.
The second part is a residual vector quantizer over that embedding, with two to four levels and 256 to 4,096 entries per level. It is trained with a straight-through gradient, the commitment loss from Node Identifiers, and resetting of dead codewords to counter collapse. Each code indexes a learned embedding. A small decoder maps that embedding and the distance $d_{ij}$ to the free σ/π/δ entries of $C$. Because the decoder depends only on the code and a scalar distance, it can be precomputed as a spline per code and used as a lookup table at inference time.
The third part is a reduced-width SO(2)-frame branch, in the style of QHNetV2, that predicts $\Delta_{ij}$.
The training loss combines the Hamiltonian mean absolute error (MAE), the commitment term, and an eigenvalue loss. For molecules, the eigenvalue loss covers orbital energies; for crystals, it covers band energies, following NextHAM.
The analysis matters as much as the model. For each benchmark we will trace the accuracy curve as the code budget and the residual width grow. This measures how much of the Hamiltonian's error-relevant variance the discrete part carries. We will count how many distinct codes actually occur in a 3,000-atom amorphous structure, which tests whether motif reuse is real. We will check whether codes cluster by chemically meaningful categories such as bond order, coordination and oxidation state. We will also test the codebook's transfer value: freeze it after QH9 training and fit only the residual on held-out molecule trajectories.
Baselines
The naive reference point is the zeroth-step Hamiltonian $H^{(0)}$, built from superposed atomic densities, which NextHAM uses as its input descriptor. It costs nothing to learn and shows how much any network adds. We found no reported result on Lacuna for $H^{(0)}$ MAE on QH9, so we will compute it ourselves.
The strongest existing method on molecules is QHNetV2. It is the strongest competitor because it already exploits the same local-frame idea and holds the best reported QH9 errors. For QH9-stable-id, the only absolute number in our file is QHNet at 76.31×10⁻⁶ Hartree MAE, reported in the QH9 benchmark paper. QHNetV2 reports a 33.7% relative reduction from that baseline, and a 46.9% reduction against SPHNet on the out-of-distribution split. We will retrain QHNetV2 from the released code on identical splits to obtain absolute numbers.
On amorphous solids, the reference is the augmented-partitioning model of Xia et al., reported at 2.17–2.58 meV Hamiltonian error with at most 0.53% eigenvalue error on 3,000-atom HfO₂. SPHNet is the efficiency baseline, reported to handle about 2,900 orbitals on one GPU against about 1,800 for earlier models.
All models get the same data splits, the same GPU type, and the same hyperparameter search budget, measured in GPU-hours. Speed is reported as wall-clock inference per structure, and memory as peak activation memory, both at matched batch size.
Two ablations isolate the key ingredient. The first is a continuous twin of our model with identical factorization, encoder and decoder, but with the quantizer removed. This tests whether discreteness itself helps or only costs accuracy. The second applies post-hoc k-means to the continuous twin's invariant embeddings, which tests whether joint training matters.
We count the proposal as succeeding on accuracy if it lands within 10% of retrained QHNetV2's Hamiltonian MAE and orbital-energy error on QH9-stable-id, and does no worse on out-of-distribution data. It succeeds on efficiency if, on a-HfO₂, it reaches Xia et al.'s error range at materially lower inference time or peak memory. Matching accuracy while running slower is a negative result for the efficiency claim, though not for the science.
Why not just…?
Why not just quantize a trained QHNetV2 after the fact? Post-hoc quantization of generic hidden features fails twice over. SAND and the retrieval literature find it about 4x worse than joint training at equal accuracy. Separately, quantizing rotation-dependent features breaks equivariance. The fair version of this alternative is post-hoc k-means on our own invariant embeddings, which keeps the symmetry. That is exactly our second ablation. If it matches joint training, we will report that joint training is unnecessary here.
Why not just use plain low-precision arithmetic, such as bf16 or int8 quantization-aware training of the existing network? For raw memory savings, this is a real threat. It is simpler and likely recovers a 2–4x activation saving with little accuracy loss. We will run int8 quantization-aware training of QHNetV2 as a baseline and will not claim a memory win we do not have. Low precision cannot do two things our design targets. It cannot cut the number of tensor-product evaluations per pair, and it cannot reuse a single decoded block across thousands of identical motifs. The unique-code count on amorphous systems decides whether that second advantage is real.
Why not just fit a continuous learned tight-binding model, with no codebook? This is the continuous twin, and it is the most serious alternative: the factorization alone may deliver most of the benefit. Discreteness earns its place only if it adds one of three things over the twin at equal accuracy. These are lookup-table inference, transfer through a frozen codebook, or interpretable motif structure. If the twin wins on all three, we will report the factorization as the contribution and the codebook as unnecessary.
Why not just prune, as SPHNet does? Pruning removes pairs, but SPHNet itself shows that the important long-range pairs and dense small-molecule environments resist removal. Our approach is complementary and could be stacked on top of pruning. We will test SPHNet-style pair gating combined with our model to check that the gains add up rather than overlap.
Decisive Checks
Four results would settle the proposal. First, a numerical equivariance test: the error from random rotations must stay at floating-point level despite the discrete codes. If it does not, the construction is wrong. Second, the code-budget curve on QH9-stable-id and QH9-dynamic-mol. If the residual branch must grow to QHNetV2's full width before accuracy recovers, the Hamiltonian is not usefully discrete and the idea fails. Third, ghost-state counts and band-energy error on the Materials-HAM-SOC benchmark, with and without the spectral loss. NextHAM reports 1.417 meV full-Hamiltonian MAE there, and this check tells us whether rounding errors from quantization corrupt the spectrum. Fourth, on 3,000-atom a-HfO₂, the ratio of unique codes to atom pairs together with wall-clock inference against Xia et al.'s model. A ratio below about 1% with matched error would show that a learned discrete motif dictionary turns the per-pair cost of Hamiltonian prediction into cost per distinct motif, which is the practical payoff.
References
- Efficient and Equivariant Graph Networks for Predicting Quantum Hamiltonian
- Efficient Prediction of SO(3)-Equivariant Hamiltonian Matrices via SO(2) Local Frames
- Efficient and Scalable Density Functional Theory Hamiltonian Prediction through Adaptive Sparsity
- Advancing Universal Deep Learning for Electronic-Structure Hamiltonian Prediction of Materials
- Learning from the Electronic Structure of Molecules across the Periodic Table
- Learning the Electronic Hamiltonian of Large Atomic Structures
- Node Identifiers: Compact, Discrete Representations for Efficient Graph Learning
- Learning Compressed Shape-Aware Molecular Representations for Virtual Screening
- Anisotropic Additive Quantization for Fast Inner Product Search
- Deep Visual-Semantic Quantization for Efficient Image Retrieval
- Optimizing Quantum Chemistry Simulations with a Hybrid Quantization Scheme
- QH9: A Quantum Hamiltonian Prediction Benchmark for QM9 Molecules