Manuscript Offprint
arXiv:2610.27136Ammonia-Hydrogen Phase Equilibria in Planetary Envelopes from First-Principles-Based Machine-Learning Molecular Dynamics
ABSTRACT
Ammonia and hydrogen are major constituents of planets within and beyond the solar system, yet how they interact in planetary envelopes is poorly known. We perform large-scale two-phase coexistence simulations of the ammonia-hydrogen system from 500 to 4000 K and 0.1 to 100 GPa, driven by machine-learning interatomic potentials trained on density functional theory calculations. From these we map the compositions of coexisting hydrogen-rich and ammonia-rich phases, and the critical curve that separates conditions of complete miscibility from those of phase separation. The critical temperature increases with pressure, from 500 K at 0.1 GPa to 2000 K near 30 GPa, and we find no phase separation at 3000 and 4000 K up to 100 GPa. The slope of the critical curve decreases substantially between 0.3 and 30 GPa, and the curve nearly flattens above about 30 GPa and 2000 K, where molecules begin to give way to atomic species. The coexistence curves are asymmetric with an ammonia-rich critical composition. For the expected envelope compositions, the phase boundary lies close to, and intersects, published thermal profiles of Uranus and Neptune, implying ammonia may be raining out in these planets today. In contrast, in warm sub-Neptunes such as TOI-270 d, ammonia and hydrogen are likely miscible in all proportions. Together with previous studies, our results suggest that silicates, water and ammonia separate from hydrogen in sequence as planets cool, with implications for their compositional, thermal and structural evolution.
Keywords: Quantum-chemical calculations(2232) - Exoplanets(498) - Exoplanet atmospheres(487) - Mini Neptunes(1063) - Uranus(1751) - Neptune(1096) - Interdisciplinary astronomy(804) - Neural networks(1933) - Computational methods(1965) - Hot Neptunes(754)
1. INTRODUCTION
Hydrogen is the main constituent of the envelopes of giant planets and of many sub-Neptunes, and ammonia, together with water and methane, is one of the planetary “ices” thought to make up much of the interiors of Uranus and Neptune (e.g., Hubbard & Macfarlane 1980). Ammonia has been measured directly in the atmospheres of Jupiter and Saturn (e.g., Giles et al. 2017; Irwin et al. 2025). Beyond the solar system, ammonia has been proposed as a potential biosignature (Phillips et al. 2021), and its abundance in the atmospheres of warm sub-Neptunes such as K2-18 b and TOI-270 d has been used to constrain the presence of liquid-water oceans beneath them (Hu et al. 2021; Madhusudhan et al. 2023a).
The phase behavior of pure ammonia has been studied extensively across planetary conditions, with experiments and first-principles calculations revealing molecular, ionic, superionic, and conducting states from sub-GPa pressures to hundreds of GPa and from hundreds to several thousand kelvin (e.g., Bethkenhagen et al. 2013; Ninet et al. 2012; Queyroux et al. 2019; Cavazzoni et al. 1999; Hernandez et al. 2023). In the envelopes of ice giants and sub-Neptunes, however, ammonia is mixed with hydrogen at conditions where hydrogen interacts strongly with other planetary materials. Recent theoretical, computational, and experiment-
Corresponding author: Akash Gupta; Jie Deng
akashgpt@princeton.edu; jie.deng@princeton.edu
- 51 Pegasi b Fellow
Future Faculty in Physical Sciences Fellow
Harry H. Hess Postdoctoral Fellow t = 0
t = 2 nanoseconds


Hydrogen (H)
Nitrogen (N)
Gibbs dividing surface
Time (ns)
Figure 1. A two-phase coexistence simulation at 1000 K and 7 GPa, containing 4096 H₂ and 2048 NH₃ molecules (16,384 atoms). Blue spheres are nitrogen atoms and gray spheres are hydrogen atoms. Top: the initial condition, in which slabs of pure ammonia and pure hydrogen are joined (left), followed by a perspective view and a side view of the system after 2 ns. The brown surfaces are the Gibbs dividing surfaces between the ammonia-rich and hydrogen-rich phases (Willard & Chandler 2010). The rightmost panel shows the mass density along the long axis of the cell after 2 ns; symbols are simulation results and the solid curve is the theoretically motivated hyperbolic-tangent profile expected for coexisting phases (Cahn & Hilliard 1958; Widom 1982). Dashed lines mark the determined interface positions and shaded bands reflect the interface widths. Bottom: total energy and composition of each phase as a function of time; the final 0.5 ns (darker) is the window over which the compositions are averaged.
tal studies have shown that hydrogen can react with, dissolve in, or separate from silicates and water at such conditions (e.g., Gupta et al. 2025; Gilmore & Stixrude 2026; Horn et al. 2025; Bali et al. 2013; Rogers et al. 2025; Tejada Arevalo et al. 2026). Whether ammonia and hydrogen mix or separate matters for these planets: separation releases gravitational energy as the denser phase sinks, and builds composition gradients that can inhibit convection (Stevenson & Salpeter 1977a; Leconte & Chabrier 2012). Yet the ammonia-hydrogen system remains poorly constrained. Measurements exist only below the critical point of ammonia, at temperatures below about 400 K, where they find limited mutual solubility and extensive phase separation with increasing pressure (e.g., Wiebe & Tremearne 1934; Wiebe & Gaddy 1937; Krichevskii & Khazanova 1939; Michels et al. 1950; Reamer & Sage 1959; Bar-Eli & Klein 1961; Kaminishi & Toriumi 1962; Heise 1972; Moore & Otto 1972; Ahrens & Heusler 1981; Chidester & Strobel 2011). Experiments at more extreme conditions of planetary envelopes and interiors are challenging.
Determining these phase equilibria at planetary conditions requires a method that remains accurate where molecules dissociate, ionize and react. Density functional theory (DFT) describes such materials without prior assumptions about their bonding, and DFT-based molecular dynamics (DFT-MD) has long been used to study planetary materials, including superionic water and ammonia (Cavazzoni et al. 1999; Bethkenhagen et al. 2013), the transport properties of hydrogen (French et al. 2012) and the phase separation of hydrogen and helium (Morales et al. 2009; Schöttler & Redmer 2018). Simulating two coexisting phases, however, requires cells large enough to hold both phases and their interface, and runs long enough for their compositions to equilibrate, which for ammonia and hydrogen are beyond the reach of DFT-MD.
Machine-learning interatomic potentials (MLPs) trained on DFT energies, forces and stresses lift this limitation, retaining near-DFT accuracy at a cost that is orders of magnitude lower and grows linearly with the number of atoms, whereas the cost of DFT-MD grows as its cube (Behler & Parrinello 2007; Zhang et al. 2018). They have been used, for example, to compute the phase diagram of water (Zhang et al. 2021) and the melting curve of (Deng et al. 2023). A potential that is reliable over a wide range of conditions must, however, be trained on configurations of every relevant phase and of the interfaces between them, which simulations at single state points rarely visit. We therefore build our MLP using active learning, combining enhanced sampling, descriptor-based selection of configurations and DFT recalculation (Appendix A).
With this potential, we simulate coexisting ammonia and hydrogen mixtures in cells of 16,000-70,000 atoms for up to several nanoseconds, at 500-4000 K and 0.1-100 GPa. These simulations map where ammonia and hydrogen form a single homogeneous phase and where they separate into two phases of distinct composition. From them we determine the coexistence (binodal) surface and the critical curve, which nearly flattens above about 30 GPa and 2000 K, where molecules begin to give way to atomic species. Comparison with models of Uranus and Neptune shows that ammonia may separate from hydrogen in their envelopes today, at depths that depend on the interior model. In warm sub-Neptunes such as TOI-270 d, by contrast, ammonia and hydrogen are likely miscible in all proportions.
2.1. Phase coexistence and separation
We use large-scale phase coexistence MD simulations to determine phase equilibria in the system. These simulations are driven by machine-learning interatomic potentials (MLPs) trained on high-fidelity data from DFT calculations. Under this framework, each simulation starts from two equilibrated slabs of fluid, one of pure and one of pure , placed in contact across a planar interface (left panel, Figure 1; Gupta et al. 2025; Insixiengmay & Stixrude 2025; Gilmore & Stixrude 2026). This setup is then allowed to evolve for several nanoseconds until energy and compositional equilibrium is reached (bottom panels, Figure 1). We then perform statistical analysis of the last 0.5 nanoseconds of the simulation.
Our simulations cover temperatures of 500-4000 K and pressures of 0.1-100 GPa (1 to kbar). Across these P-T conditions, we find ammonia and hydrogen either exist as one homogeneous fluid or phase-separate into two compositionally distinct phases existing in dynamic equilibrium: one richer in hydrogen and the other in ammonia. Mapping the compositions x of the homogeneous or coexisting phases across temperatures (T) and pressures (P) allows us to estimate the critical curve which delineates the P-T-x stability regime of single homogeneous fluid of ammonia and hydrogen.
We express the composition of each phase as its mole fraction of hydrogen
in which counts the atoms or molecules of species i. The two coexisting phases are identified with a three-dimensional Gibbs dividing surface constructed from a coarse-grained density field over the analysis window.
Figure 2 shows the compositions of the coexisting phases as a function of pressure at six temperatures. A coexistence or binodal curve defines the boundary between the single-phase and two-phase regions in the composition-pressure space at some temperature. A continuum of these across temperatures is defined as a coexistence or binodal surface. This figure shows that at the lowest pressure end of 0.1 GPa, hydrogen and ammonia are completely miscible across the explored T-P regime. As the pressure increases, the fluid mixture becomes unstable and separates into two phases whose compositions diverge. At a given temperature, the two coexistence branches merge at the critical pressure and critical composition . The exceptions are the two highest-temperature isotherms we explored: 3000 and 4000 K. At these temperatures, we do not find any demixing even at pressures of GPa which is on the higher end of possible pressures at the atmosphere-interior boundary (Nettelmann et al. 2013). We describe this phase diagram with an asymmetric (subregular) solution model whose mixing parameters depend on temperature (Methods).
We find the coexistence curves between 500 to 2000 K are asymmetric, with an ammonia-rich critical composition of . In other words, at a certain P-T condition, an ammonia-rich phase has less hydrogen dissolved in it in comparison to the amount of ammonia that could dissolve into the hydrogen-rich fluid.
In Figure 3, we show how the critical curve (black solid line) of the system changes across the temperature-pressure space. The critical curve separates the conditions under which ammonia and hydrogen mix in all proportions as a single homogeneous fluid from those under which they can separate into two phases, one richer in hydrogen and the other in ammonia, traced

Composition
Figure 2. Compositions of coexisting phases as a function of pressure at six temperatures. Filled circles are the measured compositions of each phase in simulations that result in two phases, with bands indicating their variation in time, and open circles show the compositions of simulations that remain a single homogeneous fluid. The solid curves are the posterior-median coexistence curves from our thermodynamic model, with shaded envelopes (see Methods). The simulations have bulk compositions of and 0.33, and contain between 16,384 and 70,304 atoms. No simulation at 3000 or 4000 K separates into two phases at any pressure that we sampled and thus the coexistence curve shown at 3000 K is only partially constrained.
by the two branches of the coexistence curves (Figure 2). At each temperature it gives the critical pressure at which these two branches merge, or equivalently, at each pressure, the critical temperature above which the two fluids mix in all proportions. We find that the critical pressure rises monotonically with temperature. From a critical pressure of GPa at 500 K, it increases to GPa at 2000 K. The top panel in Figure 4 demonstrates that the critical curve slope decreases continuously with increasing pressure: from K/GPa at 0.3 GPa to K/GPa at 30 GPa, where K. Beyond GPa, the critical curve flattens to a gradient of K/GPa at 100 GPa. The critical pressure consequently rapidly rises beyond 100 GPa above 3000 K.
In Figure 3, we also show as a gray line the isopleth of the coexistence surface at , that is, the boundary of two-phase stability for a mixture of this fixed composition. This is motivated by constraints on the bulk metallicity of the envelopes of Uranus and Neptune, (Nettelmann et al. 2013; Scheibe et al. 2019). Assuming an O:C:N ratio of 7:4:1 (Asplund et al. 2009), this implies for the binary mixture.

Pressure (kbar)

Figure 3. Phase diagram of the ammonia (NH₃)-hydrogen (H₂) system in pressure and temperature space. The bold black line with its gray 2σ band is the critical curve from our thermodynamic model delineating the regimes of phase stability (turquoise shading). Above 2000 K the critical curve is only partially constrained because none of the simulations at 3000-4000 K phase-separate up to 100 GPa. The bold dashed line below 500 K is physically motivated by previous work on hydrogen-water fluids (Seward & Franck 1981; Gupta et al. 2025) and joins our results to the critical point of pure ammonia (pink square) and its condensation curve (Gao et al. 2023). The gray solid line, with its 2σ band, denotes the isopleth of the coexistence surface at xH₂ ~ 0.9, as expected in the deep envelopes of Uranus and Neptune (Nettelmann et al. 2013; Scheibe et al. 2019). It is extended to experimental results from Reamer & Sage (1959) and Heise (1972). Also shown are model P-T profiles for Uranus (orange) and Neptune (purple) from Nettelmann et al. (2013) (solid lines) and Tejada Arevalo (2025) (dashed lines). The red lines are P-T profiles of TOI-270 d from Rigby & Madhusudhan (2026) for internal temperatures of 25 K (dark red) and 50 K (light red). The pressure axis is logarithmic at low pressure and linear at high pressure. Comparison of the critical curve and this isopleth with the model profiles of Uranus, Neptune, and TOI-270 d suggests that while ammonia and hydrogen are likely fully miscible in the envelopes of warm sub-Neptunes, Uranus and Neptune may be undergoing ammonia rain today, at depths that depend on assumptions about the initial conditions and evolution of these planets.
Finally, Figure 3 compares the critical curve with model P-T profiles of planets with hydrogen-rich envelopes. The profiles of Nettelmann et al. (2013) cross the extended critical curve at 0.07 GPa and then lie within its band up to 1-2 GPa; they cross the isopleth at 0.02 GPa (200 bar). The colder profiles of Tejada Arevalo (2025) lie close to or below this isopleth down to 7 GPa. The profiles of TOI-270 d from Rigby & Madhusudhan (2026) lie well within the one-phase stability region. It should be noted though that this is not a self-consistent comparison as these planet modeling studies did not account for phase separation within the envelopes and its energetic and structural implications for the planet's evolution.
2.2. Molecular-to-atomic transition
To understand these changes in the critical curve, we analyze the structure and bonding of homogeneous mixtures, simulated along the critical curve up to 3000 K and above it at 4000 K at the highest pressures explored.
We find that the flattening of the critical curve follows the molecular-to-atomic transition of the fluid (bottom panel, Figure 4). Below 2000 K and 10 GPa, the fluid is primarily molecular and , with trace amounts of . Between 2000 K, 10 GPa and 3000 K, 100 GPa, we see a gradual increase in the fraction of atomic H and single-, double- and triple-dissociated ammonia species, namely, , NH, N. Degree of dissociation for also rises with increasing temperature and pressure along the critical curve. At K nearly all nitrogen atoms are in molecules. At 3000 K the fraction of nitrogen atoms in falls to about 70 and 50 percent at 50 and 70 GPa, and at 4000 K and 100-120 GPa it falls to about 5 percent. These are fractions of nitrogen atoms for a 100 fs persistence window (Methods), whereas Figure 4 shows the fractions of species. becomes prominent at 3000 K, while NH and N account for larger nitrogen fractions at 4000 K.
The observed molecular-to-atomic transition of H occurs at conditions similar to those of the molecular-to-atomic transition in pure hydrogen (e.g., McWilliams et al. 2016) and in first-principles work on other H-bearing systems such as water-hydrogen mixtures (Gupta et al. 2025). Similarly, the dissociation of nitrogen species is consistent with past laboratory experiments and theoretical calculations (Bethkenhagen et al. 2013; Ravasio et al. 2021).
3. DISCUSSION
Our results delineate the conditions under which ammonia and hydrogen mix in all proportions and when they rather separate into two phases. The critical curve and the coexistence surface that bound these conditions run close to, and in places cross, the P-T profiles inferred for the envelopes of Uranus and Neptune, but lie well below those of warm sub-Neptunes (Figure 3). Whether and at what depth ammonia separates from hydrogen in a planet therefore depends on its temperature profile and bulk composition. This has implications for the compositional and thermal evolution of such planets, and for connecting observations of their atmospheres to their deep envelopes and interiors.
3.1. Phase separation in Uranus and Neptune
In the early lives of Uranus and Neptune, their envelopes were hotter than they are today. Despite their cold equilibrium temperatures of 50 K (Pearl et al. 1990; Pearl & Conrath 1991), much of their P-T profiles would then have lain above the critical curve, so that ammonia and hydrogen mixed in all proportions except in the outermost atmosphere, where ammonia condenses into clouds. As the planets cooled, their temperatures fell at every pressure, so the levels at which ammonia and water condense, and with them their cloud decks, moved deeper, as is general for condensate clouds (Pierrehumbert 2010; Burrows et al. 2006).
Because ammonia is far less volatile than hydrogen, the two-phase region of mixtures is bounded by two curves that meet at the critical point of ammonia (405.4 K, 11.3 MPa). Above it, the bound is the critical curve, along which the two coexisting fluids become identical. Below it, the bound is the condensation curve of pure ammonia: all measured vapor-liquid equilibria of , at 278–394 K and up to 0.04 GPa for the gas phase and 0.1 GPa for the liquid, lie on its two-phase side (Wiebe & Tremearne 1934; Reamer & Sage 1959; Heise 1972). The same holds for , whose critical curve begins at the critical point of water (Seward & Franck 1981). Crossing this bound on cooling is necessary for phase separation but not sufficient: a mixture separates only below the isopleth of its own composition on the coexistence surface (Figure 2). This coexistence surface describes vapor-liquid equilibrium below the critical point of ammonia and fluid-fluid equilibrium above it. In Figure 3, the black line is its outer bound and the gray line its cross-section at . Below 500 K, both rest on previous measurements and the condensation curve of ammonia rather than on our simulations.
In present-day Uranus and Neptune, comparison with the model profiles of Nettelmann et al. (2013) suggests that ammonia and hydrogen may phase separate at pressures below 0.02 GPa (200 bar), and are miscible in all

Figure 4. Variation with pressure of the slope of the critical curve (top) and of the speciation of the homogeneous fluid (bottom). In the top panel, the line shows the slope of the critical curve, and the shaded band its uncertainty. The bottom panel gives the fraction of each species in a homogeneous fluid with along the critical curve up to 3000 K and then at 4000 K at the highest pressures. The gray dashed curve is a Fermi-Dirac-like function tracing the change in atomic H fractions, showcasing the molecular-to-atomic transition of the fluid at about 30-100 GPa and 2000-4000 K. Species are identified from atomic neighbors that persist for 100 fs. The pressure axis is logarithmic below 15 GPa and linear above.
proportions beyond 1-2 GPa, with the profiles within the uncertainty of the critical curve in between. The colder, non-adiabatic profiles of Tejada Arevalo (2025) instead lie close to or below the isopleth down to 7 GPa. Ammonia could thus separate from hydrogen only in the outermost 200 bar of the hotter adiabatic models of Nettelmann et al. (2013), where it would condense into a cloud deck, but down to 7 GPa in the non-adiabatic models (Tejada Arevalo 2025). Whether and how deep ammonia separates today therefore depends on the assumptions of the envelope-interior models. As the planets cool and this level deepens, separation would gradually deplete ammonia in the outer envelope. Direct observation of this depletion is complicated, however, because much of the ammonia at a few to tens of bar is bound with as in clouds, as noted in previous studies (Atreya et al. 2020; Molter et al. 2021; Tollefson et al. 2021).
Where the mixture does phase-separate, the ammonia-rich phase ( ), being denser (Figure 1), rains out and sinks. This releases gravitational energy and latent heat, in addition to that from the separation of water (Bailey & Stevenson 2021; Gupta et al. 2025), much as helium rain is thought to contribute to the luminosity of the gas giants (Stevenson & Salpeter 1977a,b). The composition gradient that it builds could also inhibit convection (Leconte & Chabrier 2012). Phase separation of ammonia may therefore matter for the thermal and radius evolution of Uranus and
Neptune, and of cold exoplanets of similar mass, discussed below.
3.2. Consequences of the molecular-to-atomic transition
We find the molecular-to-atomic transition to occur at about 30-100 GPa and 2000-4000 K. This is in a similar range as in hydrogen (e.g., McWilliams et al. 2016) and in fluids (Gupta et al. 2025), and lies close to the conditions along model profiles of Uranus and Neptune (Figure 3). In our simulations, the substantially dissociated states are all single-phase. A fluid of atomic hydrogen and nitrogen-bearing fragments is a different material from one of and molecules. Its thermal and transport properties are therefore expected to differ, as they do in hydrogen (French et al. 2012) and water (French & Nettelmann 2019; Grasselli et al. 2020). In particular, dissociated hydrogen, water and ammonia conduct electricity and heat better than their molecular forms (Cavazzoni et al. 1999; Ravasio et al. 2021; French et al. 2012; Grasselli et al. 2020). Where dissociation is under way, part of the energy that would otherwise raise the temperature goes into breaking bonds, which lowers the adiabatic temperature gradient (Saumon et al. 1995; French et al. 2012). The gradient rises again as the fluid recombines on cooling. These properties govern whether heat is carried by convection or by conduction (Scheibe et al. 2021), and where the magnetic field is generated (Stanley & Bloxham 2004).
3.3. Exoplanets
Most known exoplanets are much hotter than the ice giants (Bean et al. 2021). Like those of TOI-270 d (Figure 3; Rigby & Madhusudhan 2026), their P-T profiles lie on the one-phase side of the critical curve. In such planets ammonia, like water (Gupta et al. 2025), could be fully miscible with hydrogen, so that no phase boundary separates the deep nitrogen inventory from the observable atmosphere. A mixed envelope implies a higher mean molecular weight than one of pure hydrogen, consistent with the metal-rich atmosphere inferred for TOI-270 d (Benneke et al. 2024).
Our results suggest that phase separation is thus unlikely to explain the low inferred atmospheric abundance or non-detection of ammonia in such planets. Other proposed explanations include low-pressure thermochemical conversion of to followed by vertical quenching (Ohno & Fortney 2023a), photochemical destruction of (Hu 2021; Ohno & Fortney 2023b), and nitrogen sequestration into liquid-water oceans (Hu et al. 2021) or magma oceans (Shorttle et al. 2024). The relative importance of these mechanisms remains debated (Madhusudhan et al. 2023b; Wogan et al. 2024).
Cold exoplanets of Neptune mass and below may instead resemble Uranus and Neptune. Microlensing surveys show that such planets are common, for example OGLE-2007-BLG-368Lb (Sumi et al. 2010), MOA-2009-BLG-266Lb (Muraki et al. 2011) and OGLE-2012-BLG-0950Lb (Koshimoto et al. 2017), and the Nancy Grace Roman Space Telescope is expected to find planets with this technique (Penny et al. 2019). If their deep envelopes are as cold as those of the ice giants, ammonia and water may separate from their hydrogen-rich atmospheres, which will have implications for their thermal evolution.
3.4. Ammonia versus water
Water is the other major “ice” in Uranus and Neptune and may be abundant in many sub-Neptunes (Bean et al. 2021), and its miscibility with hydrogen has been studied extensively (Seward & Franck 1981; Bali et al. 2013; Soubiran & Militzer 2015; Bailey & Stevenson 2021; Cano Amoros et al. 2024; Howard et al. 2025; Gupta et al. 2025; Bergermann et al. 2024). The critical curves of the (Gupta et al. 2025) and systems are similar up to a few GPa. At higher pressures, the critical curve is the colder of the two, by several hundred Kelvin at 10-30 GPa.
The bulk abundance of water may, however, be about seven times that of ammonia (Asplund et al. 2009). For a Neptune-like envelope, the bulk composition of the binary, , therefore lies close to its critical composition of roughly 0.6-0.7 (Gupta et al. 2025), whereas that of the binary, , lies far from its critical composition of . Water thus separates close to its critical curve, whereas ammonia requires temperatures well below its own, so that at a given temperature water separates at lower pressure than ammonia. In a planet that contains both, water and ammonia therefore need not separate from hydrogen at the same depth or at the same time. The ice giants illustrate this: the hotter interior models of Uranus and Neptune (Nettelmann et al. 2013) lie close to both critical curves at 10-30 GPa, where water may be separating, or starting to, whereas in the colder model of Tejada Arevalo (2025) water would have largely separated.
Where both are present, however, ammonia could separate earlier than our phase diagram suggests if, being polar, it partitions into the water-rich fluid as water separates (Bailey & Stevenson 2021). Other calculations suggest that at high pressures, water instead separates from ammonia and methane (Militzer 2024). This ammonia-water partitioning with temperature-pressure conditions is thus uncertain and requires study of the ternary system. Resolving it matters for interpreting the tropospheres of Uranus and Neptune, which are poor in nitrogen relative to sulfur (Molter et al. 2021; Tollefson et al. 2021), an observation that has been attributed to nitrogen-poor accretion or to uptake of ammonia by a deep water-rich or ionic layer (Tollefson et al. 2021; Atreya et al. 2020). It would likewise affect how much nitrogen the envelopes of cold exoplanets retain.
3.5. Limitations and outlook
The inferences here are subject to certain caveats. In particular, our computational experiments treat the binary system of ammonia and hydrogen, whereas planetary envelopes also contain helium, water, methane and other materials. The critical curve above 2000 K is only partially constrained: we find no two-phase state at 3000 and 4000 K up to 100 GPa, so that comparisons with planetary profiles at pressures above about 30 GPa are dependent on our thermodynamic model.
Published envelope-interior models of the ice giants also differ by several hundred kelvin at the same pressure (Figure 3), so that our conclusions for present-day Uranus and Neptune depend on the assumptions of the model adopted. Our comparisons also assume local thermodynamic equilibrium, whereas atmospheric dynamics may shape cloud levels and the distribution of ammonia (Li et al. 2017; Guillot et al. 2020; Molter et al. 2021; Tollefson et al. 2021). Future work should couple these phase relations to models of thermal evolution and vertical transport, including the energetics of phase separation and the molecular-to-atomic transition. Despite these uncertainties, our results demonstrate that the miscibility of ammonia with hydrogen, like that of water and silicates (Gupta et al. 2025; Gilmore & Stixrude 2026), changes within the range of conditions found in the envelopes of ice giants and sub-Neptune-to-Neptune class exoplanets: phase behavior thus needs to be taken into account in understanding the compositional, thermal and structural evolution of these planets.
4. CONCLUSIONS
In this work, we determined the phase diagram of mixtures at 500-4000 K and 0.1-100 GPa. The critical curve, which divides conditions under which the mixture is a single homogeneous fluid from those under which it separates into two phases, rises from 500 K at 0.1 GPa to 2000 K near 30 GPa. It flattens with increasing pressure, a change that broadly overlaps with the molecular-to-atomic transition of the fluid, which is expected to alter its thermal and transport properties. The coexistence curves are asymmetric, with an ammonia-rich critical composition ( ). Together with previous measurements at lower pressures, our results are consistent with a single, continuous coexistence surface that spans vapor-liquid equilibrium below the critical point of ammonia, where ammonia condenses into clouds, and fluid-fluid equilibrium above it, where an ammonia-rich fluid separates from hydrogen at depth.
In warm sub-Neptunes such as TOI-270 d, ammonia and hydrogen are expected to be miscible in all proportions throughout the envelope, so that a low inferred atmospheric abundance or non-detection of ammonia in these planets more likely has other causes. Uranus and Neptune, in contrast, may be experiencing ammonia rain today, although whether and how deep ammonia separates depends on the envelope-interior models and their inferred compositions. For instance, separation could be confined to the outermost 200 bar in hotter adiabatic models but extend to GPa depths in colder, non-adiabatic ones. Water, whose bulk composition lies closer to its critical composition, likely separates at lower pressures than ammonia, so the two need not separate at the same depth or time, although partitioning of ammonia into a water-rich fluid could couple them.
Our results provide the phase relations needed to include ammonia in models of the compositional, thermal and structural evolution of hydrogen-rich planets. Where ammonia separates, the denser ammonia-rich phase sinks, releasing energy that, together with the separation of water, may influence the thermal and radius evolution of the ice giants and of cold Neptune-mass exoplanets. The compositions of the coexisting phases also set how nitrogen is distributed between the envelope and the interior as a planet cools, so that a planet's present nitrogen distribution may reflect its thermal evolution as well as the composition it acquired during formation. Together with recent studies of water and silicates (Gupta et al. 2025; Gilmore & Stixrude 2026), our results suggest that separation of different species from hydrogen is likely common in Neptune-like planets and proceeds in sequence, with less volatile components such as silicates separating first and more volatile ones such as water and ammonia following it, as a planet cools over billions of years or across planets of decreasing equilibrium temperature.
ACKNOWLEDGMENTS
A.G. is grateful to Adam Burrows for helpful discussions, insights, and access to computational resources at Princeton University. A.G. acknowledges support from the Heising–Simons Foundation through the 51 Pegasi b Fellowship, and from Princeton University through the Harry H. Hess Fellowship and the Future
Faculty in Physical Sciences Fellowship. A.G. also acknowledges support from the National Aeronautics and Space Administration (NASA) under grant HST-GO-17804.011-A and the Center for Matter at Atomic Pressures (CMAP), a National Science Foundation (NSF) Physics Frontier Center under Award PHY-2020249. J.D. acknowledges support from the NSF under Award EAR-2242946.
The calculations presented in this article were performed on computational resources of the Argonne Leadership Computing Facility, which is a U.S. Department of Energy Office of Science User Facility operated under contract DE-AC02-06CH11357, and those managed and supported by Princeton Research Computing, a consortium of groups including the Princeton Institute for Computational Science and Engineering (PICSciE) and the Office of Information Technology's High Performance Computing Center and Visualization Laboratory at Princeton University.
Software: VASP (Kresse & Furthmüller 1996; Kresse & Joubert 1999), DeePMD-kit (Wang et al. 2018; Zhang et al. 2018), LAMMPS (Thompson et al. 2022), PLUMED (Tribello et al. 2014; Bonomi et al. 2009; PLUMED consortium 2019), ALCHEMY, pytim (Sega et al. 2018), PySR (Cranmer 2023), Nautilus (Lange 2023), NumPy (Harris et al. 2020) and Matplotlib (Hunter 2007).
APPENDIX
A. METHODS
A.1. Computation
To study the system, we perform large-scale molecular dynamics (MD) simulations driven by a machine-learning interatomic potential (MLP) that is trained on high-fidelity electronic structure calculations. This methodology is divided into two stages. Stage 1 consists of developing an MLP based on atomic interactions across the relevant temperature, pressure, compositional, and configurational space. Stage 2 then involves large-scale machine learning molecular dynamics (MLMD) simulations at near-DFT-accuracy, driven by the curated MLP.
For stage 1, we leverage ALCHEMY (Ab initio-deep Learning Coupled Hybrid Engine for planetary Materials Exploration and discoverY), an automated active-learning pipeline that involves four phases: training, exploration, selection and labeling, to develop a balanced, DFT-accuracy-level MLP (Deng et al. 2023; Zhang et al. 2020). For the first phase within stage 1, we adopt the smoothed version of Deep Potential (Zhang et al. 2018; Zhang et al. 2018) as implemented in DeePMD-kit (Wang et al. 2018; Zeng et al. 2023, 2025): a deep learning package for training interatomic interactions based on ab initio data. This approach does not prescribe an explicit analytic functional form for the potential energy surface or force field, and rather uses a deep neural network to model it. The total energy is written as the sum of atomic contributions, each of which depends on the local environment of the atom within a cutoff radius of 6.0 Å, smoothed from 5.8 Å. The descriptor of the local environment is parameterized by an embedding network with three hidden layers of 25, 50 and 100 nodes, and the energy is obtained from a fitting network with five hidden layers of 300 nodes each. The electronic temperature is included as an additional frame parameter, which allows the potential to distinguish the energies and forces of identical configurations at different temperatures, so that a single model describes the entire temperature range of this study. The MLP is trained on energies, forces, and virials with an initial learning rate of 0.001, which decays exponentially every 10,000 steps.
In each iteration, during the second phase, an MLP trained on all DFT data accumulated until that point drives MD simulations using the Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS; Thompson et al. 2022) package that explore pressure-temperature (P-T) regimes across compositions from pure ammonia to , in cells of 128-288 atoms. The exploration either ramps temperature and pressure in the isothermal-isobaric ensemble (NPT), or uses variationally enhanced sampling (Valsson & Parrinello 2014) with PLUMED (Tribello et al. 2014; Bonomi et al. 2009; PLUMED consortium 2019). In the latter, a bias on the potential energy, the volume, and a ratio of N-N to N-H coordination numbers that distinguishes mixed from demixed states is optimized to sample the multithermal-multibaric distribution in these three variables (Piaggi & Parrinello 2019a,b), so that a simulation visits mixed and demixed configurations over the whole temperature and pressure range of a regime. Each such simulation is run for 0.2-0.5 ns with a time-step of 0.5 fs. Across all iterations, this amounts to a total of 1.2 s of simulation data.
In the third phase, we select mutually dissimilar configurations from each trajectory by farthest-point sampling in the space of Smooth Overlap of Atomic Positions (SOAP) descriptors (SOAP; Bartók et al. 2013; Cheng et al.
2020). The selected frames are labeled with DFT, and those for which the MLP error in energy, force or virial lies between prescribed lower and upper thresholds are added to the training set. The lower threshold is set by the required MLP accuracy, whereas the upper threshold excludes configurations that are likely to be unphysical. A composition is retired from a regime once fewer than 5% of its new labels exceed the lower threshold. Driver scripts automate the loop by submitting and monitoring the training, MD and DFT jobs on the computing clusters, adapting the lower threshold, and starting the next iteration without user intervention. The regimes explored span 500-6500 K and 0.05-300 GPa. The final MLP, used for all results reported here, is the outcome of 44 iterations and is trained for 1.5 million optimization steps with Adam optimizer (Kingma & Ba 2015) on 68,994 configurations containing 16,128,230 atoms.
The labeling phase, i.e., the electronic structure calculations based on DFT that determine the reference energies, forces and virials of atomic configurations, is performed with the Vienna ab initio Simulation Package (VASP; Kresse & Hafner 1993; Kresse & Furthmüller 1996; Kresse & Furthmüller 1996; Kresse & Joubert 1999) based on the projector-augmented wave (PAW) method (Blöchl 1994). H and N have valence configurations of and , with PAW core radii of 1.10 and 1.50 bohr (0.582 and 0.794 Å), respectively. The regularized-restored Strongly Constrained and Appropriately Normed ( ) functional (Furness et al. 2020) is used for the exchange-correlation energy, and the non-spherical contributions to the gradient corrections inside the PAW spheres are included. This nonempirical meta-generalized gradient approximation (meta-GGA) is built from exact physical constraints and retains much of the transferable accuracy of SCAN (Sun et al. 2015) while improving its numerical stability and efficiency. It therefore offers a practical balance of accuracy and computational cost for the large number of reference calculations required here. Benchmarks demonstrate good performance for a range of properties in both solids and fluids, including fluid conditions from ambient to supercritical (Kingsbury et al. 2022; Chattopadhyay & Jahn 2026). Consistent with this transferability, the parent SCAN functional yields a water phase diagram spanning molecular and ionic fluids and numerous ice polymorphs in satisfactory overall agreement with experiment (Sun et al. 2015; Zhang et al. 2021). The kinetic-energy cutoff of the plane waves is 800 eV, and the Brillouin zone is sampled at the Gamma point. For five configurations with at 1000 K and 0-20 GPa, these settings yield energies, forces and pressures that are within 0.05 meV atom , 19 meV Å and 0.02 GPa, respectively, of those obtained with a k-point mesh and a cutoff of 1200 eV. The self-consistent field iteration stops when the changes in total energy and in band-structure energy are less than eV. The electronic states are occupied according to the Fermi-Dirac distribution at an electronic temperature equal to the ionic temperature, i.e., we assume thermal equilibrium between ions and electrons via the Mermin functional (Mermin 1965), and the MLP is trained on the resulting free energies inclusive of electronic entropy.
Over the training set, the root-mean-square errors of the final MLP are 12 meV atom in energy, 0.48 eV Å in force and 2.38 GPa in stress (28 meV atom in virial). The errors in force and stress grow with temperature and pressure (Figure S1): the mean error in force rises from 0.23 eV Å at 500 K (0.05-160 GPa) to 0.58 eV Å at 4000 K (0.05-300 GPa), and that in stress from 0.21 GPa to 1.64 GPa, which is expected since higher temperatures and pressures result in larger fluctuations of force and stress. The mean error in energy varies little with temperature, between 11 and 15 meV atom . We test the final MLP against DFT on 258 configurations at 500, 1000, 2000 and 4000 K that are distinct from the training set (Figure S2, top panels). This test set contains 61,562 atoms in total, and therefore 258 energies, 184,686 force components and 1,548 stress components. The root-mean-square errors are 19 meV atom in energy, 0.39 eV Å in force and 0.96 GPa in stress. Furthermore, we find radial distribution functions from MLMD agree well with those from DFT-MD at 1000 K and 30 GPa (Figure S2, bottom left).
We then leverage this final, curated MLP to perform two-phase coexistence MD simulations with LAMMPS (Thompson et al. 2022). To this end, we first equilibrate simulations of pure ammonia and hydrogen in the NPT ensemble at required pressure-temperature conditions. We then initiate phase coexistence simulations by joining the two equilibrated phases, as shown in the leftmost panel of Figure 1. This system is then allowed to equilibrate over a period of 1-5 ns until it reaches thermal and compositional dynamic equilibrium. These simulations are run using timesteps of 0.5 fs with a Nosé-Hoover thermostat and barostat (Nosé 1984; Hoover 1985; Martyna et al. 1994; Shinoda et al. 2004) with damping times of 10 fs and 100 fs, respectively. To check system-size effects, we performed coexistence simulations with 256 to 131,072 atoms at 1000 K and 10 GPa, and found that the compositions of the coexisting phases are converged for systems of about 8,000 atoms or more (Figure S2, bottom right). Our typical coexistence simulation is thus performed at either 16,384 or 20,000 atoms at or 0.33, respectively.
A.2. Analysis of simulations
Distinguishing phases. We classify each simulation from its mass- and number-density profiles along the long axis of the cell, over the last quarter of the trajectory or the last 0.5 ns, whichever is shorter. For each configuration we fit these profiles with a theoretically-motivated hyperbolic-tangent function that two coexisting fluids are expected to follow (Figure 1; Cahn & Hilliard 1958; Widom 1982). A stable two-phase system should keep a statistically similar profile from one configuration to the next, whereas in a single fluid the profile would fluctuate randomly. We thus require a correlation of at least 0.8 between successive snapshots from the trajectory. We also require the density difference between the two slabs to exceed twice the fluctuations of the density within them, so that it reflects two distinct phases rather than thermal fluctuations of one fluid. A simulation is two-phase if its profile persists in this way and the density difference exceeds this threshold in at least 90% of the configurations, and one-phase if the density difference exceeds it in fewer than half of them. In the remaining cases we use the Binder cumulant U (Binder 1981), which measures whether the distribution of the coarse-grained density is unimodal, as for one phase, or bimodal, as for two. indicates one phase and two phases. Simulations that remain undecided are not used for further analysis. We also test whether the density difference still drifts over the window, from its slope against time corrected for autocorrelation (Sokal 1997).
Phase compositions. To measure the composition of each coexisting phase, we must first decide which atoms belong to which phase. Because the interface between the phases is not flat but fluctuates, we locate it in each sampled configuration by identifying the Gibbs dividing surface (GDS; Willard & Chandler 2010) using a modified implementation based on pytim (Sega et al. 2018) and Deng et al. (2023). The mass density is coarse-grained with a Gaussian of width 2.5 Å on a periodic 1.0-Å mesh, and its isosurface at the density midway between those of the two bulk phases defines this curved GDS, from which each atom is assigned a signed shortest distance d. Averaged as a function of d, the coarse-grained density follows a hyperbolic tangent centered on this surface, changing from the density of one bulk phase to that of the other over a width w that we fit in each configuration. Atoms in the interfacial region, , are excluded, and the remaining atoms are assigned to the bulk phase on their side of the surface. In each bulk phase we count the hydrogen and nitrogen atoms, and , and convert them to equivalent numbers of molecules, and . The composition of the phase is then , where angle brackets denote averages over the configurations of the final 0.5 ns. This definition depends only on elemental inventories and therefore remains meaningful when molecules dissociate. Because successive configurations are correlated, we estimate the uncertainty of each mean composition with a circular block bootstrap (Politis & Romano 1992), a resampling form of the blocking method (Flyvbjerg & Petersen 1989), using blocks four times the integrated autocorrelation time (Sokal 1997). These uncertainties are propagated into the thermodynamic model. As a composition-sensitive check for phases that differ in composition but have nearly the same mass density, we repeat the construction using the nitrogen number density; the reported compositions are from the mass-density analysis.
Speciation. We determine the fractions of different species in homogeneous fluids with from independent simulations in the canonical ensemble. These are performed at the mean volume of the corresponding constant-pressure simulations with a time step of 0.1 fs for 5-10 ps. We define a set of atoms as bonded if they remain in mutual proximity for a minimum time interval (e.g., Tamblyn & Bonev 2010; Gupta et al. 2025). We set fs, about ten vibrational periods of the H-H and N-H bonds ( fs), so that only those atoms that persist through multiple cycles of atomic vibrations count as bonded. To this end, we track 18 of the nearest neighbors of each atom for an analysis window of 1 picosecond. The reported fraction of species is , where is the number of units of species , averaged over this analysis window.
A.3. Thermodynamic model
A single asymmetric (subregular) solution model describes all our coexistence (binodal) curves (surface). The molar Gibbs free energy of mixing can be written as (e.g., Thompson Jr 1967; Haselton & Newton 1980; Saxena 2012)
where , and describe the composition asymmetry, and and are temperature and pressure scales. For the present binary, is the mole fraction of and . This model can be rearranged by defining , and . We retain this composition dependence while allowing , and to depend on the reduced temperature :
The first term is the excess contribution and the second is the ideal contribution. The conventional form, in which and are constant and is linear in temperature, cannot reproduce the evolution of the coexistence curves and critical pressure across our vast temperature-pressure range. We therefore allow , and to depend on temperature. Here is in GPa and . The parameters (kJ mol) and (kJ mol GPa, equivalent to cm mol) set the scale of the excess Gibbs energy extrapolated to zero pressure and of the excess volume , respectively, and sets the asymmetry of the coexistence curves (Figure 2). The compositions of the two coexisting phases follow from the common tangent to , at which the chemical potentials of both H and NH are equal in the two phases.
The temperature dependence of r, u and v is guided by symbolic regression (e.g., Udrescu & Tegmark 2020) as implemented in PYSR package (Cranmer 2023), which searched among polynomials and scored each candidate by how well its common-tangent compositions match the measured coexisting compositions; the best candidates were then refit with the full likelihood described below. We adopt (Figure S3)
We fit the six coefficients to the compositions of 38 pairs of coexisting phases (Figure 2). Each composition enters a Gaussian likelihood whose variance is the sum of the squares of its uncertainty and of a fitted common scatter. The scatter, 0.045 in x, dominates, since the uncertainties of the individual compositions are much smaller (median 0.001). The 22 one-phase simulations, and one two-phase simulation at 1500 K and 25 GPa whose compositions could not be determined, enter as soft penalties, as for censored data in regression (e.g., Tobin 1958; Kelly 2007): the former are penalized when the model places their bulk composition inside the two-phase region, and the latter when it places it outside. We sample the joint posterior distribution of the six coefficients with NAUTILUS (Lange 2023), which combines importance nested sampling (Skilling 2004, 2006) with neural-network-assisted exploration of the likelihood-constrained parameter space. A physical constraint of is applied between 500 to 4000 K. The posterior medians, with intervals in brackets, are [1.31, 1.56], [-5.02, -2.15], [16.4, 22.9] and [-6.28, -2.78] kJ mol , and [0.14, 0.24] and [0.53, 0.86] kJ mol GPa ; see Figure S3.
The critical point at each temperature satisfies . Because is independent of temperature, the critical composition is constant, , and the critical pressure is
where is the value of the dimensionless excess parameter at the critical point. The resulting critical curve is shown in Figure 3, and the coexistence curves that the model predicts at fixed pressures are shown in Figure S4.
REFERENCES
Ahrens, M., & Heusler, K. E. 1981, Zeitschrift für Physikalische Chemie, 125, 127, doi: 10.1524/zpch.1981.125.1.127
Asplund, M., Grevesse, N., Sauval, A. J., & Scott, P. 2009, ARA&A, 47, 481, doi: 10.1146/annurev.astro.46.060407.145222
Atreya, S. K., Hofstadter, M. H., In, J. H., et al. 2020, Space Sci. Rev., 216, 18, doi: 10.1007/s11214-020-0640-8
Bailey, E., & Stevenson, D. J. 2021, PSJ, 2, 64, doi: 10.3847/PSJ/abd1e0
Bali, E., Audétat, A., & Keppler, H. 2013, Nature, 495, 220, doi: 10.1038/nature11908
Bar-Eli, K., & Klein, F. S. 1961, J. Chem. Phys., 35, 1915, doi: 10.1063/1.1732185
Bartók, A. P., Kondor, R., & Csányi, G. 2013, Phys. Rev. B, 87, 184115, doi: 10.1103/PhysRevB.87.184115
Bean, J. L., Raymond, S. N., & Owen, J. E. 2021, Journal of Geophysical Research (Planets), 126, e06639, doi: 10.1029/2020JE006639
Behler, J., & Parrinello, M. 2007, Phys. Rev. Lett., 98, 146401, doi: 10.1103/PhysRevLett.98.146401
Benneke, B., Roy, P.-A., Coulombe, L.-P., et al. 2024, arXiv e-prints, arXiv:2403.03325, doi: 10.48550/arXiv.2403.03325
Bergermann, A., French, M., & Redmer, R. 2024, Phys. Rev. B, 109, 174107, doi: 10.1103/PhysRevB.109.174107
Bethkenhagen, M., French, M., & Redmer, R. 2013, The Journal of Chemical Physics, 138, 234504, doi: 10.1063/1.4810883
Binder, K. 1981, Zeitschrift für Physik B Condensed Matter, 43, 119, doi: 10.1007/BF01293604
Blöchl, P. E. 1994, Phys. Rev. B, 50, 17953, doi: 10.1103/PhysRevB.50.17953
Bonomi, M., Branduardi, D., Bussi, G., et al. 2009, Computer Physics Communications, 180, 1961, doi: 10.1016/j.cpc.2009.05.011
Burrows, A., Sudarsky, D., & Hubeny, I. 2006, ApJ, 640, 1063, doi: 10.1086/500293
Cahn, J. W., & Hilliard, J. E. 1958, The Journal of chemical physics, 28, 258
Cano Amoros, M., Nettelmann, N., Tosi, N., Baumeister, P., & Rauer, H. 2024, Astron. Astrophys., 692, A152, doi: 10.1051/0004-6361/202452148
Cavazzoni, C., Chiarotti, G. L., Scandolo, S., et al. 1999, Science, 283, 44, doi: 10.1126/science.283.5398.44
Chattopadhyay, R., & Jahn, S. 2026, The Journal of Physical Chemistry A, 130, 5309, doi: 10.1021/acs.jpca.6c03132
Cheng, B., Griffiths, R.-R., Wengert, S., et al. 2020, Acc. Chem. Res., 53, 1981, doi: 10.1021/acs.accounts.0c00403
Chidester, B. A., & Strobel, T. A. 2011, J. Phys. Chem. A, 115, 10433, doi: 10.1021/jp202779f
Cranmer, M. 2023, arXiv e-prints, doi: 10.48550/arXiv.2305.01582
Deng, J., Niu, H., Hu, J., Chen, M., & Stixrude, L. 2023, Physical Review B, 107, 064103, doi: 10.1103/PhysRevB.107.064103
Flyvbjerg, H., & Petersen, H. G. 1989, J. Chem. Phys., 91, 461, doi: 10.1063/1.457480
French, M., Becker, A., Lorenzen, W., et al. 2012, ApJS, 202, 5, doi: 10.1088/0067-0049/202/1/5
French, M., & Nettelmann, N. 2019, ApJ, 881, 81, doi: 10.3847/1538-4357/ab2d21
Furness, J. W., Kaplan, A. D., Ning, J., Perdew, J. P., & Sun, J. 2020, The journal of physical chemistry letters, 11, 8208
Gao, K., Wu, J., Bell, I. H., Harvey, A. H., & Lemmon, E. W. 2023, Journal of Physical and Chemical Reference Data, 52, 013102, doi: 10.1063/5.0128269
Giles, R. S., Fletcher, L. N., Irwin, P. G. J., Orton, G. S., & Sinclair, J. A. 2017, Geophys. Res. Lett., 44, 10,838, doi: 10.1002/2017GL075221
Gilmore, T., & Stixrude, L. 2026, Nature, 650, 60, doi: 10.1038/s41586-025-09970-4
Grasselli, F., Stixrude, L., & Baroni, S. 2020, Nature Communications, 11, 3605, doi: 10.1038/s41467-020-17275-5
Guillot, T., Stevenson, D. J., Atreya, S. K., Bolton, S. J., & Becker, H. N. 2020, J. Geophys. Res. Planets, 125, e2020JE006403, doi: 10.1029/2020JE006403
Gupta, A., Stixrude, L., & Schlichting, H. E. 2025, ApJ, 982, L35, doi: 10.3847/2041-8213/adb631
Harris, C. R., Millman, K. J., van der Walt, S. J., et al. 2020, Nature, 585, 357, doi: 10.1038/s41586-020-2649-2
Haselton, H., & Newton, R. 1980, Journal of Geophysical Research: Solid Earth, 85, 6973
Heise, F. 1972, Berichte der Bunsengesellschaft für physikalische Chemie, 76, 938, doi: 10.1002/bbpc.19720760914
Hernandez, J.-A., Bethkenhagen, M., Ninet, S., et al. 2023, Nature Physics, 19, 1280, doi: 10.1038/s41567-023-02074-8
Hoover, W. G. 1985, Phys. Rev. A, 31, 1695, doi: 10.1103/PhysRevA.31.1695
Horn, H. W., Vazan, A., Chariton, S., Prakapenka, V. B., & Shim, S.-H. 2025, Nature, 646, 1069, doi: 10.1038/s41586-025-09630-7
Howard, S., Helled, R., Bergermann, A., & Redmer, R. 2025, Astron. Astrophys., 703, A154, doi: 10.48550/arXiv.2507.06288
Hu, R. 2021, Astrophys. J., 921, 27, doi: 10.3847/1538-4357/ac1789
Hu, R., Damiano, M., Scheucher, M., et al. 2021, Astrophys. J. Lett., 921, L8, doi: 10.3847/2041-8213/ac1f92
Hubbard, W. B., & Macfarlane, J. J. 1980, J. Geophys. Res., 85, 225, doi: 10.1029/JB085iB01p00225
Hunter, J. D. 2007, Computing in Science & Engineering, 9, 90, doi: 10.1109/MCSE.2007.55
Insixiengmay, L., & Stixrude, L. 2025, Earth and Planetary Science Letters, 654, 119242, doi: 10.1016/j.epsl.2025.119242
Irwin, P. G. J., Hill, S. M., Fletcher, L. N., Alexander, C., & Rogers, J. H. 2025, Journal of Geophysical Research (Planets), 130, 2024JE008622, doi: 10.1029/2024JE008622
Kaminishi, G., & Toriumi, T. 1962, Bulletin of the Chemical Research Institute of Non-Aqueous Solutions, Tohoku University, 11, 1
Kelly, B. C. 2007, ApJ, 665, 1489, doi: 10.1086/519947
Kingma, D. P., & Ba, J. 2015, in 3rd International Conference on Learning Representations. https://arxiv.org/abs/1412.6980
Kingsbury, R., Gupta, A. S., Bartel, C. J., et al. 2022, Physical Review Materials, 6, 013801, doi: 10.1103/PhysRevMaterials.6.013801
Koshimoto, N., Udalski, A., Beaulieu, J. P., et al. 2017, AJ, 153, 1, doi: 10.3847/1538-3881/153/1/1
Kresse, G., & Furthmüller, J. 1996, Phys. Rev. B, 54, 11169, doi: 10.1103/PhysRevB.54.11169
Kresse, G., & Furthmüller, J. 1996, Computational Materials Science, 6, 15, doi: https://doi.org/10.1016/0927-0256(96)00008-0
Kresse, G., & Hafner, J. 1993, Phys. Rev. B, 47, 558, doi: 10.1103/PhysRevB.47.558
Kresse, G., & Joubert, D. 1999, Phys. Rev. B, 59, 1758, doi: 10.1103/PhysRevB.59.1758
Krichevskii, I., & Khazanova, N. 1939, Zhurnal Fizicheskoi Khimii, 13, 1690
Lange, J. U. 2023, MNRAS, 525, 3181, doi: 10.1093/mnras/stad2441
Leconte, J., & Chabrier, G. 2012, A&A, 540, A20, doi: 10.1051/0004-6361/201117595
Li, C., Ingersoll, A., Janssen, M., et al. 2017, Geophys. Res. Lett., 44, 5317, doi: 10.1002/2017GL073159
Madhusudhan, N., Moses, J. I., Rigby, F., & Barrier, E. 2023a, Faraday Discussions, 245, 80, doi: 10.1039/D3FD00075C
Madhusudhan, N., Sarkar, S., Constantinou, S., et al. 2023b, ApJ, 956, L13, doi: 10.3847/2041-8213/acf577
Martyna, G. J., Tobias, D. J., & Klein, M. L. 1994, J. Chem. Phys., 101, 4177, doi: 10.1063/1.467468
McWilliams, R. S., Dalton, D. A., Mahmood, M. F., & Goncharov, A. F. 2016, Phys. Rev. Lett., 116, 255501, doi: 10.1103/PhysRevLett.116.255501
Mermin, N. D. 1965, Phys. Rev., 137, A1441, doi: 10.1103/PhysRev.137.A1441
Michels, A., Skelton, G. F., & Dumoulin, E. 1950, Physica, 16, 831, doi: 10.1016/0031-8914(50)90092-9
Militzer, B. 2024, Proc. Natl. Acad. Sci. USA, 121, e2403981121, doi: 10.1073/pnas.2403981121
Molter, E. M., de Pater, I., Luszcz-Cook, S., et al. 2021, PSJ, 2, 3, doi: 10.3847/PSJ/abc48a
Moore, R. G., & Otto, F. D. 1972, The Canadian Journal of Chemical Engineering, 50, 355, doi: 10.1002/cjce.5450500308
Morales, M. A., Schwegler, E., Ceperley, D., et al. 2009, Proc. Natl. Acad. Sci. USA, 106, 1324, doi: 10.1073/pnas.0812581106
Muraki, Y., Han, C., Bennett, D. P., et al. 2011, ApJ, 741, 22, doi: 10.1088/0004-637X/741/1/22
Nettelmann, N., Helled, R., Fortney, J. J., & Redmer, R. 2013, Planet. Space Sci., 77, 143, doi: 10.1016/j.pss.2012.06.019
Ninet, S., Datchi, F., & Saitta, A. M. 2012, Physical Review Letters, 108, 165702, doi: 10.1103/PhysRevLett.108.165702
Nosé, S. 1984, The Journal of Chemical Physics, 81, 511, doi: 10.1063/1.447334
Ohno, K., & Fortney, J. J. 2023a, Astrophys. J., 946, 18, doi: 10.3847/1538-4357/acafed
—. 2023b, Astrophys. J., 956, 125, doi: 10.3847/1538-4357/ace531
Pearl, J. C., & Conrath, B. J. 1991, J. Geophys. Res., 96, 18921, doi: 10.1029/91JA01087
Pearl, J. C., Conrath, B. J., Hanel, R. A., Pirraglia, J. A., & Coustenis, A. 1990, Icarus, 84, 12, doi: 10.1016/0019-1035(90)90155-3
Penny, M. T., Gaudi, B. S., Kerins, E., et al. 2019, ApJS, 241, 3, doi: 10.3847/1538-4365/aafb69
Phillips, C. L., Wang, J., Kendrew, S., et al. 2021, ApJ, 923, 144, doi: 10.3847/1538-4357/ac29be
Piaggi, P. M., & Parrinello, M. 2019a, Phys. Rev. Lett., 122, 050601, doi: 10.1103/PhysRevLett.122.050601
—. 2019b, J. Chem. Phys., 150, 244119, doi: 10.1063/1.5102104
Pierrehumbert, R. T. 2010, Principles of Planetary Climate (Cambridge: Cambridge University Press), doi: 10.1017/CBO9780511780783
PLUMED consortium. 2019, Nature Methods, 16, 670, doi: 10.1038/s41592-019-0506-8
Politis, D. N., & Romano, J. P. 1992, in Exploring the Limits of Bootstrap, ed. R. LePage & L. Billard (New York: Wiley), 263–270
Queyroux, J.-A., Ninet, S., Weck, G., et al. 2019, Phys. Rev. B, 100, 224104, doi: 10.1103/PhysRevB.100.224104
Ravasio, A., Bethkenhagen, M., Hernandez, J.-A., et al. 2021, Phys. Rev. Lett., 126, 025003, doi: 10.1103/PhysRevLett.126.025003
Reamer, H. H., & Sage, B. H. 1959, Journal of Chemical and Engineering Data, 4, 152, doi: 10.1021/je60002a012
Rigby, F. E., & Madhusudhan, N. 2026, MNRAS, 545, staf1969, doi: 10.1093/mnras/staf1969
Rogers, J. G., Young, E. D., & Schlichting, H. E. 2025, Monthly Notices of the Royal Astronomical Society, 544, 3496, doi: 10.1093/mnras/staf1940
Saumon, D., Chabrier, G., & van Horn, H. M. 1995, ApJS, 99, 713, doi: 10.1086/192204
Saxena, S. K. 2012, doi: 10.1007/978-3-642-65558-6
Scheibe, L., Nettelmann, N., & Redmer, R. 2019, A&A, 632, A70, doi: 10.1051/0004-6361/201936378
—. 2021, A&A, 650, A200,
doi: 10.1051/0004-6361/202140663
Schöttler, M., & Redmer, R. 2018, Phys. Rev. Lett., 120, 115703, doi: 10.1103/PhysRevLett.120.115703
Sega, M., Hantal, G., Fábián, B., & Jedlovszky, P. 2018, Journal of Computational Chemistry, 39, 2118, doi: 10.1002/jcc.25384
Seward, T. M., & Franck, E. U. 1981, Berichte der Bunsengesellschaft für physikalische Chemie, 85, 2, doi: https://doi.org/10.1002/bbpc.19810850103
Shinoda, W., Shiga, M., & Mikami, M. 2004, Phys. Rev. B, 69, 134103, doi: 10.1103/PhysRevB.69.134103
Shorttle, O., Jordan, S., Nicholls, H., Lichtenberg, T., & Bower, D. J. 2024, The Astrophysical Journal Letters, 962, L8, doi: 10.3847/2041-8213/ad206e
Skilling, J. 2004, in American Institute of Physics Conference Series, Vol. 735, American Institute of Physics Conference Series, ed. R. Fischer, R. Preuss, & U. V. Toussaint, 395–405, doi: 10.1063/1.1835238
Skilling, J. 2006, Bayesian Anal., 1, 833, doi: 10.1214/06-BA127
Sokal, A. 1997, in Functional Integration, NATO ASI Series (Boston, MA: Springer), 131–192, doi: 10.1007/978-1-4899-0319-8_6
Soubiran, F., & Militzer, B. 2015, ApJ, 806, 228, doi: 10.1088/0004-637X/806/2/228
Stanley, S., & Bloxham, J. 2004, Nature, 428, 151, doi: 10.1038/nature02376
Stevenson, D. J., & Salpeter, E. E. 1977a, ApJS, 35, 221, doi: 10.1086/190478
—. 1977b, ApJS, 35, 239, doi: 10.1086/190479
Sumi, T., Bennett, D. P., Bond, I. A., et al. 2010, ApJ, 710, 1641, doi: 10.1088/0004-637X/710/2/1641
Sun, J., Ruzsinszky, A., & Perdew, J. P. 2015, Physical Review Letters, 115, 036402, doi: 10.1103/PhysRevLett.115.036402
Tamblyn, I., & Bonev, S. A. 2010, Phys. Rev. Lett., 104, 065702, doi: 10.1103/PhysRevLett.104.065702
Tejada Arevalo, R. 2025, ApJ, 989, L40, doi: 10.3847/2041-8213/adf3a5
Tejada Arevalo, R., Gupta, A., Burrows, A., et al. 2026, The Astrophysical Journal, 1001, 243
Thompson, A. P., Aktulga, H. M., Berger, R., et al. 2022, Computer Physics Communications, 271, 108171, doi: 10.1016/j.cpc.2021.108171
Thompson Jr, J. B. 1967, Researches in geochemistry, 340
Tobin, J. 1958, Econometrica, 26, 24, doi: 10.2307/1907382
Tollefson, J., de Pater, I., Molter, E. M., et al. 2021, PSJ, 2, 105, doi: 10.3847/PSJ/abf837
Tribello, G. A., Bonomi, M., Branduardi, D., Camilloni, C., & Bussi, G. 2014, Comput. Phys. Commun., 185, 604, doi: 10.1016/j.cpc.2013.09.018
Udrescu, S.-M., & Tegmark, M. 2020, Science Advances, 6, eaay2631, doi: 10.1126/sciadv.aay2631
Valsson, O., & Parrinello, M. 2014, Phys. Rev. Lett., 113, 090601, doi: 10.1103/PhysRevLett.113.090601
Wang, H., Zhang, L., Han, J., et al. 2018, Computer Physics Communications, 228, 178
Widom, B. 1982, The Journal of Physical Chemistry, 86, 869
Wiebe, R., & Gaddy, V. L. 1937, Journal of the American Chemical Society, 59, 1984, doi: 10.1021/ja01289a055
Wiebe, R., & Tremearne, T. H. 1934, J. Am. Chem. Soc., 56, 2357, doi: 10.1021/ja01326a039
Willard, A. P., & Chandler, D. 2010, The Journal of Physical Chemistry B, 114, 1954
Wogan, N. F., Batalha, N. E., Zahnle, K. J., et al. 2024, The Astrophysical Journal Letters, 963, L7, doi: 10.3847/2041-8213/ad2616
Zeng, J., Zhang, D., Lu, D., et al. 2023, J. Chem. Phys., 159, 054801, doi: 10.1063/5.0155600
Zeng, J., Zhang, D., Peng, A., et al. 2025, J. Chem. Theory Comput., 21, 4375, doi: 10.1021/acs.jctc.5c00340
Zhang, L., Han, J., Wang, H., Car, R., & E, W. 2018, Phys. Rev. Lett., 120, 143001, doi: 10.1103/PhysRevLett.120.143001
Zhang, L., Han, J., Wang, H., et al. 2018, in Advances in Neural Information Processing Systems, ed. S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, & R. Garnett, Vol. 31 (Curran Associates, Inc.), 4436–4446. https://arxiv.org/abs/1805.09003
Zhang, L., Wang, H., Car, R., & E, W. 2021, Phys. Rev. Lett., 126, 236001, doi: 10.1103/PhysRevLett.126.236001
Zhang, Y., Wang, H., Chen, W., et al. 2020, Computer Physics Communications, 253, 107206, doi: 10.1016/j.cpc.2020.107206
B. SUPPLEMENTARY INFORMATION

Pressure (GPa)
Figure S1. Training-set performance of the final machine-learning potential (MLP) across the sampled pressure and temperature space. The panels show the mean absolute energy error per atom and the root-mean-square errors of the force and stress components for 68,994 training configurations, containing 16,128,230 atoms in total. Configurations are binned by the midpoint temperature of their training zone (Methods) and by pressure, which includes the ionic kinetic contribution at that temperature. Values in parentheses mark bins with fewer than 300 configurations, and white cells contain none. The energy and force color bars are linear, and the stress color bar is logarithmic.

Figure S2. Comparison of the machine-learning potential (MLP) predictions with density functional theory (DFT) calculations, and the dependence of our results on system size. The top panels compare the energies, forces and static stresses predicted by the MLP with those from DFT for 61,562 atoms, corresponding to 258 energies, 184,686 force components and 1,548 stress components at 500-4000 K; the dashed lines indicate perfect agreement. The root-mean-square errors are 19 meV atom in energy, 0.39 eV Å in force and 0.96 GPa in stress. The bottom left panel compares the H-H, H-N and N-N radial distribution functions from the MLP (solid lines) and from DFT (open circles) at 1000 K and 30 GPa. The bottom right panel shows the compositions of the hydrogen-rich phase (squares) and the ammonia-rich phase (circles) at 1000 K and 10 GPa as a function of the number of atoms in the simulation; the shaded bands show the frame-to-frame fluctuations, and the filled symbols mark the chosen 16,384-atom system.

Temperature (K)
Figure S3. Temperature dependence of the mixing parameters of the thermodynamic model (Equation A2): the dimensionless asymmetry parameter (left), the zero-pressure excess Gibbs energy scale in kJ mol (middle), and the excess volume scale in kJ mol GPa (right), on a logarithmic temperature axis. Solid curves show pointwise posterior medians, and shaded bands intervals, conditional on the model. The selected model has a temperature-independent , while is quadratic in and contains a term proportional to .

Composition
Figure S4. Coexistence (binodal) curves predicted by the thermodynamic model at fixed pressures of 0.3-100 GPa, shown as temperature against composition on a logarithmic temperature axis. Below each curve a mixture of that composition separates into two phases. Solid curves show posterior medians, and shaded bands intervals. Portions below 500 K and above 2000 K extend beyond the temperatures with observed two-phase states.