The nature and properties of carbonate melts at high pressures (p) and temperatures (T) may govern the exchange of carbon between the Earth’s interior and the atmosphere. Because of their low densities and viscosities at shallow depths (<5 GPa), carbonate melts can mobilize carbon out of subducting slabs and can segregate rapidly from the source regions, making them active factors in crustal and sub-crustal processes1,2. The remarkable physical properties of carbonate melts, such as low viscosity3 and high electrical conductivity4, are best explained by the electronic structure of the CO32− groups that lack unpaired orbitals for covalent bonding, and thus are unable to polymerize5, unlike the SiO44- tetrahedron in silicate melts.

Experimentally, the behavior of carbonate melts at greater depths remains unexplored, despite the changes in physical and chemical properties that could be induced from compression-driven structural transformations, as observed e.g. in silicate glasses and melts6,7,8. Indeed, meltsʼ properties directly reflect on the chemical partitioning in the Earth, especially during core-formation where partial, or complete, mantle melting occurred through the formation of deep magma oceans (MO) which enabled the segregation of the metallic core9. During this process, the growing metallic core stripped away elements from the silicate mantle depending on their affinity, or siderophile character, carbon among them. Two recent studies10,11 reported a substantial change in the carbon partition coefficient between silicates and metals (DCmetal/silicate) at p > 40 GPa, suggesting that carbon becomes more lithophile at depth and concentrated in the deep mantle, e.g. bonding into the structure of silicate melts. Recent simulations show a progressive increase in polymerization in C-bearing silicate melts at rising pressures, which is evidenced by a decrease in CO2 and CO3 species at the expense of CO4 and more complex oxo-carbon polymers (CxOy)12,13,14. The same studies also report that at highly reducing conditions the presence of Fe-C, Si-C, C-C, and C-H clusters in the melts hints toward carbon partitioning from the liquid silicate to the metallic core. However, the extent to which carbon becomes less siderophile at extreme pressures and temperatures is still unknown and the underlying physical phenomena remain elusive.

Here we report the pressure-induced changes in the atomic and electronic structure of the carbonatitic glass K2Mg(CO3)2 (Methods), used as an analog for carbonate melts5,7,8 up to pressures near the core mantle boundary (CMB). Our results provide experimental evidences for the hybridization change in C atoms from sp2 to sp3 at p > 40 GPa, which directly relates to the change in DC in the Earth’s lower mantle. We used a combination of synchrotron-based techniques, non-resonant inelastic X-ray scattering (XRS) at the oxygen K-edge and X-ray diffraction via pair distribution function (PDF) analysis, to monitor the evolution of the electronic structure and bond lengths upon compression of the glass (Methods). The interpretation of the experimental data is supported by ab initio Molecular Dynamic (AIMD) simulations and spectrum calculations based on solving the Bethe-Salpeter equation (Methods). K2Mg(CO3)2-glass was chosen for two reasons, (i) the high Mg content in the glass reflect the high abundance of Mg in the Earth’s interior, hence making it suitable for experiments looking at simplified natural systems, and (ii) it is the simplest carbonate-glass stoichiometry quenchable at ambient conditions.


X-ray Raman Scattering at the O K-edge

Figure 1 shows the oxygen K-edge XRS spectra for K2Mg(CO3)2 at pressures ranging from 1 atm (Fig. 1a bottom) to 100 GPa (Fig. 1a top). The peak near 534 eV, more pronounced at lower pressures, reflects the antibonding molecular orbital of the resonant C = O double bond associated with the CO3 planar unit, also known as π*-resonance15. At higher energies, above 538 eV, a second broader feature indicated as σ* corresponds to the unoccupied C-O σ* antibonding orbitals. The most prominent spectral change in the oxygen K-edge with pressure is the disappearance of the π*-resonance at 534 eV (Fig. 1a, b), unambiguous evidence of the breakage of the C = O double bond. The integrated intensity of the π*-feature as a function of pressure in Fig. 1c shows that this process occurs gradually. After an initial decrease between ambient conditions and 10 GPa, we observe a plateau in π*-spectral intensity and a subsequent almost linear decay starting at ~40 GPa until the highest pressure, where extrapolation suggests a complete disappearance at ca. 112 GPa. Besides these prominent changes in the spectral shape, we observe a shift of spectral weight visible by a smooth intensity increase in the σ*-resonance at pressures above 80 GPa, evidenced as the emergence of a peak at ~536 eV in the spectral-difference plot (Fig. 1b). We associate the spectral shift to higher energies to general compaction around the O atoms. Simulated XRS spectra based on atomic structural snapshots from AIMD simulations are shown as thin black lines in Fig. 1a, supporting our assessment of the formation of sp3 hybridized [4]CO4 units at the expense of [3]CO3 (Fig. 2 and Supplementary Figs. 1 and 2).

Fig. 1: Experimental and simulated data from XRS spectroscopy.
figure 1

a Oxygen K-edge XRS spectra of K2Mg(CO3)2 glass at pressures between 1 bar and ~100 GPa. Simulated spectra are shown as thin black lines, the values on the left show the pressure at which the simulations were run. The simulated spectra are matched to the most similar experimental spectrum. Error bars present standard errors of the mean, i.e. standard deviation divided by the square root of the sample size. b Spectral differences with respect to the ambient data. The regions of the π*- and σ*-features are marked with shaded gray areas. c Integrated intensity of the π* peak versus pressure. Intensity and pressure error bars represent the standard error given by the peak fitting procedure.

Fig. 2: Atomic structural snapshots from AIMD simulations of K2Mg(CO3)2 at different pressures.
figure 2

a 4.5 GPa, only CO3 groups. b 106 GPa, co-existing CO3 and CO4 units. c 145 GPa, all CO3 groups have been converted to tetracarbonate. Note that (C2O7)6- dimers are present already at 106 GPa (b) (corresponding to 79 GPa in the experimental spectrum, Fig. 1a). The entire supercell configurations at different pressures are shown in Supplementary Fig. 2.

Pair distribution function analyses

The PDFs in Fig. 3a show individual peaks representing well-defined cation-anion coordination shells, the first three being C-O, Mg-O, and K-O (Supplementary Fig. 3). Cation-cation and anion-anion peaks are located at larger distances (Supplementary Fig. 3). While Mg-O and K-O merge together upon compression, the first peak of the PDF (C-O) is well resolved up to the highest measured p-point. A detailed view of the PDFs in the vicinity of the C-O bond, is shown in Fig. 3b. After the initial compaction of the C-O distance between ambient pressure and 33 GPa, the initial C-O length is recovered at 46 GPa and increases up to 85 GPa, where it decreases again until the highest studied pressure of 104 GPa (Fig. 3 and Table 1). Above 85 GPa the C-O peak is also affected by a remarkable broadening at the FWHM, which shows that C-O distances at 104 GPa vary between 0.98 Å to 1.42 Å, (Table 1). Compared to crystalline tetracarbonates16, the C-O average bond length at 85 GPa of 1.323 Å is similar to those reported for i.e. Fe4C3O12 at 74 GPa (1.352 Å) and Fe4C4O13 at 97 GPa (1.337 Å). The expansion of the bonds to an average length similar to the C-O distance in CO4-units in crystalline tetracarbonate clearly indicates that at ~85 GPa more than 50% of the CO3-groups have been converted to CO4-groups, confirming the conclusions drawn from the XRS results and AIMD simulations (Supplementary Fig. 1). In the same pressure interval, the Mg-O bond expands to 1.98 Å (Supplementary Fig. 4 and Table 1), which suggests an increase of coordination environment to 7+ at 104 GPa, from the initial ~4.5 at 1 bar17. K-O bonds show an almost linear compression, with a kink on the compression rate at 46 GPa, which coincides with the onset of formation of [4]CO4-groups. C-O, Mg-O, and K-O distances extracted from the AIMD simulations confirm these compression trends (Supplementary Figs. 4 and 5 and Supplementary Note 1).

Fig. 3: Pair distribution functions of K2Mg(CO3)2 glass at different pressures.
figure 3

The PDFs were obtained by Fourier transforms of the structure factors (Supplementary Fig. 6a). a The gray shaded areas highlight the original position of C-O and K-O peaks (Mg-O in between) and emphasize their shift upon compression. b Close-up on the C-O peak (representing the bond length distribution).

Table 1 Statistical information on the fitting of the PDF peaks as a function of pressure.

Overall, the behavior of the carbonate glass at high pressures can be rationalized as follows (Supplementary Note 1):

  • 0 – 40/45 GPa: filling of voids (mainly in the first 10 GPa), compaction with local atomic rearrangement and distortions.

  • 40/45 – 85 GPa: breaking of C = O double bonds in [3]CO3-groups and formation of [4]CO4 tetrahedra. Onset of polymerization in the glass.

  • >85 GPa: a fully polymerized framework structure with some local remnants of CO3-groups, up to ca. 112 GPa. Further compaction.

Our simulations show a modest increase in π*-peak intensity when the glass is decompressed. However, as expected, the reversibility is far from complete because of the active kinetic barrier that hinders the reverse transformation, from 4-fold to 3-fold coordinated carbon (Supplementary Fig. 7).


Carbon distribution in the deep Earth depends on the physicochemical properties of carbon-complexes in melts along with their buoyancy. While most of the primordial carbon has been stripped away from the primordial mantle during core formation, recent estimates predict carbon concentration between 0.09(4) and 0.20(10) wt% C in the core11, much lower than the 1 wt% previously assessed from cosmochemical and geochemical considerations18. Thus even with the lowest estimates, the core would still account for more than half of Earth’s total carbon budget11,19, the rest would reside in the mantle.

The effect of pressure and temperature on the oxygen fugacity (fO2) of the Earth’s lower mantle points toward a reducing environment, i.e. fO2 ~ IW-2 log units20,21, where carbon would preferentially bond with itself (C-C), hydrogen (C-H), iron (C-Fe), and silicon atoms (C-Si), when incorporated in silicate melts12,13,14. Irrespective of the origin of lower mantle carbon content, i.e. (i) carbon of primordial origin and (ii) contributions of subducted material of oceanic crust composition, the oxidation state in the deep mantle is probably inhomogeneous, consisting of locally or regionally oxidized domains. Several processes might influence the oxidation state of these regions, most important of all the disproportionation of metallic iron, which has caused the primordial lower mantle to have an excess of Fe3+ content (high Fe3+/(Fe2++Fe3+) after metallic iron segregation down into the core22,23,24. This mechanism was also proposed to explain the Great Oxygenation Event (GOE), which happened between 2.0–2.5 Ga ago25,26 initiated with the onset of vertical mixing with subsequent subduction of slabs and a more global convection. It was also suggested by several studies an overall increase of the fO2 in the MO during Earth’s accretion, the natural consequence of a (i) late delivery of oxidized material from the outer disk (in form of carbonaceous phases and chondritic materials)27,28, and (ii) the tendency of the redox reaction SiO2 + 2Fe → 2FeO + Si to shift to the right as pressure and temperature increases (11 and refs in therein). We believe that at these conditions the presence of tetracarbonate is plausible, if not as single phases that would require fO2 values too high to be found in a MO, i.e. at least 1 log units above the IW buffer at 45 GPa29, but incorporated in silicate melts forming a number of different ionic complexes12,13,14. In fact, despite the large compositional difference between our simplified system and those reported in previous simulations12, the pressure evolution of three- to four coordinated carbon species is consistent to those reported for C-bearing MgSiO3 melts at lower mantle conditions. Even at reducing conditions where ~80% of carbon atoms are coordinated with each other forming carbon clusters, ~50% of carbon atoms are also bonded with at least one oxygen atom12. Even if these results do not automatically imply the presence of tetracarbonate groups in the melt, they clearly demonstrate that carbon-oxygen interactions are not suppressed. Moreover, carbonated-silicate melts are also predicted as a result of redox melting processes in the reduced mantle at the CMB30, and the formation of calcium carbonate was shown at the expenses of dolomite in the presence of iron metal in DAC experiments31.

Geophysical studies suggest that parts of the deep primitive mantle have probably survived through Earth’s history and constitute today distinct chemical and geophysical reservoirs at the base of the mantle32 which, most important, might be connected to well known surface processes. Today, seismic tomography reveal the presence of two massive anomalous zones above the core, commonly known as large low velocity provinces (LLVPs), where seismic waves travel slowly. These provinces occupy an area of ~30% of the CMB and are considered to be chemically distinct from the surrounding mantle, formed by a combination of primordial32 or subducted material33. As discussed in the previous paragraph, the subduction of oceanic crust into the lower mantle may also contribute to create local and highly oxidized pools where the conditions for tetracarbonate groups formation are preserved. Most recent estimations indicate that only ~30% of the subducted carbon is recycled in the crust and atmosphere1, and even if the associated uncertainties are very large, it is to be expected that at least some of the remaining carbon (in the form of carbonates or other C-carriers) is transported with the oceanic crust further down, ultimately reaching the CMB and thermochemical regions32,33. LLVPs exhibit geographical correlation with hotspot volcanism at the surface, which commonly overlie the edges of the LLVPs, in locations known as ultralow-velocity zones (ULVZ)32,33,34,35,36 (Fig. 4). Recent tomographic work suggests the presence of broad conduits of reduced wave velocities beneath some prominent hotspots, extending from ULVZ at the CMB to roughly ~1000 km depth37. The total carbon emissions (e.g. magmatic eruptions and degassing) at these hotspots, e.g. Hawaii, Iceland, and Samoa, are considered to have parental magmatic CO2 content of the source ranging between 3000 and 10,000 ppm, whereas mid-ocean-ridge (MORBs), which principally sample the convecting upper mantle, around 600 ppm38. Despite the high possible uncertainties in these estimates, hotspot mantle CO2 concentrations are regarded as distinctly higher than mantle concentrations in all MORB segments located >1000 km from hotspots39. We suggest that localized viscous carbon-rich silicate melts, of primordial and subduction origin, can be stripped away by deep upwelling material to become incorporated in rising plumes33,40, from as deep as the CMB, becoming the possible parental source of intraplate oceanic volcanism and related ocean island basalts (OIBs) (Supplementary Note 2). Upon decompression and depolymerization these C-rich silicate melts become increasingly less viscous and more buoyant also helped by the depolymerization of SiOx and CO4 groups6,7,8,17. Once exhumed to depths <1200 km mechanical factors, such as low melt density, high buoyancy and mantle convection, contribute to the ascent of these carbon-rich melts into the upper mantle and ultimately their degassing into the atmosphere (Fig. 4). Moreover, it is well known that the shallow mantle is more oxidized20,21 than the deep mantle, thus during exhumation, reduced carbon-rich silicate melts presumably increase their chance to form oxy-carbon complexes.

Fig. 4: Distribution and cycling of carbon in the deep mantle during core formation (Early Earth) and in today’s Earth (Present Day Earth).
figure 4

Carbon becomes less siderophile with depth and as a consequence is stranded in the lowermost lower mantle as tetracoordinated carbon in silicate melts. With the solidification and convective motions, primordial carbon was accumulated in defined regions at the CMB32,33 known as LLVPs and ULVZs. The latter are believed to be the original source of hotspot volcanisms33,37, thus primordial carbon trapped at the CMB could be the primary source of carbon emissions in these locations (Hawaii, Samoa, Pitcairn and many others). Image credit: Josh Wood.

It should be also emphasized that increased polymerization at great depths has a strong effect on density and melt rheology. Density estimates indicate that adding up to 5 wt% of CO2 in a MgSiO3 melt at CMB conditions does not change the melt density sufficiently to make it buoyant with respect to the surrounding mantle12. Hence, silicate melts could efficiently sequester considerable amounts of carbon and simultaneously preserve the local mechanical stability since they have been found to be denser than the surrounding environment7,12. Thus, it is conceivable that the carbon present in the lowermost part of the lower mantle would have reached mechanical stability as a constituent of dense silicate melts and remained confined there.


The correlation of our findings to the most recent data on the deep carbon cycle and geophysical models of Earth’s interior leads to suggest the existence of reservoirs of carbon-rich silicate melts at the bottom of the Earth’s mantle (LLVPs), which are the largest supply for the carbon-cycle connected to well-known surface processes, i.e. the carbon-rich emissions registered in intraplate volcanism at Hawaii, Samoa, and many others. In these melts, sp3 hybridized carbon is capable to form tetracarbonate groups, contributing to the development of a 3D network structure. A substantial amount of carbon can be incorporated in silicate melts at the CMB without compromising the gravitational stability, thus it is conceivable to think that tetracarbonates actively contribute in the polymerization of silicate melts at those conditions, acknowledging nevertheless that a large part of carbon complexes in those regions could be in a reduced form. Further studies on (i) pure carbonate melts and (ii) carbonated-silicate melts should be performed to corroborate (or confute) the predictions made by simulations.


Sample selection and preparation

Pure carbonate glass (Supplementary Fig. 8) with composition K2Mg(CO3)2 was prepared at the Bayerisches Geoinstitut (BGI) by melting a homogenous and stoichiometric (50:50) mixture of K2CO3 and MgCO3 powder in an externally heated rapid-quench cold-seal pressure vessel, at 1 kbar and 700 °C for 12 h. The experiment was terminated by rapid in-situ quenching. High purity (>99.9%) K2CO3 was purchased from Alfa Aesar GmbH, dried prior to preparation of the mixture at 110 °C and stored in a drying oven. High purity MgCO3 was kindly provided by the Natural History Museum of London (UK), and dried at 200 °C to ensure dehydration of the Mg carbonate hydrates.

K2Mg(CO3)2-glass was chosen for two reasons, (1) the high Mg content in the glass well reflect the high abundance of Mg in the Earth’s interior, hence making it suitable for experiments looking at simplified natural systems, (2) it is the simplest carbonate-glass stoichiometry quenchable at ambient conditions.

X-ray Raman scattering

The high-pressure X-ray Raman scattering (XRS) spectroscopy experiments (non-resonant inelastic x-ray scattering) were performed at beamline ID20 of the ESRF –The European Synchrotron Radiation Facility (Grenoble, France) using the large solid angle spectrometer41. We used radiation from four consecutive U26 undulators that was monochromatized by a succession of a high heat-load Si(111) pre- and a Si(311) channel-cut post-monochromator. The monochromatic x-rays were focused onto a spot size of 10 × 20 μm2 at the sample position using a Kirkpatrick-Baez (KB) mirror system. The opening angles of the DAC allowed us to use spherically bent Si(660) analyzer crystals: six in the forward and six in the backscattering geometry, respectively. Signals from the forward and backscattering arrays were checked for consistency and averaged for momentum transfers of 2.3 ± 0.1 Å−1 in forward scattering and 9.5 ± 0.1 Å−1 in backscattering. The incident energy was scanned between values of 10.20 and 10.24 keV in order to obtain energy losses in the vicinity of the oxygen K-edge. All averaged signals were area normalized in the loss-region between 528.0 and 557.0 eV. In all experiments we used BX90 DACs42 equipped with 0.5 mm thick miniature diamonds43 and 200 μm and 120 μm diamonds culet size. All diamonds had a 15 μm deep recess drilled in the middle of the culet in order to maximize the x-ray path length through the sample inside the pressure chamber for an increased signal. All data analysis was performed using the XRStools program package44,45 as described in Weis et al.46. The experimental pressure conditions were estimated offline before and after each XRS measurement based on the Raman signal of the diamonds47, with the reported pressures being an average of the two values, and their difference was used as the error estimate.

X-ray diffraction and pair distribution function

The high-pressure x-ray diffraction experiments were performed at beamlines ID15a48 and ID15b of the ESRF. Membrane cells with 120 μm culets size provided by the ESRF Sample Environment Service-HP lab were used in both experiments. For each pressure point a new ~50-µm-diameter bead of K2Mg(CO3)2 was placed in a wide-aperture membrane cell, fitted with Re gaskets and no pressure medium. For each measurement, both sample and background signals were measured separately and used to calculate the structure factors S(Q), which were obtained by subtraction of the background from the sample patterns (Fig. 5). Background measurements were taken on the DAC containing only the empty gasket after decompression back to ambient conditions, thus maintaining the same gasket thickness as the sample measurement at high pressure. Incident monochromatic x-ray beams with energies of 60 keV (λ = 0.2066 Å) and 33 keV (λ = 0.4126 Å) were used for the experiments performed at ID15a and ID15b, respectively. The x-ray beam was focused down to 3 × 3 μm2 at ID15a using a Kirkpatrick-Baez mirror system (KB) and to 10 × 10 μm2 at ID15b using Compound Refractive Lenses (CRLs). Diffraction data were collected with a Dectris Pilatus3 X CdTe 2 M detector at ID15a and a MAR555 image plate detector at ID15b. Pilatus3X and MAR555 detectors were placed at 250 mm and 260 mm from the sample. A 20 µm pinhole was mounted at the entrance of the DAC to cut background air scattering. The detector-sample distance and the detector tilt angle were calibrated using LaB6 and silicon standards for ID15a and ID15b, respectively. Contrary to the MAR555 detector, which was centered with respect to the transmitted direct beam, the Pilatus detector was off-centered, allowing a higher Q-range to be detected. The typical collection time was of ~8 min at ID15a and 30 min at ID15b. A comparison example between structure factors measured at ID15a and ID15b at ~30 GPa are displayed in Supplementary Fig. 9. As one can notice, the two curves nearly coincide, and most importantly, the onset of the first and second sharp diffraction peaks, FSDP and SSDP respectively, coincide.

Fig. 5: Graphical representation of the procedure to derive the structure factor from experimental data.
figure 5

The background signal (in red) is subtracted from the sample signal (in black) and the difference is the structure factor S(Q) (in blue). The selected signal was acquired at 46 GPa, while the background was measured at 1 bar using the same gasket, thus same distance between the diamonds, after the sample has been decompressed, removed, and the gasket cleaned in ultrasonic bath.

Because of the larger high quality Q-range obtained from structure factors measured at ID15a (larger detector placed off of the sample center, higher energy), we decided to calculate the x-ray Pair Distribution Functions (PDFs) only from those data. The structure factors collected at ID15b were used, together with those from ID15a, to perform analyses on the FSDP and SSDP, of the S(Q) (Supplementary Figs. 6 and 10). Data for PDF analysis were collected at each pressure in 128 exposures of 4 s each. Particular care was taken during cell loadings to ensure reproducible positions of the diamond Bragg reflections on the detector between sample and background measurements. For each sample dataset the median image was calculated and we subtracted the corresponding median background image. Azimuthal integration to yield I(Q) diffraction patterns was done using pyFAI49. From each I(Q) the PDF, g(r), was calculated using PdfGetX350. The range of Q for g(r) calculations was 0.8 ≤ Q ≤ 12 Å−1. In order to obtain a reliable PDF from weak, noisy signal, ad-hoc intensity weighting and smoothing of the Q-space input functions were used to remove artifacts such as e.g. ripples, associated with parasitic scatting, particularly generated by the tails of diamond peaks. While peak intensities might not be very precise due to the difficulties of estimating against an unknown background, i.e. consequence of DAC setup, the peak positions are considered to be correct. Thus, we explain the distinguished intensity drop of the C-O peak of the PDF at 104 GPa (Fig. 3), attributed to the PDF generation process.

Ab initio molecular dynamics simulations

First-principles molecular dynamics (FPMD) calculations were performed using the Vienna Ab initio Simulation Package (VASP)51 based on the density functional theory. Effects of the core electrons were replaced by atomic projected augmented wave (PAW) potentials52. Valence electronic configurations of 3s23p64s1, 3s2 3p64s2, 2s22p2, and 2s22p4 were used for K, Mg, C, and O atoms, respectively. The Perdew-Burke-Ernzerhof (PBE) exchange-correlation function53 was used. The wave functions were represented by a plane-wave basis set with an energy cutoff of 495 eV. To generate the glass structure of K2Mg(CO3)2 at ambient pressure and ambient temperature, a supercell containing 176 atoms (16 K2Mg(CO3)2 formula units) was initially melted at 2000 K for 30 ps with a time step of 1 fs in the canonical ensemble (NVT). The Nose-Hoover thermostat was used to control the temperature. A single point was used for Brillouin zone sampling. Then the molten structure was gradually cooled to 300 K in 10 ps and followed by a NVT MD run at 300 K for at least another 30 ps. Higher pressure glass structures were obtained by isotropically reducing the cell size step by step. Due to the limited cell size and time duration of the MD calculation, over-heating is usually needed for the occurrence of the structural transformation in such closed system. Thus, the high pressure structure (above 28 GPa) were annealed at 4000 K for 30 ps and then quenched to 300 K. To eliminate anisotropy in the stress tensors from the NVT calculation, the isothermal-isobaric ensemble (NPT calculation) was employed on the quenched glass structures for an additional 20 ps. In agreement with experimental observations, structural analysis of the atomic configurations show 4-fold C-O coordination starting to appear at pressures higher than 58 GPa. The amount of 3- and 4- coordinated C-O are almost equal at 106 GPa, which correspond to an experimental pressure of ~ 80 GPa (Fig. 1a and Supplementary Fig. 1). At 145 GPa, the highest pressure considered here, 4-coordinated C-O becomes dominant. Snapshots extracted from the NPT MD trajectories were used in the computation of the XRS spectra (Fig. 1a).

BSE spectral calculations

All spectrum simulations were performed based on structural snapshots from the ab initio molecular dynamics simulation trajectories described in the previous sub-section using the Bethe-Salpeter Equation (BSE) method as implemented in the OCEAN code (Obtaining Core level Excitations using Ab initio methods and the NIST BSE solver)54,55. For each of the spectra presented in Fig. 1, we used 10 snapshots at regularly spaced time intervals of a few ps and evaluated the O K-edge for each of the 96 O atoms for a total of 960 individual O K-edge spectra at each pressure point.

Ground state electronic densities and wave functions were calculated at the density functional theory (DFT) level using Quantum ESPRESSO56. All DFT calculations were performed within the local density approximation (LDA) to the exchange-correlation functional, and using norm conserving pseudopotentials taken from the ABINIT repository. A planewave energy cutoff of 70 Ry and Gamma-point sampling for the ground state electron density proved to be sufficient. The wave functions for the screening and BSE calculation were generated from a non-self-consistent-field calculation using a 2x2x2 k-point mesh. We used projector augmented wave (PAW)52 reconstructed all electron wave functions for the calculation of core to valence transition matrix elements. The dielectric screening was evaluated in within a sphere centered around every scattering atom using the random phase approximation and using the Levine-Louie model dielectric function outside this sphere. Convergence of the final spectra with respect to the change over radius52,57 was confirmed. Final electron-hole scattering states are obtained by solving the BSE.