Introduction

The composition of Earth’s core is crucial to understanding several fundamental processes of its evolution, including the early core-mantle differentiation1,2, inner core crystallization and growth3,4, and thermal-chemical convection in the core that powers the geodynamo5,6. Comparing seismically observed density and compressional wave velocity (\({V}_{P}\)) of the outer core to those of pure liquid Fe has led to the identification of Si, O, C, S, and H7,8,9,10 as candidate light elements in varying concentrations in the outer core, depending on the specific composition model. In most studies, the Preliminary Reference Earth Model (PREM)11 has served as the standard seismic model for such comparison12,13,14, however, recent seismic models, including ek13715, EPOC16, KHOMC17, and CCMOC18, reveal the presence of a low velocity (up to 1% lower than that of PREM) layer of ~150-700 km thick in the outermost outer core, known as the E′ layer. The existence of the E′ layer has often been attributed to the presence of a chemically stratified layer in the outermost outer core19,20,21,22,23,24, with supporting evidence from geomagnetic studies17,25,26,27 and fluid dynamical considerations28. However, the composition of the E′ layer presents a significant paradox. Previous studies have shown that all commonly considered light elements (Si, O, C, S, and H) increase the seismic velocity of the outer core13,14. Thus, reducing the concentrations of light elements in this layer may decrease seismic velocity but would inevitably increase density, causing gravitational instability that would destruct stratification. Although some studies proposed that incomplete mixing22,28 and reactions21,24,29 between the core and lower mantle (or subducted slabs) could form a light and slow E′ layer, it has not been quantitatively evaluated whether such E′ layer compositions would satisfy the density and velocity constraints from seismic models. Furthermore, recent computations of core properties using mineral physics data12 reveal that even for the PREM model, the observed \({V}_{P}\) in the outermost few hundred kilometers of the outer core is ~0.5-2.5% lower than those computed for the preferred compositional models, amplifying the mismatch between theoretically predicted and observed seismic velocities for the E′ layer.

Comparison of Mg/Al and Mg/Ca ratios in the bulk silicate Earth (BSE) and CI carbonaceous chondrite suggests nontrivial Mg depletion in the silicate Earth relative to refractory lithophile elements30. Such depletion may be attributed to the slight volatility of Mg during Earth’s accretion31. Alternatively, high-pressure metal-silicate partitioning experiments5,32,33 suggest that a considerable amount of primordial Mg could have been incorporated into the Earth’s core, facilitated by the enhanced affinity of Mg to liquid Fe under the extreme temperatures associated with the Moon-forming giant impact. Although the subsequent cooling of the core could exsolve some Mg, thereby driving the early geodynamo before inner core crystallization5,33, a substantial quantity of residual Mg, potentially up to ~2 wt%5,32,33,34,35,36(Supplementary Fig. S1), may remain sequestered in the core. However, the quantitative amount of Mg in the present outer core remains unclear, largely due to the lack of knowledge on the effects of Mg on density and \({V}_{P}\) of liquid Fe under outer core condition, in contrast to the relatively well-determined effects of Mg on the properties of solid Fe-Mg phases under inner core conditions37,38.

In this study, we performed first-principles molecular dynamics (FPMD) simulations to determine the density and compressional wave velocity of Fe-Mg alloying liquids as functions of Mg content under Earth’s outer core conditions. Integrating calculated properties of Fe-alloying liquids with geophysical constraints on the outer and inner cores and the chemical equilibrium of light elements at the inner core boundary, we evaluated the potential Mg content in the outermost layer of the core. Our results underscore the previously underestimated role of primordial Mg in understanding the composition and chemical evolution of Earth’s core.

Results and discussion

Effects of Mg on the density and \({V}_{P}\) of liquid Fe

FPMD simulations were conducted for pure liquid Fe and six different Fe-Mg liquid alloys with Mg contents ranging from 0–4.27 wt% under pressure and temperature conditions of 121–340 GPa and 6000–7500 K (Methods). The Mie–Grüneisen equation of state (EOS) was used to fit the calculated pressure-density-temperature (P-ρ-T) results, with best-fit EOS parameters listed in Supplementary Table S1. In general, our calculated EOS results for pure liquid Fe are consistent with those of previous computational studies14 under outer core conditions, particularly at 4000–6000 K (Supplementary Fig. S5). Following previous studies13,39, we applied a pressure correction to account for the pressure underestimation caused by the use of generalized gradient approximation (GGA) in FPMD simulations. We compared the pressures obtained from our FPMD simulations for pure liquid Fe with those along the adiabatic temperature profile in the outer core from shock-wave experimental data40 and obtained pressure corrections ~10 GPa under CMB conditions (135 GPa, 4000 K) and ~8 GPa at ICB conditions (330 GPa, 6000 K), with values at intermediate conditions obtained by linear interpolation.

As shown in Fig. 1, the density of Fe-Mg liquids increases upon compression but decreases with increasing temperature or Mg content. Using our EOS results, we calculated the density and adiabatic bulk modulus (KS) of liquid Fe and Fe-Mg alloys under outer core conditions, from which the \({V}_{P}\) of Fe-Mg liquids was obtained (Methods). The \({V}_{P}\) of Fe-Mg liquids increases with pressure but is nearly independent of temperature (Supplementary Fig. S7a), consistent with the negligible temperature effects previously observed for the \({V}_{P}\) of pure liquid Fe14. The effect of Mg on \({V}_{P}\) is weak at all pressures and temperatures explored in this study (Supplementary Fig. S7b). Figure 2 shows the calculated density and \({V}_{P}\) of Fe-Mg liquids as functions of Mg content at pressures and temperatures corresponding to the CMB and ICB, using reference temperatures of 5400 K and 6000 K at the ICB (Methods). Both ρ and \({V}_{P}\) of Fe-Mg liquids decrease linearly with Mg content. Performing the pressure correction decreases the absolute values of density and velocity by 1.6–1.8% and 2.3–2.6%, respectively, at the CMB, and by 0.6–0.7% and 1.2%, respectively, at the ICB, but does not affect the compositional dependences. The \({V}_{P}\) values as functions of Mg molar fraction (XMg) can be fitted linearly as \({V}_{P}^{{CMB}}\left({km}/s\right)=7.80(0.02)-0.71\left(0.37\right)\times {X}_{{Mg}}\) and \({V}_{P}^{{ICB}}\left({km}/s\right)=9.93(0.01)-0.32\left(0.05\right)\times {X}_{{Mg}}\), respectively, confirming that the decreasing trend of \({V}_{P}\) with increasing Mg content is significant given the uncertainties at both CMB and ICB conditions. The reduction of \({V}_{P}\) in Fe-Mg liquids relative to those containing other light elements likely originates from the weakened metallic bonding between Mg and Fe, in contrast to stronger covalent interactions exhibited partially between light elements such as Si, S, C, O, and H with Fe (Supplementary Fig. S10 and Text S3). Compared with the effects of other light elements, the effect of Mg on reducing density is comparable to that of Si7. Assuming Mg is the sole light element in the outer core, an Mg content of 10.8–11.5 mol%, corresponding to ~5.0–5.3 wt%, is required to explain the outer core density deficit at the CMB conditions, while 13.5-14.1 mol% (6.4–6.7 wt%) of Mg is required to match the ICB density deficit. On the other hand, Mg moderately lowers \({V}_{P}\), in contrast to the increasing effects of other light elements. Thus, although the presence of Mg alone in the outer core is not consistent with the elevated velocity of the outer core compared to pure liquid Fe7,13,14,41, the combined effects of Mg and other light elements (Si, S, O, C, and H) may provide a viable explanation for the reduced velocity of the E′ layer in the outer core.

Fig. 1: Equation of state of pure liquid Fe and Fe-Mg alloys under Earth’s outer conditions.
Fig. 1: Equation of state of pure liquid Fe and Fe-Mg alloys under Earth’s outer conditions.
Full size image

Seven supercells, Fe80 (black), Fe78Mg1 (red), Fe78Mg2 (blue), Fe78Mg3 (yellow), Fe78Mg4 (cyan), Fe78Mg6 (magenta), and Fe78Mg8 (green), were investigated. The equations of state are plotted along different isotherms of 6000 K (a), 6500 K (b), 7000 K (c), and 7500 K (d). The fitting parameters are listed in Supplementary Table S1.

Fig. 2: Effects of the Mg content on the density (ρ) and compressional wave velocity (VP) of liquid Fe and Fe-Mg alloys.
Fig. 2: Effects of the Mg content on the density (ρ) and compressional wave velocity (VP) of liquid Fe and Fe-Mg alloys.
Full size image

Densities and compressional wave velocities are plotted at (a) the core-mantle boundary (CMB) and (b) the inner-outer core boundary (ICB) conditions. The blue and red lines (or symbols) represent properties calculated at ICB temperatures (TICB) of 5400 K and 6000 K, respectively. The temperatures at the CMB were calculated using the adiabatic temperature gradient and the ICB temperatures. The circles and triangles represent the results obtained from the original pressures in FPMD simulations and pressures with corrections for the GGA approximation. The magenta squares, yellow hexagons, and cyan diamonds represent previous results from FPMD simulations (TICB = 6000 K)67, shock wave experiments (TICB = 5400 K)40, and inelastic x-ray scattering measurements (TICB = 5400 K)68, respectively. The horizontal green dash-dot lines represent the seismically observed density and \({V}_{P}\) of the outer core from the preliminary reference Earth model (PREM). Error bars in \({V}_{P}\) represent uncertainties propagated from one standard errors in fitting parameters of the equation of state.

Mg content in the Earth’s outer core

Here we quantitatively evaluate the Mg content in the outer core by comparing the density and \({V}_{P}\) of Mg-bearing Fe-rich liquids with those of seismic models. We consider core compositions of Fe alloyed with Ni, Mg, and other light elements among Si, O, C, S, and H. Mineral physics results from this study for Fe-Mg liquids and those of ref. 14 for Fe-X liquids (X = Si, O, C, S, and H) were used to calculate the density and \({V}_{P}\) of the outer core, assuming the ideal mixing of Fe and light elements. As shown in previous studies12,14, the presence of Ni only slightly changes the outer core properties. We thus fixed the core Ni content at 5 wt% according to cosmochemical constraints7 and made corrections to the mixing results for density and \({V}_{P}\) (Methods). Following the core composition optimization approach developed in ref. 12, we first searched for the outer core composition that minimizes a reduced misfit function ∆ (Methods) that measures the difference between our model predicted outer and inner core densities and outer core velocities and the corresponding values from PREM. Equilibrium partitioning of light elements12,42,43,44,45 between the inner and outer cores at ICB conditions were incorporated in the modeling. Two types of models were developed for the outer core: a homogeneous outer core model (one-layer model) and a stratified core model consisting of two homogeneous layers (two-layer model), with the upper layer being ~600 km thick (from 135 to 200 GPa). In latter case, the thickness of the upper layer best resembles the seismically observed E′ layer15,16,17,18, although thinner stratified layers are suggested by geomagnetic studies46 to account for the morphology of geomagnetic field at the CMB. In both models, the optimization of a homogenous layer was performed in the Fe-5wt%Ni-Mg-X-Y systems, where X and Y represent any two light elements among Si, O, C, S, and H in addition to Mg. Thus, a total of ten systems were explored for each model (Supplementary Data 1).

For the homogeneous outer core model, the Fe-5wt%Ni-Mg-C-O, Fe-5wt%Ni-Mg-C-H, and Fe-5wt%Ni-Mg-H-O systems yield no solutions with ∆< 2 (Supplementary Data 1) because the preferred partitioning of C, O, and H would lead to larger density jumps at the ICB than seismically observed values. Although the Fe-5wt%Ni-Mg-S-H, Fe-5wt%Ni-Mg-S-O, Fe-5wt%Ni-Mg-S-C, and Fe-5wt%Ni-Mg-S-Si systems (Supplementary Data 1 and Fig. S11) result in ∆ values of ~0.10–0.15, the best-fit S contents in these models considerably exceed the cosmochemical limit of 1.7 wt%47. Similarly, Fe-5wt%Ni-Mg-Si-C system with a ∆ of 0.04 results in a best-fit C content of ~1.16 wt%, much higher than the core C content of 0.2 wt% allowed by the metal-silicate partition during core-formation48. Consequently, the Fe-5wt%Ni-Mg-Si-H and Fe-5wt%Ni-Mg-Si-O systems, with ∆ values of 0.07–0.11, emerge as the most likely solutions for the composition of a homogeneous core. The best-fit outer core composition contains either 0.84 ± 0.35 wt% Mg, 4.45 ± 1.06 wt% Si, and 0.28 ± 0.13 wt% H, or 1.06 ± 0.35 wt% Mg, 5.04 ± 0.91 wt% Si, and 1.71 ± 0.86 wt% O. In both scenarios, Mg is present as a key light element in the core. Compared to previous Mg-free Fe-Ni-Si-O7,13,14,41 or Fe-Ni-Si-H12 core models, Mg primarily substitutes either O or H in the core, thereby reducing the \({V}_{P}\) of the outer core while simultaneously maintaining the density deficit. The interchangeable nature of Si and S in modifying outer core properties suggests that a small amount of S may also be present in the core, as long as its content does not exceed that allowed by cosmochemical constraints.

For the stratified (two-layer) core model, the composition of the lower outer core layer was determined using a similar approach to that employed in the one-layer model, assuming no Mg is present. Specifically, chemical equilibrium between the lower outer core and the inner core was included as a constraint, in addition to core density and velocity. The composition of the Mg-bearing upper outer core was, on the other hand, determined using density and velocity constraints only, assuming no chemical equilibrium with either the lower outer core or the lower mantle. Our optimization results suggest that only the Fe-5wt%Ni-Mg-Si-H system yields solutions with overall ∆ values lower than 0.25 (Supplementary Data 1 and Fig. S12). The best-fit composition contains 1.15 ± 0.21 wt% Mg, 5.78 ± 1.29 wt% Si, and 0.12 ± 0.12 wt% H for the upper outer core layer, and 4.30 ± 0.51 wt% Si and 0.43 ± 0.06 wt% H for the lower outer core layer, consistent with our previous results using Mg-free one-layer models12.

Most recent seismic models including EPOC16, ek13715, KHOMC17, and CCMOC18 show lower \({V}_{P}\) values in the outermost outer core than the PREM model. Here we use the EPOC model16 as a representative model to examine the impact of seismic models on our findings. Using the core density and velocity from EPOC, we performed similar optimizations for both one-layer and two-layer models. We found that for the homogeneous outer core, the Fe-5wt%Ni-Mg-Si-C, Fe-5wt%Ni-Mg-Si-H, Fe-5wt%Ni-Mg-Si-O, and Fe-5wt%Ni-Mg-Si-S systems exhibit minimum ∆ values (0.26–0.30) near 0.25, but no model can yield a ∆ value lower than 0.25 (Supplementary Data 1). For the two-layer outer core, only the Fe-5wt%Ni-Mg-Si-H system yields solutions with ∆<0.25 (Supplementary Data 1 and Fig. S13). The best-fit compositions contain 1.31 ± 0.27 wt% Mg, 4.13 ± 1.72 wt% Si, and 0.16 ± 0.16 wt% H in the upper outer core, and 5.03 ± 0.63 wt% Si and 0.23 ± 0.07 wt% H in the lower outer core. Equilibrium partitioning at the ICB42,43,44 further indicates that the inner core contains 5.03 ± 0.63 wt% Si and 0.07 ± 0.02 wt% H. Compared to PREM, using EPOC as constraints requires more Mg in the upper outer core to further reduce the velocity of Fe-rich liquid. Our study reveals the critical role played by Mg in reducing velocity in Earth’s outer core. Across all optimized composition models with ∆< 0.25, the best-fit Mg contents range from 0.50 to 1.79 wt% (Fig. 3), suggesting the presence of Mg in the outer core, particularly in the outermost a few hundred kilometers. Using Mg/Al ratios in the BSE and CI carbonaceous chondrites30, our two-layer core model using EPOC density and velocity suggests that about 8% of the missing Mg in the BSE may be sequestered the core. A larger fraction of the missing Mg would reside in the core if the one-layer core model and the PREM density and \({V}_{P}\) were used. Regardless of geophysical or compositional models, the inferred upper outer core likely contains Mg as a major light element.

Fig. 3: The calculated Mg content in Earth’s upper outer core (~600 km thick).
Fig. 3: The calculated Mg content in Earth’s upper outer core (~600 km thick).
Full size image

Optimized core composition models with < 0.25 are shown. Superscripts “1” and “2” denote the homogeneous outer core model and the two-layer outer core model, respectively, while subscripts “PREM” and “EPOC” indicate results derived from the PREM and EPOC seismic models, respectively. The horizontal red dashed line represents the maximum Mg content of ~0.5 wt% in Earth’s core that could be sequestered at moderate equilibration temperatures (2500–3500 K) at the base of an early magma ocean, without the Moon-forming giant impact.

Implications for the formation of the E′ layer

Experimental studies on high-pressure metal-silicate partitioning of Mg5,35,49 suggest that the dissolution of MgO into metal is dependent on temperature. Although some studies32,36 argue that Mg dissolution is strongly affected by the O content in the metal, recent results from ref. 50 incorporating self-consistent Mg-Si-O interactions confirm the notion that temperature is the controlling factor for Mg partitioning as both O and Si contents (two Mg-attracting elements) in the metal increase with temperature. Given the relatively modest temperatures ( ~ 2500-3500 K) at the base of the early magma ocean, where metal-silicate equilibration occurred during core formation, the Mg content in the metal was estimated to be 0.2-0.5 wt%5,49,50, significantly lower than our estimated Mg content of 1.31 ± 0.27 wt% in the upper outer core (Fig. 3), when the EPOC model is used for optimization. Thus, the Moon-forming giant impact was necessary to generate the extreme temperatures required to produce the elevated Mg content in the E′ layer. Figure 4e–h schematically illustrate the inferred formation process of the E′ layer, highlighting key stages for the exchange and differentiation of light elements. At first, a proto-core of Fe-Si-H composition (lower outer core of the two-layer model) had formed possibly through the accretion and merge of a serious of relatively small impactor cores equilibrated with magma oceans of various depths51,52,53 before the Moon-forming giant impact event (Fig. 4e). The extremely high temperatures during the Moon-forming giant impact likely produced an Mg-rich Fe-Si-H-O-Mg metal diapir that had lower density than the proto-core and formed a buoyant layer surrounding the proto-core similar to the process described in ref. 28 (Fig. 4f, g). The subsequent secular cooling of the core could have exsolved some amounts of light elements in the forms of SiO249,54,55, H2O, FeO49,55, and/or MgO5,33,49,55 (Fig. 4h), resulting in an O-depleted E′ layer with an Fe-Si-H-Mg composition. Such exsolution processes are likely determined by the temperature-dependent solubilities of various components in the liquid core, which reflect chemical equilibrium between the core and the exsolved phases, although other solid components in the lower mantle, if in contact with the liquid outer core, may also affect the exsolution processes. Figure 4a–d compare the differences in elemental concentrations for Si, H, Fe, and Mg between the inner and outer cores, reflecting the combined effects of the giant impact and subsequent light elements exsolution. The net results are such that some Mg from the mantle was incorporated into the upper outer core, while Si, H, Fe originally present in the upper outer core were transported into the mantle. Some O may have dissolved into the upper outer core along with other elements right after the giant impact but became depleted during the cooling process of the core.

Fig. 4: Schematic illustration of the E′ layer formation.
Fig. 4: Schematic illustration of the E′ layer formation.
Full size image

ad The differences in concentrations of key elements including Si, H, Fe, and Mg between the upper outer core (E′ layer) and the lower outer core; e Formation of an Fe-Si-H proto-core before the giant impact; f Merging of the giant impactor core with the proto-core; g Formation of a stratified upper outer core layer with a composition of Fe-Si-H-Mg-O by delivery of excess Mg-Si-O components to the core; h Formation of the E′ layer with Fe-Si-H-Mg composition by exsolving SiO2, H2O, FeO, and possibly MgO components from the outermost core into the mantle.

The exsolution of Si, Fe, or H into the mantle has been proposed as a potential mechanism for driving the ancient dynamo49,54,55,56. In addition, some Mg exsolution is also expected5,33, as it is estimated that the giant impact could deliver 1.5–3.3 wt% Mg to the core49, a range surpassing our estimate of 1.31 ± 0.27 wt% Mg in the present-day E′ layer. Exsolution of these primordial elements from the E′ layer to the mantle could have contributed to primordial isotopic signatures observed in some ocean island basalts (OIBs). For example, the anomalously low D/H ratios in Baffin Island and Icelandic lavas57 may reflect core-derived primordial materials brought up to the surface by mantle plumes. Our results highlight the complex Mg-Si, Mg-Fe, and Mg-H exchanges between the core and mantle, primarily driven by giant impacts and core cooling, providing insights into the coupled evolution of Earth’s deep interior.

Methods

First-principles molecular dynamics

First-principles molecular dynamics (FPMD) simulations were performed using the Vienna Ab initio Simulation Package (VASP)58 with the projector augmented wave (PAW) method59. The valence configurations for Fe and Mg in the PAW potentials are 3p63d74s1 and 3s2, respectively. The Perdew-Wang type generalized gradient approximation (GGA) was utilized for the exchange-correlation functional60. The plane wave cutoff energy was set at 450 eV and the Γ point was used to sample the Brillouin zone. Fermi-Dirac distributions were used for the single-particle orbitals. Simulations were carried out in the canonical ensemble (NVT) using a Nosé-Hoover thermostat for temperature control. To determine the effects of Mg on liquid Fe properties, seven supercells—Fe80, Fe78Mg1, Fe78Mg2, Fe78Mg3, Fe78Mg4, Fe78Mg6, and Fe78Mg8—were investigated, corresponding to Mg contents of 0.0 wt%, 0.55 wt%, 1.10 wt%, 1.65 wt%, 2.18 wt%, 3.24 and 4.27 wt%, respectively. The simulations were conducted over a pressure range of 121–340 GPa and a temperature range of 6000–7500 K. Each simulation has a timestep of 1.0 fs and a duration of about 14–24 ps. Initial temperature was set to 10000 K in the first 2 ps and melting of a system was verified by the radial distribution function (RDF) and mean square displacements (MSD) of atoms. The structures were then quenched to the target temperatures (6000 to 7500 K) over a period of 2 ps, followed by an equilibration phase of 10–20 ps to determine pressure and energy. Different pressures were accessed by varying the volume of a supercell. The Pulay stress was determined to be less than 0.2 GPa using simulations employing a cutoff energy of 800 eV and a 2 × 2 × 2 k-point mesh. The effects of simulation cell size and time duration were evaluated by performing test simulations with a larger cell of Fe156Mg16 and/or a longer duration of up to 50 ps. These simulations showed negligible differences in pressure (< 0.25 GPa), internal energy (< 9.00 meV/atom), and derived compressional wave velocity ( < 0.3%) (Supplementary Figs. S2-3), indicating that the present system size ( ~ 80 atoms) and duration ( ~ 10 ps) are sufficient for the calculations of the compressional properties of liquid Fe-Mg alloys (Supplementary Text S1). Additional simulations were performed to determine the EOS of hcp-structured Fe60Mg4 under inner core conditions (Supplementary Table S3). These results were utilized to estimate the volume of Mg at the inner core boundary and to calculate the density of Fe-Mg alloys.

Equation of state fitting

The Mie–Grüneisen equation of state (EOS) was used to describe the pressure-density-temperature (P-ρ-T) data for liquid Fe and Fe-Mg alloys:

$$P\left(\rho,T\right)= \frac{3{K}_{T0}}{2}\left[{\left(\frac{\rho }{{\rho }_{0}}\right)}^{7/3}-{\left(\frac{\rho }{{\rho }_{0}}\right)}^{5/3}\right]\left\{1+\frac{3}{4}\left({K}_{T0}^{{\prime} }-4\right)\left[{\left(\frac{\rho }{{\rho }_{0}}\right)}^{2/3}-1\right]\right\} \\ +B\left(\rho \right)(T-{T}_{{\mbox{ref}}}),$$
(1)

where \({\rho }_{0}\), \({K}_{T0}\), and \({K}_{T0}^{{\prime} }\) are, respectively, the density, isothermal bulk modulus, and pressure derivative of \({K}_{T0}\) at zero pressure and reference temperature Tref; \(B\left(\rho \right)=(a+b{\rho }_{0}/\rho )\) accounts for the temperature dependence of thermal pressure61,62. The EOS parameters (\({\rho }_{0}\), \({K}_{T0}\), \({K}_{T0}^{{\prime} }\), a, and b) for all liquids were determined by least-squares fitting of the P-ρ-T data from simulations to Eq. (1) with a Tref of 6000 K. The best-fit EOS parameters are presented in Supplementary Table S1.

Calculations of the compressional wave velocity

The compressional wave velocities (\({V}_{P}\)) of liquid Fe and Fe-Mg alloys were calculated from the adiabatic bulk modulus (KS) and density, both of which were obtained using the EOS:

$${V}_{P}=\sqrt{\frac{{K}_{S}}{\rho }}.$$
(2)

The adiabatic bulk modulus (KS) is related to the isothermal bulk modulus (KT), via

$${K}_{s}={K}_{T}+\gamma T{\left(\frac{{{{\rm{d}}}}P}{{{{\rm{d}}}}T}\right)}_{V},$$
(3)

and

$$\gamma=\frac{V}{{C}_{V}}{\left(\frac{{dP}}{{dT}}\right)}_{V},$$
(4)

where γ is the Grüneisen parameter; CV is the isochoric heat capacity; (dP/dT)V is the temperature dependence of thermal pressure and is equal to B(ρ) in Eq. (1); KT can be obtained from the EOS by taking derivative of Eq. (1) as,

$${K}_{T}=\rho {\left(\frac{{dP}}{d\rho }\right)}_{T}.$$
(5)

According to the previous studies, e.g. refs. 61,63, γ is independent of temperature but depends on density as

$$\gamma={\gamma }_{0}{\left(\frac{{\rho }_{0}}{\rho }\right)}^{c},$$
(6)

where \({\gamma }_{0}\) is the zero-pressure Grüneisen parameter and c is a constant of density. We obtained \({\gamma }_{0}\) and c by fitting the P-ρ-T data from simulations to Eqs. (4) and (6). The best-fit results are listed in Supplementary Table S2. The Grüneisen parameter is related to the density derivative of temperature at constant entropy (S):

$$\gamma={\left(\frac{\partial \log T}{\partial \log \rho }\right)}_{S},$$
(7)

Integration of Eq. (7) yields the adiabatic temperature profiles in the outer core. Using 5400 K and 6000 K as two endmember temperatures for the inner core boundary (ICB), the estimated temperatures at the core-mantle boundary are about 4000 K and 4500 K, respectively, consistent with those used in previous studies61,64.

Calculations of core properties and optimization of core composition

The density and compressional wave velocity of the Earth’s outer core were calculated using the ideal mixing model of Fe-alloying liquids, similar to the approach used in ref. 14,65 In this model, the density, adiabatic bulk modulus, and \({V}_{P}\) of Fe-alloying liquids are determined by the following equations:

$$\rho=\frac{M}{V}=\frac{{\sum }_{i}{X}_{i}{M}_{i}}{{\sum }_{i}{X}_{i}{V}_{i}},$$
(8)
$$\frac{V}{{K}_{S}}={\sum }_{i}{X}_{i}\frac{{V}_{i}}{{K}_{S,i}},$$
(9)
$${V}_{P}=\sqrt{{K}_{S}/\rho },$$
(10)

where M, V, \(\rho\), KS, and \({V}_{P}\) correspond to the molar mass, molar volume, density, adiabatic bulk modulus, and compressional wave velocity of the alloy; Xi, Mi, Vi, and KS,i represent the atomic fraction, atomic mass, partial atomic volume, and adiabatic bulk modulus of the i-th component in the Fe-alloy, respectively. The components considered include Fe, Si, O, C, S, H, and Mg. For the values of Vi and \({K}_{S,i}\), we utilized data derived from prior FPMD calculations14 that used similar exchange-correlation pseudopotentials and pressure corrections to this study. To account for the presence of 5 wt% Ni in the core, a positive density correction of 0.18% and a negative velocity correction of −0.19% were applied to the calculated properties of the Fe-rich liquids14. To evaluate the validity of the ideal mixing model for estimating density and \({V}_{P}\), we performed additional FPMD simulations for the Fe101Ni5Si11Mg3 composition, corresponding to 4.6 wt% Ni, 4.9 wt% Si, and 1.2 wt% Mg (Supplementary Text S2). This composition closely approximates the best-fit estimate for the E′ layer derived from the EPOC model. The calculated density (Supplementary Fig. S8) and \({V}_{P}\) from these simulations are consistent with those predicted by the ideal mixing model within uncertainty, confirming that the ideal mixing model provides a reliable description of the density and \({V}_{P}\) of Fe alloys under outer-core conditions.

We employed a simulated annealing algorithm66 to determine the optimal combination of light elements (Si, S, O, C, H, Mg) in the core, simultaneously satisfying seismically observed core properties and chemical equilibrium at the ICB. The density and \({V}_{P}\) of the outer core at several different depths and the density of the inner core at the ICB from both the PREM and EPOC models were used as observational constraints. The reduced misfit function for the optimization process was defined as:

$$\Delta=\frac{1}{N-M}\left\{{\sum }_{i}{\left[{\left(\frac{{\rho }_{i}^{{Calc}}-{\rho }_{i}^{{Obs}}}{{\sigma }_{\rho,i}}\right)}^{2}+{\left(\frac{{{V}_{P}}_{i}^{{Calc}}-{{V}_{P}}_{i}^{{Obs}}}{{\sigma }_{{V}_{P},i}}\right)}^{2}\right]}_{{OC}}+{\left(\frac{{\rho }_{{IC}}^{{Calc}}-{\rho }_{{IC}}^{{Obs}}}{{\sigma }_{\rho,{IC}}}\right)}^{2}\right\}$$
(11)

where ρi and \({V}_{P,i}\) represent the density and \({V}_{P}\) of the outer core (OC) at one of the nine selected depths corresponding to pressures of 135, 150, 175, 200, 225, 250, 275, 300, and 325 GPa. The term \({\rho }_{{IC}}\) denotes the density of the inner core at the ICB. Superscripts “Calc” and “Obs” indicate calculated and observed values, respectively. The degrees of freedom for fitting are given by N-M, where N and M are the number of data points and the number of free parameters, respectively. Uncertainties in the density (σρ,i and σρ,IC) and \({V}_{P}\) (\({\sigma }_{{V}_{P},i}\)) are estimated to be ~0.58% and ~0.82%, respectively. The assessment of uncertainties in \({V}_{P}\) demonstrates that variations in \({\sigma }_{{V}_{P},i}\) exert a negligible effect on the inferred Mg content and do not alter the compositional contrasts between the upper and lower outer core layers for Si, H, Fe, and Mg (Supplementary Text S4 and Figs. S1417).