Skip to content

Menu

WorksPhysics and Astronomy

Machine learning the two-electron reduced density matrix in molecules and condensed phases

Download PDFView on arXiv

Ask your agent about this work

Your agent reads this work through Valency, with its citations and similar works. Paste this at the start of a chat.

Use the Valency MCP. Work: W_ssg792uh. Fetch it with get_paper_by_id, then find its nearest works with find_similar_papers and tell me what it adds.

Works with any MCP client. Not connected yet? Connect your agent

Abstract

Machine learning is rapidly accelerating materials and chemical discovery, but most current models target energies, forces, or selected molecular properties rather than the underlying many-body electronic structure. Learning electronic-structure proxies, such as reduced density matrices, offers a path to surrogates that can predict a broad range of observables from a single ML model. Short of learning the full wavefunction, the two-electron reduced density matrix (2-RDM) is among the most information-rich, minimally lossy targets, providing direct access to expectation values of arbitrary one- and two-electron operators regardless of the strength of the underlying electron correlation. Here we show that learning the 2-RDM is a feasible goal, yielding exceptionally accurate models. We develop surrogates for correlated wavefunction methods (including configuration interaction and coupled cluster) that yield 2-RDMs with sufficient fidelity to provide direct, training-free access to energies and forces for driving energy-conserving molecular dynamics. To tackle realistic molecular condensed phases, we leverage a many-body expansion of the 2-RDM, using our ML models to supply the expansion terms and enabling ML-powered, coupled-cluster-quality electronic structure and energetics for large solvated systems. As a demonstration, we showcase a coupled-cluster-level electronic-structure calculation of glucose solvated by 500 water molecules achieved at Hartree-Fock cost. This work establishes a general framework for learning correlated electronic structure with high fidelity and deploying it to systems beyond the reach of conventional ab initio methods.

Introduction

Machine learning (ML) is rapidly reshaping atomistic simulation in chemistry and materials science. A major driver has been the emergence of accurate ML interatomic potentials and force fields [1], including increasingly general “foundation” models trained across broad chemical space [2, 3]. At the same time, there is growing interest in ML surrogates that target electronic-structure objects rather than only energies and forces, for example, neural-network wavefunctions [4, 5], electron densities [6], and reduced density matrices (RDMs) [7, 8]. Learning such objects is appealing because they can serve as central quantities from which many observables can be obtained, and can serve as platforms for developing transferable surrogate electronic-structure methods [9].

Predictive electronic-structure calculations remain a dominant computational bottleneck in computational chemistry and materials science, especially when accounting accurately for electron correlation is required. In common implementations, Kohn-Sham density functional theory (DFT) scales roughly as N3N^{3} with system size, while correlated wavefunction methods such as coupled cluster with singles and doubles (CCSD) scale as N6N^{6}. These costs are prohibitive for realistic systems and sampling demands, particularly in condensed phases.

phases. Approximations can reduce cost (for example, CC2 [10] or local-correlation variants such as DLPNO-CCSD [11]) and lower-cost electronic-structure models (e.g., extended tight binding [12] or orbital-free DFT [13]) can extend accessible length and time scales. Even so, further reductions in computational cost, together with improvements in accuracy, are essential to address the complexity of chemical processes and the breadth of chemical space required for discovering new materials and chemistry.

In this work, we pursue surrogate electronic-structure models aimed at predicting the structure of correlated electrons in molecular systems and molecular condensed phases. Our starting point is that predicting a single property (e.g., energy, dipole moment) is inherently limiting: a model trained for one observable does not automatically generalize to predict others. By contrast, the 2-RDM occupies a privileged position in many-electron theory [14]. It encodes one-electron probabilities and electron-pair correlations, yields the total electronic energy by a simple contraction with one- and two-electron integrals (vide infra), and provides direct access to two-electron observables that are otherwise expensive to compute at scale, such as the electronic structure factor which is an important quantity to interpret X-ray diffraction data [15]. Recent work [16] has used variational 2-RDM calculations and Hartree–Fock as lower and upper limits to constrain a ML model for the energy. However, to our knowledge, the 2-RDM has never been the target of ML models. Conceptually, our ML objective is to learn the map connecting the external potential (equivalently, atom types and geometry) to the ground-state 2-RDM, motivated by the general framework in which ground-state observables are functionals of the external potential, since the latter determines the electronic Hamiltonian.

Two obstacles must be overcome to make 2-RDM learning practical. First, in a one-particle basis (typically Gaussian-type orbitals), the 2-RDM is a four-index tensor, and even after exploiting symmetries [17], the number of independent elements grows steeply with system size. Second, physical 2-RDMs must satisfy NN-representability conditions (which are only partially known) that render variational 2-RDM methods technically demanding [18]. These challenges help explain why most ML work applied to electronic structure methods has focused on density functionals, electron densities, and 1-RDMs [7, 8, 19–21].

Short of learning the full electronic wavefunction [4, 5], a machine-learned model for the 2-RDM is among the most general electronic-structure surrogates one can aim for in chemistry and materials science. Unlike the electron density or the 1-RDM, the 2-RDM provides direct access to expectation values of arbitrary one- and two-electron operators. In particular, it yields the electronic energy through simple contractions with one- and two-electron integrals, yielding energies and forces without training separate models for each observable. In this sense, accurate 2-RDM models offer a broadly transferable representation of the electronic structure with minimal information loss.

Our contributions are twofold. (i) We introduce an ML framework that directly targets the 2-RDM associated with correlated electronic-structure methods (e.g., complete active space CI (CASCI) and CCSD), with the goal of producing 2-RDMs that are extremely close to reference targets and sufficiently NN-representable in practice to be used “as is” for evaluating energies, atomic forces, and two-electron operators such as structure factors [15]. (ii) To extend this approach to molecular condensed phases, we propose an RDM-friendly many-body expansion of the 2-RDM and combine it with ML models for the nn-body terms, yielding accurate predictions at substantially reduced computational cost for large systems. As a demonstration of the method, we will present a calculation of a glucose molecule solvated by 500 water molecules at the CCSD level of theory.

Together, these ideas offer a practical path to surrogate models for correlated wavefunction methods that are both predictive (via a learned 2-RDM) and scalable (via the many-body expansion) enabling applications to systems where these methods are prohibitively expensive.

Theory and Background

The electronic Hamiltonian can be expressed as the sum of one- and two-electron operators expressed on an orthogonal one-electron basis set (usually HF orbitals),

H^=∑pshpsa^p†a^s+12∑psqrgpsqra^p†a^q†a^ra^s,(1)\hat{H} = \sum_{ps} h_{ps}\hat{a}_{p}^{\dagger}\hat{a}_{s} + \frac{1}{2}\sum_{psqr}g_{psqr}\hat{a}_{p}^{\dagger}\hat{a}_{q}^{\dagger}\hat{a}_{r}\hat{a}_{s}, \tag*{(1)}

where hps=⟨ψp∣−12∇2+vext∣ψs⟩h_{ps} = \langle\psi_{p} | -\frac{1}{2}\nabla^{2} + v_{\mathrm{ext}} | \psi_{s} \rangle contains the kinetic energy and the electron–nucleus attraction (external potential vext(r)v_{\mathrm{ext}}(\mathbf{r})), and gpsqrg_{psqr} are the electron repulsion integrals. The operators a^p†\hat{a}_{p}^{\dagger} and a^p\hat{a}_{p} denote creation and annihilation operators, respectively.

Given the ground-state NN-electron wavefunction Ψ0\Psi_{0}, the electronic energy is

E=⟨Ψ0∣H^∣Ψ0⟩=∑pshpsγps+12∑psqrgpsqrΓpsqr,(2)E = \langle\Psi_{0} | \hat{H} | \Psi_{0} \rangle= \sum_{ps}h_{ps}\gamma_{ps} + \frac{1}{2}\sum_{psqr}g_{psqr}\Gamma_{psqr}, \tag*{(2)}

where the one- and two-electron reduced density matrices (1- and 2-RDMs) are defined as

γps=⟨Ψ0∣a^p†a^s∣Ψ0⟩,Γpsqr=⟨Ψ0∣a^p†a^q†a^ra^s∣Ψ0⟩.(3)\gamma_{ps} = \langle\Psi_{0} | \hat{a}_{p}^{\dagger}\hat{a}_{s} | \Psi_{0} \rangle,\qquad\Gamma_{psqr} = \langle\Psi_{0} | \hat{a}_{p}^{\dagger}\hat{a}_{q}^{\dagger}\hat{a}_{r}\hat{a}_{s} | \Psi_{0} \rangle. \tag*{(3)}

Although the energy expression above involves both the 1- and 2-RDMs, it can be recast in two equivalent forms:

E=Tr⁡[KΓ],Kpsqr=1N−1hpsδqr+gpsqr,(4)E = \operatorname{Tr}[K\Gamma],\qquad K_{psqr} = \frac{1}{N-1}h_{ps}\delta_{qr} + g_{psqr}, \tag*{(4)}
E=Tr⁡[hγ]+Tr⁡[(γ∧γ)g]+Tr⁡[Δg](5)E = \operatorname{Tr}[h\gamma] + \operatorname{Tr}[(\gamma\wedge\gamma)g] + \operatorname{Tr}[\Delta g] \tag*{(5)}
=EHF[γ]+Tr⁡[Δg].(6)= E_{\mathrm{HF}}[\gamma] + \operatorname{Tr}[\Delta g]. \tag*{(6)}

where EHFE_{\mathrm{HF}} denotes the Hartree–Fock energy functional written in terms of 1-RDMs. In the spin-restricted case, the wedge product is

(γ∧γ)pqrs=12(2γpsγqr−γpqγrs),(7)(\gamma\wedge\gamma)_{pqrs} = \frac{1}{2}(2\gamma_{ps}\gamma_{qr} - \gamma_{pq}\gamma_{rs}), \tag*{(7)}

where Δ\Delta is called cumulant. Thus, the 2-RDM decomposes as Γ=γ∧γ+Δ\Gamma= \gamma\wedge\gamma+ \Delta, and the 1-RDM is obtained from the 2-RDM via the special trace

γps=1N−1∑qrΓpsqrδqr=Tr⁡′[Γ].(8)\gamma_{ps} = \frac{1}{N-1}\sum_{qr}\Gamma_{psqr}\delta_{qr} = \operatorname{Tr}'[\Gamma]. \tag*{(8)}

An important property of γ\gamma and Δ\Delta is that they are size-extensive (see Ref. 22 and Supplementary Materials Section III.A). In contrast, the non-cumulant term γ∧γ\gamma\wedge\gamma is not.

Suppose a zeroth-order approximation to γ\gamma is available, say γHF\gamma^{\mathrm{HF}} (e.g., from Hartree–Fock), such that γ=γHF+δγ\gamma= \gamma^{\mathrm{HF}} + \delta\gamma. The 2-RDM then becomes,

Γ=(γHF+δγ)∧(γHF+δγ)+Δ.(9)\Gamma= \left(\gamma^{\mathrm{HF}} + \delta\gamma\right) \wedge\left(\gamma^{\mathrm{HF}} + \delta\gamma\right) + \Delta. \tag*{(9)}

With these considerations in place, we aim to construct a machine learning model for the 2-RDM. To this end, we use the rigorous maps connecting the RDMs to the external potential vextv_{\mathrm{ext}} (the electron–nucleus attraction),

ΓML:vext⟶Γ(10)\Gamma_{\mathrm{ML}} : v_{\mathrm{ext}} \longrightarrow\Gamma \tag*{(10)}

which we denote by ΓML\Gamma_{\mathrm{ML}} as it will be the target of a ML model. This map follows directly from the map vext→H^v_{\mathrm{ext}} \to\hat{H} by construction. Then, solving the Schrödinger equation gives H^→Ψ0\hat{H} \to\Psi_0, and from Ψ0\Psi_0 one obtains the 2-RDM, Ψ0→Γ\Psi_0 \to\Gamma. Thus Eq. (10) holds, and Γ\Gamma is a functional of the external potential, Γ[vext]\Gamma[v_{\mathrm{ext}}]. This functional need not be one-to-one, as invertibility is not required for the existence of a functional dependence.

We focus on the correlation energy, Ec=E−EHFE_{\mathrm{c}} = E - E_{\mathrm{HF}}, as well as the correlated part of the 2-RDM, Γc=Γ−γHF∧γHF\Gamma^{\mathrm{c}} = \Gamma- \gamma^{\mathrm{HF}} \wedge\gamma^{\mathrm{HF}}. Both EcE_{\mathrm{c}} and Γc\Gamma^{\mathrm{c}} can be obtained through the map in Eq. (10), which may be applied in two complementary ways:

ΓMLc:vext⟶Γc,(11)\Gamma_{\mathrm{ML}}^{\mathrm{c}} : v_{\mathrm{ext}} \longrightarrow\Gamma^{\mathrm{c}}, \tag*{(11)}
ΔML:vext⟶δγandvext⟶Δ.(12)\Delta_{\mathrm{ML}} : v_{\mathrm{ext}} \longrightarrow\delta\gamma\quad\text{and} \quad v_{\mathrm{ext}} \longrightarrow\Delta. \tag*{(12)}

In the following, we present, validate, and showcase the ML models for the 2-RDM for such applications as computing the molecular inelastic structure factor (including vibrational effects) of small molecules. Then, we generalize the surrogate ML models to approach condensed phases via a 2-RDM many-body expansion.

ML models

Similarly to our previous work [7, 20] and related approaches [6] [23, 24], the ML models used to learn the maps in Eqs. (10), (11) and (12) are based on kernel ridge regression (KRR). We consider three ML strategies (ΓML\Gamma_{\mathrm{ML}}, ΓMLc\Gamma_{\mathrm{ML}}^{\mathrm{c}}, and ΔML\Delta_{\mathrm{ML}}) which differ in the quantity learned and in whether a HF calculation is required at prediction time.

For example, for a generic target Γ[v]\Gamma[v] we write

Γ[v]=∑k=1NtrainBkK[vk,v],(13)\Gamma[v] = \sum_{k=1}^{N_{\mathrm{train}}} B_k K[v_k,v], \tag*{(13)}

where vv is the external potential at which the target is evaluated, {vk}\{v_k\} are training external potentials, BkB_k are KRR coefficients, and K[vk,v]K[v_k,v] is the kernel. We use either a linear kernel, KLIN[vk,v]=Tr⁡[vkv]K_{\mathrm{LIN}}[v_k,v] = \operatorname{Tr}[v_kv], or a radial basis function (RBF) kernel,

KRBF[vk,v]=exp⁡(−σ∥vk−v∥2),(14)K_{\mathrm{RBF}[v_k,v]} = \exp\left(-\sigma\lVert v_k-v\rVert^2\right), \tag*{(14)}

where ∥⋅∥\lVert\cdot\rVert denotes the Frobenius norm. The coefficients are obtained by solving the linear system (K+αI)B=G(\mathbf{K}+\alpha\mathbf{I})\mathbf{B}=\mathbf{G}, where G\mathbf{G} contains the training targets and K\mathbf{K} is the kernel matrix.

Once trained, the three ML strategies are deployed as follows (see Figure 1). In ΓML\Gamma_{\mathrm{ML}}, a single model approximating the map in Eq. (10) directly predicting the full 2-RDM at a given geometry. In ΓMLc\Gamma_{\mathrm{ML}}^{\mathrm{c}}, we predict only the correlation part, Γc\Gamma^{\mathrm{c}}, by exploiting the map in Eq. (11), we then perform an HF calculation at each geometry to obtain the reference 1-RDM γHF\gamma^{\mathrm{HF}}. The full 2-RDM is then reconstructed as Γ=γHF∧γHF+Γc\Gamma= \gamma^{\mathrm{HF}} \wedge\gamma^{\mathrm{HF}} + \Gamma^{\mathrm{c}}. In ΔML\Delta_{\mathrm{ML}}, we leverage the maps in Eq. (12), and starting with ΓMLc\Gamma_{\mathrm{ML}}^{\mathrm{c}}, we perform an HF calculation to obtain γHF\gamma^{\mathrm{HF}}, augment it with an ML-predicted correction δγ\delta\gamma, and reconstruct the full 2-RDM from γHF\gamma^{\mathrm{HF}}, δγ\delta\gamma, and the ML-predicted Δ\Delta using Eq. (9).

Image not extracted

Figure 1. Depiction of the ΓML\Gamma_{\mathrm{ML}}, ΓMLc\Gamma_{\mathrm{ML}}^{c} and ΔML\Delta_{\mathrm{ML}} ML models.

Image not extracted

Figure 3. Total and potential energies in kcal/mol along an NVE trajectory for ammonia (top: total energy over 10 ps; bottom: potential energy in the interval 5.0 ps to 5.1 ps), with initial velocities sampled from a Maxwell–Boltzmann distribution at T=300T = 300 K. The CCSD benchmark is shown in black. The 1-RDM-based ML models, γML\gamma_{\mathrm{ML}} are shown in green (Ntrain=216N_{\mathrm{train}} = 216) and orange (Ntrain=1200N_{\mathrm{train}} = 1200). The ΔML\Delta_{\mathrm{ML}} model is shown as a dotted red line and ΓMLc\Gamma^{\mathrm{c}}_{\mathrm{ML}} as a dotted blue line (both trained with Ntrain=216N_{\mathrm{train}} = 216 structures). Although the potential energy is not conserved in the NVE ensemble, this short time window highlights differences in its fluctuations across models. The γML\gamma_{\mathrm{ML}} model with Ntrain=216N_{\mathrm{train}} = 216 exhibits a noticeable drift. All other models closely track the CCSD benchmark.

Although ΓML\Gamma_{\mathrm{ML}}, ΓMLc\Gamma^{\mathrm{c}}_{\mathrm{ML}} and ΔML\Delta_{\mathrm{ML}} are rigorous, the corresponding target quantities differ significantly in their properties, such as size extensivity and their suitability to be approximated by regression. Specifically, Γ\Gamma and Γc\Gamma^{\mathrm{c}} are not size-extensive because they both contain non-cumulant terms, making them challenging learning targets. To illustrate, Table S1 shows the one and two-electron contributions to the total energy for the ΔML\Delta_{\mathrm{ML}} and ΓMLc\Gamma^{\mathrm{c}}_{\mathrm{ML}} models clearly exposing the poorer quality regression for ΓMLc\Gamma^{\mathrm{c}}_{\mathrm{ML}} compared to ΔML\Delta_{\mathrm{ML}}. As argued in the Supplementary Materials Section III A 1, our models are suited for learning size extensive quantities. Thus, ΔML\Delta_{\mathrm{ML}} is expected to yield the best performance, both in terms of training efficiency and model accuracy.

Results for single molecules

Testing ML models' N-representability and extrapolation behavior

We begin by considering in Figure 2(a) (see Figure S1 for KRR carried out with a linear kernel) the potential energy curve (PEC) of a water molecule as a function of one OH bond length, keeping the other bond frozen at the equilibrium length. The ML models were trained on structures consistent with a temperature of T=300T=300K, which, as the histogram shows in the figure, effectively clusters the geometries around the equilibrium geometry.

Image not extracted

Figure 2. PEC of a water molecule (FCI) as a function of the bond length of one of the OH bonds while the other is fixed at the equilibrium length. (a) Three ML models are compared. (b) the effect of purification on the 2-RDM predictions. In all panels, the distributions of training set configurations are indicated by the gray histograms. All models used the RBF kernel. For results generated with the linear kernel, see Figure S1.

The PEC predicted by the ML models is close to the target, which is FCI, in the subspace of geometries overlapping with the training set. However, they deviate when the configurations and the training set do not overlap. Specifically, ΓML\Gamma_{\mathrm{ML}} displays large deviations both for contracted and stretched OH bond lengths. The situation improves with ΓMLc\Gamma^{\mathrm{c}}_{\mathrm{ML}} where the inaccurate extrapolatory behavior mostly affects the stretched geometries. Conversely, the ΔML\Delta_{\mathrm{ML}} method finds a good interpolative and extrapolative behavior.

Clearly, the ΓML\Gamma_{\mathrm{ML}} and ΓMLc\Gamma^{\mathrm{c}}_{\mathrm{ML}} models are not as accurate as the ΔML\Delta_{\mathrm{ML}} model. While we expect ΓML\Gamma_{\mathrm{ML}} to struggle more than the other methods (as it does not rely on an Hartree-Fock result) the differences between ΓMLc\Gamma^{\mathrm{c}}_{\mathrm{ML}} and ΔML\Delta_{\mathrm{ML}} are more telling of the different physical nature of the targets of these two models. As we have discussed, we expect the ML models for γ\gamma and Δ\Delta to enjoy a smooth and size extensive asymptotic behavior along bond-stretch paths. This underlying physical behavior of the target quantities results in successfully extrapolative ML models.

Purification can substantially influence the final results [14, 26]. Since the data in Figure 2(a) were obtained without purification, we now examine Figure 2(b). As detailed in Supplementary Materials Sections III.B and III.C, we purify the 2-RDM by (i) fitting the 1-RDM natural occupations to a Fermi-Dirac form and (ii) using the fitted 1-RDM to correct the 1-RDM-dependent terms in a unitary decomposition of the 2-RDM. This procedure impacts both ΔML\Delta_{\mathrm{ML}} and ΓMLc\Gamma_{\mathrm{ML}}^{c} models. However, we noted that ΔML\Delta_{\mathrm{ML}} without purification typically provides better quality RDMs (see core energy contribution in Table S1) and also benefits from error cancellation between the one- and the two-electron energy contributions in the extrapolative regime. In particular, purification restores the correct asymptotic behavior of the PEC for ΓMLc\Gamma_{\mathrm{ML}}^{c} regardless of the kernel employed. Another aspect emerging from Figure 2 is the general superiority in both interpolative and extrapolative behavior of the RBF kernel compared to the linear kernel.

The results presented so far are specific to water. Figures S4, S3, S2 present PECs for CO2_2, NH3_3 and CH3_3OH showing a similar behavior of the ML models considered. Hereafter, we will employ the ΔML\Delta_{\mathrm{ML}} model unless otherwise stated.

Ab-Initio Molecular Dynamics

We tested the ability of the model RDMs to drive ab-initio molecular dynamics (AIMD) simulations. In Figure 3, we present total energies (kinetic plus potential) for an isolated ammonia molecule where potential energy and forces are derived from the machine learned 2-RDMs using CCSD as our target method (see Supplementary Materials Section III E for details). The stringent test consists in running separate NVE trajectories all starting from the same initial conditions. We then look for (1) the time of decoherence between the ML trajectories and the CCSD benchmark, and (2) energy drifts.

Ideally, the trajectories should be stable and coherent to the CCSD benchmark for over 10k time steps. This is when we expect the rounding errors from the finite machine precision of the CPU algebra to accumulate enough to have an effect. Indeed, we witness coherent trajectories for the ΔML\Delta_{\mathrm{ML}} and ΓMLc\Gamma_{\mathrm{ML}}^{c} models which display a strict energy conservation (no appreciable energy drift is recorded in the 10 ps time window). We note that, as before, a purification step (see Methods section) for each MD step was applied to the ΓMLc\Gamma_{\mathrm{ML}}^{c} RDMs while it was not required for the ΔML\Delta_{\mathrm{ML}} RDMs.

We also test the models previously developed for the 1-RDM (where the map vext→γv_{\mathrm{ext}} \to\gamma is learned and then the map γ→E[γ],∇RE\gamma\to E[\gamma], \nabla_R E is also learned), which indicate with γML\gamma_{\mathrm{ML}} in the figure. Two γML\gamma_{\mathrm{ML}} models are considered, one using Ntrain=216N_{\mathrm{train}} = 216 (for which an energy drift clearly noticeable and assessed to be 12-13 K/(DOF · ps), see Table S2) and one Ntrain=1200N_{\mathrm{train}} = 1200.

We also ran a stress test for the ML models. We trained them using training sets consistent with a temperature of T=300K and then ran AIMD trajectories with initial velocities compatible with T=400K, 500K, and 700K, see supplementary Figures S5, S6, S7. The ΔML\Delta_{\mathrm{ML}} and ΓMLc\Gamma_{\mathrm{ML}}^{c} models once again show strong coherence with the target CCSD trajectory and stability throughout the dynamics. In contrast, the 1-RDM model for Ntrain=216N_{\mathrm{train}} = 216 retains an unacceptable drift of 12 to 13 K/(DOF · ps) across the temperature range which is addressed by increasing the number of training points to 1200. Overall, this is a strong result for the 2-RDM models. That is, even if they are trained at 300K, they deliver stable AIMDs for temperatures well beyond the training temperature requiring a reduced training set size compared to models based on the 1-RDM. Results for FCI water are consistent with this analysis and are available in Figure S8.

Structure Factors

Our results include the evaluation of the electronic structure factor, Se(q)S_e(\mathbf{q}), a quantity important for understanding the structure of matter typically probed by scattering techniques, such as X-ray scattering. With the advent of X-ray free-electron lasers with pulse rate in the femtosecond timescale, it is now possible to observe real-time chemical and photochemical reactions [27]. This, however, is only useful if electronic structure factors can be accurately predicted for ground and excited electronic states of free molecules. As for any structure factor, they probe the presence of particles and particle pairs. The Fourier Transform of pair density, ρ2(r1,r2)\rho_2(\mathbf{r}_1,\mathbf{r}_2), is invoked and the electronic structure factor is defined as Se(q)=∫ρ2(r1,r2)eiq⋅(r2−r1)dr1dr2+NS_e(\mathbf{q}) = \int\rho_2(\mathbf{r}_1,\mathbf{r}_2)e^{i\mathbf{q}\cdot(\mathbf{r}_2-\mathbf{r}_1)}d\mathbf{r}_1d\mathbf{r}_2+N. The pair density is directly available from the 2-RDM as follows ρ2(r1,r2)=∑psqrΓpsqrχp(r1)χs(r1)χq(r2)χr(r2)\rho_2(\mathbf{r}_1,\mathbf{r}_2) = \sum_{psqr} \Gamma_{psqr}\chi_p(\mathbf{r}_1)\chi_s(\mathbf{r}_1)\chi_q(\mathbf{r}_2)\chi_r(\mathbf{r}_2), where the χ\chi functions are AOs. The evaluation of Se(q)S_e(\mathbf{q}) is problematic as obtaining accurate pair densities or the 2-RDMs is extremely costly due to the large number of Slater determinants needed to achieve high accuracy [28]. Once 2-RDMs are available, the algorithms to compute the structure factor scale like O(N4)O(N^4) as described in the Supplementary Materials Section III D.

As molecules are dynamical, structure factors are needed for vibrationally and electronically excited states [25, 28]. Accounting for the dependence of SeS_e upon displacement from the equilibrium geometry is, in practice, a computationally even more demanding task [29]. The ML models derived here, due to their excellent extrapolative behavior can efficiently sample the configuration space spanned by an AIMD simulation. In lieu of an AIMD, we generated a set of structures by generating random linear combinations of all normal modes with a probability of displacement consistent with a set temperature, using the same algorithm as the one used for generating the training set of the ML models, see the Methods section. We then proceeded to evaluate the structure factor of ammonia (see Figure 4) and water (see Figure S11) in the gas phase comparing to reference values (experiment for water [30, 31] and a high-level ab-initio simulation for ammonia [25]). Figure S10 shows that the structure factor widths are not trivially related to the RMSD of the molecular structure displacements away from the equilibrium geometry.

Image not extracted

Figure 4. Effect of molecular vibrations on the electronic structure factor of gas-phase ammonia, Se(q)S_e(q), where q=∣q∣q = |\mathbf{q}|. We evaluate Se(q)S_e(q) using 2-RDMs predicted by the ΔML\Delta_{\mathrm{ML}} model for 600 randomly sampled structures consistent with temperatures of 300 and 700 K. Reference structure factors are taken from Ref. 25. Top row: (a) total Se(q)S_e(q) (elastic + inelastic), (b) inelastic, and (c) elastic contributions. Bottom row: corresponding contributions to Se(q)S_e(q) from the correlated part of the 2-RDM.

Figure 4 shows that vibrational mode displacements cause fluctuations of up to 15% of the intensity of the correlated part of the structure factor. Additionally, the correlated part of the inelastic structure factor shows quantitative changes upon vibrational displacement. Specifically, the peak position acquires a spread of about 0.5 Å−1^{-1}, which is significant, and an equally significant spread in the peak intensity. Using ML models for predicting the 2-RDMS was crucial to produce data in a timely fashion. The computational bottleneck of the structure factor simulations in fact was the computation of the structure factor and not the generation of the correlated 2-RDMs.

An example of strong correlation: double-bond torsion and dissociation

When stretching covalent bonds and applying a torsion to double bonds, the onset of strong correlation is reached as soon as occupied and virtual HF orbital energies become nearly degenerate [32]. The crucial effect of such mixing is that the 1-RDM occupations drastically depart from the aufbau. In Figure 5(a) we report the potential energy curve of ethylene as a function of the C-C interatomic distance, dCCd_{\mathrm{CC}}. The training set used was developed as in Supplementary Materials Section III F with the addition of three geometries at dCC=2.0d_{\mathrm{CC}} = 2.0, 2.5 and 3.9Å.

Image not extracted

Figure 5. Ethylene as an example of strong correlation. (a) PEC of ethylene vs C=C bond length; (b) 1-RDM occupations of HOMO (π\pi) and LUMO (π∗\pi^*) orbitals; (c) energy vs HCCH dihedral angle. In all panels, the distributions of training set configurations are indicated by the gray histograms. Vertical lines in panels (a) and (b) indicate the C=C distance of three geometries added to the training set to include in the model a notion of dissociation.

The results are quite encouraging, showing that the energy curve is well represented by the model whose training set is closely localized at the equilibrium distance (with the exception of the additional three points at dissociation). The 1-RDM occupations seen in Figure 5(b) also show excellent behavior, tracing the reference non-aufbau occupations quite closely.

Figure 5(c) shows that the excellent behavior of the ΔML\Delta_{\mathrm{ML}} model is retained when twisting the ethene’s double bond. The figure also shows that compared with bond stretching (where we found that only a few training structures in the dissociation region were needed) the training-set distribution for bond twisting must span nearly the entire [0,90∘][0,90^\circ] interval.

Additional examples are given in the Supplementary Materials bond stretching in ammonia, methanol, and CO2\mathrm{CO}_2, see Figures S2, S3 and S4.

Computational Cost

The computational cost associated with the ML models is given by the 2-RDM prediction and purification costs. The prediction cost is determined by the complexity of the KRR kernel and by the training set size. In this work, we considered linear and RBF kernels. In both cases, the cost of their evaluation is linear in the number of 2-RDM elements, which grows like O(M4)O(M^4) with MM the size of the GTO basis set employed. As the RBF kernel involves the evaluation of a Gaussian function its computational complexity is slightly higher than the linear kernel. The cost associated with purification (whenever it is required) is concentrated in the diagonalization of the predicted 1-RDM. A computation that scales cubically, O(M3)O(M^3).

In addition there is the unavoidable cost of contracting the RDMs with the GTO matrix elements (including the electron repulsion integrals) to obtain an electronic energy, and also the cost associated with the computation of atomic forces (see Supplementary Materials Section III E). As can be seen from Figure 6 for water and Figure S12 for ammonia, although the formal scaling is O(M4)O(M^4), the computational cost is consistently lower than that of MP2.

Image not extracted

Figure 6. Computational cost (on a log scale) average over 10 AIMD snapshots of ΔML\Delta_{\mathrm{ML}} for FCI 2-RDMs of water compared against the cost of HF, MP2, CCSD, CCSD(T), and FCI. The inset shows RBF and linear kernels compared on a linear scale and split into its most important contributions: energy evaluation, prediction of the RDMs and purification (needed for the linear kernel only). All calculations are performed using a single core on the same CPU (Intel(R) Xeon(R) Platinum 8352Y CPU @ 2.20GHz).

Condensed phases via RDM-based many-body expansions

Having access to computationally cheap and accurate molecular electronic structures is a prerequisite to being able to model condensed phases. Fragmentation methods, for example, rely on ab initio solvers to compute the energy associated with each term in the nn-body expansion of the energy. Typically, these include up to three, and even four-body energy terms [33, 34]. Many-body expansions can target quantities other than the total energy, for example the correlation energy [35, 36]. Recently has emerged an approach to expand the electron density into many body terms [37, 38]. The density is

then employed in embedding workflows (using subsystem DFT). The resulting density-based many-body method, although relatively new, suggests that basing the many-body expansion on the density rather than the energy leads to faster converging energy vs many-body order of expansion.

Borrowing this idea, enabled by the ML models presented, we consider evaluating the electronic structure and the energy of condensed phase systems by a many-body expansion involving the 2-RDM. The working equations involve the 1-RDM and the cumulant. Namely,

γ=γHF+∑IδγI+∑IJδγIJ+⋯=γHF+∑IδγI+δγnadd(15)\gamma= \gamma^{\mathrm{HF}} + \sum_I \delta\gamma^I + \sum_{IJ} \delta\gamma^{IJ} + \cdots = \gamma^{\mathrm{HF}} + \sum_I \delta\gamma^I + \delta\gamma^{nadd} \tag*{(15)}
Δ=∑IΔI+∑IJΔIJ+⋯=∑IΔI+Δnadd(16)\Delta= \sum_I \Delta^I + \sum_{IJ} \Delta^{IJ} + \cdots= \sum_I \Delta^I + \Delta^{nadd} \tag*{(16)}

where we indicated with capital letters indices spanning the fragments.

Using Eq. (9), substituting the many-body expansions above in place of the 1-RDM and cumulant, we can recover a many-body expanded 2-RDM. We first consider an implementation where we truncate the expansions to one-body terms and approximate the non-additive parts of both cumulant and 1-RDM (Δnadd\Delta^{nadd} and δγnadd\delta\gamma^{nadd}) with MP2. We refer to this method as MB-RDM, hereafter. We note that the one-body terms are easily obtained with our ML models exploiting the learned maps vI→{δγI,ΔI}v_I \to\{\delta\gamma^I,\Delta^I\} where vIv_I is the external potential of isolated fragment II.

Like any method based on many-body expansions, MB-RDM is approximate and should be tested before widespread use. In Figure S13 we show MB-RDM total energies against CCSD for the 22 members of the S22 set. [39]. Clearly, MB-RDM outperforms MP2 by one to three orders of magnitude. The RMSE of the total energies predicted by MB-RDM against CCSD is 1.3 kcal/mol, a very good result in comparison to MP2’s RMSE of 33 kcal/mol. We note that by construction, the MB-RDM errors for the interaction energies mirror the RMSE for the total energy.

We have determined that MB-RDM successfully approximates CCSD while requiring only an MP2-like computational cost, owing to the need to evaluate the nonadditive RDMs. We now turn to solvated systems, since accurately modeling the energetics of processes in solution is known to require very large models [40], even when implicit solvation is employed [41].

Solvated systems are exactly the target of MB-RDM which can leverage ML models for the small solvent molecules such that the many-body expansion is completely delegated to ML and carried out with a very low computational cost. We first test MB-RDM on a solvated glucose molecule, (CH2O)6(\mathrm{CH}_{2}\mathrm{O})_{6}, in 15 water molecules which is a minimal model for the first solvation shell [42] small enough that a full-system CCSD calculation is still feasible, and large enough that MB-RDM can be applied achieving substantial computational savings. Panel (a) of Figure 7 shows that the deviation of the total electronic energy per fragment (16 fragments in total) against CCSD is 1.41 kcal/mol for MB-RDM in line with the results from the S22 set. HF and MP2, instead, deliver much worse total energies deviating by 195 and 7 kcal/mol, respectively. A similar result is apparent when comparing the electron densities differences against CCSD for MP2 and MB-RDM, see panel (b) of the figure. Clearly, the reason why MB-RDM yields more accurate energies is rooted in its more accurate electronic structure compared to MP2.

Image not extracted

Figure 7. Glucose solvated by 15 water molecules. Panel (a) error in the total electronic energy of HF, MP2 and MB-RDM compared against CCSD. Panel (b) electron density difference of MB-RDM and MP2 against CCSD.

A key question remains about scaling: can MB-RDM’s wall time be kept low for very large systems? The MB-RDM formulation in Eqs. (15) and (16) requires HF and MP2 solutions for the full system (the former to compute γHF\gamma^{\mathrm{HF}} and the latter to obtain the nonadditive RDMs). While HF carries at most a quartic cost, MP2 is more expensive, even in its most computationally amenable formulations due to a large prefactor compared to HF [43]. Borrowing the Walter Kohn idea that electronic correlation is “near sighted” [44], we posit that the non-additive cumulant is short ranged. Evidence of this is the quantitatively small contribution of many-body dispersion in systems with gap with few exceptions [45, 46]. To approach very large systems, we modify Eqs. (15) and (16) as follows: the solute interacts with an inner shell of solvent molecules (region A) where non-additive (many-body) cumulant and correlated 1-RDMs are included, and an outer solvation shell (region B) where only one-body correlated 1-RDMs and cumulants are considered, see panel (a) of Figure 8.

Image not extracted

Figure 8. MB-RDM for very large systems. (a) The full system is partitioned into regions: G (glucose) and solvent regions A/B. Regions A/B define where many-body (non-additive) contributions to the cumulant and the correlated 1-RDM are treated at the MP2 level or neglected, respectively. (b,c) Computational-cost breakdown for MB-RDM for glucose solvated in water, where A is the first solvation shell (15 water molecules) and B is the remaining solvent: 85 water molecules in (b) and 485 water molecules in (c). For (b) and (c) both MP2 and CCSD costs are estimated. The ratio of the cost of glucose wrt CCSD of the full system in (c) is less than 10−810^{-8}.

Figure 8 unsurprisingly shows that this modified MB-RDM exhibits a more favorable scaling with system size than MP2 for solvated systems; asymptotically, we expect this MB-RDM to approach HF-like scaling. For smaller clusters, such as the 101-fragment system in panel (b), the dominant MB-RDM cost arises from the monomer CCSD calculations, in particular the glucose monomer. By contrast, when region C is enlarged to 485 water molecules (panel (c)), the overall cost is dominated by the HF calculation on the full system. Replacing the monomer calculations (one-body RDMs) with ML surrogates therefore yields a substantial reduction of computational cost. Although we have not yet trained an ML model for glucose, our recent mean-field 1-RDM models already demonstrate feasibility for molecules of comparable size [20]. These results suggest that an ML-accelerated MB expansion of the RDMs for this system in its entirety, including the solute, is a realistic next step and should retain high accuracy while merely requiring mean-field cost.

Conclusions

In this work we introduced a machine-learning framework that directly targets the two-electron reduced density matrix (2-RDM) of correlated electronic-structure methods. The overarching goal is to replace expensive correlated wavefunction calculations with a surrogate ML model that preserves access to many observables, not only energies, but also forces and expectation values of one- and two-electron operators. Building on the functional dependence of ground-state observables on the external potential, we explored three complementary learning strategies that all yield the 2-RDM: direct learning of the full 2-RDM (ΓML\Gamma_{\mathrm{ML}}), learning of the correlated part of the 2-RDM (ΓMLc\Gamma_{\mathrm{ML}}^{c}), and learning of the correlated part of the 1-RDM, δγ\delta\gamma, together with the cumulant, Δ\Delta (ΔML\Delta_{\mathrm{ML}}). Across the molecular tests considered here, the ΔML\Delta_{\mathrm{ML}} strategy consistently provided the most accurate and robust predictions, reflecting the smoother and physically well-behaved asymptotic structure of its learning targets.

The ΔML\Delta_{\mathrm{ML}} models closely reproduce dissociation curves for small molecules (including H2O\mathrm{H}_{2}\mathrm{O}, NH3\mathrm{NH}_{3}, methanol, CO2\mathrm{CO}_{2}, and ethene), matching correlated wavefunction references even in extrapolative regimes where the tested structures lie well outside the configuration space spanned by the training set. Importantly, regimes of strong correlation (such as bond breaking and torsion of ethene’s double bond) are also recovered quantitatively, both in terms of energetics and natural-orbital occupations.

Beyond static tests, we demonstrated that ΔML\Delta_{\mathrm{ML}} can drive stable ab initio molecular dynamics trajectories with excellent energy conservation and long coherence times relative to CCSD benchmarks, even under “stress tests” in which trajectories are initialized at temperatures substantially above those used to generate training data. This robustness is especially encouraging for condensed-phase applications where broad sampling of configuration space is unavoidable. In addition, because the 2-RDM yields direct access to the pair-density, we leveraged the ML models to compute vibrationally broadened electronic structure factors, illustrating how learning an electronic-structure object can enable efficient, high-throughput evaluation of experimentally relevant two-electron observables that would otherwise be prohibitively expensive to obtain with traditional correlated wavefunction methods.

While the ML models presented here are already useful as drop-in surrogates for correlated RDMs, they also provide a route to shifting the computational bottleneck away from expensive solvers of correlated wavefunction methods. We demonstrated this in the context of condensed-phase chemistry via an RDM-based many-body expansion (MB-RDM), in which monomer correlated 1-RDMs and cumulants can be replaced by ML surrogates. For a range of noncovalent complexes and solvated clusters, MB-RDM yields CCSD-quality energetics and electronic structure (as probed by the electron density) when compared against full-system CCSD calculations, while retaining a substantially more favorable computational cost.

Several future directions emerge naturally from the present study. First, it will be important to reduce the formal O(M4)\mathcal{O}(M^{4}) cost associated with storing and contracting the cumulant, for example by employing density fitting/RI for the pair density and/or Cholesky-like (or other low-rank) decompositions of the 2-RDM. While conceptually straightforward, such developments may require adapting the learning targets so that the ML models directly predict the corresponding factorized representations. Second, alternative mean-field reference 1-RDMs may further improve accuracy and broaden applicability. For example, replacing γHF\gamma^{\mathrm{HF}} with a DFT reference, such as γPBE\gamma^{\mathrm{PBE}} obtained with the PBE exchange-correlation functional [47], is a promising direction, particularly for periodic systems. The advances presented here provide a foundation for learning 1- and 2-RDMs and for bringing correlated wavefunction accuracy into regimes that are currently inaccessible to traditional ab initio solvers.

Methods

Training sets are consistent with geometry displacements accessible at T=300KT=300\mathrm{K}, with Ntrain=27N_{\mathrm{train}}=27 for CO2_2 and H2_2O, 216 for NH3_3, and 5184 for CH3_3OH. We refer to Supplementary Materials Section III F. KRR is applied using either a linear or an RBF kernel. For the linear/RBF kernel, a regularization parameter of α=0.0045/0.0\alpha=0.0045/0.0 is used for all models. In the case of CO2_2, the RBF kernel is employed with a length scale of σ=1.0×10−5\sigma=1.0\times10^{-5} while the others use Scikit-learn’s default value of 1M2\frac{1}{M^2} with MM being the size of the AO basis set.

Whenever 2-RDM purification is considered (always required for the ΓMLc\Gamma^{\mathrm{c}}_{\mathrm{ML}} models), we first perform a unitary decomposition as in Ref. 48. We then enforce the correct normalization by replacing the trace of the 2-RDM with N(N−1)N(N-1), and we replace every occurrence of the 1-RDM with a purified 1-RDM. The 1-RDM purification is carried out by fitting the natural occupations to a Fermi-Dirac distribution, which has been shown to yield highly accurate 1-RDMs [7, 49]. Additional details are provided in the Supplementary Materials Sections III.B and III.C.

Ab initio molecular dynamics (AIMD) simulations are performed through an API to the Atomic Simulation Environment (ASE) [50]. We employ the velocity Verlet integrator with a 0.5 fs time step in the microcanonical (NVE) ensemble. Initial momenta are drawn from a Maxwell-Boltzmann distribution at the target temperatures. The 1-RDM–based machine learning models, γML\gamma_{\mathrm{ML}}, use KRR with an RBF kernel. For the map vext→γv_{\mathrm{ext}}\rightarrow\gamma, no regularization is applied (α=0\alpha=0). For the map γ→F\gamma\rightarrow F, an RBF kernel with length scale σ=1.0×10−5\sigma=1.0\times10^{-5} is employed, also with α=0\alpha=0.

The 2-RDM learning methods developed in this work have been integrated into the all-Python QMLearn package, available on GitHub [51]. QMLearn was originally developed for ML models of 1-RDMs; the present work required two key extensions: (1) additional quantum-mechanical solvers (engines) to support the workflows in Figure 1 based on the 2-RDM, including the evaluation of total energies and analytic energy gradients; and (2) expanded QM utilities, including unitary-decomposition-based purification and the Fourier transform of the pair density derived from the 2-RDM to compute structure factors.

QMLearn employs PySCF [52] to compute all reference quantities in a Gaussian-type orbital basis set (6-31G* throughout), including external potentials, target 1- and 2-RDMs, and Hartree-Fock (HF) 1-RDMs. For H2_2O we use Full CI (FCI), while the remaining molecules are treated with Complete Active Space Configuration Interaction (CASCI, or FOMO-CASCI for bond dissociation) using active spaces (# orbitals, # electrons) of (8,17) for NH3_3, (10,16) for CO2_2, and (12,12) for ethylene and methanol. We also report models for H2_2O and NH3_3 at the Coupled Cluster Singles and Doubles (CCSD) level in the same basis set. We note that to generate the reference results for the bond dissociation of ethene, we employed FOMO-CASCI [53]. The active spaces for points at dissociation were generated with the maximum overlap method to be as consistent as possible with the CAS used for the training structures residing near the equilibrium geometry.

The data (including databases of the models in hdf5 files), jupyter notebooks, input files and raw outputs for all results presented in this paper are available at the Zenodo repository under DOI: 10.5281/zenodo.18894170.

Acknowledgments

This material is based upon work supported by the US National Science Foundation under Grants No. CHE-2154760, OAC-1931473. Part of this research was performed while the authors were visiting the Institute for Pure and Applied Mathematics (IPAM), which is supported by the National Science Foundation (Grant No. DMS-1925919).

References

References

  1. [1]J. Behler and M. Parrinello, Generalized neural-network representation of high-dimensional potential-energy surfaces, Physical Review Letters 98, 146401 (2007).pubmed.ncbi.nlm.nih.gov/17501293
  2. [2]I. Batatia, P. Benner, Y. Chiang, A. M. Elena, D. P. Kovács, J. Riebesell, X. R. Advincula, M. Asta, M. A. Avaylon, W. J. Baldwin, et al., A foundation model for atomistic materials chemistry, The Journal of Chemical Physics 163, 184110 (2025).
  3. [3]M. Rezaee, S. Ekrami, and S. M. Hashemianzadeh, Comparing ani-2x, ani-1ccx neural networks, force field, and dft methods for predicting conformational potential energy of organic molecules, Scientific Reports 14, 11791 (2024).
  4. [4]J. Hermann, J. Spencer, K. Choo, A. Mezzacapo, W. M. C. Foulkes, D. Pfau, G. Carleo, and F. Noé, Ab initio quantum chemistry with neural-network wavefunctions, Nature Reviews Chemistry 7, 692 (2023).DOI
  5. [5]D. Pfau, S. Axelrod, H. Sutterud, I. von Glehn, and J. S. Spencer, Accurate computation of quantum excited states with neural networks, Science 385, eadn0137 (2024).DOI
  6. [6]M. Bogojeski, L. Vogt-Maranto, M. E. Tuckerman, K.-R. Müller, and K. Burke, Quantum chemical accuracy from density functional approximations via machine learning,

AI tools statement

No AI-use declaration is available for this version in Valency.

The available record does not establish whether AI systems or models contributed to this work.

How AI tools are recorded

Paper details

Cite this paper

Publication

Published
Version
Latest

Data & code

Code, data, proofs and workflows the authors linked for testing, review and reproduction. These links are part of this work’s metadata and are released under the same license as the rest of that metadata. Valency doesn’t host the files; each keeps the license set where it’s hosted.

Pick where to look, or just type