U-HamGNN: a universal model for magnetic Hamiltonians conditioned on spin and Hubbard U
Authors: Hongyu Yu, Yinze Hu, Yizhou Chen, Yang Cheng, Yingwei Chen, Xingao Gong, Yang Zhong, Hongjun Xiang
Organizations: Key Laboratory of Computational Physical Sciences (Ministry of Education), Institute of Computational Physical Sciences, State Key Laboratory of Surface Physics, Department of Physics, Fudan University, Shanghai, China · Research Laboratory for Quantum Materials, Department of Physics and Materials, The Hong Kong Polytechnic University, Hong Kong SAR, China
The electronic structure of a magnetic crystal depends jointly on its spin configuration and the on-site Hubbard correction U, requiring a separate DFT+U calculation for each combination. We introduce U-HamGNN, an equivariant network that takes these two inputs directly and predicts spin-resolved Hamiltonians across diverse crystal chemistries. A spectral-hybrid optimizer that weights each update direction by how consistently the gradient points along it reaches 8% lower Hamiltonian error than Muon and 26% lower than AdamW in a ten-epoch benchmark. The predicted bands reproduce U-dependent gap opening and altermagnetic spin splitting within the trained window and beyond it; exchange couplings and magnetic-order calls derived from the Hamiltonian agree with DFT+U on a calibration set. This universal model provides a new tool for magnetic research.
Figures & tables
Fig. 1: U-HamGNN: spin and Hubbard U as model inputs. a , One crystal ( MnTe ) queried with our model in two collinear magnetic configurations (FM and AFM1) at three values of U; each query returns the two spin channels of the Hamiltonian, from which the bands follow by diagonalization. b , Architecture. Each atom carries a scalar attribute ai that joins its element embedding to a zero-centred Gaussian expansion of its U; edges carry spherical harmonics up to l=6 and a Bessel radial basis. Three equivariant convolution layers with edge updates feed two heads: a spin-independent block Hnm assembled through Clebsch–Gordan coupling and made Hermitian, and a spin head that returns a coupling J per pair of orbital shells and a weight matrix W . The input spins si and the non-self-consistent OpenMX reference H0 enter only at the assembly step, Hσ=H0+Hnm+σΔ with Δ=W∘∑aJasa , and band energies enter the training loss. The model is collinear and has no spin-orbit term. The elements of the training set are shown in Supplementary Fig. S6.
Fig. 2: Spectral-hybrid training and test accuracy. a , Validation Hamiltonian mean absolute error (MAE) of AdamW, Muon and the spectral-hybrid optimizer over ten epochs on 500 iron-containing graphs (33.2-million-parameter configuration, seed 666); final values at the line ends. Supplementary Fig. S3b gives a matched three-seed comparison. b , Validation Hamiltonian MAE (upper) and validation band MAE (lower) of the production run on one epoch axis, through the Hamiltonian-only stage 1 and the band-energy stage 2 (stage 2 epochs offset to continue the axis; the band loss and its validation error exist only in stage 2); open circles, the selected checkpoint (stage 2 epoch 78), 2.0926 meV and 96.48 meV. c , Predicted against reference DFT+U Hamiltonian elements as a log-scaled two-dimensional count over all 1,482,157,610 nonzero elements of the 1,577 test graphs; dashed line, identity; inset, elements within 0.5 eV of zero. MAE 1.802 meV, R2 0.99984. d , Fraction of test graphs whose per-graph MAE exceeds a given value; median 1.667 meV, 95th percentile 4.302 meV, mean 2.047 meV. e , Per-element test MAE for the 70 elements with test coverage, attributing each graph’s error to every element in its formula (graph-attributed, not orbital-resolved). Errors in c–e are taken over the matrix elements whose DFT+U reference is nonzero, without the zero padding of the orbital blocks (Methods). All values are for the frozen checkpoint.
Fig. 3: Band gaps and spin splitting across Hubbard U. a , MnTe in the AFM1 configuration (two repeats of the four-atom cell; arrows, Mn spins). b , Spin-resolved bands at U = 0, 4 and 8 eV at a fixed structure, for the magnetic state of the converged DFT+U calculation, on the same 141-point k path (dashed black, DFT+U; blue and red, model spin up and down), relative to the OpenMX chemical potential of the converged calculation; headers give the band MAE within 1 eV of it (58.7, 33.8 and 20.9 meV). The path runs through the fractional points Γ (0, 0, 0), M (½, 0, 0), M ′ (½, ½, 0, equivalent to M), Γ and A (0, 0, ½) of the hexagonal cell; shading marks the scan through k* = (0.158, 0, 0.25), the point of largest predicted splitting. Lower strips, largest same-band spin splitting at each k over bands within 2 eV of the chemical potential (fill, DFT+U; line, model). c , Path gap and largest same-band splitting within 2 eV against U for MnTe (U = 0 to 8 eV in steps of 2 eV) and AgX3RuOX4 (U = 0 to 10 eV), model (blue, filled) and DFT+U (black, open; circles, MnTe ; squares, AgX3RuOX4 ); each point is one calculation without replicate spread, and the two systems share one y scale per row and one U axis, so model–DFT+U differences can be compared directly. The gap is zero when a band crosses the chemical potential; bands are paired by index within each spin channel. Shading marks U above the trained window of 8 eV.
Fig. 4: Exchange couplings, model against DFT+U. Isotropic exchange couplings extracted with TB2J from the model and from the converged DFT+U Hamiltonian on the same ferromagnetic reference configuration, for 76 bonds in five calibration materials (colour and marker shape identify the material, legend with bond counts; dashed line, identity): Pearson r 0.92, MAE 1.38 meV, sign agreement 89.5%; the isolated point at the top is four overlapping, symmetry-equivalent shortest bonds of MgX2SiNiX2Ir (2.49 Å; DFT+U 4.9 meV, model 18.0 meV), which carry about half of the total absolute deviation.
Fig. 5: DFT+U validation of altermagnet candidates. a , HfX3CrX2TcPX3 (AFM1 spins on Cr), one of five validated altermagnets among the 24 GNoME altermagnet candidates with the highest predicted splitting, which were adjudicated by DFT+U under rules fixed before any result was seen (Supplementary Table S4); its DFT+U bands (dashed, as in b) with the tabulated U of each element (Methods), spin up (blue) and down (red), along Γ–M–M ′ –Γ–A of the hexagonal cell (labels as in Fig. 3b) and through k*. The DFT+U spin splitting over a 9 × 9 × 9 Brillouin-zone mesh (Methods) is 469.2 meV; the spin-group class is read on the transition-metal sublattice that carries the splitting. b , AgX3RuOX4 at U = 4 eV around k*: DFT+U (dashed) and model bands, and the same-band splitting at each k (fill, DFT+U; line, model). Within 1 eV of the chemical potential the largest splitting is 68.9 meV in DFT+U and 67.3 meV in the model; spin group P4122 (amcheck). c , Model against DFT+U spin splitting for the nine of the 24 candidates whose altermagnetic splitting DFT+U confirms, both measured on the same 9 × 9 × 9 mesh with the same rule (Methods): blue diamonds, the five validated altermagnets; green, the four candidates whose splitting is confirmed in the antiferromagnetic state, three of them ferrimagnetic with an uncompensated Nd 4f moment (ferromagnetic and supercell references in Supplementary Note 7). The other 15 candidates are listed in Supplementary Table S4.
Accurate prediction of electronic Hamiltonians would enable broad property inference while avoiding the high computational cost of Density Functional Theory (DFT). However, progress toward general-purpose materials foundation models is limited by a data bottleneck: existing Hamiltonian datasets are typically small, lack structural diversity, and often omit essential relativistic physics such as spin--orbit coupling (SOC). We therefore construct UniHam, a large-scale Hamiltonian dataset and benchmark suite comprising 100,000+ DFT-computed complex-valued Hermitian Hamiltonians with full SOC, covering 72 elements and a wide range of crystal geometries and symmetries (spanning diverse lattice types and space-group families). Building on UniHam, we benchmark two representative state-of-the-art models under a standardized protocol and introduce complementary evaluation metrics that jointly assess three dimensions: (i) Hamiltonian reconstruction accuracy, (ii) out-of-distribution (OOD) generalization across composition/symmetry shifts, and (iii) the ability to support downstream property prediction from the predicted Hamiltonians. Experiments on UniHam demonstrate that the proposed benchmark and metrics effectively differentiate model capabilities, revealing intrinsic SOC- and element-dependent failure modes, large variations in compositional OOD robustness, and the necessity of spectral-level evaluation to assess whether Hamiltonian predictions reliably support downstream electronic-structure properties. Overall, UniHam provides a reproducible, SOC-complete benchmark that can sharpen model comparisons and accelerate the development of next-generation foundation models for quantum materials.
Magnetic order is a fundamental property of materials, governing collective behavior and enabling a broad range of functionalities. Yet magnetic structure remains difficult to determine: experiments are costly and specialized, while first-principles methods often struggle with the noncollinear and incommensurate orders found in real materials. Here we introduce magnetic structure network (MSN), an E(3) equivariant graph neural network that predicts both collinear and non-collinear magnetic structures directly from atomic crystal structures, trained directly on experimentally determined structures from MAGNDATA. By proposing the primitive modulated structure representation (PMSR), we are able to encode commensurate and incommensurate structures in a unified way without symmetry assumptions. The model achieves strong performance across all modulation components and reconstructs experimental magnetic structures with high fidelity. Our approach provides a scalable framework for rapid magnetic structure prediction and opens a route to data-driven discovery of magnetic materials.
Quantum Measurement Group, MIT, Cambridge, MA 02139, USA · Department of Electrical Engineering and Computer Science, MIT, Cambridge, MA 02139, USA · Department of Chemistry, MIT, Cambridge, MA 02139, USA +4
Density functional theory (DFT) gives the electronic structure of materials, but its cost limits large-supercell calculations and materials screening. Machine-learned Hamiltonians bypass the self-consistent cycle but are usually system-specific; universal ones could cover new compositions and disordered solids. Such models must generalize across chemistry and keep downstream properties physical, while staying inexpensive for large cells. Here we introduce UniTB, a universal E(3) equivariant Hamiltonian representation framework that integrates physical priors rooted in density-functional tight-binding theory with deep learning. UniTB's network, which corrects a prior Hamiltonian, generalizes across chemistry through a mixture of experts routed by that prior and a charge-equilibration head as in self-consistent-charge tight binding. A projection bounds band shifts from the prior, suppressing spurious states and keeping downstream properties physical. We provide the fastest SO(2) tensor-product GPU kernels for the network. The variant UniTB-Flash assembles its prior from two-center tables at O(N) cost for N atoms, against O(NlogN) on a grid. Trained on 29,242 crystals, UniTB reaches a 0.48 meV matrix-element error on nonmagnetic test crystals spanning 68 elements. Without amorphous training data, both models agree with DFT optics and conductivity of amorphous Ge-Sb-Te. UniTB-Flash ranks candidates with no significant difference from UniTB, whose property values are more accurate; together they screen 16,195 crystals for five application domains of industrial relevance.
Mingkang Liu, Zhanghao Zhouyin, Guanghui Wang +3
Suzhou Institute for Advanced Research, University of Science and Technology of China, Suzhou 215123, China · Department of Mechanical Engineering, National University of Singapore, 9 Engineering Drive 1, Singapore 117575, Singapore · Department of Physics, McGill University, Montreal, Quebec H3A 2T8, Canada +4