betaFeedback

WorksPhysics and Astronomy

High-order Equivariant Flow Matching for Density Functional Theory Hamiltonian Prediction

Abstract

Density functional theory (DFT) is a fundamental method for simulating quantum chemical properties, but it remains expensive due to the iterative self-consistent field (SCF) process required to solve the Kohn-Sham equations. Recently, deep learning methods are gaining attention as a way to bypass this step by directly predicting the Hamiltonian. However, they rely on deterministic regression and do not consider the highly structured nature of Hamiltonians. In this work, we propose QHFlow, a high-order equivariant flow matching framework that generates Hamiltonian matrices conditioned on molecular geometry. Flow matching models continuous-time trajectories between simple priors and complex targets, learning the structured distributions over Hamiltonians instead of direct regression. To further incorporate symmetry, we use a neural architecture that predicts SE(3)-equivariant vector fields, improving accuracy and generalization across diverse geometries. To further enhance physical fidelity, we additionally introduce a fine-tuning scheme to align predicted orbital energies with the target. QHFlow achieves state-of-the-art performance, reducing Hamiltonian error by 71% on MD17 and 53% on QH9. Moreover, we further show that QHFlow accelerates the DFT process without trading off the solution quality when initializing SCF iterations with the predicted Hamiltonian, significantly reducing the number of iterations and runtime.

https://github.com/seongsukim-ml/QHFlow

Introduction

Density functional theory (DFT) [1, 2] is a cornerstone of modern computational physics [3, 4], chemistry [5, 6], and materials science [7, 8]. It offers a powerful trade-off between accuracy and computational efficiency in predicting the electronic properties of atoms, molecules, and solids [9, 10, 11]. The practical implementation of DFT relies mainly on solving the Kohn-Sham equations [12], which describe a system of non-interacting electrons that yield the same ground-state density as the interacting system [12]. These equations are typically solved using the self-consistent field (SCF) method [13, 14, 15], an iterative procedure that updates the electron density until convergence. To this end, at each iteration, the Kohn-Sham Hamiltonian must be reconstructed from the kinetic operator, external potential, Coulomb (Hartree) potential, and exchange–correlation potential [16, 17]. However, this reconstruction of the Hamiltonian becomes computationally demanding for larger systems, limiting the scalability of conventional DFT approaches [18].

To address this challenge, recent work has explored machine learning models to predict the Hamiltonian directly from atomic configurations, with the aim of bypassing or accelerating the SCF loop [19, 20, 21, 22, 23, 24, 25, 26]. A key challenge in this task is ensuring that the model preserves the physical symmetries of molecular systems, particularly SE(3) symmetry, which governs how Hamiltonians transform under rotations and translations due to their construction in a spherical harmonics basis. SE(3)-equivariant networks such as PhisNet [20], QHNet [23], WANet [25], and SHNet [26] have been proposed to address this, using tensor representation and Clebsch–Gordan products to enforce rotational equivariance. These approaches rely on pointwise regression, which may lead to high predictive uncertainty and often struggle to capture the structural correlations present in the Hamiltonian matrix.

Contribution. In this work, we introduce QHFLOW, a high-order SE(3)-equivariant flow matching for generating Kohn-Sham Hamiltonians. Our work uses flow matching to learn a neural ordinary equation (ODE) that transforms a prior distribution to the target distribution of Hamiltonians. We also parameterize the vector fields using high-order SE(3)-equivariant neural networks to ensure that symmetry is preserved not only in the output, but throughout the entire ODE trajectory [27, 28].

To be specific, QHFLOW generates Hamiltonians conditioned on molecular geometries using equivariant architectures and is trained to match the distribution of Hamiltonians obtained from DFT. To this end, we design two types of SE(3)-invariant priors to support equivariant flow-based learning: a Gaussian orthogonal ensemble (GOE) and a tensor expansion-based (TE) prior that includes a group-theoretic structure. To further enhance the accuracy of energy-related properties, we introduce a fine-tuning stage that aligns the predicted orbital energies with those from the DFT, inspired by the weight alignment loss in WANet [25]. We provide an overview of QHFLOW in Figure 1.

Overview of QHFLOW

Figure 1. Overview of QHFLOW. (a) Initial Hamiltonian sampled from the tensor expansion-based SE(3)-invariant prior (TE). (b) Initial Hamiltonian sampled from the Gaussian orthogonal ensemble SE(3)-invariant prior (GOE). (c) QHFLOW transforms the initial Hamiltonian H0H_0 into the target Hamiltonian H1H_1 using flow matching, guided by an SE(3)-equivariant vector field vθ(t,M)v_\theta(t,\mathcal{M}) from an invariant prior p0p_0. The predicted Hamiltonian H1H_1 defines a learned target distribution p1θp_1^\theta and is used to compute the electronic density ρM\rho_{\mathcal{M}}, as well as the ϵLUMO\epsilon_{\mathrm{LUMO}} and ϵHOMO\epsilon_{\mathrm{HOMO}}. When H1H_1 is used to initialize SCF, QHFLOW can accelerate conventional DFT and SCF procedures.

Our main contributions are as follows:

  • Flow matching for Hamiltonian prediction: We are the first to formulate Hamiltonian prediction as a generative problem, learning a trajectory to generate Kohn-Sham Hamiltonians conditioned on molecular geometry using SE(3)-equivariant vector fields.

  • Symmetry-aware prior distributions: We introduce two SE(3)-invariant priors, based on the Gaussian orthogonal ensemble (GOE) and the tensor expansion (TE), ensuring equivariant flow matching and symmetrical initialization of Hamiltonian priors.

  • Energy alignment fine-tuning: We introduce a fine-tuning strategy that aligns the predicted orbital energies with target orbital energies. This step encourages the model to match the target orbital energies, resulting in physically consistent property predictions.

  • Empirical performance: Extensive experiments on MD17 and QM9 demonstrate that QHFLOW outperforms recent methods in terms of predicting the Hamiltonian MAE, orbital energy prediction, HOMO, LUMO and gap energy accuracy. We also show that using QHFLOW’s predictions as initialization for the SCF procedure leads to significant acceleration of the DFT process, reducing the number of iterations and total computation time.

Related work

Hamiltonian matrix prediction. Learning-based approaches for Hamiltonian matrix prediction have emerged as promising alternatives to the computationally demanding traditional DFT method. Early work such as SchNOrb [19] extends SchNet [29] to enable accurate prediction of molecular orbitals. PhiSNet [20] introduces an architecture that explicitly respects SE(3)-symmetry using tensor representations and tensor product operations. QHNet [23] improves computational efficiency by reducing the number of high-order tensor products, and WANet [25] further extends this direction to larger molecular systems by incorporating a physically grounded loss function. Recently, SPHNet [26] improves scalability through adaptive path selection in the tensor product. Despite these advances, all preceding methods treat Hamiltonian prediction as a pointwise regression task. In contrast, our approach leverages flow matching to model the structural correlation in the Hamiltonian.

Flow matching for prediction. Flow matching [30, 31] has gained significant attention in generative modeling for its ability to leverage an ordinary differential equation (ODE)-based formulation, enabling faster inference than diffusion models [27]. Flow matching has been increasingly applied to machine learning problems in chemistry and drug discovery [32]. In particular, recent work has shown its effectiveness in regression-style applications such as protein structure prediction [33], crystal structure prediction [34, 35], and protein binding site identification [36], where modeling complex target distributions is crucial. In this work, we further extend flow matching to Hamiltonian matrix prediction. By framing the task as a distributional matching problem, our model learns structured outputs with greater accuracy and physical fidelity than conventional regression-based methods, illustrating the broader utility of flow matching in scientific prediction tasks.

Preliminary

Kohn-Sham density functional theory and Roothaan-Hall equation

Kohn-Sham density functional theory (KS-DFT). The Kohn-Sham (KS) equations [1, 12] are simplified analogs of the many-body Schrödinger equation [37] that retain a one-to-one correspondence with the ground-state density of the interacting electron system. This framework has revolutionized quantum mechanical simulations of electronic structures in atoms, molecules, and solids [9, 10, 11], offering a practical balance between computational efficiency and predictive accuracy.

Consider an NN-particle system associated with the wavefunction Ψ:R3×N→C\Psi: \mathbb{R}^{3 \times N} \to\mathbb{C}. In principle, the system is governed by the stationary Schrödinger equation H^Ψ=ϵΨ\hat{H}\Psi= \epsilon\Psi, which describes the quantum behavior of a system using the Hamiltonian operator H^\hat{H} and the total energy ϵ\epsilon. A direct solution is generally intractable, as its computational cost scales exponentially with the number of particles NN.

Kohn-Sham density functional theory (KS-DFT) provides a computationally feasible alternative. Instead of solving the complex many-body wavefunction Ψ\Psi, KS-DFT uses the ground-state electron density ρ(r)\rho(\mathbf{r}) as its fundamental variable. This is achieved by introducing a fictitious system of non-interacting electrons that share the same ground-state density with the real, interacting wavefunction Ψ\Psi. The behavior of non-interacting system is described by a set of NN single-particle orbitals, {ψi}i=1N\{\psi_i\}_{i=1}^{N}, which are the solutions to the KS equations:

H[ρ]ψi=ϵiψi,ρ(r)=∑n=1N∣ψi(ri)∣2,(1)\mathcal{H}[\rho]\psi_i = \epsilon_i\psi_i,\qquad\rho(\mathbf{r}) = \sum_{n=1}^{N} \lvert\psi_i(\mathbf{r}_i)\rvert^2, \tag*{(1)}

where ρ:R3→R+\rho: \mathbb{R}^3 \to\mathbb{R}_{+} is the electron density, H[ρ]\mathcal{H}[\rho] is the effective single-particle KS Hamiltonian constructed from ρ\rho, and ϵi∈R\epsilon_i \in\mathbb{R} is the orbital energy. The H[ρ]\mathcal{H}[\rho] contains the external, Hartree, and exchange-correlation terms. We provide a detailed explanation in Section A.1.

Roothaan-Hall (RH) equation. In practice, the KS-equations are projected into a finite basis set, converting differential equations into the matrix eigenvalue problem known as RH-equation [38, 39]:

H[C]C=SCϵ.(2)\mathbf{H}[\mathbf{C}]\mathbf{C} = \mathbf{S}\mathbf{C}\boldsymbol{\epsilon}. \tag*{(2)}

Here, C∈RB×N\mathbf{C} \in\mathbb{R}^{B \times N} denotes the set of coefficients where each row {Cbi}b=1B\{C_{b i}\}_{b=1}^{B} express an orbital ψi\psi_i as a linear combination of BB basis functions {ϕb(r)}i=1B\{\phi_b(\mathbf{r})\}_{i=1}^{B} i.e., ψi(r)=∑i=1BCibϕb(r)\psi_i(\mathbf{r}) = \sum_{i=1}^{B} C_{i b}\phi_b(\mathbf{r}). Next, H[C]\mathbf{H}[\mathbf{C}] is the Hamiltonian matrix H∈RB×B\mathbf{H} \in\mathbb{R}^{B \times B} constructed by the coefficient C\mathbf{C}, and ϵ∈RN×N\boldsymbol{\epsilon} \in\mathbb{R}^{N \times N} is the diagonal matrix of orbital energies i.e., diag⁡(ϵ1,…,ϵN)\operatorname{diag}(\epsilon_1,\ldots,\epsilon_N). Finally, S∈RB×B\mathbf{S} \in\mathbb{R}^{B \times B} is the matrix of overlap between basis functions Sbb′=∫ϕb∗(r)ϕb′(r)drS_{b b'} = \int\phi_b^*(\mathbf{r})\phi_{b'}(\mathbf{r})\mathrm{d}r where ϕb∗\phi_b^* denotes the complex conjugate of ϕb\phi_b. The basis functions {ϕb(r)}\{\phi_b(\mathbf{r})\} is selected to match the system geometry and commonly chosen between Slater-type orbitals (STOs) [40, 15], Gaussian-type orbitals (GTOs) [41], or plane waves [42, 10].

SO(3)-equivariance in RH-DFT

SO(3)-equivariance and irreducible representations. Formally, a map ff is said to be SO(3)-equivariant if R⋅f(x)=f(R⋅x)\mathbf{R} \cdot f(\mathbf{x}) = f(\mathbf{R} \cdot\mathbf{x}) for all R∈SO(3)\mathbf{R} \in\mathrm{SO}(3) where ⋅\cdot denotes the SO(3) group action. This equivariance can be described in terms of the representation theory [43]. A representation of SO(3) is a matrix-valued function that describes the transforms under rotations, and it is called irreducible if it cannot be decomposed into smaller invariant subspaces. These irreducible representations (irreps) form the fundamental components for constructing SO(3)-equivariant function, and irrep vector is the vector that transforms under a specific irrep. Each SO(3) irrep is indexed by a non-negative integer ℓ\ell, and represented by a Wigner D-matrix D(ℓ)(R)∈C(2ℓ+1)×(2ℓ+1)D^{(\ell)}(\mathbf{R}) \in\mathbb{C}^{(2\ell+1)\times(2\ell+1)}. These matrices characterize how scalar (ℓ=0\ell= 0), vector (ℓ=1\ell= 1), and higher-order tensor features (ℓ≥2\ell\ge2) transform under rotation. A rank-ℓ\ell irrep vector w(ℓ)∈R(2ℓ+1)\mathbf{w}^{(\ell)} \in\mathbb{R}^{(2\ell+1)} transforms under rotation R\mathbf{R} as:

w(ℓ)→RR⋅w(ℓ)=D(ℓ)(R)w(ℓ)\mathbf{w}^{(\ell)} \xrightarrow{\mathbf{R}} \mathbf{R} \cdot\mathbf{w}^{(\ell)} = D^{(\ell)}(\mathbf{R})\mathbf{w}^{(\ell)}

where →R\xrightarrow{\mathbf{R}} implies the transformation under R\mathbf{R}. We provide additional background on group theory and equivariance in Sections A.2 and A.3.

High-order SO(3)-equivariance of RH-DFT. The Hamiltonian matrix in RH-DFT exhibits a highly structured form of equivariance. As shown in Figure 2, the matrix can be organized into blocks, where each block corresponds to interactions between two sets of orbital basis functions indexed by pairs of quantum principal numbers and angular momentum numbers, i.e., (n1,ℓ1)(n_1,\ell_1) and (n2,ℓ2)(n_2,\ell_2). For example, a block labeled 1s-2p denotes interactions between (n1,ℓ1)=(1,0)(n_1,\ell_1) = (1,0) and (n2,ℓ2)=(2,1)(n_2,\ell_2) = (2,1). These orbital groupings induce a higher-order structure, where the Hamiltonian must remain equivariant not only at the global matrix level but also within each individual block. This makes Hamiltonian modeling more challenging than conventional equivariant tasks such as force or energy prediction, as it requires explicit handling of block-level symmetry constraints.

Illustration of the Hamiltonian matrix structure of H2O

Figure 2. Illustration of the Hamiltonian matrix structure of H2_2O. Rows and columns are indexed by quantum and angular momentum numbers (i.e., 1s, 2s) ordered by atom (O, H, H). The full matrix (right) is partitioned into atomic blocks with gray dashed line; the top-left 9×99 \times9 sub-matrix corresponds to O and is shown in detail (left), grouped by quantum and angular momentum. Colors indicate the sign and magnitude of matrix elements.

This symmetry arises naturally in RH-DFT when the basis set is constructed from spherical harmonics, which serve as irrep vectors of SO(3). In particular, standard basis functions such as STO or GTO are defined using spherical harmonics YℓmY_\ell^m, where ℓ\ell and mm denote the angular momentum and magnetic quantum numbers, respectively [44]. When using such spherical-type basis, the full orbital basis set {ϕb}b=1B\{\phi_b\}_{b=1}^{B} can be partitioned into KK groups, with the kk-th group {ϕnkℓkm}m=−ℓkℓk\{\phi_{n_k\ell_km}\}_{m=-\ell_k}^{\ell_k} sharing the same principal quantum number nkn_k and angular momentum quantum number ℓk\ell_k. Each group spans a (2ℓk+1)(2\ell_k+1) functions indexed by mm, forming a rank-ℓk\ell_k irrep vector. We assume the columns of the coefficient matrix C\mathbf{C} are ordered according to these groupings. Under a rotation R∈SO(3)\mathbf{R} \in\mathrm{SO}(3), the matrix C\mathbf{C} transforms as follows:

C→RR⋅C,D(R)=D(ℓ1)(R)⊕⋯⊕D(ℓK)(R),(3)\mathbf{C} \xrightarrow{\mathbf{R}} \mathbf{R} \cdot\mathbf{C}, \qquad\mathcal{D}(\mathbf{R}) = \mathcal{D}^{(\ell_1)}(\mathbf{R}) \oplus\cdots\oplus\mathcal{D}^{(\ell_K)}(\mathbf{R}), \tag*{(3)}

where each D(ℓk)∈R(2ℓk+1)×(2ℓk+1)\mathcal{D}^{(\ell_k)} \in\mathbb{R}^{(2\ell_k+1)\times(2\ell_k+1)} is the rank-ℓk\ell_k Wigner D-matrix and ⊕\oplus denotes the direct sum over irreps. The Hamiltonian matrix H\mathbf{H}, being a function of C\mathbf{C}, also satisfies the SO(3)-equivariance:

H[C]→RR⋅H[C]=H[D(R)C]=D(R)H[C]D(R)−1.(4)\mathbf{H}[\mathbf{C}] \xrightarrow{\mathbf{R}} \mathbf{R} \cdot\mathbf{H}[\mathbf{C}] = \mathbf{H}[\mathcal{D}(\mathbf{R})\mathbf{C}] = \mathcal{D}(\mathbf{R})\mathbf{H}[\mathbf{C}]\mathcal{D}(\mathbf{R})^{-1}. \tag*{(4)}

We provide further details about the SO(3)-equivariance structure of Hamiltonian submatrix and the direct sum of Wigner D-matrices in Section A.4.

Quantum Hamiltonian flow matching (QHFlow)

Flow matching for Hamiltonian matrix

Problem formulation. Our goal is to train a model that predicts the Hamiltonian matrix H\mathbf{H} from a molecular configuration M=(x,h)\mathcal{M} = (\mathbf{x},\mathbf{h}). Here, for a molecule M\mathcal{M} with MM atoms, x∈RM×3\mathbf{x} \in\mathbb{R}^{M \times3} and h∈RM×Dh \in\mathbb{R}^{M \times D} denotes the atom-wise coordinates and DD-dimensional atom-wise features, respectively. We train the model using a atomic dataset A\mathcal{A} with a sample (M,H)(\mathcal{M}, \mathbf{H}) corresponding to a molecular configuration M\mathcal{M} and its Hamiltonian matrix H\mathbf{H} obtained from conventional RH-DFT solvers.

Conditional flow matching (CFM). We first propose the flow matching for Hamiltonian matrix, by parameterizing our model as a continuous normalizing flow (CNF) model. Our CNF aims to learn a time-dependent vector field vt(⋅∣M)v_t(\cdot\mid\mathcal{M}) that outputs the Hamiltonian matrix H\mathbf{H} from solving the ODE ddtHt=vt(Ht∣M)\frac{\mathrm{d}}{\mathrm{d}t}\mathbf{H}_t = v_t(\mathbf{H}_t \mid\mathcal{M}) for time t∈(0,1]t \in(0,1]. The ODE starts from H0\mathbf{H}_0 sampled from the prior distribution p0p_0 defined over the space RB×B\mathbb{R}^{B \times B} of Hamiltonian matrices and outputs a Dirac distribution centered at the Hamiltonian matrix H\mathbf{H}. To this end, we learn the vector field vtθ≈vtv_t^\theta\approx v_t to match the distribution induced from the empirical distribution (M,H1)∼A(\mathcal{M}, \mathbf{H}_1) \sim\mathcal{A} associated with conditional probability paths pt(Ht∣H)p_t(\mathbf{H}_t \mid\mathbf{H}). Importantly, the conditional path pt(Ht∣H)p_t(\mathbf{H}_t \mid\mathbf{H}) is expressed using a closed-form conditional vector field ut(⋅∣H1)u_t(\cdot\mid\mathbf{H}_1): ddtHt=ut(Ht∣H1,M)\frac{\mathrm{d}}{\mathrm{d}t}\mathbf{H}_t = u_t(\mathbf{H}_t \mid\mathbf{H}_1,\mathcal{M}) for H0∼p0\mathbf{H}_0 \sim p_0.

Following previous works [45, 35], we parameterize the conditional probability path using linear interpolation between H0\mathbf{H}_0 and H1\mathbf{H}_1, resulting in the conditional vector field ut(Ht∣H1,M)=H1−Ht1−tu_t(\mathbf{H}_t \mid\mathbf{H}_1,\mathcal{M}) = \frac{\mathbf{H}_1-\mathbf{H}_t}{1-t}. To train the CNF, we use the conditional flow matching objective defined as follows:

LCFM=E(H,M)∼A,t∼U(0,1),Ht∼pt(⋅∣H)[∥vtθ(Ht)−ut(Ht∣H1,M)∥22],(5)\mathcal{L}_{\mathrm{CFM}} = \mathbb{E}_{(\mathbf{H},\mathcal{M})\sim\mathcal{A},t\sim\mathcal{U}(0,1),\mathbf{H}_t\sim p_t(\cdot\mid\mathbf{H})}\left[\left\|v_t^\theta(\mathbf{H}_t)-u_t(\mathbf{H}_t\mid\mathbf{H}_1,\mathcal{M})\right\|_2^2\right], \tag*{(5)}

where U\mathcal{U} denotes an uniform distribution and ∥⋅∥22\|\cdot\|_2^2 denotes the Frobenious norm of a matrix. In practice, we parameterize the vector field by vtθ=H1θ(Ht,M)−Ht1−tv_t^\theta= \frac{\mathbf{H}_1^\theta(\mathbf{H}_t,\mathcal{M})-\mathbf{H}_t}{1-t} using a neural network H1θ(⋅)\mathbf{H}_1^\theta(\cdot). This results in the final loss function:

LCFM=E(H,M)∼A,t∼U(0,1),Ht∼pt(⋅∣H)[1(1−t)2∥H1θ(Ht,M)−H1∥22],(6)\mathcal{L}_{\mathrm{CFM}} = \mathbb{E}_{(\mathbf{H},\mathcal{M})\sim\mathcal{A},t\sim\mathcal{U}(0,1),\mathbf{H}_t\sim p_t(\cdot\mid\mathbf{H})}\left[\frac{1}{(1-t)^2}\left\|\mathbf{H}_1^\theta(\mathbf{H}_t,\mathcal{M})-\mathbf{H}_1\right\|_2^2\right], \tag*{(6)}

which one could interpret as training H1θ\mathbf{H}_1^\theta to approximate the true Hamiltonian matrix H\mathbf{H} from its noisy versions Ht\mathbf{H}_t. We provide a full description of the training and sampling algorithms in Section B.1.

Fine-tuning for energy alignment. In practice, many important quantum properties derived from DFT rely directly on orbital energies. To improve the accuracy of such downstream quantities including orbital energies, highest occupied molecular orbital (HOMO) energy, lowest unoccupied molecular orbital (LUMO) energy, and the HOMO–LUMO gap, we introduce a fine-tuning strategy that explicitly aligns the predicted orbital energies with their ground-truth DFT references. This approach is motivated by the weighted alignment loss (WALoss) introduced in WANet [25], which improves prediction quality by aligning the energy of predicted and reference matrix. Rather than incorporating this loss during full training, we adopt it as a post hoc fine-tuning objective.

Specifically, we define a fine-tuning objective that aligns the approximate orbital energies ε~\tilde{\boldsymbol{\varepsilon}} derived from our predicted Hamiltonian matrix H1θ\mathbf{H}_1^\theta from CNF with the ground-truth orbital energies ε\boldsymbol{\varepsilon} computed from RH-DFT as defined in Equation (2):

LFT=E(H,M)∼A,t∼U(0,1),Ht∼pt(⋅∣H)[∥ε~(H1θ(Ht,M))−ε∥22](7)\mathcal{L}_{\mathrm{FT}} = \mathbb{E}_{(\mathbf{H},\mathcal{M})\sim\mathcal{A},t\sim\mathcal{U}(0,1),\mathbf{H}_t\sim p_t(\cdot\mid\mathbf{H})}\left[\left\|\tilde{\boldsymbol{\varepsilon}}(\mathbf{H}_1^\theta(\mathbf{H}_t,\mathcal{M}))-\boldsymbol{\varepsilon}\right\|_2^2\right] \tag*{(7)}

Here, the ground-truth orbital energies ε\boldsymbol{\varepsilon} are computed via the identity ε=CTHC\boldsymbol{\varepsilon} = \mathbf{C}^{\mathsf{T}}\mathbf{H}\mathbf{C}, which follows from the orthonormality condition CTSC=I\mathbf{C}^{\mathsf{T}}\mathbf{S}\mathbf{C} = \mathbf{I}, where C\mathbf{C} is the ground-truth coefficient matrix and S\mathbf{S} is the overlap matrix. Following Equation (2), we estimate ε~\tilde{\boldsymbol{\varepsilon}} using the predicted Hamiltonian: ε~=CTH1θC≈(Cθ)TH1θCθ\tilde{\boldsymbol{\varepsilon}} = \mathbf{C}^{\mathsf{T}}\mathbf{H}_1^\theta\mathbf{C} \approx(\mathbf{C}^\theta)^{\mathsf{T}}\mathbf{H}_1^\theta\mathbf{C}^\theta, where Cθ\mathbf{C}^\theta is the coefficient matrix obtained by solving the RH-DFT for the predicted Hamiltonian H1θ\mathbf{H}_1^\theta. We provide the implementation details in Section B.2.

SE(3)-equivariant flow matching with equivariant priors.

Here, we introduce our approach to design our QHFlow to satisfy SE(3)-equivariance. We follow the framework of Song et al. [27] to learn an equivariant vector field under an invariant prior. To handle translational symmetry, our networks operate in a mean-free system by centering the molecular coordinates X\mathbf{X} at the origin, i.e., set X↦X−1M11TX\mathbf{X} \mapsto\mathbf{X} - \frac{1}{M}\mathbf{1}\mathbf{1}^{\mathsf{T}}\mathbf{X} given a vector 1∈RN×1\mathbf{1} \in\mathbb{R}^{N \times1} of ones. To make QHFlow satisfy equivariance, we (1) parameterize the vector field vtθv_t^\theta using a SO(3)-equivariant neural network [23] and (2) propose Gaussian orthogonal ensemble (GOE) and tensor expansion-based (TE) priors for the Hamiltonian. The main challenge is to design new priors that are invariant to the rotation of the Hamiltonian matrix as described in Equation (4).

Gaussian orthogonal ensemble (GOE) prior. We here introduce a simple rotational invariant prior, the GOE prior. A GOE is defined over matrices H∈Rn×n\mathbf{H} \in\mathbb{R}^{n \times n}, with each element drawn from a Gaussian distribution: Hij∼N(0,σ2)H_{ij} \sim\mathcal{N}(0,\sigma^2). The log-density is proportional to the Frobenius norm of the matrix, which is invariant under any transformations associated with SO(3) irreps, i.e., the 3D-rotation matrix (ℓ=1\ell= 1) and even the high-rank Wigner D-matrices (ℓ≥2\ell\ge2). Therefore, the prior satisfies the desired invariance, i.e., p(H)=p(D(R)HD(R)−1)p(\mathbf{H}) = p(\mathbf{D}(\mathbf{R})\mathbf{H}\mathbf{D}(\mathbf{R})^{-1}) for all R∈SO(3)\mathbf{R} \in\mathrm{SO}(3). We provide the full proof for the SO(3)-invariance in Section C.1.

Tensor expansion-based (TE) prior. We also introduce TE prior, an SO(3)-invariant distribution constructed by first sampling an irrep vector w(ℓ)\mathbf{w}^{(\ell)}, then applying tensor expansion to produce a matrix H(ℓ1,ℓ2)∈R(2ℓ1+1)×(2ℓ2+1)\mathbf{H}^{(\ell_1,\ell_2)} \in\mathbb{R}^{(2\ell_1+1) \times(2\ell_2+1)} that transforms covariantly under rotation R∈SO(3)\mathbf{R} \in\mathrm{SO}(3):

H(ℓ1,ℓ2)→RD(ℓ1)(R)H(ℓ1,ℓ2)D(ℓ2)(R)−1.(8)\mathbf{H}^{(\ell_1,\ell_2)} \xrightarrow{\mathbf{R}} \mathbf{D}^{(\ell_1)}(\mathbf{R})\mathbf{H}^{(\ell_1,\ell_2)}\mathbf{D}^{(\ell_2)}(\mathbf{R})^{-1}. \tag*{(8)}

To this end, we first design an SO(3)-invariant distribution of irrep vector p(w(ℓ3))p(\mathbf{w}^{(\ell_3)}) by decomposing the vector into a radial and rotational parts: w(ℓ)=rD(ℓ)(R)w(ℓ0)\mathbf{w}^{(\ell)} = r\mathbf{D}^{(\ell)}(\mathbf{R})\mathbf{w}^{(\ell_0)} where rr is a scalar norm and w(ℓ0)\mathbf{w}^{(\ell_0)} is a fixed unit-norm irrep vector, i.e., Yℓ(r^0)Y^\ell(\hat{\mathbf{r}}_0) for fixed direction r^0\hat{\mathbf{r}}_0. By sampling rr independently of R\mathbf{R}, and choosing R\mathbf{R} uniformly on SO(3), the resulting prior p(w(ℓ))p(\mathbf{w}^{(\ell)}) is SO(3)-invariant. In practice, we take r∼Normal⁡(μ,σ2)r \sim\operatorname{Normal}(\mu,\sigma^2) to ensure positivity, and R∼Uniform⁡(SO(3))\mathbf{R} \sim\operatorname{Uniform}(\mathrm{SO}(3)).

Next, we apply tensor expansion, which maps a rank-ℓ\ell irrep vector w(ℓ)∈R(2ℓ+1)\mathbf{w}^{(\ell)} \in\mathbb{R}^{(2\ell+1)} into a matrix of shape (2ℓ1+1)×(2ℓ2+1)(2\ell_1+1) \times(2\ell_2+1), indexed by the (m1,m2)(m_1,m_2) satisfying −ℓ1≤m1≤ℓ1-\ell_1 \le m_1 \le\ell_1 and −ℓ2≤m2≤ℓ2-\ell_2 \le m_2 \le\ell_2, respectively. Each entry of the resulting matrix is defined as follows:

(⊗ˉw(ℓ))(m1,m2)(ℓ1,ℓ2)=∑m=−ℓℓC(ℓ1,m1),(ℓ2,m2)(ℓ,m)wm(ℓ),(9)\left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)^{(\ell_1,\ell_2)}_{(m_1,m_2)} = \sum_{m=-\ell}^{\ell} C^{(\ell,m)}_{(\ell_1,m_1),(\ell_2,m_2)} w^{(\ell)}_m, \tag*{(9)}

where CC denotes Clebsch-Gordan coefficients, ⊗ˉ\bar{\otimes} denotes the tensor expansion operation. Note that the superscript (ℓ1,ℓ2)(\ell_1,\ell_2) indicates the output irrep structure and can be omitted when clear from context. The rotation of this expanded matrix is represented by the Wigner D-matrix as follows:

⊗ˉw(ℓ)→RD(ℓ1)(R)(⊗ˉw(ℓ))D(ℓ2)(R)−1.(10)\bar{\otimes}\mathbf{w}^{(\ell)} \xrightarrow{\mathbf{R}} \mathbf{D}^{(\ell_1)}(\mathbf{R})\left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)\mathbf{D}^{(\ell_2)}(\mathbf{R})^{-1}. \tag*{(10)}

See Section C.2 for proof. This property allows us to construct SO(3)-invariant distributions over Hamiltonians. We formalize this in the following theorem:

Theorem 1. Let H=(⊗ˉw(ℓ))(ℓ1,ℓ2)\mathbf{H} = \left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)^{(\ell_1,\ell_2)}, where an irrep vector w(ℓ)∼p(w(ℓ))\mathbf{w}^{(\ell)} \sim p(\mathbf{w}^{(\ell)}) is drawn from a SO(3)-invariant distribution. Then the induced distribution over H\mathbf{H} is invariant under SO(3) transformation:

p(H)=p(D(ℓ1)(R)HD(ℓ2)(R)−1),∀R∈SO(3).(11)p(\mathbf{H}) = p\left(\mathbf{D}^{(\ell_1)}(\mathbf{R})\mathbf{H}\mathbf{D}^{(\ell_2)}(\mathbf{R})^{-1}\right), \qquad\forall\mathbf{R} \in\mathrm{SO}(3). \tag*{(11)}

We provide proof in Section C.3. Using the expansion, we can model the invariant distributions for each sub-matrix of Hamiltonian H\mathbf{H}. We further extend this construction to build global invariant distributions over full Hamiltonian matrices H\mathbf{H} by composing multiple high-order irrep vector via tensor expansion. We provide a detailed construction of this multi-block formulation in Section C.4.

Model implementation

We construct QHFlow by extending OHNet [23], an SE(3)-equivariant GNN for Hamiltonian prediction. Our architecture introduces time conditioning and two additional inputs: the current Hamiltonian Ht\mathbf{H}_t and the overlap matrix S\mathbf{S}. The model takes (M,Ht,S,t)(\mathcal{M},\mathbf{H}_t,\mathbf{S},t) and predicts the target Hamiltonian H1t\mathbf{H}_1^t as described in Equation (6). We provided the implementation details in Section D.1.

Feature initialization. We first construct the atom-wise features hi,si\mathbf{h}_i,\mathbf{s}_i based on (1) extracting atom-wise submatrices Hi,Si\mathbf{H}_i,\mathbf{S}_i from Ht,S\mathbf{H}_t,\mathbf{S} and (2) mapping the submatrices into SO(3) irrep vectors based on Wigner-Eckart projections [46], i.e., set hi=ProjBlock⁡(Hi),si=ProjBlock⁡(Si)\mathbf{h}_i = \operatorname{ProjBlock}(\mathbf{H}_i),\mathbf{s}_i = \operatorname{ProjBlock}(\mathbf{S}_i) where ProjBlock⁡\operatorname{ProjBlock} flattens and applies change of basis transformations to the input matrix. We further encode time tt through tensor field network (TFN) [47] layer and sinusoidal encoding et=ftime(t)e_t = f_{\mathrm{time}}(t), i.e., set mi=TFN⁡(xi,hi,et)m_i = \operatorname{TFN}(x_i,h_i,e_t).

Message-passing layers. To propagate information between neighbors, our model updates the irrep vectors hi\mathbf{h}_i and si\mathbf{s}_i using SO(3)-equivariant attention-based layers adapted from Equiformer [48]:

hi←EquiBlock⁡(hi,{(hj,dij)}j∈Ni,et),si←EquiBlock⁡(si,{(sj,dij)}j∈Ni,et),\mathbf{h}_i \leftarrow\operatorname{EquiBlock}\left(\mathbf{h}_i,\{(\mathbf{h}_j,d_{ij})\}_{j \in\mathcal{N}_i},e_t\right), \qquad\mathbf{s}_i \leftarrow\operatorname{EquiBlock}\left(\mathbf{s}_i,\{(\mathbf{s}_j,d_{ij})\}_{j \in\mathcal{N}_i},e_t\right),

where Ni\mathcal{N}_i denotes the neighbors of atom ii and dijd_{ij} is distance between atom ii and jj. We then apply a channel mixing module, Mix, which linearly combines the set of irrep vectors by flattening and reordering them according to their corresponding irrep indices while preserving SE(3)-equivariance. This module update the mi\mathbf{m}_i in the residual manner:

mi←TFN⁡(mi+Mix⁡(hi,si,mi),{(mj,dij)}j∈Ni,ϵt).(12)\mathbf{m}_i \leftarrow\operatorname{TFN}\left(\mathbf{m}_i+\operatorname{Mix}(\mathbf{h}_i,\mathbf{s}_i,\mathbf{m}_i),\left\{(\mathbf{m}_j,d_{ij})\right\}_{j\in\mathcal{N}_i},\epsilon_t\right). \tag*{(12)}

This update process is repeated for a fixed number of iterations, allowing the model to integrate geometric and physical information across the molecular graph.

Hamiltonian reconstruction. The atom-wise irrep vectors mi\mathbf{m}_i are passed into two TFN modules to predict Hamiltonian components. The first TFN⁡s\operatorname{TFN}_{\mathrm{s}} computes atom-wise irreps wii\mathbf{w}_{ii} using messages from neighboring atoms, while the next TFN⁡p\operatorname{TFN}_{\mathrm{p}} predicts pairwise irreps wij\mathbf{w}_{ij} between atom ii and jj:

wii=TFN⁡s(mi,{(mk,dik)}k∈Ni),wij=TFN⁡p(mi,mj,dij).(13)\mathbf{w}_{ii}=\operatorname{TFN}_{\mathrm{s}}\left(\mathbf{m}_i,\left\{(\mathbf{m}_k,d_{ik})\right\}_{k\in\mathcal{N}_i}\right),\qquad\mathbf{w}_{ij}=\operatorname{TFN}_{\mathrm{p}}\left(\mathbf{m}_i,\mathbf{m}_j,d_{ij}\right). \tag*{(13)}

Each output consists of a set of irrep vectors, wii={wii(ℓ)}ℓ∈Li\mathbf{w}_{ii}=\left\{\mathbf{w}_{ii}^{(\ell)}\right\}_{\ell\in L_i} and wij={wij(ℓ)}ℓ∈Li\mathbf{w}_{ij}=\left\{\mathbf{w}_{ij}^{(\ell)}\right\}_{\ell\in L_i}, where LiL_i is the set of angular momentum ℓ\ell corresponding to the atom ii. Then Hamiltonian blocks are constructed via tensor expansion ⊗‾\overline{\otimes} and learnable weights FF:

Hij(ℓ1,ℓ2)=∑ℓ∈LiFij(ℓ1,ℓ2,ℓ)(⊗‾wij(ℓ))(ℓ1,ℓ2),(14)\mathbf{H}_{ij}^{(\ell_1,\ell_2)}=\sum_{\ell\in L_i}F_{ij}^{(\ell_1,\ell_2,\ell)}\left(\overline{\otimes}\mathbf{w}_{ij}^{(\ell)}\right)^{(\ell_1,\ell_2)}, \tag*{(14)}

where ℓ1∈Li\ell_1\in L_i and ℓ2∈Lj\ell_2\in L_j, and the case i=ji=j corresponds to diagonal block. These blocks are then assembled into the full Hamiltonian matrix H^\hat{\mathbf{H}}, which is structured into K×KK\times K sub-matrices corresponding to all pairwise combinations of the KK groups of basis functions. All operations in this reconstruction preserve SE(3)-equivariance, ensuring that both H^\hat{\mathbf{H}} and the learned vector field vtθ\mathbf{v}_t^\theta remain equivariant under any SE(3) transformation of the molecular geometry.

Experiments

In this section, we present experimental results that demonstrate the effectiveness of QHFlow. We evaluate the performance on a public benchmark and compare it with competitive baselines [19, 20, 23, 26] when metrics are available. We provide training settings and hyperparameters in Section E.

Datasets. We evaluate our model on two datasets: MD17 [49, 19] and QH9 [50, 51, 24]. MD17 contains DFT Hamiltonians along molecular dynamics trajectories for four small molecules, water (4,900 structures), ethanol (30,000), malondialdehyde (26,978), and uracil (30,000). The PBE exchange–correlation [52, 53] functional with a GTO basis set is used for DFT.

QH9 consists of two subsets: stable and dynamic-300k, each supporting in-distribution (id) and out-of-distribution (ood) splits. The stable includes 130,831 molecules with up to 29 atoms. The id split randomly samples molecules, while the ood split groups them by size. The dynamic-300k contains 2,998 molecules, each with 100 perturbed geometries. The geo split assigns geometries randomly across splits for each molecule; the mol split partitions at the molecule level to test on unseen molecular identities. All QH9 Hamiltonians are computed using B3LYP [54] with the def2-SVP basis set. We provide the details about the dataset in Section E.1.

Evaluation metrics. Our evaluation metrics include the mean absolute error (MAE) of the Hamiltonian HH, the MAE of occupied orbital energies (ϵocc\epsilon_{\mathrm{occ}}), and the similarity score of the orbital coefficient matrix (SC\mathcal{S}_{\mathrm{C}}). To assess physical fidelity on QH9, we also report the energy of LUMO (ϵLUMO\epsilon_{\mathrm{LUMO}}), HOMO (ϵHOMO\epsilon_{\mathrm{HOMO}}), and HOMO–LUMO gap (ϵΔ\epsilon_{\Delta}). We provide details of the metrics in Section E.2.

Performance on MD17 dataset

We extensively evaluate QHFlow on the widely used MD17 benchmark dataset to assess its accuracy in predicting Hamiltonian matrices in diverse molecular geometries. As shown in Table 1, we compare QHFlow with baseline models in four representative molecules, and it consistently outperformed all existing methods. With up to a 73% reduction in Hamiltonian prediction error, QHFlow demonstrates strong predictive performance. This improvement highlights its ability to capture fine-grained variations in quantum Hamiltonians resulting from subtle geometric changes, an essential capability for accurately modeling physical and chemical behavior.

ModelWater (3 atoms) H↓H \downarrow [μEh\mu E_h]Water (3 atoms) ϵocc↓\epsilon_{\mathrm{occ}} \downarrow [μEh\mu E_h]Water (3 atoms) Sc↑S_c \uparrow [%]Ethanol (9 atoms) H↓H \downarrow [μEh\mu E_h]Ethanol (9 atoms) ϵocc↓\epsilon_{\mathrm{occ}} \downarrow [μEh\mu E_h]Ethanol (9 atoms) Sc↑S_c \uparrow [%]Malondialdehyde (9 atoms) H↓H \downarrow [μEh\mu E_h]Malondialdehyde (9 atoms) ϵocc↓\epsilon_{\mathrm{occ}} \downarrow [μEh\mu E_h]Malondialdehyde (9 atoms) Sc↑S_c \uparrow [%]Uracil (12 atoms) H↓H \downarrow [μEh\mu E_h]Uracil (12 atoms) ϵocc↓\epsilon_{\mathrm{occ}} \downarrow [μEh\mu E_h]Uracil (12 atoms) Sc↑S_c \uparrow [%]
SchNOrb165.4279.3100.00187.4334.4100.00191.1400.699.00227.81760.90.00
PhiSNet15.6785.53100.0020.09102.0499.8121.31100.699.8918.65143.3699.86
QHNet*11.7026.06100.0027.9999.3399.9929.60100.1699.9226.80127.9399.87
SPHNet23.18182.29100.0021.0282.30100.0020.6795.7799.9919.36118.2199.99
Ours4.9319.29100.005.3329.03100.003.8022.6899.993.6830.5499.99

Table 1. Table 1: MD17 benchmark. Results shown in bold denote the best result in each column, whereas those that are <u>underlined</u> indicate the second best.

DatasetModelH↓H \downarrow [μEh\mu E_h]ϵocc↓\epsilon_{\mathrm{occ}} \downarrow [μEh\mu E_h]Sc↑S_c \uparrow [%]ϵLUMO↓\epsilon_{\mathrm{LUMO}} \downarrow [μEh\mu E_h]ϵHOMO↓\epsilon_{\mathrm{HOMO}} \downarrow [μEh\mu E_h]ϵΔ↓\epsilon_{\Delta} \downarrow [μEh\mu E_h]
QH9-stable (id)QHNet*77.72963.4594.8018257.341546.2717822.62
WANet80.00833.6296.86---
SPHNet45.48334.2897.75---
Ours22.95119.6799.51437.96179.48553.87
Ours (WA-FT)<u>23.85</u>101.9299.56187.4892.22206.15
QH9-stable (ood)QHNet*69.69884.9793.0125848.831045.9925370.10
SPHNet43.33186.4098.16---
Ours20.01<u>84.54</u>99.04321.20130.74395.83
Ours (WA-FT)<u>20.55</u>72.6499.16171.2477.96179.57
QH9-dynamic (300k-geo)QHNet*88.361170.5093.6523269.412040.0622407.96
WANet74.74416.5799.68---
SPHNet52.18<u>100.88</u>99.12---
Ours25.94103.11<u>99.59</u>425.18175.18547.33
Ours (WA-FT)<u>27.12</u>89.0399.65136.6384.17154.68
QH9-dynamic (300k-mol)QHNet*121.395554.3686.0253505.094352.7650424.86
SPHNet108.191724.1091.49---
Ours45.91<u>442.56</u>98.651344.68479.711605.03
Ours (WA-FT)<u>46.60</u>424.7598.74912.10403.511047.88

Table 2. Table 2: QH9 benchmark. WA-FT implies finetuned model with WAloss. Results shown in bold denote the best result in each column, whereas those that are <u>underlined</u> indicate the second best.

Performance on QH9 dataset

We evaluate QHFlow on the QH9 dataset, a more challenging benchmark that includes various molecular sizes and compositions. This setting requires the model to generalize effectively across chemical and geometric variations. We trained on four different data splits. As shown in Table 2, QHFlow consistently outperforms all prior methods in all metrics. In particular, it shows significant improvements in properties sensitive to eigenvalues such as ϵLUMO\epsilon_{\mathrm{LUMO}}, ϵHOMO\epsilon_{\mathrm{HOMO}}, and ϵΔ\epsilon_{\Delta}, showing the benefits of the flow-based model in capturing a physically meaningful structure in Hamiltonians. These results demonstrate QHFlow’s strong potential as a surrogate model for DFT.

We also apply our energy fine-tuning stage to a pretrained QHFlow using the weighted alignment loss (WAloss) [25] for an additional 60,000 steps, which we denote as WA-FT. As shown in Table 2, this improves predictions of orbital energies and their downstream task, confirming that energy alignment fine-tuning serves as an effective inductive bias. We compare training from scratch with the WAloss and flow matching objectives in Section F.1.

DFT acceleration performance

Here, we show that our QHFlow can accelerate DFT through initializing the SCF iterations [13, 14, 15] using the predicted Hamiltonian matrix, replacing the conventional SCF initialization methods.

Preliminaries on SCF method. Starting from an initial Hamiltonian H(0)\mathbf{H}^{(0)}, each SCF iteration solves the generalized eigenvalue problem H(k)C(k)=SC(k)ϵ(k)\mathbf{H}^{(k)}\mathbf{C}^{(k)}=\mathbf{S}\mathbf{C}^{(k)}\boldsymbol{\epsilon}^{(k)} to obtain the coefficients C(k)\mathbf{C}^{(k)}. The coefficients are then used to construct the density ρ(k)\boldsymbol{\rho}^{(k)} and subsequently update the Hamiltonian to H(k+1)\mathbf{H}^{(k+1)} through the mapping C(k)→Qρ(k)→HH(k+1)\mathbf{C}^{(k)} \xrightarrow{Q} \boldsymbol{\rho}^{(k)} \xrightarrow{H} \mathbf{H}^{(k+1)}, where →Q\xrightarrow{Q} and →H\xrightarrow{H} denote the density construction and Hamiltonian update operators, respectively. The iteration continues until convergence.

DFT acceleration via SCF initialization. We use QHFlow’s prediction H^\hat{H} to replace the conventional Hamiltonian guess by beginning the SCF loop closer to convergence. Performance is summarized with four relative metrics normalized by the conventional DFT baseline metric: SCF Iter Ratio: ratio of SCF iteration count, SCF T Ratio: ratio of SCF wall time, Inf T Ratio: ratio of inference time as a fraction of baseline SCF wall time, Total T Ratio: Ratio of net runtime after adding inference overhead. We provide the definition of metric in Section E.2.

We evaluate QHFlow on 300 test molecules from the QH9 dataset, selected via a fixed index slice using a 3-step ODE-based sampling. As shown in Figure 3, QHFlow significantly accelerates the convergence of SCF. For instance, on the QH9 id benchmark, QHFlow achieves convergence in 46% of the runtime required by conventional DFT, corresponding to 54% relative speedup. Compared to previous ML-based initializations methods like QHNet which requires 53% of the conventional runtime, QHFlow provides an additional reduction of 7% points. These results demonstrate the practical utility of QHFlow for accelerating real-world DFT simulations.

DFT acceleration performance on 300 samples from the QH9 dataset

Figure 3. DFT acceleration performance on 300 samples from the QH9 dataset. All metrics are reported as percentages relative to conventional DFT (initialized with minao), which serves as the 100% baseline. The SCF Iter Ratio measures the ratio of SCF iterations required, while Inf T Ratio, SCF T Ratio, and Total T Ratio measure time. Lower SCF Iter Ratio and Total T Ratio values indicate faster convergence. For example, a Total T Ratio of 46% means QHFlow converges in 46% of the conventional DFT time, including the negligible model inference time.

Ablation studies

Here, we ablate our design choices, with more results (e.g., orbital energy metrics) in Section F.3.

GOE, TE-based priors. We explore the effects of the flow matching prior for Hamiltonian prediction by comparing the two priors introduced in § 4: GOE and TE prior. The GOE prior treats each symmetric matrix as structure-free noise, whereas the TE prior injects group-theoretic bias that matches the blockwise symmetry of Hamiltonians.

Table 3 compares GOE and TE priors, where the TE prior results are identical to those of QHFlow reported in Table 2. We found that the TE prior consistently yields lower errors than the GOE prior across all splits. This highlights the importance of designing task-aligned and symmetry-aware priors for accurate Hamiltonian prediction.

DataPriorH↓[μEh]H \downarrow[\mu E_h]ϵocc↓[μEh]\epsilon_{\mathrm{occ}} \downarrow[\mu E_h]Sc↑[%]S_c \uparrow[\%]
idGOE25.93154.6599.39
TE22.95119.6199.51
oodGOE20.4187.3298.95
TE20.0184.5499.04
geoGOE29.39122.1499.49
TE25.94103.1199.59
molGOE46.78419.6898.65
TE45.91442.5698.65

Table 3. Effect of prior distribution.

Predictive variance. To evaluate the robustness of QHFlow to stochastic initialization, we repeat inference 5 times per molecule using the TE prior, changing only the seed that generates the initial noise sample. Results are shown in Table 4, with all metrics reported as mean±\pmstd over five runs. The predicted Hamiltonians exhibit a mean absolute deviation of just 0.03% and a standard deviation of predicted energy below 0.3μEh\mu E_h, much smaller than the prevalent chemical accuracy thresholds. These results confirm that QHFlow produces stable and consistent predictions despite stochastic initialization.

DataModelH↓[μEh]H \downarrow[\mu E_h]ϵocc↓[μEh]\epsilon_{\mathrm{occ}} \downarrow[\mu E_h]S^c↑[%]\hat{S}_c \uparrow[\%]
idOurs22.95±0.00122.95 \pm0.001119.67±0.021119.67 \pm0.02199.51±0.00199.51 \pm0.001
WA-FT23.85±0.00123.85 \pm0.001101.92±0.279101.92 \pm0.27999.56±0.00299.56 \pm0.002
oodOurs20.01±0.00120.01 \pm0.00184.54±0.00784.54 \pm0.00799.04±0.00399.04 \pm0.003
WA-FT20.55±0.00220.55 \pm0.00272.64±0.01872.64 \pm0.01899.16±0.00699.16 \pm0.006
geoOurs25.94±0.00125.94 \pm0.001103.26±0.031103.26 \pm0.03199.59±0.00199.59 \pm0.001
WA-FT27.18±0.00227.18 \pm0.00289.03±0.02389.03 \pm0.02399.65±0.00199.65 \pm0.001
molOurs45.91±0.00145.91 \pm0.001443.56±0.171443.56 \pm0.17198.65±0.00198.65 \pm0.001
WA-FT46.60±0.00146.60 \pm0.001424.75±0.324424.75 \pm0.32498.74±0.00198.74 \pm0.001

Table 4. Predictive variance of QHFlow.

Conclusion

In this work, we introduce QHFLOW, a high-order equivariant flow-based generative model designed to predict Hamiltonian matrices with high accuracy and physical consistency. By designing SE(3)SE(3)-invariant priors GOE and TE, QHFLOW improves the accuracy and generalization across diverse geometries. Extensive experiments on the MD17 and QH9 datasets demonstrate that QHFLOW not only achieves state-of-the-art performance across multiple evaluation metrics but also significantly improves efficiency in downstream SCF calculations. Our results highlight the power of flow-based learning for scientific tasks and establish QHFLOW as a scalable and physically grounded framework for accelerating quantum chemistry simulations.

Limitation

We did not fully verify the generalizability of our approach, e.g., extension to new architectures (WANet [25], SPHNet [26]) or datasets (PubChemQH [25]), due to the lack of resources, public codes, and public datasets. Our flow-based formulation introduces computational overhead for solving ODEs. In the future, one could consider removing the overhead with the one-step generative models [55]. Our experiments are limited to gas-phase molecules with up to 29 atoms and two commonly used XC functionals (PBE and B3LYP). The algorithms are left to be verified for more general settings, such as periodic solids or higher-accuracy functionals (e.g., hybrid or double-hybrid). We also acknowledge that our datasets consist of relatively small molecules. One could further test the scalability of our approach once new datasets on larger systems are available. We also note that our work does not give a theoretical explanation of how Hamiltonian prediction error translates to SCF acceleration. Developing a theoretically grounded algorithm specifically for SCF acceleration would be an interesting future research.

Broader Impact

This work focuses on advancing machine learning methods for quantum chemistry applications and does not involve human subjects, personal data, or sensitive information. As such, we believe that there are no direct ethical concerns associated with this research. Nevertheless, we acknowledge that improved computational tools for molecular modeling could have downstream applications in sensitive areas such as pharmaceuticals or materials development. We encourage responsible and ethical use of our methods in accordance with applicable laws and scientific guidelines.

Acknowledgements and Funding Disclosure

This work was partly supported by Institute for Information & Communications Technology Planning & Evaluation(IITP) grant funded by the Korea government(MSIT) (RS-2019-II190075, Artificial Intelligence Graduate School Support Program(KAIST)), National Research Foundation of Korea(NRF) grant funded by the Ministry of Science and ICT(MSIT) (No. RS-2022-NR072184), GRDC(Global Research Development Center) Cooperative Hub Program through the National Research Foundation of Korea(NRF) grant funded by the Ministry of Science and ICT(MSIT) (No. RS-2024-00436165), and the Institute of Information & Communications Technology Planning & Evaluation(IITP) grant funded by the Korea government(MSIT) (RS-2025-02304967, AI Star Fellowship(KAIST)). We thank Minsu Kim, Hyomin Kim, and Hyoosoon Jang for helpful discussions and feedback.

Additional Preliminary

Kohn-Sham density functional theory

Density functional theory (DFT) is a cornerstone of quantum chemistry and materials science, offering a computationally tractable framework for approximating the electronic structure of many-body systems. As directly solving the many-electron Schrödinger equation [37] is prohibitively expensive for systems with many particles, DFT reformulates the problem by expressing ground-state properties as a functional of the electron density ρ(r)\rho(\mathbf{r}). Since ρ(r)\rho(\mathbf{r}) depends only on three spatial coordinates, this significantly reduces the computational cost regardless of the number of electrons.

In practical applications, DFT is most commonly implemented via the Kohn–Sham formulation [1, 12], which introduces a fictitious system of non-interacting electrons designed to reproduce the true ground-state density of the real interacting system. The wavefunction of this non-interacting system, often referred to as the Kohn–Sham wavefunction ΨKS\Psi_{KS}, is defined as follows. Since electrons are fermions, ΨKS\Psi_{KS} must obey the Pauli exclusion principle. This requires the wavefunction to be antisymmetric with respect to the exchange of any two electrons, a property that is achieved by constructing ΨKS\Psi_{KS} as a Slater determinant built from the NN single-particle Kohn-Sham orbitals {ψi}i=1N\{\psi_i\}_{i=1}^{N}:

ΨKS(r1,…,rN)=1N!det⁡[ψi(rj)]i,j=1N=1N!∣ψ1(r1)ψ2(r1)⋯ψN(r1)ψ1(r2)ψ2(r2)⋯ψN(r2)⋮⋮⋱⋮ψ1(rN)ψ2(rN)⋯ψN(rN)∣(15)\Psi_{KS}(\mathbf{r}_1,\ldots,\mathbf{r}_N)=\frac{1}{\sqrt{N!}}\det[\psi_i(\mathbf{r}_j)]_{i,j=1}^{N}=\frac{1}{\sqrt{N!}}\begin{vmatrix}\psi_1(\mathbf{r}_1)&\psi_2(\mathbf{r}_1)&\cdots&\psi_N(\mathbf{r}_1)\\\psi_1(\mathbf{r}_2)&\psi_2(\mathbf{r}_2)&\cdots&\psi_N(\mathbf{r}_2)\\\vdots&\vdots&\ddots&\vdots\\\psi_1(\mathbf{r}_N)&\psi_2(\mathbf{r}_N)&\cdots&\psi_N(\mathbf{r}_N)\end{vmatrix} \tag*{(15)}

Originally, the electron density is calculated from the wavefunction Ψ\Psi:

ρ(r)=N∫⋯∫∣Ψ(r,r2,…,rN)∣ dr2⋯drN.(16)\rho(\mathbf{r})=N\int\cdots\int|\Psi(\mathbf{r},\mathbf{r}_2,\ldots,\mathbf{r}_N)|\,d\mathbf{r}_2\cdots d\mathbf{r}_N. \tag*{(16)}

However, assuming orthonormal orbitals, the density expression simplifies to:

ρ(r)=∑i=1N∣ψi(r)∣2.(17)\rho(\mathbf{r})=\sum_{i=1}^{N}|\psi_i(\mathbf{r})|^2. \tag*{(17)}

Instead of explicitly constructing the full KS wavefunction, which scales exponentially with system size due to the determinant, we can directly obtain the electron density from the single-particle orbitals ψi\psi_i. The single-particle orbitals {ψi(r)}\{\psi_i(\mathbf{r})\} and their corresponding energies {ϵi}\{\epsilon_i\} are found by solving the Kohn-Sham (KS) equations:

H[ρ]ψi(r)=[−12∇2+Vext(r)+VH[ρ](r)+Vxc[ρ](r)]ψi(r)=ϵiψi(r),(18)\mathcal{H}[\rho]\psi_i(\mathbf{r})=\left[-\frac{1}{2}\nabla^2+V_{\mathrm{ext}}(\mathbf{r})+V_{\mathrm{H}}[\rho](\mathbf{r})+V_{\mathrm{xc}}[\rho](\mathbf{r})\right]\psi_i(\mathbf{r})=\epsilon_i\psi_i(\mathbf{r}), \tag*{(18)}

Here, the entire term in brackets is the effective KS Hamiltonian H[ρ]\mathcal{H}[\rho], which is a functional of the electron density ρ\rho. It consists of the Laplacian operator (∇2\nabla^2) for the kinetic energy of the non-interacting electrons, the external potential (VextV_{\mathrm{ext}}) from the atomic nuclei, the Hartree potential (VHV_{\mathrm{H}}) representing classical electrostatic repulsion, and the crucial exchange-correlation potential (VxcV_{\mathrm{xc}}), which encapsulates all complex many-body quantum effects.

The ground-state electron density ρ(r)\rho(\mathbf{r}) is then constructed from the NN occupied KS orbitals obtained from solving these equations:

ρ(r)=∑i=1N∣ψi(r)∣2.(19)\rho(\mathbf{r})=\sum_{i=1}^{N}|\psi_i(\mathbf{r})|^2. \tag*{(19)}

It is important to note that the KS orbital ψi\psi_i is not, by itself, a physical wavefunction. It is a mathematical construct introduced solely to yield the same ground-state electron density as the real, interacting system. Additionally, the Hamiltonian H[ρ]\mathcal{H}[\rho] depends on the density ρ\rho, and ρ\rho itself is constructed from the orbitals ψi\psi_i that solve the KS equations, therefore forming a self-consistent problem.

Group theory

We briefly introduce key concepts from group theory, providing the necessary background to understand the motivation behind equivariant designs in Hamiltonian prediction.

Groups. A group GG is a non-empty set equipped with a binary operation ∘:G×G→G\circ: G \times G \to G, satisfying the following axioms:

  • Associativity: For all a,b,c∈Ga, b, c \in G, (a∘b)∘c=a∘(b∘c)(a \circ b) \circ c = a \circ(b \circ c).

  • Identity: There exists an identity element e∈Ge \in G such that for all a∈Ga \in G, e∘a=a∘e=ae \circ a = a \circ e = a.

  • Inverse: For each a∈Ga \in G, there exists an inverse a−1∈Ga^{-1} \in G such that a∘a−1=a−1∘a=ea \circ a^{-1} = a^{-1} \circ a = e.

  • Closure: For all a,b∈Ga, b \in G, the result a∘ba \circ b is also in GG.

We typically simplify notation by omitting ∘\circ, writing abab instead of a∘ba \circ b. Groups can be finite or infinite, discrete or continuous, compact or non-compact. Group theory [43] provides a rigorous mathematical foundation for describing symmetries in physical systems [56], an essential perspective for designing physically informed machine learning models.

Group actions. To make group theory applicable to structures in mathematics and physics, we define how groups act on sets. A group GG is said to act on a set X\mathcal{X} if there exists a function ⋅X:G×X→X\cdot_{\mathcal{X}} : G \times\mathcal{X} \to\mathcal{X}2 such that for all g,h∈Gg, h \in G and x∈Xx \in\mathcal{X}, the following conditions hold: (1) e⋅Xx=xe \cdot_{\mathcal{X}} x = x, where ee is the identity element of GG, and (2) (gh)⋅Xx=g⋅X(h⋅Xx)(gh) \cdot_{\mathcal{X}} x = g \cdot_{\mathcal{X}} (h \cdot_{\mathcal{X}} x). These conditions ensure that the group operation is compatible with its action on the set. In practice, such group actions often correspond to geometric transformations, such as translations, rotations, or reflections, on points or functions defined over Euclidean space.

Equivariance. When working with structured data such as molecular geometries or fields, it is often desirable that the operations we apply preserve the symmetries of the underlying space. A function f:X→Yf : \mathcal{X} \to\mathcal{Y} is said to be equivariant with respect to group actions ⋅X\cdot_{\mathcal{X}} on the input space X\mathcal{X} and ⋅Y\cdot_{\mathcal{Y}} on the output space Y\mathcal{Y}, if it satisfies

f(g⋅Xx)=g⋅Yf(x),∀g∈G,x∈X.(20)f(g \cdot_{\mathcal{X}} x) = g \cdot_{\mathcal{Y}} f(x), \quad\forall g \in G, x \in\mathcal{X}. \tag*{(20)}

This means that applying a group transformation before or after the function yields consistent results. In physical systems, such as those governed by rotational symmetry (e.g., SO(3) in molecules), equivariance ensures that rotated inputs yield correspondingly rotated outputs. This property is critical in designing models that generalize well across symmetrically equivalent configurations.

Group representations. Group actions on vector spaces are formalized through the notion of representations. A representation of a group GG on a vector space VV is a homomorphism ρ:G→GL(V)\rho: G \to\mathrm{GL}(V), where GL(V)\mathrm{GL}(V) denotes the group of invertible linear transformations on VV. This mapping associates each group element with a linear operator that describes how the group acts on the space. The vector space VV is referred to as the representation space, and its dimension is the representation’s size.

In finite-dimensional real spaces V=RdV = \mathbb{R}^{d}, these representations are often expressed as invertible matrices D(g)∈Rd×dD(g) \in\mathbb{R}^{d \times d}. For instance, the group SO(3) of 3D rotations is represented by orthogonal matrices g∈SO(3)g \in\mathrm{SO}(3) and its 3D rotation matrix R∈R3×3\mathbf{R} \in\mathbb{R}^{3 \times3} acting on vectors x∈R3x \in\mathbb{R}^{3} via matrix multiplication D(g)x=RxD(g)x = \mathbf{R}x.

Two representations D(g)D(g) and D′(g)D'(g) are said to be equivalent if they are related by a change of basis:

D′(g)=Q−1D(g)Q,(21)D'(g) = Q^{-1}D(g)Q, \tag*{(21)}

for some invertible matrix QQ. Such equivalence indicates that the two representations describe the same group action under different coordinate systems.

Irreducible representations

Irreducible representations (Irreps). A representation ρ:G→GL(V)\rho: G \to\mathrm{GL}(V) of a group GG on a vector space VV is called irreducible if it does not contain any nontrivial invariant subspace. More formally, a subspace W⊆VW \subseteq V is said to be invariant under the representation ρ\rho if for all group elements g∈Gg \in G and all vectors w∈Ww \in W, the action satisfies:

ρ(g)w∈W.(22)\rho(g)w \in W. \tag*{(22)}

Then, the representation ρ\rho is irreducible if the only invariant subspaces it admits are the trivial subspace {0}\{0\} and the entire representation space VV.

Irreducible representations play a fundamental role because any finite-dimensional unitary representation of a compact group can be uniquely decomposed into a direct sum of irreducible representations, up to isomorphism [57]. This decomposition is foundational in analyzing the symmetry properties and constructing equivariant neural network architectures.

For the rotation group SO(3)\mathrm{SO}(3), the irreps are completely characterized by non-negative integers ℓ∈N0\ell\in\mathbb{N}_0. Each irreducible representation D(ℓ):SO(3)→C(2ℓ+1)×(2ℓ+1)D^{(\ell)}: \mathrm{SO}(3) \to\mathbb{C}^{(2\ell+1)\times(2\ell+1)} has dimension 2ℓ+12\ell+1 and is explicitly realized by the action on spherical harmonics Ymℓ(θ,ϕ)Y^\ell_m(\theta,\phi). For a function f:S2→Cf : S^2 \to\mathbb{C} can be expanded in the basis of spherical harmonics as:

f(θ,ϕ)=∑ℓ=0∞∑m=−ℓℓfℓmYmℓ(θ,ϕ),(23)f(\theta,\phi) = \sum_{\ell=0}^{\infty} \sum_{m=-\ell}^{\ell} f_{\ell m}Y^\ell_m(\theta,\phi), \tag*{(23)}

where fℓm∈Cf_{\ell m} \in\mathbb{C} is the complex coefficients of the spherical harmonics. The action of a rotation R∈SO(3)\mathbf{R} \in\mathrm{SO}(3) on ff is defined as:

(R⋅f)(θ,ϕ)=f(R−1⋅(θ,ϕ))=∑ℓ=0∞∑m=−ℓℓ∑m′=−ℓℓDmm′(ℓ)(R)fℓm′Ymℓ(θ,ϕ),(24)(\mathbf{R}\cdot f)(\theta,\phi) = f(\mathbf{R}^{-1}\cdot(\theta,\phi)) = \sum_{\ell=0}^{\infty}\sum_{m=-\ell}^{\ell}\sum_{m'=-\ell}^{\ell}D^{(\ell)}_{mm'}(\mathbf{R})f_{\ell m'}Y^\ell_m(\theta,\phi), \tag*{(24)}

where D(ℓ)(R)D^{(\ell)}(\mathbf{R}) is the Wigner D-matrix corresponding to the irreducible representation labeled by ℓ\ell, acting linearly on the vector of expansion coefficients f(ℓ)=(f−ℓ,f−ℓ+1,…,fℓ)∈C(2ℓ+1)\mathbf{f}^{(\ell)} = (f_{-\ell}, f_{-\ell+1},\ldots,f_{\ell}) \in\mathbb{C}^{(2\ell+1)}. Explicitly, under rotation:

f(ℓ)→RD(ℓ)(R)f(ℓ).(25)\mathbf{f}^{(\ell)} \xrightarrow{\mathbf{R}} D^{(\ell)}(\mathbf{R})\mathbf{f}^{(\ell)}. \tag*{(25)}

Thus, irreps serve as the fundamental building blocks in constructing functions and features that transform equivariantly under the action of SO(3)\mathrm{SO}(3).

Clebsch–Gordan tensor product. Given two irreps D(ℓ1)D^{(\ell_1)}, D(ℓ2)D^{(\ell_2)} of SO(3)\mathrm{SO}(3), their tensor product D(ℓ1)⊗D(ℓ2)D^{(\ell_1)} \otimes D^{(\ell_2)} acts on the tensor product space and is generally reducible. It decomposes into a direct sum of irreps:

D(ℓ1)⊗CGD(ℓ2)≅⨁ℓ=∣ℓ1−ℓ2∣ℓ1+ℓ2D(ℓ),(26)D^{(\ell_1)} \otimes_{\mathrm{CG}} D^{(\ell_2)} \cong\bigoplus_{\ell=|\ell_1-\ell_2|}^{\ell_1+\ell_2} D^{(\ell)}, \tag*{(26)}

where the decomposition is governed by Clebsch–Gordan (CG) coefficients. CG coefficients enable a basis transformation from the product space to irreps, playing crucial roles in quantum angular momentum coupling and equivariant neural networks.

Explicitly, for vectors u(ℓ1)∈C(2ℓ1+1)\mathbf{u}^{(\ell_1)} \in\mathbb{C}^{(2\ell_1+1)} and v(ℓ2)∈C(2ℓ2+1)\mathbf{v}^{(\ell_2)} \in\mathbb{C}^{(2\ell_2+1)}, their CG tensor product produces an irreducible feature w(ℓ)∈C(2ℓ+1)\mathbf{w}^{(\ell)} \in\mathbb{C}^{(2\ell+1)}:

wm(ℓ)=∑m1,m2C(ℓ1,m1),(ℓ2,m2)(ℓ,m)um1(ℓ1)vm2(ℓ2).(27)w^{(\ell)}_m = \sum_{m_1,m_2} C^{(\ell,m)}_{(\ell_1,m_1),(\ell_2,m_2)}u^{(\ell_1)}_{m_1}v^{(\ell_2)}_{m_2}. \tag*{(27)}

This construction ensures that w(ℓ)\mathbf{w}^{(\ell)} transforms correctly under R∈SO(3)\mathbf{R} \in\mathrm{SO}(3):

(D(ℓ1)(R)u(ℓ1))⊗CG(D(ℓ2)(R)v(ℓ2))=D(ℓ)(R)w(ℓ).(28)\left(D^{(\ell_1)}(\mathbf{R})\mathbf{u}^{(\ell_1)}\right)\otimes_{\mathrm{CG}}\left(D^{(\ell_2)}(\mathbf{R})\mathbf{v}^{(\ell_2)}\right)=D^{(\ell)}(\mathbf{R})\mathbf{w}^{(\ell)}. \tag*{(28)}

Thus, CG tensor products ensure equivariant transformations, fundamental to maintaining consistency and symmetry in equivariant neural architectures.

Tensor field networks (TFN). The TFN [47] is a widely used architecture that achieves SE(3)\mathrm{SE}(3)-equivariance by explicitly encoding features as irreps of SO(3)\mathrm{SO}(3) and using spherical harmonics to process directional information. Each feature vector at a node is decomposed into spherical tensor components V(ℓ)∈C(2ℓ+1)V^{(\ell)} \in\mathbb{C}^{(2\ell+1)}, where ℓ\ell denotes the order of the irreducible representation. The key component of the TFN layer is equivariant convolution and self-interaction. For the equivariant convolution, the filter function is generated by the spherical harmonic functions Ymℓf(r^ij)Y^{\ell_f}_m(\hat{r}_{ij}) are applied to the direction between atoms ii and jj, i.e., r^ij=(ri−rj)/∥ri−rj∥\hat{r}_{ij} = (r_i-r_j)/\lVert r_i-r_j\rVert, and are modulated by a learnable radial function R(∥rij∥)R(\lVert r_{ij}\rVert), implemented as an MLP to produce the filter:

Fc(ℓin,ℓf)(rij)=R(ℓin,ℓf)(∥rij∥)Ymℓf(r^ij).(29)F^{(\ell_{\mathrm{in}},\ell_f)}_c(r_{ij}) = R^{(\ell_{\mathrm{in}},\ell_f)}(\lVert r_{ij}\rVert)Y^{\ell_f}_m(\hat{r}_{ij}). \tag*{(29)}

The equivariant convolution aggregates information from neighboring nodes set N\mathcal{N} using the tensor product between the filters and neighboring features:

V~i(ℓout)=∑j∈N(Fc(ℓin,ℓf)(rij)⊗Vj(ℓin))(ℓout),(30)\widetilde{V}^{(\ell_{\mathrm{out}})}_i = \sum_{j\in\mathcal{N}}\left(F^{(\ell_{\mathrm{in}},\ell_f)}_c(r_{ij})\otimes V^{(\ell_{\mathrm{in}})}_j\right)^{(\ell_{\mathrm{out}})}, \tag*{(30)}

where ℓout∈{∣ℓin−ℓf∣,…,(ℓin+ℓf)}\ell_{\mathrm{out}}\in\{\lvert\ell_{\mathrm{in}}-\ell_f\rvert,\ldots,(\ell_{\mathrm{in}}+\ell_f)\}. This convolution ensures that the result transforms equivariantly under rotation.

The self-interaction step applies a linear transformation over the channel dimension to each irreps independently:

V~icm(ℓ)=∑c′wcc′Vic′m(ℓ),(31)\widetilde{V}^{(\ell)}_{icm}=\sum_{c'}w_{cc'}V^{(\ell)}_{ic'm}, \tag*{(31)}

preserving equivariance due to the linearity and diagonal structure in the irrep indices. By construction, all operations in TFNs are equivariant to SE(3), allowing them to model tensorial and directional quantities while respecting physical symmetries. This makes them especially well-suited for applications in molecular modeling, quantum chemistry, and materials science, where equivariance is crucial for generalization and physical accuracy.

Symmetry and equivariance of RH-DFT

Spherical harmonics and atomic orbital basis. To numerically solve the Kohn–Sham equations, electronic wavefunctions are typically expanded in a basis of atomic orbitals. These orbitals are constructed using spherical harmonics Ymℓ(θ,ϕ)Y^\ell_m(\theta,\phi), which form a complete orthonormal basis on the sphere S2\mathbb{S}^2 and transform under the irreducible representations D(ℓ)D^{(\ell)} of the rotation group SO(3). An atomic orbital basis function takes the form [58]:

ϕnℓm(r)=Rnℓ(∥r∥)Ymℓ(θ,ϕ),(32)\phi_{n\ell m}(r)=R_{n\ell}(\lVert r\rVert)Y^\ell_m(\theta,\phi), \tag*{(32)}

where Rnℓ(∥r∥)R_{n\ell}(\lVert r\rVert) is a radial function (e.g., Gaussian [41] or Slater-type [40, 15]), and YmℓY^\ell_m captures the angular component. Here, nn is the principal quantum number, ℓ\ell is the orbital angular momentum quantum number, and m∈{−ℓ,…,ℓ}m\in\{-\ell,\ldots,\ell\} is the magnetic quantum number [44].

These basis functions are central to Kohn–Sham DFT calculations, as molecular orbitals are expressed as linear combinations of atomic orbitals:

ψi(r)=∑α=(nℓm)Cαiϕnℓm(r−rα),(33)\psi_i(r)=\sum_{\alpha=(n\ell m)}C_{\alpha i}\phi_{n\ell m}(r-r_\alpha), \tag*{(33)}

where C∈RB×OC\in\mathbb{R}^{B\times O} is the orbital coefficient matrix, BB is the number of basis functions, and OO is the number of occupied orbitals.

Block Hamiltonian matrix. The Hamiltonian matrix in RH-DFT can be decomposed according to the angular momentum quantum numbers ℓ\ell grouping associated with the atomic orbitals. Specifically, let H(ℓ,ℓ′)∈C(2ℓ+1)×(2ℓ′+1)\mathbf{H}^{(\ell,\ell')}\in\mathbb{C}^{(2\ell+1)\times(2\ell'+1)} denote the submatrix representing the coupling between two angular momentum numbers ℓ\ell and ℓ′\ell'. Under a rotation R∈SO(3)\mathbf{R}\in\mathrm{SO}(3), each such sub-matrix H(ℓ,ℓ′)\mathbf{H}^{(\ell,\ell')} transforms equivariantly according to the SO(3) irreps as follows:

H(ℓ,ℓ′)[D(R)C]=D(ℓ)(R)(H(ℓ,ℓ′)[C])D(ℓ′)(R)−1,(34)\mathbf{H}^{(\ell,\ell')}[\mathcal{D}(\mathbf{R})\mathbf{C}]=\mathcal{D}^{(\ell)}(\mathbf{R})\left(\mathbf{H}^{(\ell,\ell')}[\mathbf{C}]\right)\mathcal{D}^{(\ell')}(\mathbf{R})^{-1}, \tag*{(34)}

where atomic orbitals are grouped by their ℓ\ell and ℓ′\ell', D(R)\mathcal{D}(\mathbf{R}) is block diagonal Wigner-D matrix, and Dℓ\mathcal{D}^{\ell} and Dℓ′\mathcal{D}^{\ell'} are Wigner D-matrices for ℓ\ell and ℓ′\ell', respectively. These submatrices H(ℓ,ℓ′)\mathbf{H}^{(\ell,\ell')}, called orbital-wise Hamiltonian blocks, are the minimal building blocks of the full Hamiltonian that respect SO(3)-equivariance and have (2ℓ+1)×(2ℓ′+1)(2\ell+1)\times(2\ell'+1) elements which corresponds to the combination of the magnetic quantum number mm and m′m'.

Full Hamiltonian matrix. In practice, basis functions are grouped not only by their angular momentum, but also by the atom they are centered on. For atom ii, we denote its angular momentum support as Li={ℓ1,ℓ2,…}L_i = \{\ell_1,\ell_2,\ldots\}, where each ℓk\ell_k corresponds to its atomic shell (e.g., ss, pp, dd) represented in the basis set.

From this atomic partitioning, the Hamiltonian can be reorganized into block form where each submatrix Hij(ℓ,ℓ′)\mathbf{H}_{ij}^{(\ell,\ell')} corresponds to the interaction between angular momentum ℓ∈Li\ell\in L_i of atom ii and ℓ′∈Lj\ell' \in L_j of atom jj. The full Hamiltonian H\mathbf{H} is thus a structured matrix composed of K×KK \times K blocks, where K=∑i∣Li∣K = \sum_i |L_i| is the total number of irreps (angular momentum groups) across all atoms, where ∣Li∣|L_i| denotes the cardinality of the set.

To construct the full Hamiltonian matrix, we first form the atom-pair matrix Hij\mathbf{H}_{ij} for every atom-pair (i,j)(i,j). This atom-pair matrix gathers all interactions between the angular momentum orbital groupings on the two atoms:

Hij=[Hij(ℓ0,ℓ0′)Hij(ℓ0,ℓ1′)⋯Hij(ℓ1,ℓ0′)Hij(ℓ1,ℓ1′)⋯⋮⋮⋱],ℓk∈Li,ℓk′∈Lj,(35)\mathbf{H}_{ij} = \begin{bmatrix} \mathbf{H}_{ij}^{(\ell_0,\ell'_0)} & \mathbf{H}_{ij}^{(\ell_0,\ell'_1)} & \cdots\\ \mathbf{H}_{ij}^{(\ell_1,\ell'_0)} & \mathbf{H}_{ij}^{(\ell_1,\ell'_1)} & \cdots\\ \vdots& \vdots& \ddots \end{bmatrix}, \qquad\ell_k \in L_i,\quad\ell'_k \in L_j, \tag*{(35)}

where Hij(ℓ,ℓ′)∈C(2ℓ+1)×(2ℓ′+1)\mathbf{H}_{ij}^{(\ell,\ell')} \in\mathbb{C}^{(2\ell+1)\times(2\ell'+1)} denotes the interaction between angular momentum ℓ∈Li\ell\in L_i of atom ii and ℓ′∈Lj\ell' \in L_j of atom jj.

Next, we place these atom-pair blocks into a global block matrix to obtain the full RH Hamiltonian matrix: The full Hamiltonian matrix H∈Cn×n\mathbf{H} \in\mathbb{C}^{n \times n}, where n=∑ℓ∈L(2ℓ+1)n = \sum_{\ell\in\mathcal{L}} (2\ell+1), is assembled by concatenating the atom-pair blocks:

H=[HiiHji⋯HijHjj⋯⋮⋮⋱],n=∑i∈M∑ℓ∈Li(2ℓ+1),(36)\mathbf{H} = \begin{bmatrix} \mathbf{H}_{ii} & \mathbf{H}_{ji} & \cdots\\ \mathbf{H}_{ij} & \mathbf{H}_{jj} & \cdots\\ \vdots& \vdots& \ddots \end{bmatrix}, \qquad n = \sum_{i \in\mathcal{M}}\sum_{\ell\in L_i}(2\ell+1), \tag*{(36)}

for every atom-pair (i,j)(i,j) in the molecule M\mathcal{M}.

For better intuition, we illustrate a schematic structure of the Hamiltonian matrix in Figure 4a. Here, blocks corresponding to ss, pp, and dd orbitals are arranged according to their angular momentum, highlighting the blockwise symmetry pattern induced by the underlying spherical harmonics basis.

Schematic illustration of the full Hamiltonian matrix and Wigner D-matrix

Figure 4. (a) Schematic illustration of the full Hamiltonian matrix H\mathbf{H} for a water molecule (H2O\mathrm{H_2O}). Color intensity indicates the magnitude of matrix elements, with red representing larger values and blue representing smaller values. (b) Schematic illustration of the full Wigner D-matrix D\mathit{D} corresponding to H\mathbf{H}, where green denotes larger values and purple denotes smaller values. Gray solid and dashed lines separate molecular blocks and orbital blocks, respectively, corresponding to submatrices defined by atomic orbital pairs.

Rotational equivariance of full Hamiltonian. The global action of a rotation R\mathbf{R} on the basis is encoded by the block-diagonal matrix as follows Equation (3):

D(R)=D(ℓ1)(R)⊕⋯⊕D(ℓK)(R)=[D(ℓ1)(R)0⋯0D(ℓ2)(R)⋯⋮⋮⋱],(37)\mathcal{D}(\mathbf{R}) = D^{(\ell_1)}(\mathbf{R}) \oplus\cdots\oplus D^{(\ell_K)}(\mathbf{R}) = \begin{bmatrix} D^{(\ell_1)}(\mathbf{R}) & 0 & \cdots\\ 0 & D^{(\ell_2)}(\mathbf{R}) & \cdots\\ \vdots& \vdots& \ddots \end{bmatrix}, \tag*{(37)}

where each block Dℓ(R)D^\ell(\mathbf{R}) corresponds to the Wigner D-matrix for angular momentum ll. The Hamiltonian matrix as a whole then transforms under rotation as:

H[C]→RH[R⋅C]=R⋅H[C]=D(R)H[C]D(R)−1.(38)\mathbf{H}[\mathbf{C}] \xrightarrow{\mathbf{R}} \mathbf{H}[\mathbf{R}\cdot\mathbf{C}] = \mathbf{R}\cdot\mathbf{H}[\mathbf{C}] = \mathcal{D}(\mathbf{R})\mathbf{H}[\mathbf{C}]\mathcal{D}(\mathbf{R})^{-1}. \tag*{(38)}

This global equivariance condition guarantees that the Hamiltonian transforms consistently with molecular rotations, preserving the physical structure of the system. Leveraging this symmetry is critical for constructing SE(3)-equivariant machine learning models, which not only respect physical laws but also improve model generalization and interpretability in quantum chemistry tasks. For better intuition, we illustrate a schematic structure of the Wigner D-matrix in Figure 4b.

Training and sampling algorithms, and fine-tuning objective

Training and sampling algorithms

We investigate two types of prior distributions for the initial Hamiltonian H0H_0: Gaussian orthogonal ensemble (GOE) and tensor expansion-based (TE) priors. For the GOE prior, we sample each matrix entry independently as Mij∼N(0,σ2)M_{ij} \sim\mathcal{N}(0,\sigma^2), where we set σ2=1.0\sigma^2 = 1.0 for MD17 and σ2=0.1\sigma^2 = 0.1 for QH9.

For TE prior, we sample each irreducible component wl\mathbf{w}^l by drawing its radial norm from LogNormal⁡(1,σ2=0.1)\operatorname{LogNormal}(1,\sigma^2 = 0.1) and applying a uniform SO(3) rotation to construct the full equivariant basis, which is then mapped to the Hamiltonian space via tensor expansion.

These choices provide flexibility in modeling different types of initial distributions, depending on the target dataset and symmetry constraints. Formal definitions and proofs of equivariance for both priors are provided in Section C.1 and Section C.4.

The training and sampling procedures based on the above rotationally invariant priors are summarized in Algorithm 1 and Algorithm 2, respectively.

Algorithm 1 QHFlow training procedure
Require: Dataset of molecular configurations {Mi}\{\mathcal{M}_i\}, target Hamiltonians H1,M\mathbf{H}_{1,\mathcal{M}}, overlap matrix SM\mathbf{S}_{\mathcal{M}}, model fθf_\theta
1: for each training step do
2: Sample minibatch B={Mi}i=1B\mathcal{B} = \{\mathcal{M}_i\}_{i=1}^{B}
3: for each Mi\mathcal{M}_i in B\mathcal{B} do
4: Sample initial Hamiltonian H0∼p0\mathbf{H}_0 \sim p_0 and time t∼U(0,1)t \sim\mathcal{U}(0,1)
5: Compute interpolated Hamiltonian: Ht,M=(1−t)H0+tH1,M\mathbf{H}_{t,\mathcal{M}} = (1-t)\mathbf{H}_0 + t\mathbf{H}_{1,\mathcal{M}}
6: Predict H1,M(θ)=fθ(Ht,M,SM,M,t)\mathbf{H}^{(\theta)}_{1,\mathcal{M}} = f_\theta(\mathbf{H}_{t,\mathcal{M}},\mathbf{S}_{\mathcal{M}},\mathcal{M},t)
7: Compute flow matching loss: Li=∣H1,M(θ)−H1,M∣2\mathcal{L}_i = \left|\mathbf{H}^{(\theta)}_{1,\mathcal{M}}-\mathbf{H}_{1,\mathcal{M}}\right|^2
8: end for
9: Compute L=1B∑i=1BLi\mathcal{L} = \frac{1}{B}\sum_{i=1}^{B}\mathcal{L}_i, update θ←θ−η∇θL\theta\leftarrow\theta-\eta\nabla_\theta\mathcal{L}
10: end for

Table 1.

Algorithm 2 QHFlow sampling procedure
Require: Molecular configuration M\mathcal{M}, initial Hamiltonian H0∼p0\mathbf{H}_0 \sim p_0, model fθf_\theta, time discretization {t0,t1,…,tK}\{t_0,t_1,\ldots,t_K\} where t0=0t_0=0 and tK=1t_K=1
1: Initialize Ht0=H0\mathbf{H}_{t_0}=\mathbf{H}_0
2: for k=0k=0 to K−1K-1 do
3: Predict target Hamiltonian: H1,M(θ)←fθ(Htk,S,M,tk)\mathbf{H}^{(\theta)}_{1,\mathcal{M}} \leftarrow f_\theta(\mathbf{H}_{t_k},\mathbf{S},\mathcal{M},t_k)
4: Compute conditional vector field: vtk,θ←(H1,M(θ)−Htk)/(1−tk)\mathbf{v}_{t_k,\theta} \leftarrow(\mathbf{H}^{(\theta)}_{1,\mathcal{M}}-\mathbf{H}_{t_k})/(1-t_k)
5: Update Hamiltonian: Htk+1←Htk+(tk+1−tk)⋅vtk,θ\mathbf{H}_{t_{k+1}} \leftarrow\mathbf{H}_{t_k}+(t_{k+1}-t_k)\cdot\mathbf{v}_{t_k,\theta}
6: end for
7: Output H^1=HtK\widehat{\mathbf{H}}_1=\mathbf{H}_{t_K}

Table 2.

These algorithms ensure that training aligns the predicted vector field with the true conditional flow, while inference produces a final Hamiltonian via integration through the learned ODE trajectory. This design ensures SE(3)-equivariance and physical consistency throughout the training and prediction processes.

Fine-tuning objective

After pre-training with the flow matching objective, we further fine-tune QHFlow to enhance its spectral accuracy by introducing energy alignment objectives. To implement the energy alignment objective, we adopt the weighted alignment loss (WALoss) from WANet [25].

Property of the RH-equation. The relationship between the Hamiltonian matrix H, the coefficient matrix C, and the orbital energy matrix ϵ\epsilon is governed by the Roothaan–Hall equation:

HC=SCϵ,(39)HC = SC\epsilon, \tag*{(39)}

where S is overlap matrix. Using orthonormality condition CTSC=IC^{\mathsf{T}}SC = I, this relation simplifies to:

CTHC=ϵ.(40)C^{\mathsf{T}}HC = \epsilon. \tag*{(40)}

This identity forms the foundation for designing spectral alignment objectives.

Weighted alignment loss (WALoss). WALoss encourages the predicted Hamiltonian H^\hat{H} to match the spectral structure of the converged SCF Hamiltonian H⋆H^{\star}. Let C⋆C^{\star} and ϵ⋆\epsilon^{\star} denote the eigenvectors and eigenvalues of H⋆H^{\star}, respectively. We define WALoss as:

LWALoss=∥diag⁡((C⋆)TH^C⋆)−ϵ⋆∥2,(41)\mathcal{L}_{\mathrm{WALoss}} = \left\lVert\operatorname{diag}\left((C^{\star})^{\mathsf{T}}\hat{H}C^{\star}\right) - \epsilon^{\star} \right\rVert_{2}, \tag*{(41)}

where diag⁡(⋅)\operatorname{diag}(\cdot) extracts the diagonal elements and ∥⋅∥2\lVert\cdot\rVert_{2} denotes the L2 norm.

To emphasize physically important states, we place larger weights on eigenvalues up to the Lowest unoccupied molecular orbital (LUMO) i.e., the k+1k+1 lowest-energy orbitals. By projecting H^\hat{H} onto the fixed eigenbasis C⋆C^{\star}, WALoss promotes alignment with the ground-truth spectrum. However, it is important to note that (C⋆)TH^C⋆(C^{\star})^{\mathsf{T}}\hat{H}C^{\star} does not exactly diagonalize H^\hat{H} unless H^=H⋆\hat{H}=H^{\star}. Nevertheless, minimizing this discrepancy helps guide H^\hat{H} toward the correct eigenspectrum, improving orbital energy prediction and SCF behavior.

Overall fine-tuning objective. Our final finetuning objective combines the flow matching loss with WALoss:

Ltotal=LCFM+λWALWA,(42)\mathcal{L}_{\mathrm{total}} = \mathcal{L}_{\mathrm{CFM}} + \lambda_{\mathrm{WA}}\mathcal{L}_{\mathrm{WA}}, \tag*{(42)}

where λWA\lambda_{\mathrm{WA}} is the weighting coefficients controlling the contributions of the energy alignment terms, and we chose λWA=2.0\lambda_{\mathrm{WA}}=2.0 for the finetuning.

Proofs and additional details

Proof of SE(3)-equivariance of GOE

Let M∈Rn×n\mathbf{M} \in\mathbb{R}^{n \times n} be a symmetric matrix drawn from the Gaussian orthogonal ensemble (GOE), characterized by:

E[Mij]=0,Var⁡(Mij)=σ2,with Mij=Mji, and independent entries for i≤j.(43)\mathbb{E}[M_{ij}] = 0,\qquad\operatorname{Var}(M_{ij}) = \sigma^2,\qquad\text{with } M_{ij} = M_{ji},\text{ and independent entries for } i \le j. \tag*{(43)}

Let D=D(R)\mathbf{D} = \mathcal{D}(\mathbf{R}) denote an orthogonal matrix representing a Wigner D-transformation corresponding to a rotation R∈SO(3)\mathbf{R} \in\mathrm{SO}(3), satisfying orthogonality i.e. DDT=I\mathbf{D}\mathbf{D}^{\mathsf{T}} = \mathbf{I}. We define the rotated matrix as:

M′=DMDT,with Mij′=∑k,lDikMklDjl.(44)\mathbf{M}' = \mathbf{D}\mathbf{M}\mathbf{D}^{\mathsf{T}},\qquad\text{with } M'_{ij} = \sum_{k,l} D_{ik}M_{kl}D_{jl}. \tag*{(44)}

We aim to show that the distribution of M′\mathbf{M}' is the same as that of M\mathbf{M}, i.e., that GOE is invariant under conjugation by orthogonal transformations:

ρ(M)=ρ(DMDT).(45)\rho(\mathbf{M}) = \rho(\mathbf{D}\mathbf{M}\mathbf{D}^{\mathsf{T}}). \tag*{(45)}

To establish this, it suffices to verify that the first and second moments of the entries in M′\mathbf{M}' match those of GOE.

Mean. Since E[Mkl]=0\mathbb{E}[M_{kl}] = 0 for all k,lk,l, we have:

E[Mij′]=∑k,lDikDjlE[Mkl]=0.(46)\mathbb{E}[M'_{ij}] = \sum_{k,l} D_{ik}D_{jl}\mathbb{E}[M_{kl}] = 0. \tag*{(46)}

Covariance. We now compute the covariance of the entries Mab′M'_{ab} and Mcd′M'_{cd}:

E[Mab′Mcd′]=E[(∑i,jDaiDbjMij)(∑k,lDckDdlMkl)](47)\mathbb{E}[M'_{ab}M'_{cd}] = \mathbb{E}\left[\left(\sum_{i,j} D_{ai}D_{bj}M_{ij}\right)\left(\sum_{k,l} D_{ck}D_{dl}M_{kl}\right)\right] \tag*{(47)}
=∑i,j,k,lDaiDbjDckDdl E[MijMkl].(48)= \sum_{i,j,k,l} D_{ai}D_{bj}D_{ck}D_{dl}\,\mathbb{E}[M_{ij}M_{kl}]. \tag*{(48)}

Using the independence and zero mean of GOE entries, we know:

E[MijMkl]=σ2δikδjl.(49)\mathbb{E}[M_{ij}M_{kl}] = \sigma^2\delta_{ik}\delta_{jl}. \tag*{(49)}

Thus,

E[Mab′Mcd′]=σ2∑i,jDaiDbjDciDdj=σ2(∑iDaiDci)(∑jDbjDdj)=σ2(DDT)ac(DDT)bd(50)\begin{aligned} \mathbb{E}[M'_{ab}M'_{cd}] = \sigma^2\sum_{i,j}D_{ai}D_{bj}D_{ci}D_{dj} \\ &= \sigma^2\left(\sum_i D_{ai}D_{ci}\right)\left(\sum_j D_{bj}D_{dj}\right) \\ &= \sigma^2(\mathbf{D}\mathbf{D}^{\mathsf{T}})_{ac}(\mathbf{D}\mathbf{D}^{\mathsf{T}})_{bd} \tag*{(50)} \end{aligned}
=σ2δacδbd.(51)= \sigma^2\delta_{ac}\delta_{bd}. \tag*{(51)}

This matches the covariance structure of the original GOE matrix. Since both M\mathbf{M} and M′\mathbf{M}' are jointly Gaussian with zero mean and identical covariances, we conclude:

DMDT∼M,i.e., GOE is invariant under orthogonal conjugation.(52)\mathbf{D}\mathbf{M}\mathbf{D}^{\mathsf{T}} \sim\mathbf{M},\qquad\text{i.e., GOE is invariant under orthogonal conjugation.} \tag*{(52)}

This proves that the GOE prior is SO(3)-invariant, even for the high-rank Wigner D-matrices ℓ≥2\ell\ge2.

Proof of the SE(3)-equivariance of tensor expansion operation

Since the w(ℓ)\mathbf{w}^{(\ell)} is the irrep vector, the mm-th entry wm(ℓ)w^{(\ell)}_m transforms under rotation R∈SO(3)\mathbf{R} \in\mathrm{SO}(3) as:

wm(ℓ)→R(R⋅w(ℓ))m=(∑m′Dmm′(ℓ)(R)wm′(ℓ)),(53)w^{(\ell)}_m \xrightarrow{\mathbf{R}} \left(\mathbf{R} \cdot\mathbf{w}^{(\ell)}\right)_m = \left(\sum_{m'}D^{(\ell)}_{mm'}(\mathbf{R})w^{(\ell)}_{m'}\right), \tag*{(53)}

where D(ℓ)(R)∈C(2ℓ1+1)×(2ℓ2+1)D^{(\ell)}(\mathbf{R}) \in\mathbb{C}^{(2\ell_1+1)\times(2\ell_2+1)} is the Wigner D-matrix.

By substituting above Equation (53) in Equation (9), the entry of rotated tensor expansion is

(⊗ˉw(ℓ))(m1,m2)(ℓ1,ℓ2)→R(⊗ˉ[R⋅w(ℓ)])(m1,m2)(ℓ1,ℓ2)=∑mC(ℓ1,m1),(ℓ2,m2)(ℓ,m)[∑m′Dmm′(ℓ)(R)wm′(ℓ)],(54)\left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)^{(\ell_1,\ell_2)}_{(m_1,m_2)} \xrightarrow{\mathbf{R}} \left(\bar{\otimes}\left[\mathbf{R}\cdot\mathbf{w}^{(\ell)}\right]\right)^{(\ell_1,\ell_2)}_{(m_1,m_2)} = \sum_m C^{(\ell,m)}_{(\ell_1,m_1),(\ell_2,m_2)} \left[\sum_{m'}D^{(\ell)}_{mm'}(\mathbf{R})w^{(\ell)}_{m'}\right], \tag*{(54)}

and we can exchange the order of summation:

(⊗ˉw(ℓ))(m1,m2)(ℓ1,ℓ2)→R∑m′(∑mC(ℓ1,m1),(ℓ2,m2)(ℓ,m)Dmm′(ℓ)(R))wm′(ℓ).(55)\left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)^{(\ell_1,\ell_2)}_{(m_1,m_2)} \xrightarrow{\mathbf{R}} \sum_{m'} \left(\sum_m C^{(\ell,m)}_{(\ell_1,m_1),(\ell_2,m_2)}D^{(\ell)}_{mm'}(\mathbf{R})\right)w^{(\ell)}_{m'}. \tag*{(55)}

Now we can use a crucial identity from representation theory:

Theorem 2. The Clebsch–Gordan coefficients provide a basis change between the product representation D(ℓ1)(R)⊗D(ℓ2)(R)D^{(\ell_1)}(\mathbf{R}) \otimes D^{(\ell_2)}(\mathbf{R}) and the irreducible representation D(ℓ)(R)D^{(\ell)}(\mathbf{R}):

∑mC(ℓ1,m1),(ℓ2,m2)(ℓ,m)Dmm′(ℓ)(R)=∑m1′,m2′Dm1m1′(ℓ1)(R)Dm2m2′(ℓ2)(R)C(ℓ1,m1′),(ℓ2,m2′)(ℓ,m′).(56)\sum_m C^{(\ell,m)}_{(\ell_1,m_1),(\ell_2,m_2)}D^{(\ell)}_{mm'}(\mathbf{R}) = \sum_{m'_1,m'_2}D^{(\ell_1)}_{m_1m'_1}(\mathbf{R})D^{(\ell_2)}_{m_2m'_2}(\mathbf{R})C^{(\ell,m')}_{(\ell_1,m'_1),(\ell_2,m'_2)}. \tag*{(56)}

We can substitute the identity, then we have:

(⊗ˉw(ℓ))(m1,m2)(ℓ1,ℓ2)→R∑m1′,m2′Dm1m1′(ℓ1)(R)Dm2m2′(ℓ2)(R)(∑m′C(ℓ1,m1′),(ℓ2,m2′)(ℓ,m′)wm′(ℓ)),(57)\left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)^{(\ell_1,\ell_2)}_{(m_1,m_2)} \xrightarrow{\mathbf{R}} \sum_{m'_1,m'_2}D^{(\ell_1)}_{m_1m'_1}(\mathbf{R})D^{(\ell_2)}_{m_2m'_2}(\mathbf{R}) \left(\sum_{m'}C^{(\ell,m')}_{(\ell_1,m'_1),(\ell_2,m'_2)}w^{(\ell)}_{m'}\right), \tag*{(57)}

and the last sum implies the

∑m′C(ℓ1,m1′),(ℓ2,m2′)(ℓ,m′)wm′(ℓ)=(⊗ˉw(ℓ))(m1′,m2′)(ℓ1,ℓ2)(58)\sum_{m'}C^{(\ell,m')}_{(\ell_1,m'_1),(\ell_2,m'_2)}w^{(\ell)}_{m'} = \left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)^{(\ell_1,\ell_2)}_{(m'_1,m'_2)} \tag*{(58)}

Therefore,

(⊗ˉw(ℓ))(m1,m2)(ℓ1,ℓ2)→R∑m1′,m2′Dm1m1′(ℓ1)(R)Dm2m2′(ℓ2)(R)(⊗ˉw(ℓ))(m1′,m2′)(ℓ1,ℓ2),(59)\left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)^{(\ell_1,\ell_2)}_{(m_1,m_2)} \xrightarrow{\mathbf{R}} \sum_{m'_1,m'_2}D^{(\ell_1)}_{m_1m'_1}(\mathbf{R})D^{(\ell_2)}_{m_2m'_2}(\mathbf{R}) \left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)^{(\ell_1,\ell_2)}_{(m'_1,m'_2)}, \tag*{(59)}

in the matrix form,

⊗ˉw(ℓ)→RD(ℓ1)(R)(⊗ˉw(ℓ))D(ℓ2)(R)−1.(60)\bar{\otimes}\mathbf{w}^{(\ell)} \xrightarrow{\mathbf{R}} D^{(\ell_1)}(\mathbf{R})\left(\bar{\otimes}\mathbf{w}^{(\ell)}\right)D^{(\ell_2)}(\mathbf{R})^{-1}. \tag*{(60)}

Proof of the invariance of the tensor expansion based (TE) prior

To construct an SO(3)-invariant distribution over matrices via tensor expansion, we begin with a rotationally invariant distribution over irreducible features w(ℓ)∈C(2ℓ+1)\mathbf{w}^{(\ell)} \in\mathbb{C}^{(2\ell+1)}. We define this distribution by factorizing it into two independent components:

  • A magnitude r=∥w(ℓ)∥r = \|\mathbf{w}^{(\ell)}\| drawn from a radial distribution, e.g., r∼Normal⁡(1,σ2)r \sim\operatorname{Normal}(1,\sigma^2).

  • A direction sampled uniformly on the sphere S2\mathbb{S}^2, induced by a Haar-uniform rotation R∈SO(3)\mathbf{R} \in\mathrm{SO}(3), applied to a canonical unit-norm feature vector w0(ℓ)\mathbf{w}^{(\ell)}_0, such that w(ℓ)=rD(ℓ)(R)w0(ℓ)\mathbf{w}^{(\ell)} = rD^{(\ell)}(\mathbf{R})\mathbf{w}^{(\ell)}_0.

This construction ensures that w(ℓ)\mathbf{w}^{(\ell)} is distributed isotropically, i.e., p(w(ℓ))=p(D(ℓ)(R)w(ℓ))p(\mathbf{w}^{(\ell)}) = p(D^{(\ell)}(\mathbf{R})\mathbf{w}^{(\ell)}) for any R∈SO(3)\mathbf{R} \in\mathrm{SO}(3). Now, from the tensor expansion defined as:

H(ℓ1,ℓ2)=(⊗‾w(ℓ))(ℓ1,ℓ2),(61)\mathbf{H}^{(\ell_1,\ell_2)} = \left(\overline{\otimes}\mathbf{w}^{(\ell)}\right)^{(\ell_1,\ell_2)}, \tag*{(61)}

we know from the previous subsection that this construction transforms under SO(3)\mathrm{SO}(3) as:

H(ℓ1,ℓ2)→RD(ℓ1)(R)H(ℓ1,ℓ2)D(ℓ2)(R)−1.(62)\mathbf{H}^{(\ell_1,\ell_2)} \xrightarrow{\mathbf{R}} D^{(\ell_1)}(\mathbf{R})\mathbf{H}^{(\ell_1,\ell_2)}D^{(\ell_2)}(\mathbf{R})^{-1}. \tag*{(62)}

To prove invariance, consider the pushforward distribution:

p(H(ℓ1,ℓ2))=p(w(ℓ))=p(D(ℓ)(R)w(ℓ))∀R∈SO(3).(63)p(\mathbf{H}^{(\ell_1,\ell_2)}) = p(\mathbf{w}^{(\ell)}) = p(D^{(\ell)}(\mathbf{R})\mathbf{w}^{(\ell)}) \quad\forall\mathbf{R} \in\mathrm{SO}(3). \tag*{(63)}

Because H(ℓ1,ℓ2)\mathbf{H}^{(\ell_1,\ell_2)} is a deterministic, equivariant function of w(ℓ)\mathbf{w}^{(\ell)}, and p(w(ℓ))p(\mathbf{w}^{(\ell)}) is rotation-invariant, the induced distribution p(H(ℓ1,ℓ2))p(\mathbf{H}^{(\ell_1,\ell_2)}) must also be invariant under conjugation by D(ℓ1)(R)D^{(\ell_1)}(\mathbf{R}) and D(ℓ2)(R)D^{(\ell_2)}(\mathbf{R}). Thus:

p(H(ℓ1,ℓ2))=p(D(ℓ1)(R)H(ℓ1,ℓ2)D(ℓ2)(R)−1).(64)p(\mathbf{H}^{(\ell_1,\ell_2)}) = p(D^{(\ell_1)}(\mathbf{R})\mathbf{H}^{(\ell_1,\ell_2)}D^{(\ell_2)}(\mathbf{R})^{-1}). \tag*{(64)}

This proves that the prior distribution constructed via tensor expansion from rotationally invariant w(ℓ)\mathbf{w}^{(\ell)} yields an SO(3)\mathrm{SO}(3)-equivariant (conjugation-invariant) distribution over matrix-valued outputs.

Proof of the invariance of the multiple tensor expansion prior

We now generalize the single-irrep vector expansion to construct a full Hamiltonian matrix H∈Rn×n\mathbf{H} \in\mathbb{R}^{n \times n} composed of multiple irrep vectors components. Let the atomic orbital basis consist of a set of irrep vectors indexed by L={ℓ1,ℓ2,…,ℓB}L = \{\ell_1, \ell_2, \ldots, \ell_B\}, where each angular momentum ℓi\ell_i corresponds to a subspace of dimension (2ℓi+1)(2\ell_i + 1).

For each irrep vector rank ℓi\ell_i, we define a random irrep vector w(ℓi)∈C(2ℓi+1)\mathbf{w}^{(\ell_i)} \in\mathbb{C}^{(2\ell_i+1)}, sampled independently from a rotationally invariant distribution:

w(ℓi)=riD(ℓi)(Ri)w0(ℓi),ri∼LogNormal⁡(1,σ2),Ri∼Uniform⁡(SO(3)).(65)\mathbf{w}^{(\ell_i)} = r_iD^{(\ell_i)}(\mathbf{R}_i)\mathbf{w}_0^{(\ell_i)}, \qquad r_i \sim\operatorname{LogNormal}(1,\sigma^2), \qquad\mathbf{R}_i \sim\operatorname{Uniform}(\mathrm{SO}(3)). \tag*{(65)}

We then define a factorized prior:

p(w(ℓ1),…,w(ℓB))=∏i=1Bpi(w(ℓi)),(66)p(\mathbf{w}^{(\ell_1)}, \ldots, \mathbf{w}^{(\ell_B)}) = \prod_{i=1}^{B} p_i(\mathbf{w}^{(\ell_i)}), \tag*{(66)}

with each pi(w(ℓi))p_i(\mathbf{w}^{(\ell_i)}) being SO(3)\mathrm{SO}(3)-invariant.

Using the tensor expansion, each pair (ℓi,ℓj)(\ell_i,\ell_j) generates a block of the Hamiltonian matrix via:

H(ℓi,ℓj)=⊗‾ℓi,ℓjw(ℓk),for some ℓk∈{∣ℓi−ℓj∣,…,ℓi+ℓj}.(67)\mathbf{H}^{(\ell_i,\ell_j)} = \overline{\otimes}_{\ell_i,\ell_j}\mathbf{w}^{(\ell_k)}, \qquad\text{for some }\ell_k \in\{|\ell_i-\ell_j|,\ldots,\ell_i+\ell_j\}. \tag*{(67)}

The full Hamiltonian is then assembled as:

H=⨁i,jH(ℓi,ℓj).(68)\mathbf{H} = \bigoplus_{i,j}\mathbf{H}^{(\ell_i,\ell_j)}. \tag*{(68)}

From the single-component proof, we know that each block transforms as:

H(ℓi,ℓj)→RD(ℓi)(R)H(ℓi,ℓj)D(ℓj)(R)−1.(69)\mathbf{H}^{(\ell_i,\ell_j)} \xrightarrow{\mathbf{R}} D^{(\ell_i)}(\mathbf{R})\mathbf{H}^{(\ell_i,\ell_j)}D^{(\ell_j)}(\mathbf{R})^{-1}. \tag*{(69)}

Therefore, under a global rotation R∈SO(3)\mathbf{R} \in\mathrm{SO}(3), the full matrix H\mathbf{H} transforms as:

H→RD(R)HD(R)−1,(70)\mathbf{H} \xrightarrow{\mathbf{R}} \mathcal{D}(\mathbf{R})\mathbf{H}\mathcal{D}(\mathbf{R})^{-1}, \tag*{(70)}

where D(R)\mathcal{D}(\mathbf{R}) is the block-diagonal rotation operator acting on the full basis.

Since each w(ℓi)\mathbf{w}^{(\ell_i)} is sampled independently from an SO(3)\mathrm{SO}(3)-invariant distribution, the joint distribution of all irreducible components p(H)p(\mathbf{H}) remains invariant under this global conjugation:

p(H)=p(D(R)HD(R)−1),∀R∈SO(3).(71)p(\mathbf{H}) = p\left(\mathcal{D}(\mathbf{R})\mathbf{H}\mathcal{D}(\mathbf{R})^{-1}\right), \qquad\forall\mathbf{R} \in\mathrm{SO}(3). \tag*{(71)}

This completes the proof that the full Hamiltonian matrix constructed via multiple tensor expansions, using independently sampled spherical features from invariant priors, defines an SO(3)\mathrm{SO}(3)-invariant distribution over matrices.

Implementation details

Model implementation

We build our model upon the official QHNet [23] and DEQHNet [59] codebases, which implement SE(3)-equivariant GNN for Hamiltonian matrix prediction. QHNet is selected as our backbone for its balance of architectural simplicity and strong predictive performance. Although more recent models such as WANet [25] and SPHNet [26] have demonstrated improvements, their codebases are not publicly available and thus are not considered here. Notably, our method is model-agnostic and could be paired with more expressive backbones if desired.

We extend QHNet by incorporating additional physically meaningful inputs: the current Hamiltonian matrix Ht\mathbf{H}_t, the overlap matrix S\mathbf{S}, the molecular configuration M\mathcal{M}, and the time tt. Unlike the original QHNet, which processes only M\mathcal{M}, our model is designed to handle Ht\mathbf{H}_t, and S\mathbf{S} as well, following symmetry-preserving strategies inspired by DEQHNet and OrbNet-Equi [60].

Project Block. To map the equivariant matrix features H\mathbf{H} and S\mathbf{S} into the SO(3) irrep vectors, we used diagonal reduction in OrbNet [60] based on the Wigner-Eckart theorem [46]. For atom ii, we first extract the atom-wise matrices, Hi:=Hii\mathbf{H}_i := \mathbf{H}_{ii} (see Equation (35)). Each element of Hi\mathbf{H}_i carries two orbital index, (ℓ,m)(\ell,m) and (ℓ′,m′)(\ell',m'). We project these matrices onto rank-ℓo\ell_o irrep vectors hi(ℓo)=[hi(ℓo,−ℓo),…hi(ℓo,ℓo)]∈C(2ℓo+1)\mathbf{h}_i^{(\ell_o)} = [h_i^{(\ell_o,-\ell_o)}, \ldots h_i^{(\ell_o,\ell_o)}] \in\mathbb{C}^{(2\ell_o+1)} by

hi(ℓo,mo)=∑(ℓ,ℓ′)∑(m,m′)Hi(ℓ,m;ℓ′,m′)Qi,(ℓo,mo)(ℓ,m;ℓ′,m′),(72)h_i^{(\ell_o,m_o)} = \sum_{(\ell,\ell')} \sum_{(m,m')} \mathbf{H}_i^{(\ell,m;\ell',m')} Q_{i,(\ell_o,m_o)}^{(\ell,m;\ell',m')}, \tag*{(72)}

where Hi(ℓ,m;ℓ′,m′)\mathbf{H}_i^{(\ell,m;\ell',m')} is an element of submatrix Hi(ℓ,ℓ′)\mathbf{H}_i^{(\ell,\ell')} that corresponds to the mm and m′m' index, and a set of atom-wise projection weights Qi,(ℓo,mo)(ℓ,m;ℓ′,m′)Q_{i,(\ell_o,m_o)}^{(\ell,m;\ell',m')} which plays the role of Clebsch-Gordan-like projection weights. Because the map in Equation (72) is an SO(3) tensor contraction, the resulting feature vectors remain equivariant. The same procedure is applied to overlap matrix S\mathbf{S}, giving two parallel streams of SE(3)-equivariant atomic features that are subsequently fused in the network.

Construction of projection weights. To construct the coefficients atom-wise projection coefficients, we compute three-center integrals involving orbital basis function Φi(ℓ,m)\Phi_i^{(\ell,m)} and auxiliary spherical-type basis functions Φ~i(ℓo,mo)\widetilde{\Phi}_i^{(\ell_o,m_o)}:

Qi,(ℓo,mo)(ℓ,m;ℓ′,m′)=∫(Φi(ℓ,m)(r))∗Φi(ℓ′,m′)(r)Φ~i(ℓo,mo)(r) dr.(73)Q_{i,(\ell_o,m_o)}^{(\ell,m;\ell',m')} = \int\left(\Phi_i^{(\ell,m)}(\mathbf{r})\right)^* \Phi_i^{(\ell',m')}(\mathbf{r}) \widetilde{\Phi}_i^{(\ell_o,m_o)}(\mathbf{r}) \, \mathrm{d}\mathbf{r}. \tag*{(73)}

In practice, the angular parts of these integrals are related with the Clebsch-Gordan coefficients due to their relation to spherical harmonics:

Qi,(ℓo,mo)(ℓ,m;ℓ′,m′)∝∫S2Ymℓ(r^)Ym′ℓ′(r^)(Ymoℓo(r^))∗ dr.(74)Q_{i,(\ell_o,m_o)}^{(\ell,m;\ell',m')} \propto\int_{\mathbb{S}^2} Y_m^\ell(\hat{\mathbf{r}})Y_{m'}^{\ell'}(\hat{\mathbf{r}})\left(Y_{m_o}^{\ell_o}(\hat{\mathbf{r}})\right)^* \, \mathrm{d}\mathbf{r}. \tag*{(74)}

Training objective

Our training objective adopts a residual learning strategy, following prior works such as WANet and SHNet. Rather than directly predicting the converged Hamiltonian, the model learns to approximate the residual between the initial and converged Hamiltonians using a time-dependent vector field within the conditional flow matching framework. We define the residual target as done in prior works:

H1,M:=HM∗−HM(0),(75)\mathbf{H}_{1,\mathcal{M}} := \mathbf{H}_{\mathcal{M}}^* - \mathbf{H}_{\mathcal{M}}^{(0)}, \tag*{(75)}

where HM(0)\mathbf{H}_{\mathcal{M}}^{(0)} is the initial guess of Hamiltonian matrix3, and HM∗\mathbf{H}_{\mathcal{M}}^* is the SCF solution. The final prediction of Hamiltonian is obtained by summing the predicted residual and the initial Hamiltonian guess.

The conditional flow matching loss is defined as:

L=E(H,M)∼A,t∼U(0,1),Ht∼pt[∥vθ,t(Ht,M)−ut(Ht,M∣H1,M)∥22](76)\mathcal{L} = \mathbb{E}_{(\mathbf{H},\mathcal{M})\sim\mathcal{A},t\sim\mathcal{U}(0,1),\mathbf{H}_t\sim p_t}\left[\left\|v_{\theta,t}(\mathbf{H}_t,\mathcal{M})-u_t(\mathbf{H}_t,\mathcal{M}\mid\mathbf{H}_{1,\mathcal{M}})\right\|_2^2\right] \tag*{(76)}
=E(H,M)∼A,t∼U(0,1),Ht∼pt[1(1−t)2∥H1,M(0)−H1,M∥22],(77)= \mathbb{E}_{(\mathbf{H},\mathcal{M})\sim\mathcal{A},t\sim\mathcal{U}(0,1),\mathbf{H}_t\sim p_t}\left[\frac{1}{(1-t)^2}\left\|\mathbf{H}_{1,\mathcal{M}}^{(0)}-\mathbf{H}_{1,\mathcal{M}}\right\|_2^2\right], \tag*{(77)}

where the second line follows from the analytical form of the conditional velocity field utu_t, showing that the model is penalized based on the squared residual error at each time step. This formulation encourages smooth convergence from the initial guess to the target solution. To simplify the objective, we omit the 1/(1−t)21/(1-t)^2 time-scaling for our implementation.

Experimental study settings

Dataset preparation

To demonstrate the effectiveness of flow-matching-based training, we conduct experiments on two molecular datasets: MD17 and QH9. The MD17 represents a relatively simple task compared to the QH9, focusing solely on small systems and their conformational space. The PubChemQH9 is not considered since their dataset and codebase are not publicly released.

MD17. The MD17 [49, 19] dataset consists of quantum chemical simulations for four small organic molecules: water (H2O\mathrm{H}_{2}\mathrm{O}), ethanol (C2H5OH\mathrm{C}_{2}\mathrm{H}_{5}\mathrm{OH}), malondialdehyde (CH2(CHO)2\mathrm{CH}_{2}(\mathrm{CHO})_{2}), and uracil (C4H4N2O2\mathrm{C}_{4}\mathrm{H}_{4}\mathrm{N}_{2}\mathrm{O}_{2}). It provides a comprehensive set of molecular properties, including geometries, total energies, forces, Kohn–Sham Hamiltonian matrices, and overlap matrices. All reference computations were implemented via the ORCA electronic structure package [61] using the PBE exchange–correlation functional [52, 53] and the def2-SVP Gaussian-type orbital (GTO) basis set. We follow the standard data split protocol used in prior work [19, 20, 23] to divide each molecule’s conformational data into training, validation, and test sets. The detailed dataset statistics are summarized in Table 5 and MOs in the table imply molecular orbitals (i.e., s,p,d,f)

Dataset# of structuresTrainValTest# of atoms# of orbitals# of occupied MOs
Water4,9005005003,9003245
Ethanol30,00025,0005004,50097210
Malondialdehyde26,97825,0005001,47899019
Uracil30,00025,0005004,5001213226

Table 5. The statistics of MD17 dataset [19].

QH9. The QH9 dataset [24] is a large-scale quantum chemistry benchmark designed to support the training and evaluation of machine learning models for Hamiltonian matrix prediction across diverse chemical structures. It is based on the QM9 [50, 51] molecular dataset and includes 130,831 Hamiltonian matrices from stable molecular geometries, as well as 2,698 molecular dynamics trajectories. The dataset covers small organic molecules composed of up to nine heavy atoms (C, N, O, and F). All Hamiltonians were computed using the PySCF [62] quantum chemistry package with the B3LYP [54] exchange–correlation functional and the def2-SVP Gaussian-type orbital (GTO) basis set. We provide the detailed dataset statistics in Table 6.

Dataset# of structures# of MoleculesTrainValTest
Stable-id130,831130,831104,66413,08313,084
Stable-ood130,831130,831104,00117,4959,335
Dynamic-300k-geo299,8002,998239,84029,98029,980
Dynamic-300k-mol299,8002,998239,80029,90030,100

Table 6. The statistics of QH9 dataset [24].

QH9 is organized into two main subsets, QH9-stable and QH9-dynamic-300k, and provides four standard evaluation splits: stable-id, stable-ood, dynamic-300k-geo, and dynamic-300k-mol. The id split randomly partitions the QH9-stable subset into training, validation, and test sets, while the ood split is constructed based on molecular size. Specifically, it groups molecules with 3–20 atoms in the training set, molecules with 21–22 atoms in the validation set, and molecules with 23–29 atoms in the test set. This ood setup allows for a rigorous evaluation of out-of-distribution (OOD) generalization in terms of molecular complexity.

The geo and mol splits are based on molecular dynamics (MD) trajectories, where each molecule is associated with 100 geometry snapshots. In the geo split, geometries are randomly assigned within each molecule: 80 for training, 10 for validation, and 10 for testing. Thus, while all molecules are present across the splits, the specific conformations are disjoint, enabling an assessment of geometric generalization. In contrast, the mol split divides the 2,698 molecules themselves into disjoint sets with an 80/10/10 train/validation/test ratio. All 100 geometries of a molecule are assigned to the same subset. This split presents a more challenging task than the geo split, as it requires generalization to entirely unseen molecular identities rather than just new conformations.

Evaluation Metrics

To comprehensively evaluate the performance of Hamiltonian prediction models, we adopt several metrics that measure accuracy, physical fidelity, and downstream impact on quantum chemical properties. Below are detailed descriptions of each metric used in our experiments.

Hamiltonian MAE. This metric measures the mean absolute error (MAE) between the predicted Hamiltonian matrix H^\hat{\mathbf{H}} and the ground-truth matrix H⋆\mathbf{H}^{\star}:

MAE⁡(H)=1n2∑i,j=1n∥H^ij−Hij⋆∥22,(78)\operatorname{MAE}(\mathbf{H}) = \frac{1}{n^2}\sum_{i,j=1}^{n}\left\lVert\hat{H}_{ij}-H^{\star}_{ij}\right\rVert_{2}^{2}, \tag*{(78)}

where nn is the length of the Hamiltonian matrix (H∈Rn×n\mathbf{H} \in\mathbb{R}^{n \times n}), and ∥⋅∥22\lVert\cdot\rVert_{2}^{2} is the Frobenius norm. This metric directly reflects the quality of the predicted Hamiltonian in element-wise terms.

Occupied orbital energy MAE (ϵocc\epsilon_{\mathrm{occ}}). This metric measures the MAE between the predicted and true orbital energies for only the occupied orbitals. Let ϵ^\hat{\epsilon} and ϵ⋆\epsilon^{\star} be predicted and the ground-truth generalized eigenvalues of the Hamiltonian, respectively, and let IoccI_{\mathrm{occ}} be the set of indices of the occupied orbitals:

MAE⁡(ϵocc)=1card⁡(Iocc)∑i∈Iocc∥ϵ^i−ϵi⋆∥22.(79)\operatorname{MAE}(\epsilon_{\mathrm{occ}}) = \frac{1}{\operatorname{card}(I_{\mathrm{occ}})}\sum_{i \in I_{\mathrm{occ}}}\left\lVert\hat{\epsilon}_{i}-\epsilon^{\star}_{i}\right\rVert_{2}^{2}. \tag*{(79)}

This is particularly important for capturing the energy spectrum relevant to ground-state electronic properties. We identify the occupied orbitals by selecting the ⌊N/2⌋\lfloor N/2 \rfloor lowest eigenvalues, where NN is the number of electrons in the system.

Orbital coefficient similarity score (SCS_{\mathrm{C}}). To compare the predicted and ground-truth molecular orbital coefficient matrices C^\hat{\mathbf{C}} and C⋆\mathbf{C}^{\star}, we use a cosine similarity-based score averaged over all columns:

SC(C^,C⋆)=⟨C^,C⋆⟩=∑iCiCi⋆∥C^∥∥C⋆∥,(80)S_{\mathrm{C}}(\hat{\mathbf{C}},\mathbf{C}^{\star}) = \langle\hat{\mathbf{C}},\mathbf{C}^{\star}\rangle= \frac{\sum_i C_i C_i^{\star}}{\lVert\hat{\mathbf{C}}\rVert\lVert\mathbf{C}^{\star}\rVert}, \tag*{(80)}

where CiC_i is the ii-th column vector of the coefficient matrix and ⟨⋅,⋅⟩\langle\cdot,\cdot\rangle denotes the inner product. This metric evaluates how well the predicted orbitals align with the ground truth.

HOMO, LUMO, and energy gap MAE (ϵHOMO\epsilon_{\mathrm{HOMO}}, ϵLUMO\epsilon_{\mathrm{LUMO}}, ϵΔ\epsilon_{\Delta}). These metrics quantify the predictive accuracy of specific frontier orbital energies, which are critical for determining electronic properties such as reactivity and charge transport. The highest occupied molecular orbital (HOMO) and lowest unoccupied molecular orbital (LUMO) energies, along with their difference (the HOMO–LUMO gap), are particularly sensitive to model generalization, especially in challenging settings like QH9, where predictions are evaluated on unseen molecular structures or conformations. These metrics are computed as follows:

ϵHOMO=∣ϵ^HOMO−ϵHOMO⋆∣,(81)\epsilon_{\mathrm{HOMO}} = \left\lvert\hat{\epsilon}_{\mathrm{HOMO}}-\epsilon^{\star}_{\mathrm{HOMO}}\right\rvert, \tag*{(81)}
ϵLUMO=∣ϵ^LUMO−ϵLUMO⋆∣,(82)\epsilon_{\mathrm{LUMO}} = \left\lvert\hat{\epsilon}_{\mathrm{LUMO}}-\epsilon^{\star}_{\mathrm{LUMO}}\right\rvert, \tag*{(82)}
ϵΔ=∣(ϵ^LUMO−ϵ^HOMO)−(ϵLUMO⋆−ϵHOMO⋆)∣.(83)\epsilon_{\Delta} = \left\lvert\left(\hat{\epsilon}_{\mathrm{LUMO}}-\hat{\epsilon}_{\mathrm{HOMO}}\right)-\left(\epsilon^{\star}_{\mathrm{LUMO}}-\epsilon^{\star}_{\mathrm{HOMO}}\right)\right\rvert. \tag*{(83)}

Here, ϵHOMO\epsilon_{\mathrm{HOMO}} corresponds to the ⌊N/2⌋\lfloor N/2 \rfloor-th lowest eigenvalue, and ϵLUMO\epsilon_{\mathrm{LUMO}} to the (⌊N/2⌋+1)(\lfloor N/2 \rfloor+1)-th, where NN is the number of electrons in the system.

SCF Iter Ratio. This metric measures the reduction in the number of SCF iterations required when using a predicted Hamiltonian as the initial guess, relative to a standard reference initialization (e.g., from a minimal basis or atomic superposition guess). It is defined as

SCF Iter Ratio=IterpredIterref,(84)\mathrm{SCF\ Iter\ Ratio} = \frac{\mathrm{Iter}_{\mathrm{pred}}}{\mathrm{Iter}_{\mathrm{ref}}}, \tag*{(84)}

where Iterpred\mathrm{Iter}_{\mathrm{pred}} is the number of SCF iterations with the predicted initialization, and Iterref\mathrm{Iter}_{\mathrm{ref}} is the number of iterations under the reference setup. In our setting, we used the reference value, which is measured from the conventional DFT metric to compare the acceleration of our method.

SCF T Ratio. This represents the reduction in total wall-clock time spent during SCF convergence using the predicted Hamiltonian. It reflects actual runtime savings in quantum chemical simulations:

SCF T Ratio=TSCF-predTSCF-ref,(85)\mathrm{SCF\ T\ Ratio} = \frac{T_{\mathrm{SCF\text{-}pred}}}{T_{\mathrm{SCF\text{-}ref}}}, \tag*{(85)}

where TSCF-predT_{\mathrm{SCF\text{-}pred}} and TSCF-refT_{\mathrm{SCF\text{-}ref}} denote the SCF runtimes under predicted and reference initializations, respectively.

Inf T Ratio. This metric captures the inference overhead of the predictive model itself. It is the fraction of time required to generate the predicted Hamiltonian relative to the baseline SCF time:

Inf T Ratio=TinferenceTSCF-ref,(86)\mathrm{Inf\ T\ Ratio} = \frac{T_{\mathrm{inference}}}{T_{\mathrm{SCF\text{-}ref}}}, \tag*{(86)}

where TinferenceT_{\mathrm{inference}} is the runtime of the Hamiltonian prediction model.

Total T Ratio. This quantifies the net cost of using the predictive model, combining both inference and SCF convergence times. It provides a holistic view of overall computational efficiency:

Total T Ratio=Tinference+TSCF-predTSCF-ref.(87)\mathrm{Total\ T\ Ratio} = \frac{T_{\mathrm{inference}} + T_{\mathrm{SCF\text{-}pred}}}{T_{\mathrm{SCF\text{-}ref}}}. \tag*{(87)}

Note. All energy values are reported in units of Hartree (1Eh=27.211eV1E_h = 27.211\mathrm{eV}), and similarity scores are unitless with values in \[0, 1\], where higher is better. While the SCF Iter Ratio is a deterministic metric reflecting algorithmic convergence behavior, the wall-clock timing ratios (SCF T, Inf T, and Total T) are subject to variability due to system-level factors. In our experiments, all timing evaluations were conducted on A100-80GB GPUs. However, due to resource allocation via SLURM and shared CPU environments, precise time measurements were not always reproducible. As such, reported time ratios should be interpreted as indicative trends rather than absolute benchmarks.

Experimental setup

Environment. Experiments were conducted using a single GPU per model. For the MD17 dataset, we used NVIDIA RTX 3090 and A5000 GPUs, while for the QH9 dataset, experiments were performed on NVIDIA A100 80GB GPUs. Our implementation is based on PyTorch 2.1.2 and PyG 2.3.0, both compiled with CUDA 12.1. Detailed package versions [62, 63, 64] and environment specifications will be released upon publication for full reproducibility.

Training was performed on a SLURM-managed cluster, where slight variability in runtime was observed due to system-wide GPU and CPU resource contention. Random seeds were fixed where possible to ensure training stability; however, minor non-determinism remains due to the inherent variability of distributed computing environments.

Training QHFlow took approximately 2–4 days on MD17 and 7–10 days on QH9, which is slightly longer than QHNet due to the added complexity of incorporating the current Hamiltonian and orbital information as inputs. Finetuning on QH9 required an additional 3–4 days. While the total training time could be further reduced with optimized infrastructure, our experiments were conducted under a SLURM-managed environment with periodic reinitialization every 72 hours. Importantly, QHFlow is a model-agnostic framework; with more scalable architectures, training efficiency can be significantly improved.

Hyperparameters. For fair comparison, we adopted the same hyperparameters used by the baseline model QHNet [23] whenever possible. Our QHFlow shares the majority of its architecture and training settings with QHNet to ensure that performance improvements are attributable to the proposed flow matching design rather than hyperparameter tuning. A summary of the key hyperparameters used across different datasets is provided in Table 7.

HyperparameterDescriptionQH9MD17 (Water)MD17 (Others)
Learning RateInitial learning rate5e-45e-41e-3
Minimum Learning RateMinimum learning rate1e-71e-91e-9
Batch SizeNumber of molecules per batch32105
SchedulerLearning rate schedulerPolynomialPolynomialPolynomial
LR Warmup StepsWarmup steps to linearly increase learning rate1,0001,0001,000
Max StepsMaximum number of training steps260,000200,000200,000
Fine-tuning LRInitial learning rate of fine-tuning stage1e-5--
Fine-tuning Minimum LRMinimum learning rate of fine-tuning stage1e-7--
Finetuning StepsMaximum number of Finetuning steps60,000--
Prior DistributionPrior distribution for flow matchingGOE / TEGOEGOE
Using HtH_t BlockUse time-dependent Hamiltonian HtH_t as inputTrueTrueTrue
Using SS BlockUse overlap matrix SS as inputTrueFalseFalse
Model OrderMaximum degree of spherical harmonics444
Embedding DimensionNode feature embedding dimension128128128
Bottle Hidden SizeHidden size of bottleneck layer323232
Number of GNN LayersNumber of graph neural network layers555
Max RadiusCutoff radius for neighbor search151515
Sphere ChannelsNumber of channels in spherical basis128128128
Edge ChannelsNumber of channels for edge features323232

Table 7. Training hyperparameters of QHFlow used across datasets.

For evaluating DFT acceleration performance, we used the PySCF [62] framework with the B3LYP exchange–correlation functional. The numerical integration grid level was set to 3, and the maximum number of SCF cycles was 50. All other parameters followed the default settings of the PySCF RKS implementation.

Additional experimental results and limitations

Ablation study of the finetuning objective

We conduct additional experiments to evaluate various fine-tuning strategies to improve the Hamiltonian prediction performance of QHFlow after standard flow matching pretraining. In this section, we describe each strategy in detail and provide empirical observations.

For the WALoss implementation, we follow the coefficient settings proposed in WANet [25] (λWA=2.0\lambda_{\mathrm{WA}} = 2.0). During fine-tuning, we train for an additional 60,000 steps starting from the pretrained model with TE prior, using an initial learning rate of 1×10−51 \times10^{-5} and a polynomial learning rate scheduler.

Full Flow Matching with WA Loss training from scratch (WA-Full). In this strategy, we train the model from scratch by jointly optimizing the flow matching objective and WALoss for 260,000 steps, matching the default training steps as done in WANet. However, this approach significantly degraded the Hamiltonian error. We hypothesize that imposing strong spectral constraints too early disrupts the learning of the global Hamiltonian structure, leading to unstable convergence and poor generalization.

WA Loss finetuning (WA-FT). After completing standard flow matching pre-training, we fine-tune the model solely using WALoss, which encourages alignment between the predicted Hamiltonian’s eigenstructure and the ground-truth SCF solutions. This approach improves orbital energy prediction and SCF convergence compared to pure flow matching training, confirming the value of adding spectral supervision during fine-tuning.

Summary. Table 8 summarizes the quantitative results of all fine-tuning strategies. Here, w/o-FT refers to QHFlow trained solely with the flow matching objective using the TE prior. Among the approaches, WA-FT achieves the best balance between Hamiltonian prediction accuracy and practical DFT acceleration, demonstrating the effectiveness of spectral alignment in the fine-tuning stage.

DatasetTypeHH [μEh\mu E_h] ↓\downarrowϵocc\epsilon_{\mathrm{occ}} [μEh\mu E_h] ↓\downarrowScS_c [%] ↑\uparrowϵLUMO\epsilon_{\mathrm{LUMO}} [μEh\mu E_h] ↓\downarrowϵHOMO\epsilon_{\mathrm{HOMO}} [μEh\mu E_h] ↓\downarrowϵΔ\epsilon_{\Delta} [μEh\mu E_h] ↓\downarrow
QH9-stable (id)WA-Full62.69153.8298.96240.07117.26251.81
QH9-stable (id)w/o-FT22.95 ± 0.001119.67 ± 0.21199.51 ± 0.001437.96 ± 7.452179.48 ± 0.098553.87 ± 7.454
QH9-stable (id)WA-FT23.85 ± 0.003101.92 ± 0.27999.56 ± 0.002187.48 ± 6.43492.22 ± 0.234206.15 ± 6.197
QH9-stable (ood)WA-Full57.11110.3498.12416.08113.55387.83
QH9-stable (ood)w/o-FT20.01 ± 0.00184.54 ± 0.00799.04 ± 0.003321.20 ± 1.497130.74 ± 0.043395.83 ± 1.510
QH9-stable (ood)WA-FT20.55 ± 0.00272.64 ± 0.01899.16 ± 0.006171.24 ± 0.27377.96 ± 0.095179.57 ± 0.271
QH9-dynamic (300k-geo)WA-Full75.38108.9698.77231.63114.14219.20
QH9-dynamic (300k-geo)w/o-FT25.94 ± 0.001103.11 ± 0.03199.59 ± 0.001425.18 ± 1.119175.18 ± 0.255547.33 ± 1.168
QH9-dynamic (300k-geo)WA-FT27.12 ± 0.00289.03 ± 0.21399.65 ± 0.001136.63 ± 4.66184.17 ± 0.211154.68 ± 4.449
QH9-dynamic (300k-mol)WA-Full103.47692.1797.021046.21760.851408.36
QH9-dynamic (300k-mol)w/o-FT45.91 ± 0.001442.56 ± 0.17198.65 ± 0.0011344.68 ± 2.338479.71 ± 0.1501605.03 ± 2.286
QH9-dynamic (300k-mol)WA-FT46.60 ± 0.003424.75 ± 0.32498.74 ± 0.001912.10 ± 2.941403.51 ± 1.8611047.88 ± 2.683

Table 8. Ablation experimental results on QH9 dataset Finetuning. Results shown in bold denote the best result in each column, whereas those that are underlined indicate the second best.

Full results of DFT acceleration via SCF initialization

For completeness, we include in Figure 5 the figure with the inset from Figure 3. As shown in Figure 5, the inference time of QHFlow is longer than that of QHNet because QHFlow performs multi-step inference for ODE integration. However, this additional cost is negligible compared to the overall DFT computation pipeline, as reflected in the SCF TT ratio.

DFT acceleration performance on 300 samples from the QH9 dataset

Figure 5. DFT acceleration performance on 300 samples from the QH9 dataset. All metrics are reported as percentages relative to conventional DFT (initialized with minao), which serves as the 100% baseline. The SCF Iter Ratio measures the ratio of SCF iterations required, while Inf T Ratio, SCF T Ratio, and Total T Ratio measure time.

Full results of ablation study

For completeness, we provide the full ablation study results in Table 9, and Table 10, including additional metrics beyond those presented in the main text. While the main manuscript focused primarily on Hamiltonian prediction error (HH), occupied orbital energy error (ϵocc\epsilon_{\mathrm{occ}}), and electronic density accuracy (ScS_{\mathrm{c}}) for clarity, here we also report the LUMO (ϵLUMO\epsilon_{\mathrm{LUMO}}), HOMO (ϵHOMO\epsilon_{\mathrm{HOMO}}), and HOMO-LUMO gap (ϵΔ\epsilon_{\Delta}) energy errors.

DatasetPriorHH [10−6Eh10^{-6}E_h] ↓\downarrowϵocc\epsilon_{\mathrm{occ}} [10−6Eh10^{-6}E_h] ↓\downarrowScS_c [10−210^{-2}] ↑\uparrowϵLUMO\epsilon_{\mathrm{LUMO}} [10−6Eh10^{-6}E_h] ↓\downarrowϵHOMO\epsilon_{\mathrm{HOMO}} [10−6Eh10^{-6}E_h] ↓\downarrowϵΔ\epsilon_{\Delta} [10−6Eh10^{-6}E_h] ↓\downarrow
QH9-stable (id)GOE25.93 ± 0.001154.65 ± 1.09799.39 ± 0.001638.03 ± 7.744220.49 ± 0.192764.46 ± 7.635
QH9-stable (id)TE22.95 ± 0.001119.61 ± 0.21199.51 ± 0.001437.96 ± 7.452179.48 ± 0.098553.87 ± 7.454
QH9-stable (ood)GOE21.93 ± 0.00187.32 ± 0.01298.95 ± 0.002382.09 ± 13.87120.16 ± 0.070432.93 ± 13.84
QH9-stable (ood)TE20.01 ± 0.00184.54 ± 0.00799.04 ± 0.003321.20 ± 1.497130.74 ± 0.043395.83 ± 1.510
QH9-dynamic (300k-geo)GOE29.39 ± 0.001122.14 ± 0.05099.49 ± 0.001618.75 ± 3.089215.41 ± 0.569756.45 ± 3.371
QH9-dynamic (300k-geo)TE25.94 ± 0.001103.11 ± 0.03199.59 ± 0.001425.18 ± 1.119175.18 ± 0.255547.33 ± 1.168
QH9-dynamic (300k-mol)GOE46.78 ± 0.001419.68 ± 0.00198.65 ± 0.0011409.07 ± 3.759478.12 ± 0.2141718.80 ± 3.907
QH9-dynamic (300k-mol)TE45.91 ± 0.001442.56 ± 0.17198.65 ± 0.0011344.68 ± 2.338479.71 ± 0.1501605.03 ± 2.286

Table 9. Full experimental results on QH9 dataset along the initial distribution. Results shown in bold denote the best result in each column.

DatasetModelHH [μEh\mu E_h] ↓\downarrowϵocc\epsilon_{\mathrm{occ}} [μEh\mu E_h] ↓\downarrowScS_c [%] ↑\uparrowϵLUMO\epsilon_{\mathrm{LUMO}} [μEh\mu E_h] ↓\downarrowϵHOMO\epsilon_{\mathrm{HOMO}} [μEh\mu E_h] ↓\downarrowϵΔ\epsilon_{\Delta} [μEh\mu E_h] ↓\downarrow
QH9-stable (id)QHNet*77.72963.4594.8018257.341546.2717822.62
QH9-stable (id)WANet80.00833.6296.86---
QH9-stable (id)SPHNet45.48334.2897.75---
QH9-stable (id)Ours22.95 ± 0.001119.67 ± 0.21199.51 ± 0.001437.96 ± 7.452179.48 ± 0.098553.87 ± 7.454
QH9-stable (id)Ours (WA-FT)23.85 ± 0.003101.92 ± 0.27999.56 ± 0.002187.48 ± 6.43492.22 ± 0.234206.15 ± 6.197
QH9-stable (ood)QHNet*69.69884.9793.0125848.831045.9925370.10
QH9-stable (ood)SPHNet43.33186.4098.16---
QH9-stable (ood)Ours20.01 ± 0.00184.54 ± 0.00799.04 ± 0.003321.20 ± 1.497130.74 ± 0.043395.83 ± 1.510
QH9-stable (ood)Ours (WA-FT)20.55 ± 0.00272.64 ± 0.01899.16 ± 0.006171.24 ± 0.27377.96 ± 0.095179.57 ± 0.271
QH9-dynamic (300k-geo)QHNet*88.361170.5093.6523269.412040.0622407.96
QH9-dynamic (300k-geo)WANet74.74416.5799.68---
QH9-dynamic (300k-geo)SPHNet52.18100.8899.12---
QH9-dynamic (300k-geo)Ours25.94 ± 0.001103.11 ± 0.03199.59 ± 0.001425.18 ± 1.119175.18 ± 0.255547.33 ± 1.168
QH9-dynamic (300k-geo)Ours (WA-FT)27.12 ± 0.00289.03 ± 0.21399.65 ± 0.001136.63 ± 4.66184.17 ± 0.211154.68 ± 4.449
QH9-dynamic (300k-mol)QHNet*121.395554.3686.0253505.094352.7650424.86
QH9-dynamic (300k-mol)SPHNet108.191724.1091.49---
QH9-dynamic (300k-mol)Ours45.91 ± 0.001442.56 ± 0.17198.65 ± 0.0011344.68 ± 2.338479.71 ± 0.1501605.03 ± 2.286
QH9-dynamic (300k-mol)Ours (WA-FT)46.60 ± 0.003424.75 ± 0.32498.74 ± 0.001912.10 ± 2.941403.51 ± 1.8611047.88 ± 2.683

Table 10. Full predictive variance results on QH9 dataset. WA-FT implies the finetune the model with WA loss. Metrics for Ours and Ours (WA-FT) are means±std over five random seeds. Results shown in bold denote the best result in each column, whereas those that are underlined indicate the second best.

Overall, the trends observed in the full table are consistent with those discussed in the main text. In particular, the improvements in Hamiltonian accuracy and density prediction are accompanied by consistent reductions in orbital energy errors (ϵLUMO\epsilon_{\mathrm{LUMO}}, ϵHOMO\epsilon_{\mathrm{HOMO}}) and gap errors (ϵΔ\epsilon_{\Delta}), further demonstrating the broad effectiveness of our proposed methods. These results reinforce the conclusion that flow matching enhance both Hamiltonian structure prediction and downstream electronic properties.

Also, to better visualize the role of the prior distributions, we provide interpolation trajectories from the GOE and TE prior toward target Hamiltonians. Figure 6 shows example interpolations for both settings, highlighting how the initial distribution affects the learned flow dynamics. As seen, the TE prior results in smoother and more structured trajectories compared to the GOE prior, which starts from unstructured noise.

Visualization of Hamiltonian interpolation trajectories from different prior distributions

Figure 6. Visualization of Hamiltonian interpolation trajectories from different prior distributions of H2_2O: (a) tensor expansion-based (TE) prior and (b) Gaussian orthogonal ensemble (GOE) prior. Color intensity indicates the magnitude of Hamiltonian elements across flow time tt.

Ablation studies on model design

In this section, we present additional ablation studies on the architectural design choices of QHFlow, as summarized in Table 11, to clarify their individual roles and contributions to the overall performance.

ModelHH ↓\downarrow [μEh\mu E_h]ϵocc\epsilon_{\mathrm{occ}} ↓\downarrow [μEh\mu E_h]ScS_c ↑\uparrow [%]ϵLUMO\epsilon_{\mathrm{LUMO}} ↓\downarrow [μEh\mu E_h]ϵHOMO\epsilon_{\mathrm{HOMO}} ↓\downarrow [μEh\mu E_h]ϵΔ\epsilon_{\Delta} ↓\downarrow [μEh\mu E_h]
QHNet*77.72963.4594.8018257.341546.2717822.62
QHFlow (Regression)35.85213.4598.891548.64330.771783.99
QHFlow (W/o S embed)25.24159.4199.38734.40239.18851.33
QHFlow (W/ S embed)22.95119.6799.51437.96179.48553.87

Table 11. Ablation study on the model design of QHFLOW. The models are trained on the QH9-Stable (id) split. Bold indicate the best.

Regression. QHFlow (Regression) is a baseline that directly predicts the Hamiltonian correction matrix (ΔH=H⋆−H(0)\Delta H = H^{\star} - H^{(0)}) using the same objective described above, without incorporating any physical priors or structural constraints. This variant isolates the effect of the flow-matching mechanism itself and evaluates how well the model performs under a purely regression-based setting. Although this approach achieves improved Hamiltonian prediction compared to QHNet, its overall performance remains inferior to the flow-matching version.

Overlap matrix S. We further examine the impact of incorporating the overlap matrix embedding, which encodes pairwise correlations among atomic orbitals. Comparing models with and without S embedding shows that leveraging overlap information significantly enhances model stability and accuracy across both Hamiltonian prediction and SCF convergence.

Analysis of error distribution of the predictions

To better understand the properties of QHFlow, we move beyond single–number summaries and visualise the entire error distribution for six key quantities Hamiltonian MAE (HH), occupied–orbital MAE (ϵocc\epsilon_{\mathrm{occ}}), ϵHOMO\epsilon_{\mathrm{HOMO}}, ϵLUMO\epsilon_{\mathrm{LUMO}}, ϵΔ\epsilon_{\Delta}, and ScS_c on all four QH9 splits (id, ood, geo, mol). Figure 7 shows log-scale violin plots for QHNet* (grey), QHFlow (orange), and its WA-finetuned variant (cyan). (only the similarity score is kept on a linear axis.) Each violin displays the full empirical distribution; the thick dashed line marks the median, and the two thinner lines divide the inter-quartile ranges.

Figure 7. Violin plots compare QHNet* (gray), QHFLOW (orange), and its weighted-alignment fine-tune (WA-FT, cyan) on six metrics: Hamiltonian MAE (H), occupied-orbital MAE (ϵocc\epsilon_{\mathrm{occ}}), ϵHOMO\epsilon_{\mathrm{HOMO}}, ϵLUMO\epsilon_{\mathrm{LUMO}}, ϵΔ\epsilon_{\Delta} (Δ\Delta), and coefficient similarity (ScS_c). Results are shown for the four evaluation splits — id, ood, geo, mol. All axes are logarithmic except ScS_c. Thick dashed lines mark the median; thin dashed lines indicate the quartiles. Across every split the QHFLOW violins are both lower and narrower than those of QHNet*, and WA-FT delivers an additional (though smaller) improvement on the energy-related metrics.

Across every split and metric, the QHFlow violins are both lower and narrower. Median Hamiltonian error is reduced by roughly one order of magnitude on id and geo, and by a factor of 3–5 on the tougher ood and mol sets. In addition, the long error tails of QHNet* largely vanish, demonstrating that our flow objective mitigates the occasional catastrophic failure modes that plague point-wise regression models.

Figure 8 plots log HH against log ϵocc\epsilon_{\mathrm{occ}} for every test geometry. QHFlow occupies the bottom-left corner of each panel, while QHNet* points fan out towards larger joint errors, especially in ood and mol, where chemical diversity is highest. These results show the QHFlow superior performance on both the geometric and unseen molecules.

Scatter plots of log H versus log $\epsilon_{\mathrm{occ}}$ for each QH9 split

Figure 8. Scatter plots of log H\mathbf{H} versus log ϵocc\epsilon_{\mathrm{occ}} for each QH9 split. Points for QHNet* (gray) extend to the upper right, revealing frequent large joint errors. QHFlow (orange) and WA-FT (cyan) cluster tightly in the lower-left region, indicating that the flow-matching model achieves simultaneously low Hamiltonian and occupied-orbital errors, even on the challenging ood and mol splits.

Finally, Figure 9 compares Hamiltonian error versus atom count. QHFlow remains flat up to the largest molecules in QH9 (29atoms). This suggests that modeling a distribution over Hamiltonians confers a form of size transferability.

Figure 9. Mean log Hamiltonian error (markers) and one-standard-deviation bands (vertical bars) versus atom count for the four QH9 splits. QHNet* (gray) errors rise with molecular size in ood, whereas QHFlow (orange) and WA-FT (cyan) remain nearly flat up to 29 atoms. This suggests that modelling the full Hamiltonian distribution with symmetry-aware priors confers robust transferability to larger, more complex molecules.

References

  1. [1]Pierre Hohenberg and Walter Kohn. Inhomogeneous electron gas. Physical review, 136(3B): B864, 1964. 1, 3, 15
  2. [2]Robert G Parr. Density functional theory of atoms and molecules. In Horizons of Quantum Chemistry: Proceedings of the Third International Congress of Quantum Chemistry Held at Kyoto, Japan, October 29-November 3, 1979, pages 5–15. Springer, 1989. 1
  3. [3]Nathan Argaman and Guy Makov. Density functional theory: An introduction. American Journal of Physics, 68(1):69–79, 2000. 1DOI
  4. [4]Axel D Becke. Perspective: Fifty years of density-functional theory in chemical physics. The Journal of chemical physics, 140(18), 2014. 1DOI
  5. [5]Kieron Burke. Perspective on density functional theory. The Journal of chemical physics, 136 (15), 2012. 1DOI
  6. [6]Narbe Mardirossian and Martin Head-Gordon. Thirty years of density functional theory in computational chemistry: an overview and extensive assessment of 200 density functionals. Molecular physics, 115(19-23):2315–2372, 2017. 1DOI
  7. [7]Jörg Neugebauer and Tilmann Hickel. Density functional theory in materials science. Wiley Interdisciplinary Reviews: Computational Molecular Science, 3(5):438–448, 2013. 1pubmed.ncbi.nlm.nih.gov/24563665
  8. [8]Andrew M Teale, Trygve Helgaker, Andreas Savin, Carlo Adamo, Bálint Aradi, Alexei V Arbuznikov, Paul W Ayers, Evert Jan Baerends, Vincenzo Barone, Patrizia Calaminici, et al. Dft exchange: sharing perspectives on the workhorse of quantum chemistry and materials science. Physical chemistry chemical physics, 24(47):28700–28781, 2022. 1DOI
  9. [9]Michael te Vrugt, Hartmut Löwen, and Raphael Wittkowski. Classical dynamical density functional theory: from fundamentals to applications. Advances in Physics, 69(2):121–247, 2020. 1, 3DOI
  10. [10]Richard M Martin. Electronic structure: basic theory and practical methods. Cambridge university press, 2020. 3
  11. [11]Priyanka Makkar and Narendra Nath Ghosh. A review on the use of dft for the prediction of the properties of nanomaterials. RSC advances, 11(45):27897–27924, 2021. 1, 3DOI
  12. [12]Walter Kohn and Lu Jeu Sham. Self-consistent equations including exchange and correlation effects. Physical review, 140(4A):A1133, 1965. 1, 3, 15DOI
  13. [13]JC Slater. A generalized self-consistent field method. Physical Review, 91(3):528, 1953. 1, 8DOI
  14. [14]H Ehrenreich and Morrel H Cohen. Self-consistent field approach to the many-electron problem. Physical Review, 115(4):786, 1959.
  15. [15]Warren J Hehre, Robert F Stewart, and John A Pople. Self-consistent molecular-orbital methods. i. use of gaussian expansions of Slater-type atomic orbitals. The Journal of Chemical Physics, 51(6):2657–2664, 1969. 1, 3, 8, 18DOI
  16. [16]C David Sherrill. An introduction to hartree-fock molecular orbital theory. School of Chemistry and Biochemistry Georgia Institute of Technology, 2000. 1
  17. [17]Eva Pavarini, Erik Koch, Jeroen van den Brink, and George Sawatzky. Quantum materials: Experiments and theory. Modeling and Simulation, 6:420, 2016. 1
  18. [18]Beatriz G del Rio, Brandon Phan, and Rampi Ramprasad. A deep learning framework to emulate density functional theory. npj Computational Materials, 9(1):158, 2023. 1DOI
  19. [19]KT Schütt, M Gastegger, A Tkatchenko, K-R Müller, and RJ Maurer. Unifying machine learning and quantum chemistry with a deep neural network for molecular wavefunctions. Nature Communications, 10(1), 2019. 1, 3, 7, 28
  20. [20]Oliver Unke, Mihail Bogojeski, Michael Gastegger, Mario Geiger, Tess Smidt, and Klaus-Robert Müller. Se (3)-equivariant prediction of molecular wavefunctions and electronic densities. Advances in Neural Information Processing Systems, 34:14434–14447, 2021. 2, 3, 7, 28arxiv.org/abs/2106.02347
  21. [21]He Li, Zun Wang, Nianlong Zou, Meng Ye, Runzhang Xu, Xiaoxun Gong, Wenhui Duan, and Yong Xu. Deep-learning density functional theory hamiltonian for efficient ab initio electronic-structure calculation. Nature Computational Science, 2(6):367–377, 2022.DOI
  22. [22]Xiaoxun Gong, He Li, Nianlong Zou, Runzhang Xu, Wenhui Duan, and Yong Xu. General framework for e (3)-equivariant neural network representation of density functional theory hamiltonian. Nature Communications, 14(1):2848, 2023.DOI
  23. [23]Haiyang Yu, Zhao Xu, Xiaofeng Qian, Xiaoning Qian, and Shuiwang Ji. Efficient and equivariant graph networks for predicting quantum hamiltonian. In International Conference on Machine Learning, pages 40412–40424. PMLR, 2023. 2, 3, 5, 6, 7, 26, 28, 30arxiv.org/abs/2306.04922
  24. [24]Haiyang Yu, Meng Liu, Youzhi Luo, Alex Strasser, Xiaofeng Qian, Xiaoning Qian, and Shuiwang Ji. Qh9: A quantum hamiltonian prediction benchmark for qm9 molecules. Advances in Neural Information Processing Systems, 36:40487–40503, 2023. 7, 28, 29arxiv.org/abs/2306.09549
  25. [25]Yunyang Li, Zaishuo Xia, Lin Huang, Xinran Wei, Samuel Harshe, Han Yang, Erpai Luo, Zun Wang, Jia Zhang, Chang Liu, et al. Enhancing the scalability and applicability of kohn-sham hamiltonians for molecular systems. In The Thirteenth International Conference on Learning Representations, 2025. 2, 3, 5, 8, 10, 21, 26, 32arxiv.org/abs/2502.19227
  26. [26]Erpai Luo, Xinran Wei, Lin Huang, Yunyang Li, Han Yang, Zun Wang, Chang Liu, Zaishuo Xia, Jia Zhang, and Bin Shao. Efficient and scalable density functional theory hamiltonian prediction through adaptive sparsity. arXiv preprint arXiv:2502.01171, 2025. 1, 2, 3, 7, 10, 26arxiv.org/abs/2502.01171
  27. [27]Yuxuan Song, Jingjing Gong, Minkai Xu, Ziyao Cao, Yanyan Lan, Stefano Ermon, Hao Zhou, and Wei-Ying Ma. Equivariant flow matching with hybrid probability transport for 3d molecule generation. Advances in Neural Information Processing Systems, 36:549–568, 2023. 2, 3, 5DOI
  28. [28]Leon Klein, Andreas Krämer, and Frank Noé. Equivariant flow matching. Advances in Neural Information Processing Systems, 36:59886–59910, 2023. 2
  29. [29]Kristof T Schütt, Huziel E Sauceda, P-J Kindermans, Alexandre Tkatchenko, and K-R Müller. Schnet–a deep learning architecture for molecules and materials. The Journal of Chemical Physics, 148(24), 2018. 3
  30. [30]Yaron Lipman, Ricky TQ Chen, Heli Ben-Hamu, Maximilian Nickel, and Matthew Le. Flow matching for generative modeling. In The Eleventh International Conference on Learning Representations, 2023. 3arxiv.org/abs/2210.02747
  31. [31]Alexander Tong, Kilian FATRAS, Nikolay Malkin, Guillaume Huguet, Yanlei Zhang, Jarrid Rector-Brooks, Guy Wolf, and Yoshua Bengio. Improving and generalizing flow-based generative models with minibatch optimal transport. Transactions on Machine Learning Research, 2023. 3arxiv.org/abs/2302.00482
  32. [32]Majdi Hassan, Nikhil Shenoy, Jungyoon Lee, Hannes Stark, Stephan Thaler, and Dominique Beaini. Et-flow: Equivariant flow-matching for molecular conformer generation. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2025. 3arxiv.org/abs/2410.22388
  33. [33]Bowen Jing, Bonnie Berger, and Tommi Jaakkola. Alphafold meets flow matching for generating protein ensembles. arXiv preprint arXiv:2402.04845, 2024. 3arxiv.org/abs/2402.04845
  34. [34]Benjamin Kurt Miller, Ricky TQ Chen, Anuroop Sriram, and Brandon M Wood. Flowmm: Generating materials with riemannian flow matching. In Forty-first International Conference on Machine Learning, 2024. 3arxiv.org/abs/2406.04713
  35. [35]Nayoung Kim, Seongsu Kim, Minsu Kim, Jinkyoo Park, and Sungsoo Ahn. Mofflow: Flow matching for structure prediction of metal-organic frameworks. arXiv preprint arXiv:2410.17270, 2024. 3, 5arxiv.org/abs/2410.17270
  36. [36]Hannes Stark, Bowen Jing, Regina Barzilay, and Tommi Jaakkola. Harmonic self-conditioned flow matching for joint multi-ligand docking and binding site design. In Forty-first International Conference on Machine Learning, 2024. 3arxiv.org/abs/2310.05764
  37. [37]Erwin Schrödinger. An undulatory theory of the mechanics of atoms and molecules. Physical review, 28(6):1049, 1926. 3, 15DOI
  38. [38]C. C. J. Roothaan. New developments in molecular orbital theory. Reviews of Modern Physics, 23(2):69–89, Apr 1951. doi: https://doi.org/10.1103/revmodphys.23.69. 3
  39. [39]G G Hall. The molecular orbital theory of chemical valency viii. a method of calculating ionization potentials. Proceedings of the Royal Society of London, 205(1083):541–552, Mar 1951. doi: https://doi.org/10.1098/rspa.1951.0048. 3
  40. [40]John C Slater. Atomic shielding constants. Physical review, 36(1):57, 1930. 3, 18DOI
  41. [41]Peter MW Gill. Molecular integrals over gaussian basis functions. In Advances in quantum chemistry, volume 25, pages 141–205. Elsevier, 1994. 3, 18DOI
  42. [42]V Milman, MH Lee, and MC Payne. Ground-state properties of cosi 2 determined by a total-energy pseudopotential method. Physical Review B, 49(23):16300, 1994. 3
  43. [43]Yvette Kosmann-Schwarzbach et al. Groups and symmetries. Universitext, Springer, New York, 2010. 4, 16
  44. [44]David J Griffiths and Darrell F Schroeter. Introduction to quantum mechanics. Cambridge university press, 2018. 4, 18
  45. [45]Jason Yim, Andrew Campbell, Emile Mathieu, Andrew YK Foong, Michael Gastegger, Jose Jimenez-Luna, Sarah Lewis, Victor Garcia Satorras, Bastiaan S Veeling, Frank Noe, et al. Improved motif-scaffolding with se (3) flow matching. Transactions on Machine Learning Research, 2024. 5
  46. [46]Eugene P Wigner. On the matrices which reduce the kronecker products of representations of sr groups. In The Collected Works of Eugene Paul Wigner: Part A: The Scientific Papers, pages 608–654. Springer, 1993. 6, 26
  47. [47]Nathaniel Thomas, Tess Smidt, Steven Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor field networks: Rotation-and-translation-equivariant neural networks for 3d point clouds. arXiv preprint arXiv:1802.08219, 2018. 6, 17
  48. [48]Yi-Lun Liao and Tess Smidt. Equiformer: Equivariant graph attention transformer for 3d atomistic graphs. arXiv preprint arXiv:2206.11990, 2022. 6
  49. [49]Stefan Chmiela, Alexandre Tkatchenko, Huziel E Sauceda, Igor Poltavsky, Kristof T Schütt, and Klaus-Robert Müller. Machine learning of accurate energy-conserving molecular force fields. Science advances, 3(5):e1603015, 2017. 7, 28
  50. [50]Lars Ruddigkeit, Ruud Van Deursen, Lorenz C Blum, and Jean-Louis Reymond. Enumeration of 166 billion organic small molecules in the chemical universe database gdb-17. Journal of chemical information and modeling, 52(11):2864–2875, 2012. 7, 28
  51. [51]Raghunathan Ramakrishnan, Mia Hartmann, Enrico Tapavicza, and O Anatole Von Lilienfeld. Electronic spectra from tddft and machine learning in chemical space. The Journal of chemical physics, 143(8), 2015. 7, 28
  52. [52]John P Perdew, Kieron Burke, and Matthias Ernzerhof. Generalized gradient approximation made simple. Physical review letters, 77(18):3865, 1996. 7, 28
  53. [53]Florian Weigend and Reinhart Ahlrichs. Balanced basis sets of split valence, triple zeta valence and quadruple zeta valence quality for h to rn: Design and assessment of accuracy. Physical Chemistry Chemical Physics, 7(18):3297–3305, 2005. 7, 28
  54. [54]Philip J Stephens, Frank J Devlin, Cary F Chabalowski, and Michael J Frisch. Ab initio calculation of vibrational absorption and circular dichroism spectra using density functional force fields. The Journal of physical chemistry, 98(45):11623–11627, 1994. 7, 28
  55. [55]Nikita Kornilov, Petr Mokrov, Alexander Gasnikov, and Aleksandr Korotin. Optimal flow matching: Learning straight trajectories in just one step. Advances in Neural Information Processing Systems, 37:104180–104204, 2024. 10arxiv.org/abs/2403.13117
  56. [56]John F Cornwell. Group theory in physics: An introduction, volume 1. Academic press, 1997. 16
  57. [57]Eugene Wigner. Group theory: and its application to the quantum mechanics of atomic spectra, volume 5. Elsevier, 2012. 17
  58. [58]Wolfram Koch and Max C Holthausen. A chemist’s guide to density functional theory. John Wiley & Sons, 2015. 18
  59. [59]Zun Wang, Chang Liu, Nianlong Zou, He Zhang, Xinran Wei, Lin Huang, Lijun Wu, and Bin Shao. Infusing self-consistency into density functional theory hamiltonian prediction via deep equilibrium models. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. 26arxiv.org/abs/2406.03794
  60. [60]Zhuoran Qiao, Matthew Welborn, Animashree Anandkumar, Frederick R Manby, and Thomas F Miller. Orbnet: Deep learning for quantum chemistry using symmetry-adapted atomic-orbital features. The Journal of chemical physics, 153(12), 2020. 26DOI
  61. [61]Frank Neese, Frank Wennmohs, Ute Becker, and Christoph Riplinger. The orca quantum chemistry program package. The Journal of chemical physics, 152(22), 2020. 28DOI
  62. [62]Qiming Sun, Timothy C Berkelbach, Nick S Blunt, George H Booth, Sheng Guo, Zhendong Li, Junzi Liu, James D McClain, Elvira R Sayfutyarova, Sandeep Sharma, et al. Pyscf: the python-based simulations of chemistry framework. Wiley Interdisciplinary Reviews: Computational Molecular Science, 8(1):e1340, 2018. 28, 30arxiv.org/abs/1701.08223
  63. [63]Mario Geiger and Tess Smidt. e3nn: Euclidean neural networks. arXiv preprint arXiv:2207.09453, 2022.arxiv.org/abs/2207.09453
  64. [64]Ask Hjorth Larsen, Jens Jørgen Mortensen, Jakob Blomqvist, Ivano E Castelli, Rune Christensen, Marcin Dulak, Jesper Friis, Michael N Groves, Björk Hammer, Cory Hargus, et al. The atomic simulation environment—a python library for working with atoms. Journal of Physics: Condensed Matter, 29(27):273002, 2017. 30DOI

Paper details

vlnc:W_r9j4ujuf
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents