Manuscript Offprint
arXiv:2610.01432Learning ab initio phase-field models
Mengyi Chen, Peichen Zhong, Zihan Zhang, and Qianxiao Li
Department of Mathematics, National University of Singapore, Singapore
Department of Materials Science and Engineering, National University of Singapore, Singapore
Institute for Functional Intelligent Materials, National University of Singapore, Singapore
(Dated: October 2, 2026)
Simulating microstructure evolution requires quantum-mechanical accuracy and mesoscopic reach in length and time scales, a combination that no current method achieves. Classical phase-field models provide this reach, but their accuracy is limited by phenomenological free energies and mobilities. Here we develop a framework for learning ab initio phase-field models, where the mesoscopic equation is not postulated but derived from a Mori–Zwanzig projection of molecular dynamics onto species-density fields under explicit assumptions. The nonlocal free energy and mobility left unspecified by this equation are parametrized by neural networks and learned from short molecular dynamics trajectories generated with machine-learning interatomic potentials of ab initio accuracy. We demonstrate the framework on an iron–boron melt and on hydrogen–helium mixtures under planetary conditions. For iron–boron, the model shows that the melt at the FeB₄ composition is spinodally unstable at ambient pressure but stabilized at 10 GPa, offering a thermodynamic rationale for why FeB₄ has been synthesized only under high pressure. For hydrogen–helium, the model predicts the immiscibility boundary and captures droplet nucleation and growth in helium-rain simulations of a column corresponding to 2.2 million atoms, far beyond the scale of atomistic modeling at comparable accuracy. Trained across compositions and conditions, such models could provide a mesoscopic counterpart to ab initio molecular dynamics.
Collective behavior in materials, including nucleation, phase separation and coarsening, emerges from microscopic interactions and spans length scales from nanometers to micrometers and time scales from nanoseconds to hours [1, 2]. Accurate and scalable simulation across these length and time scales is therefore central to understanding the underlying physical mechanisms. Ab initio atomistic simulations retain quantum-mechanical accuracy, but their computational cost limits access to these length and time scales [3]. Phase-field models enable scalable simulations by representing microstructure through continuous fields at mesoscopic scales and have been successful across a wide range of materials processes [4–8]. However, they rely on prescribed forms of the free energy and mobility, with a few coefficients fitted to experiments or to the very phenomena being predicted, resulting in a phenomenological description with limited predictive accuracy [8–10].
Accurate and scalable mesoscopic simulation therefore remains a grand challenge, motivating the development of ab initio phase-field (AIPF) models grounded in microscopic theory and data (Fig. 1). We use the term ab initio in the same spirit as in ab initio molecular dynamics (AIMD). In AIMD, the equations of nuclear motion follow from quantum mechanics under the Born–Oppenheimer approximation. The forces are computed using density functional theory (DFT), where the exchange–correlation functional is chosen from a ladder of systematically improvable approximations known as Jacob's ladder [11]. Similarly, for phase-field models to qualify as ab initio, we impose two corresponding requirements. First, the evolution equation is derived from microscopic dynamics under stated assumptions, without phenomenological prescriptions (Fig. 1a). Second, the free-energy functional and mobility are selected from ladders of systematically improvable models, with their parameters learned from microscopic data of ab initio accuracy (free-energy ladder in Fig. 1b).
Several attempts have been made to obtain the mesoscopic free energy from microscopic theory rather than from the phenomena it describes, and each occupies a rung of the free-energy ladder. At the lowest rung, phase-field models retain a prescribed basis expansion for the free energy and determine its few coefficients from static DFT calculations [9, 12]. At the next rung of the ladder, the basis expansion for the local free energy is replaced by a neural network trained on equilibrium chemical potentials [13, 14]. At both rungs, only the local free energy is obtained from microscopic calculations. The gradient coefficient that sets the interfacial energy and the mobility that sets the relaxation rate are fixed separately or prescribed. Neural classical density functional theory (cDFT) extends this hierarchy to nonlocal free-energy functionals learned from equilibrium data [15–17]. Learning these functionals typically requires hundreds to thousands of simulations under external potentials to sample diverse equilibrium profiles [15–17]. The computational cost restricts applications largely to simple model fluids, such as hard spheres and Lennard-Jones fluids, in planar geometries. Few extend to three-dimensional density fields [17], or to complex liquids such as water, using training data generated with machine-learning interatomic potentials (MLIPs) [16]. The learned equilibrium free-energy functionals have also been used to predict dynamics within dynamical density functional the-
b

Figure 1. Ab initio phase-field models. a, The proposed ab initio phase-field (AIPF) model is ab initio in both its derivation and its learning, which start from quantum mechanics. The derivation proceeds from quantum mechanics to molecular dynamics under the Born–Oppenheimer approximation, then to a generalized Langevin equation through the Mori–Zwanzig formalism, and finally to the ab initio phase-field model under the stated assumptions. For the learning process, the AIPF model is trained on molecular dynamics trajectories generated with a machine-learning interatomic potential (MLIP) of ab initio accuracy. The free energy and mobility of the density field are parametrized by neural networks, with the free-energy functional chosen from the ladder in b. b, Ladder of free-energy functionals from exact statistical mechanics to phenomenology, where F splits into the known ideal-gas and external-potential parts and the unknown excess part . Each lower rung introduces additional restrictions, reducing flexibility and training-data requirements. Rung 4 is a neural operator, with layer fields starting from , convolution kernels , channel-mixing weights , biases and a pointwise nonlinearity . Rung 3, adopted in this work, restricts the excess free energy to a local free-energy density plus a nonlocal kernel . Rung 2 approximates the nonlocal term by the Cahn–Hilliard square-gradient form with coefficient . Rung 1 further restricts the local free energy to a prescribed basis expansion in composition x, such as Landau polynomials or Redlich–Kister expansions, with coefficients .
ory, under the adiabatic approximation in which the equilibrium functional determines the instantaneous driving forces [18]. A few studies instead learn the free energy and mobility jointly from dynamics, but use lattice or chain models rather than ab initio data [19, 20]. All of these approaches seek an explicit mesoscopic equation. Multiscale coupling instead bypasses the mesoscopic equation and calls the microscopic solver at every macroscopic step [21, 22], so every new simulation still requires microscopic runs.
Despite these advances, an ab initio phase-field framework for accurately predicting both thermodynamics and dynamics remains to be established. Here, we present a framework for learning ab initio phase-field models. The mesoscopic equation follows from molecular dynamics (MD) under three assumptions: Markovian dynamics, local mobility and Gaussian fluctuating forces. The nonlocal free-energy functional and mobility are then learned jointly from MD trajectories generated using MLIPs of ab initio accuracy (Fig. 2). Recent advances in MLIPs, including foundation potentials trained on extensive datasets, make the required training data computationally accessible [23, 24]. Training requires only short MD trajectories of systems containing a few thousand atoms, generated without external potentials, making the approach data efficient. The learned AIPF model can then simulate much larger systems over longer times.
Ab initio phase-field models
We consider a multicomponent system in which each species comprises atoms with positions and momenta . The dynamics is simulated using an MLIP of ab initio accuracy. We describe each species by a band-limited number-density field . This density field is constructed by removing modes with from the Fourier representation of the microscopic particle density and transforming the remaining modes back to real space. The cutoff sets the spatial resolution, retaining long-wavelength density variations associated with slow mesoscopic dynamics. We apply an exact Mori–Zwanzig projection onto these band-limited density fields, yielding a generalized Langevin equation (GLE) [25–27]. The GLE describes the evolution of the density fields through a memory-dependent response to the free-energy gradient, while a fluctuating force accounts for stochastic effects from unresolved degrees of freedom.
Although exact, the GLE is difficult to evaluate be-
Simulation
Learning
Inference

Figure 2. Framework for learning ab initio phase-field models. In the simulation stage, molecular dynamics with an MLIP propagates a configuration over a short interval . In the learning stage, each configuration is coarse-grained into species density fields , from which neural networks with trainable parameters output the local mobility and the free-energy functional . At inference, the thermodynamics follows from minimizing the learned functional and the dynamics from integrating the mesoscopic equation.
cause its memory kernel and fluctuating force are not directly accessible. We make three assumptions to reduce the GLE to a practical mesoscopic model. First, in many systems, such as simple fluids, fluid mixtures, and colloidal suspensions, a particle's velocity decorrelates within a few collisions, so the memory kernel decays far faster than the evolution of the resolved density modes [28, 29]. We therefore take the dynamics to be Markovian, replacing the memory kernel by its time integral, which we call the mobility [26, 27, 30]. Second, we restrict the mobility to depend only on the local densities, since fully nonlocal mobility is difficult to identify from data. Third, we assume the fluctuating force to be Gaussian conditional on the current density fields, with covariance fixed by the fluctuation-dissipation relation [28, 30, 31]. Under these three assumptions, the GLE reduces to the mesoscopic model (Methods, 'Theoretical derivation'),
with the local mobility, the free-energy functional, and a unit Gaussian white noise. The dynamics admits the Boltzmann equilibrium distribution associated with , and the most probable configurations satisfy the stationarity condition
with the constant chemical potentials.
Equation (1) fixes the form of the equation but leaves and unspecified. The free energy can be decomposed as , where the ideal-gas part and the external-potential part are known exactly and the excess part accounts for interparticle interactions. We adopt rung 3 of Fig. 1b for ,
(3)
with a function of the local densities and the radial kernel between species and . Rung 3 balances nonlocal expressiveness with data efficiency. Its nonlocal kernel extends the square-gradient term of rung 2 to the full wavevector dependence of the pair correlations, while its quadratic pair term provides a stronger physical prior than rung 4, reducing the amount of training data required. Under the assumption of local mobility, M depends only on the densities at the same point. As a parametrization choice, M is taken to be separable, a function of the densities scaled by a temperature factor. The temperature factor takes an Arrhenius form with learned activation energies when necessary (Methods, ‘Model parametrization’).
With the model parametrization specified, we learn and from short MD trajectories of systems containing only a few thousand atoms, generated without external potentials (Fig. 2; Methods, ‘Training data’). We consider two kinds of initial configuration, homogeneous mixtures and slabs with interfaces between regions of different composition. We learn the dynamics from phase separation in the former and interface relaxation in the latter, where phase separation provides direct access to unstable states in the spinodal region. We estimate the density evolution over an interval longer than the microscopic memory time, so that a Markovian description applies, but short enough that the drift does not change appreciably. We match the deterministic part of Eq. (1) to the measured density evolution (Methods, ‘Training objective’). Fluctuations in homogeneous equilibrium trajectories provide additional constraints on the mobility and the curvature of the free energy (Methods, a

b
Figure 3. Binary Lennard-Jones mixture. a, Phase diagrams from the AIPF model and the Landau (upper small panel) and Flory–Huggins (lower small panel) baselines, compared with MD [32]. All models are trained on the same data using the same loss function and mobility parametrization, differing only in the form of the free-energy functional. b, Domain size at (3 seeds each), compared between MD and the three models, with defined in Supplemental Material, Section S3 A. Fits to give effective exponents and .
‘Fluctuation-based measurements’).
Iron–boron melt. Computational searches identify promising solid-state materials by their stability on the formation-energy convex hull [37, 38], yet thermodynamic stability alone does not guarantee synthesis, which also depends on the synthesis route and conditions. For example, is predicted to be thermodynamically stable [39], but its synthesis has been reported only under high pressure [40]. One route to solid-state synthesis proceeds through a transient melt, formed at the interface between two solid precursors, from which the target crystal nucleates [41]. Zhang et al. proposed that synthesis through this route requires the melt at the target composition to be locally stable and, using MLIP-driven MD simulations, showed that the Fe–B melt near is spinodally unstable at ambient pressure but stabilized by high pressure [41].
Identifying the spinodal region requires the composition curvature of the Gibbs free energy of mixing, , of the homogeneous melt. Inside this region, however, the homogeneous melt is unstable and out of equilibrium, whereas conventional methods rely on equilibrium measurements of the homogeneous melt. Prior works either compute the free energy from the enthalpy and entropy of a homogeneous melt in small cells that suppress phase separation [33–35, 41, 42], or obtain its curvature from equilibrium structure factors [36, 41, 43]. The former requires the nonideal mixing entropy, which is hard to determine accurately. The latter yields a nonnegative curvature estimate by construction and identifies the spinodal only as this estimate approaches zero, with resolution limited by system size and simulation time. Both yield results only at discrete state points, so obtaining a continuous phase boundary requires fitting a prescribed free-energy form, such as a Redlich–Kister expansion [33, 36, 44].
The negative curvature, however, governs the early stage of phase separation. The demixing that prior methods either suppress or cannot use is itself informative about the curvature. By learning from the dynamics, the AIPF model accesses the spinodal region directly. Using the MACE potential of Zhang et al. [41], we learn a single AIPF model of the Fe–B melt at 0, 5 and 10 GPa, where pressure enters implicitly through the model's dependence on species densities and temperature, as expressed by the Euler relation (Methods, Eq. (12)). The Gibbs free energy of mixing then follows by adding the pressure–volume term PV to (Methods, Eq. (13), and Fig. A3). Its curvature is quantified by the thermody-a

b
C
d
Figure 4. Iron–boron melt. a, The predicted thermodynamic factor at 0, 5 and 10 GPa is shown with the MD classification of the sampled states. For each state, is obtained from a 50–500 ps trajectory by extrapolating the concentration structure factor to using the Ornstein–Zernike form. States are classified as stable when , is converged to within 10% and composition fluctuations show no growth, and as spinodal when and the melt coarsens. All remaining states are classified as unresolved. b, The spinodal regions predicted by the AIPF model at the three pressures. The star marks the composition at 1500 K, inside the spinodal region at 0 and 5 GPa and outside it at 10 GPa. c, The thermodynamic factor is shown at three temperatures for each pressure. Dots mark the composition. d, The predictions are compared with for states classified by MD as spinodal or unresolved. The AIPF model agrees with the spinodal classification from MD and predicts the sign of for unresolved states.
namic factor
where is the atomic fraction of boron, with for a locally stable melt and inside the spinodal region. The learned functional provides continuous predictions of and across composition, temperature and pressure, resolving the negative curvature inaccessible to equilibrium fluctuation measurements (Fig. 4a). The AIPF model predicts a B-rich spinodal region at ambient pressure, and both increasing pressure and increasing temperature stabilize the melt (Fig. 4b,c). At 10 GPa, the composition exits the spinodal region, consistent with the proposed thermodynamic indicator of synthesizability. Beyond agreeing with the spinodal classification from MD, the AIPF model predicts the sign of the free-energy curvature for states whose stability remains unresolved in the MD trajectories (Fig. 4d).
Hydrogen–helium mixture. To demonstrate applicability beyond synthesizability, we apply the framework to hydrogen–helium (H–He) mixtures, which make up most of the mass of gas giants such as Jupiter and Saturn. Inside gas giants, helium is hypothesized to become immiscible in metallic hydrogen and settle as droplets toward the planetary center, a process known as helium rain. Whether and where helium rain occurs depends on the immiscibility boundary as a function of helium fraction , pressure P and temperature T, while its subsequent evolution depends on the kinetics of droplet nucleation, growth and transport. Experiments at planetary interior conditions are extremely challenging, and direct AIMD simulations are limited in accessible length and time scales. MLIP-driven MD simulations extend thermodynamic predictions to larger systems [36, 45], but these systems remain far smaller than the length and time scales of helium rain dynamics (Fig. A4). How helium droplets nucleate, grow and redistribute helium therefore remains an open question.
We train a single AIPF model, spanning 200–800 GPa and 2000–12 000 K, on trajectories from molecular dynamics driven by a MACE potential [36]. The immiscibility boundary across (Fig. 5a,b), together with the free energy of mixing and its curvature (Fig. A5), follows directly from the learned functional. We compare
Phase diagram
a

b
Helium rain in gas giants
C
d

e
P [GPa]
P [GPa]
Dynamics
f

Figure 5. Hydrogen–helium mixture. The AIPF model is trained at 200, 400, 600 and 800 GPa, with predictions in d,e extending to 150–900 GPa. a, Binodal surface in with the critical line . b, Isobaric sections of a at 200, 400, 600 and 800 GPa, with the predicted critical temperatures. Circles denote binodal compositions measured from MD at 800 GPa. c, Schematic of helium demixing from metallic hydrogen and settling toward the center of a gas giant. d, Predicted binodal (solid) and spinodal (dashed) at the protosolar composition , compared with published binodals from Schöttler and Redmer [33], Morales et al. [34] and Lorenzen et al. [35], and the spinodal from Wang et al. [36], computed with the vdW-DF functional. e, The same boundaries are compared with the interior profiles of Jupiter and Saturn. Bands span published isentropes and present-day thermal profiles compiled by Wang et al. [36]. Helium rain is expected wherever a profile lies below the binodal. f,g, Helium rain simulated for 1 ns in a nm column corresponding to 2.2 million atoms, at and 400 GPa (Supplemental Material, Section S3). Temperature increases from 3700 K at the top to 3900 K at the base, with enhanced gravity directed toward the planet's center. f, Opaque surfaces show helium droplets colored by radius. White surfaces indicate helium-rich fluctuations below the droplet threshold. g, The helium fraction is shown on a wedge section of the same domain at the same times.
our predicted binodal and spinodal along the protosolar isopleth with prior results (Fig. 5d) and with the interior profiles of Jupiter and Saturn (Fig. 5e). At the protosolar composition, Saturn's interior profiles intersect the predicted immiscibility region, in agreement with previous studies [35, 36, 45]. Jupiter's profiles lie above but close to the immiscibility boundary. With more accurate MLIPs and planetary thermal profiles, our framework would have the potential to give a definitive answer on whether helium demixes in Jupiter.
Beyond predicting the immiscibility boundary, the learned AIPF model directly simulates how helium rain develops at mesoscopic scales. We simulate helium rain for 1 ns in a column corresponding to 2.2 million atoms (Fig. 5f,g), beyond the reach of AIMD or MLIP-driven MD at comparable computational cost (Fig. A4). The simulation includes an enhanced gravitational potential absent from training. The initially uniform density fields fluctuate within the metastable region until helium droplets nucleate and grow. Under gravity, helium accumulates in the lower region and is depleted from the upper region. As helium depletion drives the upper region across the immiscibility boundary, nucleation stops there and the rain zone shifts downward. These results provide a dynamical picture of helium rain, from droplet formation in an initially homogeneous mixture to helium redistribution and the downward shift of the rain zone. They also demonstrate the scalability of the AIPF model.
and its ability to include an imposed external field.
Discussion
We have developed a framework for learning ab initio phase-field models that accurately predict mesoscopic thermodynamics and dynamics from microscopic data. The framework captures the contrasting effects of pressure, which stabilizes the Fe–B melt but promotes demixing in the H–He mixture. Our framework and neural cDFT [15–17, 46] both replace prescribed free-energy forms with flexible, learned functionals. Neural cDFT primarily targets equilibrium thermodynamics, whereas we jointly learn the free-energy functional and mobility from dynamics, with equilibrium predictions obtained directly from the free-energy functional. The training trajectories, starting from unstable homogeneous mixtures or slab configurations, naturally sample diverse density profiles as the systems relax toward equilibrium. This diversity enables training on short trajectories without external potentials, which makes the framework data efficient compared with equilibrium sampling under a range of external potentials. Learning from these trajectories also gives the AIPF model direct access to the spinodal region, which equilibrium approaches cannot sample and can reach only by extrapolation.
The accuracy of the learned AIPF model depends on the underlying MLIP, and advances in these potentials could make the microscopic data both more accurate and cheaper to generate. The free-energy and mobility parametrizations used here represent one implementation of the AIPF framework. The framework can accommodate more general parametrizations, allowing greater predictive accuracy and broader applicability as more diverse training data become available. The present model resolves only density fields. In the helium-rain simulation, helium therefore accumulates in the lower region through diffusion under enhanced gravity rather than through hydrodynamic droplet settling. Incorporating momentum density would extend the framework to a broader range of fluid phenomena, capturing how flow shapes phase separation and transport. The Markovian assumption may also become inadequate when memory persists on the time scale of the resolved fields, as can occur in supercooled liquids and glasses. Learning memory kernels and correlated noise offers a possible extension, as has been done for collective variables on crystal lattice sites [47] and for coarse-grained particles with many-body, state-dependent memory [48, 49]. Extending these approaches to continuum density fields requires memory kernels that are nonlocal in both space and time. Beyond the fluids studied here, applications to solids will require training data that capture rare atomic rearrangements. Generating such data efficiently, for example through kinetic Monte Carlo with barriers computed from first principles, is a natural next step.
Looking ahead, we envision ab initio phase-field modeling as an accurate and scalable tool for mesoscopic simulation grounded in microscopic theory and data. Training across elements, compositions and thermodynamic conditions could establish mesoscopic foundation models with reusable free-energy functionals and mobilities, analogous to CALPHAD (calculation of phase diagrams) databases [50] but built on general free-energy functionals rather than parametric bulk free energies. Such mesoscopic foundation models could enable accurate thermodynamic and dynamical predictions in regimes where experiments are difficult and direct MD simulations are prohibitively costly.
Methods
Theoretical derivation. We outline the derivation here and provide the full details in Supplemental Material, Section S1. We consider a multicomponent system containing atoms of each species in a simulation cell of volume V with periodic boundary conditions. The microscopic state Z comprises their positions and momenta , extended by thermostat variables where applicable. We consider microscopic dynamics that is deterministic on this phase space and possesses an invariant distribution , where denotes a point of this phase space. Molecular dynamics in the microcanonical (NVE) and canonical (NVT) ensembles falls within this class, provided the latter is generated by the Nosé–Hoover thermostat, whose dynamics is deterministic on the extended phase space and whose invariant measure is known [51]. For any set of collective observables defined on the phase space, the Zwanzig projection operator maps a phase function to its conditional average at a fixed value of the resolved variables,
The normalization is the marginal equilibrium distribution of the resolved variables,
and it defines the free energy of the resolved variables,
For NVT dynamics, depends on the temperature, and every quantity defined through it carries a parametric dependence on the temperature, which we keep implicit for notational simplicity. For NVE dynamics, T in Eq. (5) is a fixed constant that drops out of the exact relations (Supplemental Material, Section S1). Applying to the microscopic dynamics yields the GLE, which describes the nonequilibrium evolution of [26, 27, 52]. Specifically, A contains the independent components of the band-limited species density modes,
Here, are the Fourier coefficients of the microscopic number density . Throughout this paper, we use a hat to denote the spatial Fourier transform. These modes define the band-limited density field in real space,
The resulting GLE takes the form,
(7)
where is the memory kernel, which describes how the density modes at the current time are affected by the past configurations of the field. is a matrix on the mode indices, and the divergence is taken in its second index, . is the fluctuating force satisfying the fluctuation-dissipation relation, which fixes its covariance in terms of the memory kernel [30, 53]. The construction is exact whether the projection is defined with respect to the NVE or the NVT ensemble [30, 53].
The three assumptions introduced with Eq. (1) act on Eq. (7) as follows and are stated in their precise form as Assumptions 1 to 3 in Supplemental Material, Section S1 C. First, we assume that the memory kernel and its first derivatives with respect to the resolved state decay on a time much shorter than the evolution time of every retained density mode. Only time lags contribute appreciably to the memory integral, and during this interval the density changes negligibly, so and the kernel is replaced by , with the integrated mobility. The fluctuation-dissipation relation together with this delta approximation gives the covariance of as . Second, we assume that the integrated mobility takes the form
where M is a symmetric positive semidefinite matrix on the species indices, depending only on the local species densities and temperature. Under this restriction the divergence of the mode-space mobility, , vanishes, because the retained band contains conjugate wavevector pairs. Third, we replace the exact force by a zero-mean white noise , Gaussian conditional on the current state, with this covariance, which is obtained in real space as . The three assumptions then give , which in real space is Eq. (1), and which admits the Boltzmann distribution as its invariant density.
Training data. We first smooth the microscopic density of each species by replacing each with a normalized Gaussian , where . In Fourier space, this multiplies each mode by . We then retain modes with and transform back to real space, which gives the Gaussian-weighted band-limited field
We use rather than the band-limited field of Eq. (6) for two reasons. First, truncating the Fourier series at produces oscillations in real space, so can take unphysical negative values. We choose because the Gaussian weight has already decayed to there, so the cutoff has little effect and is essentially the sum of Gaussians, which is positive. Second, the Gaussian smoothing makes the temporal evolution of the density field smoother and thus easier to learn. For notational simplicity, we write for in what follows. We store the Fourier modes rather than the real-space density fields to reduce storage requirements.
Lennard-Jones. We adopted the symmetric binary Lennard-Jones mixture of Das et al. [32], with and a common diameter . The pair potential was truncated and force-shifted at , and the total number density was . We used overdamped Langevin dynamics with translational damping and a time step of , where and is the common particle mass. For the Lennard-Jones mixture, we express length, temperature and time in units of , and , respectively. Two run families supply different information. Slabs of 3456 particles at provide the interface dynamics on which the drift term is fitted, with held out. Homogeneous cubes of 4000 particles at supply the equilibrium anchors. The coarse-graining width is , giving .
Iron-boron. We used a MACE-MH-1 potential with its r²SCAN head, fine-tuned for the Fe–B melt [41]. We generated training data in the NPT ensemble with a Nosé–Hoover thermostat and a Martyna–Tobias–Klein barostat at 0, 5 and 10 GPa. The cell dimensions vary little along a trajectory, and positions are rescaled to the mean cell before the density modes are formed. The rescaled trajectories are then treated as fixed-cell data, to which the derivation above applies. All Fe–B simulations used a time step of 1 fs. Only cubes were used for training, since the coexisting compositions are unknown and a slab cannot be prepared. Cubes of 3456 atoms covered and K, with run lengths of 50 to 500 ps. We measured the equilibrium number density at every state point using isotropic NPT runs of 512 atoms, with 5 ps of melting, 5 ps of equilibration and 5 ps of averaging. The coarse-graining width is Å, giving Å .
Hydrogen–helium. We used a MACE potential trained on vdW-DF reference calculations [36]. All simulations ran in the NPT ensemble with the same thermostat and barostat at 200, 400, 600 and 800 GPa, spanning 2000 to 12 000 K. Cubes of 3456 atoms covered , and slabs of 2000 to 4700 atoms each paired two compositions between pure hydrogen and pure helium (Supplemental Material, Section S3). We used time steps of 0.1 fs for slabs and 0.2 fs for homogeneous cubes and equation-of-state calculations. We measured the equilibrium number density at every state point using short isotropic NPT runs of 512 atoms, with 1 ps of equilibration followed by 1 ps of averaging. The resulting table was used to set the density at which each cube was built. The small box suppresses phase separation, so the table gives the density of the homogeneous state even inside the miscibility gap. The coarse-graining width is , giving . Further details for each system are given in Supplemental Material, Section S3.
Model parametrization. We denote by all trainable parameters, namely the weights of the neural networks and scalar coefficients such as and introduced below, and write the learned free energy and mobility as and . The learned free energy is a Helmholtz functional of the species densities and temperature, given by the sum of an intrinsic part and a coupling to an external potential,
and the intrinsic part splits into an ideal-gas term, known exactly, and an excess term that carries all interparticle correlations,
where is the thermal wavelength. In all three systems, takes the rung 3 form of Eq. (3), with a learned local free-energy density and a learned nonlocal kernel whose components depend only on the separation . The mobility depends only on the densities and temperature at the same point and is parametrized as
where , the lower-triangular is represented by a multilayer perceptron (MLP) taking the densities as inputs, and carries the temperature dependence. This construction ensures that is symmetric and positive semidefinite.
We begin with stronger physical priors and adopt more general parametrizations only when the simpler forms are insufficient to describe the system. For , we first consider a temperature expansion,
using simple basis functions such as 1, T, and . The linear form suffices for the Lennard-Jones mixture, whereas H–He requires an additional term. When these expansions are insufficient, as for the strongly asymmetric Fe–B melt, we instead adopt a general MLP for . We initially take the mobility to be temperature independent, with , and introduce Arrhenius factors when the mobility anchors show temperature dependence, as for Fe–B and the Lennard-Jones mixture.
Lennard-Jones. The Lennard-Jones mixture is nearly incompressible, so we take the local total density to be at every point. The dependence of the free energy and mobility on the species densities therefore reduces to a dependence on the composition field , giving and . The ideal part of the free energy, the local free-energy density and the mobility are
with and defined up to a constant. Here, is an even Taylor polynomial in up to eighth order and is an input-convex neural network. In the pair term, is replaced by the scalar field and by a scalar radial kernel of finite range . The mobility is the scalar form of , with in place of and a learned constant in place of . Both and are learned. For , we found that the polynomial fits this single-variable function better than an MLP. The entire expression is even in because of the symmetry.
Baselines. For the Lennard-Jones mixture, we compare with two rung 1 forms (Fig. 1b), trained with the same data, loss, anchors and mobility form as the AIPF model. The Flory–Huggins baseline keeps and takes
with temperature-independent w and , both learned. The Landau baseline drops the ideal term and takes
(11)
with , and learned. Without the ideal term, it does not confine to .
Iron-boron. An MLP represents the density and temperature dependence of . The kernel is a symmetric matrix of radial functions with cutoff . We learn one activation energy per species for the mobility.
Hydrogen-helium. We use the temperature expansion
where each is an MLP of the species densities and is a reference temperature. The kernel has the same parametrization and cutoff as for Fe–B. The mobility has no explicit temperature dependence, with .
Thermodynamic predictions. Evaluating the learned functional in the absence of an external potential on a spatially uniform profile and dividing by the system volume gives the bulk Helmholtz free-energy density . For the Lennard-Jones mixture, we construct the phase diagram from at fixed total density . At each temperature, a common tangent to gives the binodal compositions, while defines the spinodal region, where the homogeneous mixture is unstable to infinitesimal composition fluctuations (Fig. A6). Between the binodal and the spinodal region, the mixture is metastable and phase separation requires nucleation.
For Fe–B and H–He, we instead construct phase diagrams at prescribed temperature and pressure, allowing the total density to vary with composition. The pressure of a homogeneous state follows from the Euler relation,
Let be the number fraction of species . For a binary mixture, we denote the fraction of the selected species by , species for the Lennard-Jones mixture, boron for Fe–B and helium for H–He. The composition fixes the direction of , since with . At a specified temperature, the total number density is obtained by solving Eq. (12) at the prescribed pressure and composition. The species densities then follow as . For the H–He mixture, Fig. A7 compares the densities so obtained with the MD equation-of-state table. At a prescribed pressure , the Gibbs free energy per particle also follows from Eq. (12),
and the Gibbs free energy of mixing per particle is
(13)
At fixed T and P, a common tangent to gives the binodal compositions, while defines the spinodal region. The metastable region lies between the binodal and the spinodal region, and their boundaries meet at the critical point. Figures A3 and A5 show and its curvature along the isobars of the Fe–B melt and the H–He mixture. The thermodynamic factor of Eq. (4) is the reduced composition curvature of the Gibbs free energy per particle, taken at fixed T and P and written here for a general composition x. The learned functional gives at any state, and it is negative inside the spinodal region. The equilibrium density under an external potential is defined in Supplemental Material, Section S2 B.
Dynamical predictions. We integrate the learned AIPF model using a pseudospectral method on a periodic grid. For the rung 3 functional (Eq. (3)), the Fourier transform of the excess chemical potential is . The nonlocal convolution thus reduces to a matrix-vector product at each wavevector, which is computationally efficient in Fourier space. The local, ideal-gas and external-potential contributions to the chemical potential are evaluated point by point in real space and then transformed to Fourier space using fast Fourier transforms. We use a first-order implicit-explicit scheme, treating the dynamics linearized about the mean density implicitly, at the next time step, and the nonlinear remainder explicitly, at the current time step. This splitting improves numerical stability, allowing larger time steps than a fully explicit scheme. Thermal noise is added with the covariance set by the fluctuation-dissipation relation, using the same as in the deterministic part. The solver runs on a single NVIDIA A100 40 GB GPU, with computational cost scaling approximately linearly with system size (Fig. A4). For helium-rain dynamics, the model simulates 1 ns at a scale corresponding to 2.2 million atoms in about one day. Implementation details are provided in Supplemental Material, Section S2 A.
Fluctuation-based measurements. The structure factors and mobility can be measured from homogeneous equilibrium trajectories. The partial structure factors are
where for are the density modes defined above, evaluated for NPT trajectories with positions rescaled componentwise as , with the instantaneous box length and its time average. The wavevectors are , with integer . We average over frames and over wavevectors of equal magnitude , so the quantities below depend on only. The Hessian of the free energy is related to the partial structure factors through
Here, is the Fourier transform of the second functional derivative at the uniform state, with , where is the bulk Helmholtz free-energy density.
The concentration structure factor is
We estimate its long-wavelength limit by fitting the Ornstein–Zernike form to the low-k shells of and taking the intercept a. For a stable homogeneous state, the thermodynamic factor of Eq. (4) is fixed by the equilibrium concentration fluctuations,
where is the number fraction of the selected species. Only in a stable homogeneous state does this estimate coincide with the free-energy curvature (Eq. (4)). is nonnegative by construction. Inside the spinodal region, phase separation enhances long-wavelength concentration fluctuations, driving toward zero as the simulation time and system size increase. Within the accessible MD time scales it only approaches zero from above, whereas the functional returns the negative curvature directly. This is the difference displayed in Fig. 4d, and the reason the classification of Fig. 4a thresholds instead of testing its sign.
We obtain the mobility from the covariance of changes in the density modes over intervals longer than the microscopic memory time but shorter than the relaxation time of the resolved modes. The fluctuation–dissipation relation in Eq. (1) gives, to leading order in ,
where is the change in a density mode over the interval and is the mean box volume. For H–He and Fe–B, we estimate M from the zero-lag intercept of a linear fit to finite-lag mobility estimates within this mesoscopic time window. For the Lennard-Jones mixture, we evaluate it directly at a lag of (Supplemental Material, Section S3).
Training objective. We learn the AIPF model by minimizing a loss function that compares its dynamics and thermodynamics with microscopic data. The dynamical term compares the measured density evolution with the deterministic part of Eq. (1),
where are the chemical potentials of the current field, which become spatially constant at equilibrium (Eq. (2)), is estimated from the coarse-grained density fields over each trajectory segment, averages over these segments, and is the number of retained modes. The factor gives larger weight to the long-wavelength modes, which carry the slow mesoscopic dynamics.
The dynamical loss alone does not fully determine the AIPF model, for two reasons. First, matches only the deterministic part of Eq. (1). The noise, which alone would fix the mobility, is averaged out. In the deterministic part, and enter only through the product , so the rescaling leaves unchanged. Second, near the critical temperature the mixture undergoes critical slowing down. As the composition curvature approaches zero, the restoring force weakens relative to thermal noise. The drift therefore becomes less informative about the free-energy curvature, making equilibrium fluctuation measurements particularly important near . Both limitations are addressed with the mobility and structure factors measured from homogeneous runs.
The mobility anchor removes the scale ambiguity through the fluctuation–dissipation relation, which connects the leading-order covariance of short-time density changes to . It penalizes the mean squared relative deviation between and the mobility measured through Eq. (15). The static anchors and supply the thermodynamic information by matching the Hessian of to the measured structure factors through Eq. (14). compares the matrices on the measured shells , and compares the scalar from the Ornstein–Zernike intercept at . Figure A8 compares the AIPF model with the measurements at the H–He anchor states.
For Fe–B and H–He, simulated in the NPT ensemble, we add an isobar anchor that constrains the equation of state. It compares the pressure obtained from through Eq. (12) with the prescribed pressure at each state point, using a mean squared normalized residual. These data-fitting terms form the weighted sum
with for the Lennard-Jones mixture. We add regularization terms for Fe–B and H–He to Eq. (16). The regularization terms and the weight of every term are given per system in Supplemental Material, Section S3.
Data availability
The trained AIPF models, the data underlying the figures and the pipeline that generates the molecular-dynamics trajectories and training datasets are available at https://github.com/mengyi-chen/ab-initio-phase-field-models. The trajectories and datasets themselves are available from the corresponding author on reasonable request, owing to their size. The MLIPs for hydrogen–helium and iron–boron were taken from Wang et al. [36] and Zhang et al. [41], respectively.
Code availability
The code for training and simulating AIPF models is available at https://github.com/mengyi-chen/ab-initio-phase-field-models.
Acknowledgments
This research is supported by the National Research Foundation, Singapore under its AI Singapore Programme (AISG Award No: AISG3-RP-2022-028). This research is supported by computational resources from the NUS High Performance Computing facility (NUSREC-HPC-00001). The computational work for this article was partially performed on resources of the National Supercomputing Centre, Singapore (https://www.nscc.sg).
Author contributions
Q.L. and M.C. conceived the study. M.C. carried out the research. P.Z. contributed to the research design and interpretation of the results. Z.Z. developed the MLIP for the iron–boron melt. All authors contributed to discussions and to writing the manuscript.
Competing interests
The authors declare no competing interests.
[1] Y. Li, F. El Gabaly, T. R. Ferguson, R. B. Smith, N. C. Bartelt, et al., Nature Materials 13, 1149 (2014).
[2] W. Mao, C. R. Hall, S. Bernardi, Y.-B. Cheng, A. Widmer-Cooper, et al., Nature Materials 20, 55 (2021).
[3] W. Jia, H. Wang, M. Chen, D. Lu, L. Lin, et al., in SC20: International Conference for High Performance Computing, Networking, Storage and Analysis (IEEE, 2020) pp. 1–14.
[4] P. C. Hohenberg and B. I. Halperin, Reviews of Modern Physics 49, 435 (1977).
[5] A. Karma and W.-J. Rappel, Physical Review E 57, 4323 (1998).
[6] L.-Q. Chen, Annual Review of Materials Research 32, 113 (2002).
[7] I. Steinbach, Modelling and Simulation in Materials Science and Engineering 17, 073001 (2009).
[8] D. Tourret, H. Liu, and J. LLorca, Progress in Materials Science 123, 100810 (2022).
[9] S. Bhattacharyya, R. Sahara, and K. Ohno, Nature Communications 10, 3451 (2019).
[10] G. Pruessner and A. P. Sutton, Physical Review B 77, 054101 (2008).
[11] J. P. Perdew and K. Schmidt, in Density Functional Theory and Its Application to Materials, AIP Conference Proceedings, Vol. 577, edited by V. Van Doren, C. Van Alsenoy, and P. Geerlings (American Institute of Physics, 2001) pp. 1–20.
[12] V. Vaithyanathan, C. Wolverton, and L. Q. Chen, Physical Review Letters 88, 125503 (2002).
[13] G. H. Teichert, A. R. Natarajan, A. Van der Ven, and K. Garikipati, Computer Methods in Applied Mechanics and Engineering 353, 201 (2019).
[14] M. Faghih Shojaei, J. Holber, S. Das, G. H. Teichert, T. Mueller, et al., Journal of the Mechanics and Physics of Solids 190, 105726 (2024).
[15] F. Sammüller, S. Hermann, D. de las Heras, and M. Schmidt, Proceedings of the National Academy of Sciences 120, e2312484120 (2023).
[16] A. T. Bui and S. J. Cox, Proceedings of the National Academy of Sciences 123, e2610049123 (2026).
[17] B. Cheng, Equivariant learning of a transferable three-dimensional classical density functional (2026), arXiv:2608.13506.
[18] K. Ram, J. Dijkman, R. van Roij, J.-W. van de Meent, B. Ensing, et al., Physical Review E 112, 045314 (2025).
[19] S. Huang, Z. He, N. Dirr, J. Zimmer, and C. Reina, Journal of the Mechanics and Physics of Solids 194, 105908 (2025), 2312.05810.
[20] Z. Li, A. Zhu, and Q. Li, Hypothesis-driven construction of mesoscopic dynamics (2026), arXiv:2605.16211.
[21] W. E and B. Engquist, Communications in Mathematical Sciences 1, 87 (2003).
[22] I. G. Kevrekidis, C. W. Gear, J. M. Hyman, P. G. Kevrekidis, O. Runborg, et al., Communications in Mathematical Sciences 1, 715 (2003).
[23] I. Batatia, P. Benner, Y. Chiang, A. M. Elena, D. P. Kovács, et al., The Journal of Chemical Physics 163, 184110 (2025), arXiv:2401.00096.
[24] B. Deng, P. Zhong, K. Jun, J. Riebesell, K. Han, et al., Nature Machine Intelligence 5, 1031 (2023).
[25] H. Mori, Progress of Theoretical Physics 33, 423 (1965).
[26] R. Zwanzig, Physical Review 124, 983 (1961).
[27] H. Grabert, Projection Operator Techniques in Nonequilibrium Statistical Mechanics, Springer Tracts in Modern Physics, Vol. 95 (Springer, Berlin, Heidelberg, 1982) p. 166.
[28] J. M. Ortiz de Zárate and J. V. Sengers, Hydrodynamic Fluctuations in Fluids and Fluid Mixtures (Elsevier, Amsterdam, 2006).
[29] M. te Vrugt, H. Löwen, and R. Wittkowski, Advances in Physics 69, 121 (2020).
[30] C. Hijón, P. Español, E. Vanden-Eijnden, and R. Delgado-Buscalioni, Faraday Discussions 144, 301 (2010).
[31] L. Onsager and S. Machlup, Physical Review 91, 1505 (1953).
[32] S. K. Das, J. Horbach, K. Binder, M. E. Fisher, and J. V. Sengers, The Journal of Chemical Physics 125, 024506 (2006).
[33] M. Schöttler and R. Redmer, Physical Review Letters 120, 115703 (2018).
[34] M. A. Morales, S. Hamel, K. Caspersen, and E. Schwegler, Physical Review B 87, 174105 (2013).
[35] W. Lorenzen, B. Holst, and R. Redmer, Physical Review B 84, 235109 (2011).
[36] X. Wang, S. Hamel, and B. Cheng, Nature Communications 17, 10382 (2026).
[37] A. Merchant, S. Batzner, S. S. Schoenholz, M. Aykol, G. Cheon, et al., Nature 624, 80 (2023).
[38] J. Riebesell, R. E. A. Goodall, P. Benner, Y. Chiang, B. Deng, et al., Nature Machine Intelligence 7, 836 (2025).
[39] A. N. Kolmogorov, S. Shah, E. R. Margine, A. F. Bialon, T. Hammerschmidt, et al., Physical Review Letters 105, 217003 (2010).
[40] H. Gou, N. Dubrovinskaia, E. Bykova, A. A. Tsirlin, D. Kasinathan, et al., Physical Review Letters 111, 157002 (2013).
[41] Z. Zhang, M. Chen, Q. Li, and P. Zhong, Interfacial melting as a thermodynamic indicator of solid-state synthesizability (2026), arXiv:2606.22885.
[42] S. M. Wahl and B. Militzer, Earth and Planetary Science Letters 410, 25 (2015).
[43] B. Cheng, The Journal of Chemical Physics 157, 121101 (2022).
[44] Y. Huang, M. Widom, and M. C. Gao, Physical Review Materials 6, 013802 (2022).
[45] X. Chang, B. Chen, Q. Zeng, H. Wang, K. Chen, et al., Nature Communications 15, 8543 (2024).
[46] A. T. Bui and S. J. Cox, Physical Review Letters 134, 148001 (2025).
[47] P. Xie, R. Car, and W. E, Proceedings of the National Academy of Sciences 121, e2308668121 (2024).
[48] L. Lyu and H. Lei, Physical Review Letters 131, 177301 (2023).
[49] P. Ge, Z. Zhang, and H. Lei, Physical Review Letters 133, 077301 (2024).
[50] I. Steinbach, B. Böttger, J. Eiken, N. Warnken, and S. G. Fries, Journal of Phase Equilibria and Diffusion 28, 101 (2007).
[51] G. J. Martyna, M. L. Klein, and M. Tuckerman, The Journal of Chemical Physics 97, 2635 (1992).
[52] T. Schilling, Physics Reports 972, 1 (2022).
[53] A. Kuhnhold, H. Meyer, G. Amati, P. Pelagejcev, and T. Schilling, Physical Review E 100, 052140 (2019).
Appendix A: Additional figures
a

MD
AIPF
FH
Landau
Density profile
b
MD
AIPF
FH
Landau
Density profile

Figure A1. Equilibrium distribution of the Lennard-Jones mixture under external potentials. a,b, Equilibrium profiles are compared for hexagonal (a) and checkerboard (b) potentials at T = 1.20. Each row shows, from left to right, the imposed potential , with its magnitude indicated by the vertical axis, the coarse-grained composition field from molecular dynamics, the fields of the AIPF, Flory–Huggins (FH) and Landau models, and profiles from all four along . The fields of all three models are time averages of stochastic simulations started from a uniform composition. The external potentials and this temperature are not included in training.
a

b

c

d
e
Figure A2. Interface relaxation in the Lennard-Jones mixture. a,b, MD composition fields (a) and corresponding x-averaged profiles (b) at and in a box, with z horizontal. The temperature, , is not included in training. The composition contrast is defined as , where and are the upper and lower fitted plateaus of (right and left in b). c–e, Comparison of with MD at seven temperatures for the Landau (c), Flory–Huggins (d) and AIPF (e) models. Curves show means over four independent seeds for MD and each model, and bands show one standard deviation. In the stochastic model simulations, is clamped to at every step and the mean composition is restored. Below , the Landau model predicts coexistence compositions outside . In these gray panels of c, the subsequent increase in is a clamping artifact rather than physical interface relaxation.

Figure A3. Mixing free energy of the iron–boron melt. The Gibbs free energy of mixing per atom, , is shown as a function of boron fraction along the learned isobars at 0, 5 and 10 GPa. Colors indicate temperatures from 1200 to 2600 K in increments of 200 K. The corresponding spinodal regions are identified by the thermodynamic factor in Fig. 4a,c.
a

b

Figure A4. Comparison of computational scaling. a, GPU hours per simulated nanosecond and b, peak GPU memory as functions of the number of atoms for cubic boxes of the hydrogen–helium mixture at , 400 GPa and 9000 K. All runs use a single NVIDIA A100 GPU with 40 GB of memory. Molecular dynamics uses a MACE potential trained specifically for hydrogen–helium on vdW-DF data [36], with approximately parameters. Filled symbols denote the AIPF model simulated with a 5 fs time step and a grid spacing of approximately 0.7 Å. Open symbols, labeled ML potential, denote MD with a 0.2 fs time step. The dotted line indicates linear scaling with system size.
a




b




Figure A5. Mixing free energy and thermodynamic factor of hydrogen–helium. a, The Gibbs free energy of mixing per atom, , is shown as a function of helium fraction along the learned isobars at 200, 400, 600 and 800 GPa. Colors indicate temperatures from 2000 to 12 000 K in increments of 1000 K. Common tangents determine the binodal compositions. b, The corresponding thermodynamic factor (Eq. (4)). The dotted line marks ideal mixing ( ), and the solid line marks the spinodal boundary ( ). Negative values identify the spinodal region.
a
b


Figure A6. Learned bulk free energy of the Lennard-Jones mixture. a, The learned bulk free energy is shown with the binodal and spinodal compositions, where is the number fraction of species A. b, The composition curvature is negative in the spinodal region.

Figure A7. Comparison of the hydrogen–helium equation of state from the AIPF model and molecular dynamics. Number density n is shown as a function of helium fraction at 200, 400, 600 and 800 GPa. Colors indicate six isotherms from 2000 to 12 000 K in increments of 2000 K. Points denote molecular-dynamics reference states obtained with the machine-learning interatomic potential. Lines show the predictions of the AIPF model, obtained by solving the Euler relation (Eq. (12)) at each composition and temperature.



Figure A8. Agreement with the hydrogen–helium training anchors. The predictions of the AIPF model are compared with molecular-dynamics measurements at the homogeneous states used for the static and mobility anchors. These states span 6500–12000 K at 200, 400, 600 and 800 GPa. Marker shapes indicate pressure, colors indicate temperature, and dashed lines denote equality. The first panel compares calculated from the learned free-energy curvature with estimates from MD concentration fluctuations. The remaining panels compare the independent components of the symmetric Onsager mobility matrix, measured from short-time density changes. The cross-species mobility is negative at every state and is shown in magnitude.
Supplemental Material for “Learning ab initio phase-field models”
Mengyi Chen, Peichen Zhong, Zihan Zhang, and Qianxiao Li
Department of Mathematics, National University of Singapore, Singapore
Department of Materials Science and Engineering,
National University of Singapore, Singapore
Institute for Functional Intelligent Materials,
National University of Singapore, Singapore
(Dated: October 2, 2026)
CONTENTS
S1. Derivation of the mesoscopic model 2
A. Mori–Zwanzig formalism 2
B. Application to density fields 3
C. From the GLE to the mesoscopic model 5
S2. Numerical methods 10
A. Dynamics 10
B. Thermodynamics 11
S3. Experimental details and further results 12
A. Symmetric binary Lennard-Jones mixture 12
B. Iron–boron melt 15
C. Hydrogen–helium mixture 17
References 21
S1. DERIVATION OF THE MESOSCOPIC MODEL
A. Mori-Zwanzig formalism
We consider a general state space and the autonomous deterministic dynamics on it,
where is a microstate of the state space. We are interested in the dynamics of the observable , and write . The components are assumed functionally independent, with no identity relating them as functions of [1]. By the chain rule,
where is the Liouville operator, the generator of the flow on observables, so that . Let be an invariant probability distribution, so that and, for every admissible observable ,
Equation (1) follows from the stationarity of by the divergence theorem provided the flux vanishes on the boundary of the state space and at infinity. For the dynamics used below this holds because the positions are periodic and is compactly supported or decays at least exponentially in every other coordinate, so every observable of polynomial growth is admissible. For a fixed value , the Zwanzig projection maps an observable, also called a phase function, to its average over conditional on ,
(2)
Here is the equilibrium probability density of the resolved observables. Where , the free energy at fixed temperature is
Here T is the temperature of the ensemble , or any fixed positive constant when is microcanonical. It enters the exact relations below only through K and F together, in a combination that does not depend on it. For any admissible function h of the resolved observables, conditional expectation gives
Evaluating the conditional average at defines the projection on observables and its complement:
(5) so that, by eq. (4), and . We assume that the operator evolutions and exist on the observables used below.
The resolved variables then obey the standard generalized Langevin equation of the projection-operator formalism [1–5].
Theorem 1 (Generalized Langevin equation (GLE)). Under eq. (1) and the existence and regularity assumptions stated above, the resolved trajectory satisfies
with the drift, the fluctuating force and the memory kernel given by
The fluctuating force has zero conditional mean at every admissible resolved value,
For component indices , the divergence acts on the second matrix index:
B. Application to density fields
We consider molecular dynamics of atoms of each species in a periodic cell D of volume V, so z comprises the particle positions and momenta. Periodic boundary conditions are assumed throughout this section, so all fields are periodic and integrations by parts over D produce no boundary terms. For Hamiltonian dynamics in the microcanonical (NVE) ensemble this is the whole state space. For canonical (NVT) dynamics generated by a Nosé–Hoover thermostat [6], z also contains the thermostat variables, so the state space is the extended phase space of that scheme, on which the dynamics is deterministic.
For the density-field specialization below the cell is fixed, so particle of species and mass evolves by . For species with particles and every reciprocal-lattice wavevector of the cell , define the retained Fourier coefficients
Within the cutoff these are the Fourier coefficients of the microscopic number density . Since the positions are real,
Let be the vector of retained coefficients. Along a microscopic trajectory, write . The resolved density field is the inverse series of these coefficients, and its transform returns them,
(13)
The sum is finite by eq. (11), so is real and band-limited, and it shares its retained Fourier coefficients with the microscopic density while its higher ones vanish. The cutoff sets the spatial resolution. We write for the vector of species density fields. For any field f on D, let keep its retained Fourier coefficients,
so that .
We apply Theorem 1 with and write . The fixed resolved value is still denoted by . The entries of are not functionally independent, since eq. (12) ties to and fixes the zero modes. Following Zubarev and Morozov [7], the independent variables are the real and imaginary parts of over a half-space of wavevectors with . As in Zubarev and Morozov [7], we assume these variables to be functionally independent, so that the hypotheses of Theorem 1 apply to them. Every integral over and every derivative below is taken with respect to them, while the formulas are written in the complex coefficients over the full band for brevity. For , the chain rule gives
which is odd under reversal of all momenta, whereas and are even. Reversing the momenta in eq. (2) therefore gives , so the drift vanishes,
Substituting into eq. (6) yields
Here is the memory kernel, which describes how past density configurations affect the current evolution of the field. It is a matrix on the independent real density-mode indices. Derivatives with respect to act on the resolved-state argument before evaluation at the displayed state, and the divergence acts on the second matrix index as in eq. (10).
The fluctuating force and the memory kernel account for the eliminated momenta and density modes above . At a fixed initial resolved density , the fluctuating force has zero conditional mean by eq. (9), and satisfies the conditional fluctuation–dissipation relation [4] of eq. (8),
The free energy is defined by eq. (3) and is a functional of the retained density fields. These relations are exact under the stated conditions and impose neither a Markov assumption nor Gaussian noise.
C. From the GLE to the mesoscopic model
Equation (16) is exact, but evaluating its memory kernel and fluctuating force requires propagating the orthogonal dynamics, which is generally impractical [4]. We make three assumptions to obtain a tractable mesoscopic model. We retain the microscopic dynamics of section S1B and the density field defined in eq. (13). First, in many systems, such as simple fluids, fluid mixtures, and colloidal suspensions, the memory kernel decays on a time much shorter than the evolution of the resolved density modes [8, 9]. We therefore take the dynamics as Markovian, where the memory kernel is replaced by its time integral [1, 2, 4].
Assumption 1 (Markovian dynamics). We assume that the memory kernel and its first derivatives with respect to the resolved state decay on a time much shorter than the evolution time of every retained density mode. The time integral below is assumed to converge and to allow differentiation under the integral with respect to the resolved state. We define the integrated mobility and approximate the kernel by
The delta approximation is understood under time integration against slowly varying functions. We use the symmetric endpoint convention , so the one-sided kernel integral is . Only time lags contribute appreciably to the memory integral. During this interval, the density changes negligibly, so . For , the free-energy contribution therefore becomes
The first approximation freezes the density, and the second neglects the small remaining tail. The same steps apply to the divergence term, using differentiation under the integral. Thus
The fluctuation–dissipation relation in eq. (17), together with the delta approximation in eq. (18), gives
Before imposing the local-mobility approximation, we express the memory kernel in terms of correlations of orthogonally propagated currents. By eq. (7), , and , since the drift vanishes by eq. (15). Together with eq. (14), written as where is the microscopic current, and with the linearity of , which commutes with the constant vector , this gives with the orthogonally propagated current. Substituting into eq. (8) gives the exact form with , for every . Provided these current correlations are time integrable, the integrated mobility of eq. (18) admits the representation
(19)
where is a Cartesian tensor that depends on the resolved state , and below denotes the identity on the Cartesian indices. It is the double Fourier transform of a two-point tensor kernel , a functional of the whole density field. Explicitly, with the orthogonally propagated current field and its Fourier transform,
(20)
where is the time-integrated correlation of the current field, and the mobility operator acts as . The factors and express mass conservation, since every term of eq. (16) is a divergence and is constant. The next assumption restricts only .
Assumption 2 (Local mobility). We restrict in eq. (19) to the local and isotropic form , that is, , so that in the complex coefficients of section S1 B
(21)
is defined only for . Here is the local real-space mobility, a matrix on species indices. It is symmetric positive semidefinite and continuously differentiable in the local densities, with no dependence on density gradients or the field elsewhere. This local restriction makes the integrated mobility easier to identify from trajectory data. The density field is the one defined in eq. (13), and the same retained band is used for every species. No locality assumption is imposed on . All mode sums below run over the retained wavevectors, including both and .
Lemma 1 (Vanishing thermal drift). Under Assumption 2, the divergence of the mode-space mobility vanishes:
Proof. Equation (13) gives . Consequently,
This expression is independent of , so
The last sum vanishes because the retained band contains conjugate wavevector pairs. The coordinate transformation is linear, so the divergence also vanishes in the independent real coordinates.
Assumption 3 (Gaussian white noise). We assume that the eliminated variables equilibrate rapidly conditional on the current density, and replace the exact force by a white noise in the mode coordinates of that is zero-mean and Gaussian conditional on the current state , with conditional covariance
Such a process can be obtained in real space as follows. Let be a zero-mean Gaussian space-time white noise with
where i, j are Cartesian components, and set
with the field of the current resolved state and the square root the symmetric positive semidefinite one, which exists by Assumption 2. Its Fourier coefficients are retained only for ,
Conditional on a, they are zero-mean and jointly Gaussian, being linear in at fixed , and eqs. (21) and (23) give
which is eq. (22).
Using Lemma 1, the three assumptions give
interpreted in the Itô sense.
Theorem 2 (Conservative mesoscopic model). Under Assumptions 1–3, in real space eq. (25) reads
Proof. We compare the retained Fourier coefficients of eq. (26) with the mode equation eq. (25).
- Free-energy derivative. Write for the zero-mean variational derivative in the retained field space. Substituting the Fourier series of an admissible density variation gives
The positive exponential gives the coefficient at . Comparing with the differential of , with the complex coefficients treated as independent, yields
- Deterministic term. Substituting eqs. (21) and (27) into the mode drift gives
(28)
where the last line uses . To identify this expression, Fourier transform the real-space flux. Since ,
Taking the divergence multiplies this coefficient by . Thus and the sum over give exactly eq. (28). Here lies in the retained band, but the local function is not truncated before multiplication. Its coefficient at may lie outside that band.
The noise term of eq. (26) is eq. (24) by definition. Inverse transformation reconstructs the rate as
This is eq. (26), the projection coming from the retained-band indices of and in Assumptions 2 and 3.
In the main text eq. (26) is written without , as is customary for phase-field equations. The projection is nevertheless always in force, since the state is stored as the retained Fourier coefficients and the equation is solved in Fourier space, with the nonlinear terms evaluated in real space and their retained coefficients taken, which is eq. (29).
Theorem 3 (Mass conservation and invariant equilibrium). The model in eq. (26) preserves every and admits the invariant probability density
the equilibrium marginal of eq. (2), normalized by eq. (3).
Proof. The integral of a periodic divergence is zero, so
Read in the Itô sense, eq. (25) has drift and diffusion matrix , half the covariance in eq. (22). Its Fokker–Planck equation for the density of the real mode coordinates is
where by Lemma 1. Substituting eq. (30) gives
so the probability current vanishes and .
S2. NUMERICAL METHODS
We describe the two-species solver used for hydrogen–helium (H–He) and iron–boron (Fe–B), followed by the scalar implementation used for the Lennard-Jones mixture, and then the equilibrium density under an external potential. All mesoscopic simulations reported here include thermal noise. The same integration scheme can also be used for deterministic dynamics by omitting the stochastic contribution.
A. Dynamics
Discretization. We use a pseudospectral method on a periodic grid and represent the two density fields by their nonredundant Fourier coefficients . For simulations initialized from molecular dynamics, we coarse-grain the measured modes, normalize them by the system volume and map them onto the Fourier grid. The helium-rain simulation starts from the prescribed state described in Section S3. At each step, we differentiate the local free energy to obtain the local chemical potentials and evaluate the nonlocal contribution as . This matrix-vector product replaces direct real-space convolution, and the transformed kernel can be precomputed for a fixed kernel and grid. We compute the chemical-potential gradients spectrally, multiply them by the local mobility in real space and evaluate the resulting flux divergence spectrally.
Time integration. We use a first-order implicit–explicit (IMEX) scheme based on the reference linear operator
where is the mean initial density and is the Fourier-space Hessian of the learned free-energy functional , evaluated at this uniform reference state. Writing for the Fourier transform of the full deterministic term , we split it as
The first term is treated implicitly and the bracketed remainder explicitly. The added and subtracted linear terms cancel, so the reference linearization does not replace the full nonlinear dynamics. Including the stochastic contribution gives
where is evaluated at the current density fields and is the stochastic contribution defined below. Each Fourier mode requires only an independent linear solve, performed analytically, rather than a nonlinear solve over the full spatial grid. In the absence of noise and additional state projections, the update preserves the stationary solutions of the deterministic dynamics.
Stochastic contribution. At each step, we draw independent standard normal variables for each grid cell, species j and Cartesian direction d. We construct the stochastic flux from a Cholesky factor of the local mobility,
where is the grid-cell volume and repeated species indices are summed. This construction preserves the cross-species noise correlations specified by the off-diagonal mobility. We evaluate the flux divergence spectrally and apply the Gaussian filter used to define the coarse-grained fields. The resulting Fourier contribution is , whose zero mode is set to zero to conserve the number of each species. Evaluating the noise amplitude at the beginning of each step gives a semi-implicit Euler–Maruyama discretization in the Itô convention.
Lennard-Jones implementation. For the Lennard-Jones mixture, we use a scalar version of the same scheme to evolve the composition field, which is stored in real space. The reference linear operator is the Cahn–Hilliard gradient-energy stabilizer of the semi-implicit Fourier-spectral method [10, 11],
where is the gradient-energy coefficient given by the small-k expansion of the learned kernel, or the gradient coefficient of the baselines, and is the maximum of the local mobility over the domain at the current step. It replaces the learned Hessian of the two-species scheme. The noise construction, Gaussian filtering and zero-mode constraint follow the procedure above, with .
B. Thermodynamics
The external potential enters through the coupling term of Methods. At fixed chemical potentials , the equilibrium density minimizes the grand potential,
In the canonical ensemble, the particle numbers N are fixed and the equilibrium density minimizes subject to particle conservation,
subject to .
Both variational problems give the stationarity condition
which is the stationarity condition of the main text with the external potential retained. The chemical potentials are prescribed in the grand canonical ensemble and arise as Lagrange multipliers enforcing particle conservation in the canonical ensemble.
S3. EXPERIMENTAL DETAILS AND FURTHER RESULTS
A. Symmetric binary Lennard-Jones mixture
Model form. The Lennard-Jones mixture is nearly incompressible, so the local total density remains at every point, and the free energy and mobility depend only on the composition field . We impose symmetry under exchange of species A and B. The free energy comprises the parameter-free ideal part and the learned excess part,
The local energy is an even Taylor polynomial in , with terms of orders 2, 4, 6 and 8. The function is an input-convex neural network with one input and width 32, symmetrized under . The temperature-independent radial kernel is represented by a multilayer perceptron with two layers of width 16, multiplied by a quintic envelope that vanishes at .
The mobility is , where and . Both and are learned.
Training and validation data. The datasets and simulation conditions are summarized in table S1. Slab trajectories provide the dynamical training data. The trajectories at T = 1.20 are held out from training and model selection and used only for validation. Homogeneous cubes provide the mobility and bulk anchors at four temperatures, T = 1.50, 1.60, 1.70 and 1.80, with measurements averaged over three independent seeds at each temperature. Quench trajectories are excluded from training and used only to assess the predicted coarsening dynamics.
The dynamical residual compares an estimate of the time derivative over a window of frames with the model drift averaged over the same window. For fields saved at interval and a window centered at frame , the time derivative is estimated as
This estimator divides the difference between the mean fields over the following and preceding w frames by , the interval defined in the main text. We evaluate the model drift at evenly spaced frames within the same window and take a weighted average. The dynamical residual is the difference between this averaged drift and the estimated time derivative.
For the Lennard-Jones mixture, frames are saved every , and gives . Window centers are separated by 20 frames, and the drift is evaluated at frames per window. The loss averages over all windows and training trajectories. To prevent strongly
| Particles | 3456 | 4000 | 6912 |
|---|---|---|---|
| Cells | |||
| Temperatures | 1.00–1.70 | 1.50, 1.60, 1.70, 1.80 | 1.10–1.30 |
| Production () | 20 000 | 5000 | 10 000 |
Table S1. Microscopic simulations used for the Lennard-Jones mixture. All three datasets use the force-shifted pair potential described in Methods, with , total density and mean composition . Trajectories are generated by overdamped Langevin dynamics with and a time step of . Configurations are saved every . Slab trajectories provide the dynamical training data, with held out from both training and model selection. Homogeneous cubes provide the bulk and mobility anchors. Quench cubes are used exclusively to validate spinodal decomposition. Two additional systems of 55 296 particles are simulated with an underdamped integrator under checkerboard and hexagonal external potentials. These runs sample equilibrium density profiles and are excluded from training.
driven trajectories from dominating, trajectory is weighted by , where is the mean squared band-limited norm of its estimated time derivative and is the median across trajectories.
The training loss is , with unit weight for the dynamical term and . We use neither a finite-wavevector static anchor nor an isobar anchor, and impose no additional constraint term for this symmetric mixture at fixed total density.
Anchor measurements. Configurations are saved every . We estimate the mobility from the covariance of density-mode increments at a lag of , averaged over , after analytically deconvolving the Gaussian coarse-graining filter. For the bulk anchor, we fit the low- concentration structure factor to the Ornstein–Zernike form and extrapolate to obtain . At each temperature, the anchor compares the learned free-energy curvature at equimolar composition with , weighted by the standard error of the intercept across seeds. The bulk anchor therefore constrains only the zero-wavevector curvature at .
Domain growth. We characterize spinodal decomposition by a length scale obtained from the inverse first moment of the composition spectrum,
where . For molecular dynamics, , with the Gaussian coarse-graining filter applied analytically to the bare particle modes. For the initio phase-field (AIPF) model, is the Fourier amplitude of the already coarse-grained composition field. This construction gives the same estimator for both descriptions. The sums include individual modes on the box's wavevector lattice over . We avoid shell a

1.0
0.5
0.0
b

t [τ]
C

1.0
0.5
0.0
d
t [τ]
e

1.0
0.5
0.0
f
t [τ]
g

1.0
0.5
0.0
h
t [τ]
Figure S1. Coarsening of the Lennard-Jones mixture. Results at T = 1.10, 1.15, 1.25 and 1.30 are shown from top to bottom, complementing the results at T = 1.20 in the main text. a,c,e,g, Composition fields from the ab initio phase-field (AIPF) model at four times. b,d,f,h, Domain size , defined in eq. (32), compared between three independent molecular dynamics (MD) runs and three independent AIPF runs.
averaging because replacing wavevectors by shell centers imposes an artificial upper limit on that is reached during these runs.
We extract the growth exponent from the slope of against , using a window after the initial transient and before finite-size saturation. For each method, we select the half-decade with the steepest slope within this interval. The quoted uncertainty represents the scatter across independent seeds. At the present box size, the local slope does not reach a plateau. The fitted is therefore an effective, window-dependent exponent rather than an asymptotic growth law. Distinguishing candidate asymptotic laws would require a box several times larger.
We evaluate the growth exponent at five quench temperatures between 1.10 and 1.30 (fig. S1). Agreement is closest at T = 1.20, the case shown in the main text. The largest discrepancy occurs at T = 1.10, where the AIPF model gives , compared with from molecular dynamics.
B. Iron-boron melt
Model form. We describe the melt by the species-density fields . The free-energy functional comprises the parameter-free ideal contribution , with in , and the learned excess contribution
The ideal contribution differs from the form given in Methods by , where is the thermal wavelength of species . This term is linear in the densities at fixed temperature and changes neither the pressure nor the free energy of mixing. The local function is a multilayer perceptron of the two densities and the temperature, with architecture and GELU activations. The temperature-independent, symmetric kernel contains three radial components corresponding to B–B, B–Fe and Fe–Fe interactions. Each component is represented by a perceptron of the separation, multiplied by a quintic envelope that vanishes at .
The mobility is parametrized as , with and . A perceptron of the densities supplies the lower-triangular factor , which makes positive semidefinite by construction. The temperature dependence is , with and one learned activation energy for each species.
Training data and state selection. The molecular-dynamics datasets cover 0, 5 and 10 GPa, with the same grid of 145 state points at each pressure (table S2). The temperatures are K. At each temperature, the boron fractions are , with additional points at for 1500 and 1800 K.
We classify each state from the concentration structure factor . A state is spinodal when and coarsening is confirmed on a trajectory of at least 200 ps. Coarsening requires that the peak of either moves toward the smallest wavevector of the box or stays at a finite wavevector while its amplitude grows, and that the peak exceeds five times the background without declining at the end of the trajectory. A state is stable when three conditions hold. First, . Second, the Ornstein–Zernike estimate of rests on at least 100 independent samples of the long-wavelength composition modes, which corresponds to a relative error of 10%. Third, the long-wavelength band shows no growth over the second half of the trajectory, meaning that the late-to-early change in its amplitude is within 1.5 standard deviations and the series is stationary. All other states are classified as unresolved.
States are excluded from all trajectory-based loss terms if or if the slower species diffuses less than one bond length over the trajectory, as determined by . The remaining trajectories contribute to the dynamical loss. Stable states that also satisfy the anchor-selection threshold provide the static and mobility anchors. Separate equation-of-state calculations provide the isobar anchor.
Training objective and constraints. The dynamical residual uses the estimator of eq. (31), with frames saved every 0.1 ps, giving ps. Window centers
| 0 GPa | 5 GPa | 10 GPa | |
|---|---|---|---|
| State points | 145 | 145 | 145 |
| Runs | 156 | 159 | 149 |
| Production (ps) | 50 to 500, per state point | ||
| Spinodal / stable / unresolved | 12 / 88 / 45 | 8 / 81 / 56 | 4 / 72 / 69 |
| Excluded from training | 31 | 36 | 41 |
| Equation-of-state rows | 208 | 106 | 128 |
Table S2. Molecular-dynamics datasets for the iron–boron melt. Trajectories are generated for homogeneous cubes of 3456 atoms in the isotropic isothermal–isobaric (NPT) ensemble using the fine-tuned MACE potential of Zhang et al. [12]. Each system is melted at 2600 K for 10 ps before simulation at the target temperature. The time step is 1 fs, and configurations are saved every 0.1 ps. The state-point grid and selection criteria are described in the text. Retained trajectories provide the dynamical training data, and stable states that satisfy the anchor-selection threshold also provide the static and mobility anchors. Separate equation-of-state calculations use 512 atoms, with 5 ps each for melting, equilibration and averaging, and provide the isobar anchor.
are spaced every 40 frames, and . All trajectories carry equal weight. The model is evaluated at states midway between consecutive frames.
The loss is . The dynamical term sums the contributions from nonequilibrium and stable runs at all three pressures, with . The remaining weights are , , , and . The hinge penalty penalizes violations of the lower bound on , with .
We impose no convexity penalty on the local free energy and no prior on the thermodynamic factor. This allows the local free energy to become nonconvex in the boron-rich region where the instability is observed.
The isobar anchor compares the model's Euler pressure with the target pressure of each equation-of-state state point,
where and the denominator avoids division by zero at ambient pressure. All three target pressures lie at or below , so the same denominator applies to every state and the penalty measures the squared absolute pressure residual in units of .
Anchor measurements. Configurations are saved every 0.1 ps. We evaluate the apparent mobility at lags of one to ten frames, fit its diffusive branch linearly in for each wavevector shell and extrapolate to . The resulting shell intercepts are then extrapolated linearly in to obtain the zero-wavevector mobility. The static anchor uses measured shells up to , whereas the Ornstein–Zernike fit uses .
Equation of state. We assess the fit to the isobar constraint using the 442 reference states (fig. S2). At each reference composition and temperature, we solve the model pressure equation by bisection to obtain the density at the target pressure.

Figure S2. Equation of state of the iron–boron melt at 0, 5 and 10 GPa. Number density n is shown as a function of boron fraction along six isotherms between 1200 and 2600 K, distinguished by color. Points denote molecular-dynamics reference states obtained with the fine-tuned potential. Lines show the learned isobars, calculated by solving the model pressure equation at fixed composition and temperature. The 442 reference states are included in the isobar anchor during training, so this comparison assesses the fit to that constraint.
C. Hydrogen-helium mixture
Model form. We describe the mixture by the species-density fields . The free-energy functional comprises the parameter-free ideal contribution , with in , and the learned excess contribution
The ideal contribution uses the same convention as for the iron–boron melt. The local functions , and are multilayer perceptrons with architecture , GELU activations and widths , 32 and 16, respectively. The reference temperature is . Before training, the basis function is orthogonalized against 1 and over 9000–12 000 K. This redistributes its constant and linear parts among , and without changing the space spanned by the basis functions. The temperature-independent, symmetric kernel contains three radial components corresponding to H–H, H–He and He–He interactions. Each component is represented by a perceptron of the separation, multiplied by a quintic envelope that vanishes at .
The mobility is parametrized as , where and a perceptron of the densities supplies the lower-triangular factor . This parametrization makes positive semidefinite by construction. No explicit temperature factor is included.
Training data. The AIPF model is trained on molecular-dynamics trajectories generated with a machine-learning potential at 200, 400, 600 and 800 GPa. The datasets comprise slabs, homogeneous cubes and equation-of-state calculations, as summarized in table S3. Slabs and cubes provide the dynamical training data. Cubes that satisfy the temperature and single-phase criteria described below also provide the static, bulk and mobility anchors. All 484 equation-of-state rows contribute to the isobar anchor.
| Slabs | Homogeneous cubes | Equation of state | |
|---|---|---|---|
| Atoms | 2000–4700 | 3456 | 512 |
| Ensemble | NPT, z only | NPT, isotropic | NPT, isotropic |
| Time step (fs) | 0.1 | 0.2 | 0.2 |
| Production (ps) | 40 | 30 | 1 |
| Runs at 200, 400, 600, 800 GPa | 48, 56, 64, 88 | 79, 90, 101, 133 | 121 rows each |
Table S3. Molecular-dynamics datasets for hydrogen–helium. All runs use the MACE potential of Wang, Hamel and Cheng [13], a Nosé–Hoover thermostat and a Martyna–Tobias–Klein barostat. Configurations are saved every 0.02 ps. Slabs are initialized with a double hyperbolic-tangent composition profile containing two interfaces in a box, with pressure control applied only along the interface normal. Cubes are melted for 1.5 ps at 2000 K above the target temperature before production. At 800 GPa, cube simulations span 2000–12 000 K in increments of 1000 K and helium fractions of 0.05–0.98. At each lower pressure, they span helium fractions of 0.05–0.95 at temperatures on both sides of the critical line. Slabs and cubes contribute to the dynamical loss. The 98 cube runs that meet the temperature and single-phase criteria also provide the static, bulk and mobility anchors. The 484 equation-of-state rows provide the isobar anchor and the density paths for the thermodynamic-factor prior.
At each pressure and temperature, we simulate slabs with eight composition pairs. The temperature grids start at 2000 K with increments of 1000 K and contain 6, 7, 8 and 11 temperatures at 200, 400, 600 and 800 GPa, respectively. This gives 48, 56, 64 and 88 slab runs. At the three lower pressures, the composition pairs are (0.05, 0.50), (0.05, 0.95), (0.15, 0.85), (0.25, 0.75), (0.35, 0.65), (0.40, 0.60), (0.45, 0.55) and (0.50, 0.95). At 800 GPa, where the miscibility gap is widest, we use pairs closer to the pure components, (0.00, 0.90), (0.00, 1.00), (0.10, 0.80), (0.10, 0.90), (0.10, 1.00), (0.20, 0.80), (0.20, 0.90) and (0.30, 0.70). Slab trajectories contribute only to the dynamical loss.
The dynamical residual uses the estimator of eq. (31), with frames saved every 0.02 ps, giving ps. Window centers are spaced every 10 frames, and . Trajectories are weighted as for the Lennard-Jones mixture.
The cube datasets contain 79, 90, 101 and 133 runs at the four pressures. Their roles in training are shown in fig. S3. Anchor data are restricted to temperatures above 6100, 7800, 8800 and 8973 K, respectively, because uncertainties in the concentration structure factor are underestimated below these thresholds. Runs must also remain single phase over the sampled interval. These criteria select 22, 22, 22 and 32 cube runs for the anchors, giving 98 in total. All other cube runs contribute only to the dynamical loss.




Figure S3. Coverage of the hydrogen–helium cube datasets at the four training pressures. Each run is shown at its helium fraction and temperature. Rust denotes runs used only for the dynamical loss. Navy denotes runs that also provide the static, bulk and mobility anchors. Anchor selection requires temperatures above 6100, 7800, 8800 and 8973 K at 200, 400, 600 and 800 GPa, respectively, and single-phase behavior over the sampled interval. Runs below these thresholds are excluded from the anchors because the uncertainty in the concentration structure factor is underestimated. The datasets contain 79, 90, 101 and 133 cube runs at the four pressures, of which 22, 22, 22 and 32 provide anchor data.
Training objective and anchor measurements. The loss is . The eight dynamical terms correspond to the slab and cube datasets at each of the four pressures and enter with unit weight. The remaining weights are , , , , and . The weights were set by a coarse sweep over a few values of each, judged by the fit to the anchors, the equation of state and the dynamical residual on the training data.
Configurations are saved every 0.02 ps. We evaluate the apparent mobility at lags of one to ten frames and exclude lags shorter than 0.06 ps, where fast nonhydrodynamic fluctuations introduce a lag-independent contribution to the increment variance. For each wavevector shell, we fit the diffusive branch of the apparent mobility linearly in and extrapolate to . We then obtain by fitting the shell intercepts to a universal kernel shape over , with one fitted parameter. The static anchor uses measured shells up to , whereas is obtained from an Ornstein–Zernike fit over .
The isobar anchor compares the model's Euler pressure with the target pressure of each equation-of-state state point,
Normalizing each residual by its target pressure gives a relative-error penalty, so that the weight has the same interpretation at all four pressures.
Functional constraints. Two additional one-sided penalties constrain the shape of the learned functional. They encode modeling priors and vanish wherever their respective conditions are satisfied.
The first penalizes deviations from convexity of the local free energy. Let be the smallest eigenvalue of and a fixed margin. We define
The penalty is zero for and grows quadratically below this threshold. We estimate the average by Monte Carlo sampling. At each optimization step, we draw new points uniformly within the density trust region and uniformly in logarithmic temperature over the training range. The nonlocal kernel is excluded from this penalty. Enforcing local convexity assigns the bulk demixing instability to rather than to the local free energy. This separation is a modeling choice.
The second penalty constrains the composition dependence of the thermodynamic factor,
It penalizes negative curvature of , with no additional margin. We evaluate from the local Hessian and along measured equation-of-state density paths. We compute its second derivative using a five-point stencil. The average is restricted to the interior of the sampled composition range. Dilute compositions are excluded to avoid penalizing their physical curvature. Pressure and temperature paths are resampled at each optimization step.
Helium-rain simulation. The helium-rain panels in the main text are obtained from a single stochastic simulation of the learned model using the Fourier pseudospectral scheme described in Section S2. We use a grid with spacing and periodic boundaries in all three directions. The full computational domain measures nm and corresponds to approximately 4.4 million atoms. The gravitational potential and prescribed temperature profile are extended by reflection along the vertical direction and smoothed near the reflection planes to maintain periodicity. No reflection symmetry is imposed on the density fields or stochastic noise, so these planes do not impose reflecting boundary conditions. The main-text panels show one half of the periodic domain, measuring nm and corresponding to approximately 2.2 million atoms.
The initial density fields are uniform, with protosolar composition and total number density , corresponding to the equilibrium density at 400 GPa. Within the displayed half-domain, the fixed temperature profile increases from 3700 K at the top to 3900 K at the bottom and is linear away from the 8 Å smoothing layers at each end. The entire domain is initially metastable, with both ends inside the binodal and outside the spinodal. The temperature profile thus produces a gradient in supersaturation without crossing a phase boundary. Gravity is imposed through an external potential linear in height, with , approximately times Saturn’s gravity. This value gives a Bond number of 4.00 over the free height of 163.2 Å, which is the physical height of 179.2 Å minus an 8 Å layer at each end over which gravity is smoothly switched off, matching the ratio of gravitational to interfacial forces in a planetary rain zone thousands of kilometers deep.
We integrate the model using the stochastic scheme described in Section S2, with a time step of ps and the noise amplitude set by the fluctuation–dissipation relation. Density fields are saved every 2 ps. We use a single noise seed and show the first nanosecond in the main-text panels.
[1] H. Grabert, Projection Operator Techniques in Nonequilibrium Statistical Mechanics, Springer Tracts in Modern Physics, Vol. 95 (Springer, Berlin, Heidelberg, 1982) p. 166.
[2] R. Zwanzig, Physical Review 124, 983 (1961).
[3] H. Mori, Progress of Theoretical Physics 33, 423 (1965).
[4] C. Hijón, P. Español, E. Vanden-Eijnden, and R. Delgado-Buscalioni, Faraday Discussions 144, 301 (2010).
[5] T. Schilling, Physics Reports 972, 1 (2022).
[6] G. J. Martyna, M. L. Klein, and M. Tuckerman, The Journal of Chemical Physics 97, 2635 (1992).
[7] D. Zubarev and V. Morozov, Physica A: Statistical Mechanics and its Applications 120, 411 (1983).
[8] J. M. Ortiz de Zárate and J. V. Sengers, Hydrodynamic Fluctuations in Fluids and Fluid Mixtures (Elsevier, Amsterdam, 2006).
[9] M. te Vrugt, H. Löwen, and R. Wittkowski, Advances in Physics 69, 121 (2020).
[10] L. Q. Chen and J. Shen, Computer Physics Communications 108, 147 (1998).
[11] J. Zhu, L.-Q. Chen, J. Shen, and V. Tikare, Physical Review E 60, 3564 (1999).
[12] Z. Zhang, M. Chen, Q. Li, and P. Zhong, Interfacial melting as a thermodynamic indicator of solid-state synthesizability (2026), arXiv:2606.22885.
[13] X. Wang, S. Hamel, and B. Cheng, Nature Communications 17, 10382 (2026).