Introduction

The decades old quest for a near room-temperature superconductor has recently come to fruition. Inspired by Ashcroft’s predictions that hydrogen-rich compounds metallized under pressure could be phonon-mediated high-temperature superconductors1,2, synergy between experiment and theory has led to remarkable progress3,4,5. A superconducting critical temperature, Tc, of 203 K near 150 GPa was reported for H3S6, followed by a Tc of 260 K near 200 GPa in LaH107,8. Later, a carbonaceous sulfur hydride superconductor with a Tc of 288 K at 267 GPa was reported9. Many questions remain unanswered about this system; perhaps the most pressing being: “What is the composition and structure of the phase, or phases, responsible for the remarkable superconductivity?” Recent x-ray diffraction (XRD) studies suggest the material is derived from the Al2Cu structure type up to 180 GPa10,11,12, but its evolution upon further compression where the Tc is highest has not yet been determined experimentally. The reported Tc verses pressure9 shows evidence for a transition near 200 GPa, although the scatter in the data are consistent with a continuous change in Tc. On the other hand, the XRD results suggest that this change in Tc could arise from the collapse of the observed lower symmetry orthorhombic to higher symmetry superconducting phases11. Moreover, recent studies of the C-S-H system suggest a Tc as high as 191 K near 100  GPa, results that highlight the sensitivity of the material to the thermodynamic paths used to synthesize the high Tc phase.13.

To understand the nature of carbonaceous sulfur hydride, it is useful to review the work leading to the discovery of the initial high-Tc H3S superconductor14. Synthesis of (H2S)2H2 van der Waals compounds at pressures up to 40 GPa15 inspired the computational search for additional H-S phases that might be stable and potentially superconducting at megabar pressures16,17. An \(Im\bar{3}m\) symmetry H3S phase, which can be described as a body centered cubic sulfur lattice with H atoms lying midway between adjacent S atoms (Tc = 191–204 K at 200 GPa), was predicted to be stable above 180 GPa. An analogous lower-symmetry R3m phase with asymmetric H-S bonds was preferred at pressures down to 110 GPa (Tc = 155–166 K at 130 GPa)17. Experiments on the H–S system confirmed the maximum Tc (203 K) near the expected pressures (155 GPa), leading to the proposal that the synthesized structure was the predicted \(Im\bar{3}m\) phase6. Subsequently XRD measurements largely confirmed the predicted cubic structure18,19. However, the synthesis conditions were found to dictate the product that formed, and Tcs as low as 33 K were measured. Thus, reproducing the synthesis of the cubic phase proved difficult20,21, and more recently altogether new structures have been reported22.

These observations suggest that a number of HxSy superconductors can be made. Indeed, additional peaks observed in XRD measurements have been assigned to possible secondary phases18,21. Various stoichiometries including H2S16,23, HS224, H4S325, and H5S226 have been proposed for materials with lower Tcs. Exotic Magnéli phases with HxS1−x (2/3 < x < 3/4) compositions characterized by alternating H2S and H3S regions with a long modulation whose ratio can be varied to tune the Tc have also been proposed27. First-principles calculations suggested that H2S self-ionizes under pressure forming a (SH)(H3S)+ perovskite-type structure28 that may undergo further deformations to a complex modulated phase29,30. A Z = 24 \(R\bar{3}m\) symmetry phase whose density of states (DOS) at the Fermi level (EF) was predicted to be lower than that of R3m and \(Im\bar{3}m\) H3S was computed to be more stable than these two phases between 110 and 165 GPa31. The role of quantum nuclear and anharmonic effects on the \(R3m\to Im\bar{3}m\) transition and Tc has been investigated32,33, as has the response of the Fermi surface to uniaxial strain34.

Turning to the C-S-H ternary, initial crystal structure prediction calculations conducted prior to the discovery of the carbonaceous sulfur hydride superconductor considered stoichiometric CxSyHz compositions with relatively high carbon dopings35,36. These studies identified metastable CSH7 structures that were based on the intercalation of methane into an H3S framework, with maximum Tcs estimated to be 194 K at 150 GPa35 and 181 K at 100 GPa36. Since then other stoichiometries based on these structural motifs, such as CS2H10, have been explored37,38. However, the measured structural parameters, PV equations of state11, and the variation of Tc versus pressure9 do not match those calculated for these hydride perovskite-like materials. First-principles calculations employing the virtual crystal approximation (VCA) predicted that remarkably low-level hole-doping resulting from the incorporation of carbon in the parent H3S phase (i.e. C0.038S0.962H3) could increase the Tc up to 288 K39. It was argued that doping tunes the position of EF, moving it closer to the maximum in the DOS that arises from the presence of two van Hove singularities (vHs). Because vHs increase the number of states that can participate in the electron-phonon-coupling (EPC) mechanism, this effect is known in general to enhance the total coupling strength, λ, and in turn the Tc in conventional superconductors. The role that the vHs play in increasing the Tc in H3S has been studied in detail40,41,42,43.

Despite the striking success of the VCA model in reproducing theoretically the very high Tc measured for the C-S-H superconductor39, this approach does not take into account the effect of the doping on the local structure and electronic properties, and its limitations have been discussed44,45. To overcome these limitations we systematically study the role of doping on the thermodynamic and dynamic stability, electronic structure, and geometric properties of phases with doping levels as low as 1.85%. Three types of substitutions are considered involving S replaced by C, together with different numbers of hydrogens, yielding either six-fold or four-fold coordinate carbon atoms. We find that CH6 and CH4 form stable configurations within the dense solid in phases that are dynamically stable at the pressures studied experimentally. Moreover, doping decreases the DOS at EF because it breaks degeneracies and localizes electrons in C-H bonds. Our results illustrate that the rigid band model does not reliably predict the superconducting properties of the doped phases. Finally, the descriptors associated with superconductivity, such as the DOS at EF, the logarithmic averaged phonon frequency, and Tc of various metastable C–S–H phases are analyzed.

Results and discussion

Octahedrally coordinated carbon in CxS1−xH3 phases

To investigate how different levels of doping affect the kinetic and thermodynamic stability, electronic structure, and superconducting properties of H3S, we constructed supercells of the \(Im\bar{3}m\) structure where one of the sulfur atoms was replaced by carbon. Calculations were carried out at 270 GPa with CxS1−xH3 stoichiometries and two different types of coordination environments around the dopant atom were considered. In the first type the carbon atom was octahedrally coordinated by six hydrogen atoms, and in the second type two of these C–H bonds broke resulting in a quasi-tetrahedral CH4 molecule. A detailed analysis was carried out on the C0.0625S0.9375H3 (CS15H48) stoichiometry at 270 GPa, which was dynamically stable for both carbon coordination environments (as illustrated in Supplementary Figs. 2f and 8c).

The calculated C–H distance in the octahedrally coordinated phase, which we refer to as Oh-CS15H48 (Fig. 1a), measures 1.17 Å. The negative of the crystal orbital Hamilton population integrated to the Fermi level (-iCOHP), which can be used to quantify the bond strength, is calculated to be 5.11 eV for this bond. The distance between the hydrogen atom bonded to carbon and its nearest neighbor sulfur (1.71 Å), is significantly larger than the H–S distance found in \(Im\bar{3}m\) H3S at this pressure (1.45 Å). The weakening of the CH–S bond upon doping is evident in the -iCOHP, which decreases from 3.74 eV/bond (in H3S) to 2.00 eV/bond. Despite the non-negligible -iCOHPs between the hydrogen atoms bonded to carbon and the nearest neighbor sulfur atoms, the ELF (Fig. 1b) does not show any evidence of covalent CH–S bond formation. The integrated crystal orbital bond index (iCOBI), which is a quantification of the extent of covalent bond formation46, is calculated to be 0.34 for each S–H bond in H3S, indicating a bond order of roughly 1/3. Substituting C in an octahedral coordination environment leaves the S–H iCOBI essentially unchanged for bonds distant from the C substitution site, but for CH–S bonds the iCOBI drops to 0.21, showing the weakening of this bond. Practically no antibonding states are filled in the S–H interaction with H coordinating C (Supplementary Discussion 1), but the increased S–H distance leads to an overall decrease in the magnitude of the iCOBI. The C–H bonds in the octahedral CH6 motif possess the largest iCOBI in the system, 0.51. Subtracting the charge density of the CS15H48 structure from a sum of the density arising from the neutral CH6 molecule and the neutral H–S framework (Fig. 1d) illustrates that charge is transferred from the CH6 unit into the nearest neighbor sulfur lone pairs, which can also be seen in the ELF plot (Fig. 1b). A Bader analysis, which typically underestimates the formal charge, yields a +0.25 charge on CH6, indicating that charge redistribution is associated with stabilization of this configuration in the dense structure.

Fig. 1: Geometry and electronic structure of Oh-CS15H48.
figure 1

a Optimized geometry and b, c electron localization function (ELF) contour plot of C0.0625S0.9375H3 (Oh-CS15H48, space group \(Pm\bar{3}m\)), where the carbon atom is octahedrally coordinated by hydrogen atoms at 270 GPa. The plane of the contour passes through b CH6 and c H3S, and the range of the isovalues is from 0.0 (blue/cold) to 1.0 (red/warm). The atoms through which the plane passes are labelled. d The following electron density difference: ρ(CH6) + ρ(S15H42) − ρ(CS15H48) where red denotes a loss of charge and green a gain of charge (isovalue = 0.005). Sulfur/carbon/hydrogen atoms are yellow/black/white and select geometric parameters are provided. Hydrogen bonded to carbon is green.

An analysis using the reversed approximation Molecular Orbital (raMO) method47, which uses linear combinations of the occupied crystal orbitals of the system to reproduce target orbitals, revealed substantial bonding interactions within the CH6 cluster. The reproduced s orbital on the hydrogen atom in this motif contained electron density with p-orbital symmetry on the neighboring C atom, indicative of sp bonding. Similarly, the reproduced s orbital on C strongly interacted with the surrounding H atoms, which is evident in its anisotropy as compared to the more isotropic sulfur s orbital reproductions (Supplementary Discussion 2).

Theoretical considerations have been key in designing ways to stabilize four-coordinate carbon in unusual bonding configurations such as planar tetracoordinate carbon48,49. While a wide variety of molecular compounds containing coordination numbers surpassing four, such as carbocations, carboranes, organometallics, and carbon clusters, are also known50,51, octahedrally coordinated carbon is quite unusual. Examples include elemental carbon, which has been predicted to become six-fold coordinate at terapascal pressures52,53, and high pressure Si–C compounds such as rock-salt SiC54,55, and two predicted Si3C phases56. More relevant to the C–S–H system are carbon atoms bonded to more than four hydrogen atoms such as the nonclassical carbocation, Cs-CH\({}_{5}^{+}\), which contains three short and two long C–H bonds. It can be viewed as a proton inserted into one of the σ C–H bonds within methane, forming a three-center two-electron (3c–2e) bond between one carbon and two hydrogen atoms57. Ab initio calculations for the isolated molecule have shown that the minimum energy configuration for the di-carbocation, CH\({}_{6}^{2+}\), possesses C2v symmetry with two long 3c–2e and two short classic 2c–2e bonds, rather than the Oh symmetry CH\({}_{6}^{2+}\) geometry58,59. Following one of the triply degenerate imaginary normal modes, which can be described as a wagging motion along the three sets of H–C–H 180 angles in the octahedron, leads to the C2v minimum. Turning now to the hypercoordinated carbon atom in the Oh-CS15H48 model structure, explicit calculation of the phonons at the Γ point reveals that in the solid state the frequency of this same triply degenerate mode is real (calculated frequency of 1712 cm−1), and the vibration is coupled with the motions of the hydrogens in the H3S lattice. Thus, the stabilization of the octahedral molecular complex is facilitated by weak interactions with the host lattice. Notably, the calculated C-H bond length in CH\({}_{6}^{2+}\) obtained at the HF/6-311+G(2d,p) level of theory, is nearly identical to that of Oh-CS15H48 at 270 GPa (both ~ 1.17 Å). That the carbon weakly interacts with the host lattice is supported by calculations where the carbon (or sulfur) is replaced with neon. The optimized Oh-NeS15H48 structure is dynamically stable at these pressures, with a calculated Ne-H distance of 1.37 Å (Supplementary Fig. 27).

Quasi-tetrahedrally coordinated carbon in CxS1−xH3 phases

When placed in a cube a tetrahedral methane molecule can retain its symmetry only if it its hydrogens point toward four corners of the cube. In the phases studied here such an orientation introduces unfavorable steric interactions, and a lower enthalpy can be obtained when the hydrogens point towards four cube faces instead. Because of this the four coordinate CH4 species within the phase we refer to as Td-CS15H48 actually possesses C2v symmetry. As illustrated in Fig. 2a, at 270 GPa its two C–H bond lengths are nearly identical with calculated -iCOHPs of 6.34 and 6.30 eV/bond. The H-S distances between two of the hydrogens bonded to carbon elongate to 1.73 Å, and a further two to 1.91 Å. At the same time two of the S–H bonds contract relative to those within \(Im\bar{3}m\) H3S (1.35 Å). The encapsulated methane molecule possesses H–C–H angles that deviate from the ideal tetrahedral angle (100, 103, and 140), and its Bader charge, −0.09, is suggestive of electron donation from the H–S lattice. Plots of the ELF (Fig. 2b) clearly illustrate the C–H bond, but do not show any evidence of covalent bond formation between CH4 and the H–S framework. Thus, two H–S and four C–H bonds per unit cell in Td-CS15H48 become classical 2c–2e bonds, no longer participating in delocalized multi-centered bonding as they would within H3S.

Fig. 2: Geometry and electronic structure of Td-CS15H48.
figure 2

a Optimized geometry and b electron localization function (ELF; isovalue = 0.8) of the CH4-based C0.0625S0.9375H3 (Td-CS15H48, space group Amm2) in which the carbon atom is quasi-tetrahedrally coordinated by hydrogen atoms at 270 GPa. Sulfur/carbon/hydrogen atoms are yellow/black/white and select geometric parameters are provided. Hydrogens bonded to carbon/sulfur only are green/orange. ELF contour plot is provided in Supplementary Fig. 19.

Properties of the S → C Doped Phases at 270 GPa

Our calculations find the DOS at the Fermi level, NF, in H3S to be 0.050 states eV−1 Å−3 at 270 GPa. Moving EF down in energy by 0.17 eV, which can be achieved by doping with ~ 5.7% C, yields the highest possible value of 0.055 states eV−1 Å−3. Given a reference material whose superconducting critical temperature, \({T}_{{{{\rm{c}}}}}^{0}\), is known, the approximate Bardeen–Cooper–Schrieffer formula can be employed to estimate the Tc of a similar material via the formula \({T}_{{{{\rm{c}}}}}=1.13{{{\Theta }}}_{{{{\rm{D}}}}}{({T}_{{{{\rm{c}}}}}^{0}/1.13{{{\Theta }}}_{{{{\rm{D}}}}}^{0})}^{{N}_{{{{\rm{F}}}}}^{0}/{N}_{{{{\rm{F}}}}}}\), where ΘD is the Debye temperature and NF is given per unit volume60. Using the measured value of \({T}_{{{{\rm{c}}}}}^{0}=\)170 K at 270 GPa for \(Im\bar{3}m\) H3S19, this simple model, which neglects the likely increase of λ that is associated with an increase in the DOS at EF, predicts a Tc of 208 K for ~ 5.7% C doping, which is somewhat lower than the results obtained using the VCA at the same pressure and doping level39.

To study the effect of doping on the electronic structure, we performed a single point calculation on an unrelaxed 2 × 2 × 2 supercell of \(Im\bar{3}m\) H3S where a single sulfur atom was replaced by carbon. In contrast to the VCA model predictions we found that NF decreases to 0.048 states eV−1 Å−3. Structural relaxation to the Oh- and Td-CS15H48 phases further lowers NF to 0.040 and 0.033 states eV−1 Å−3, respectively, as illustrated in Fig. 3. This initially counter-intuitive behavior of NF can be understood by considering the following: replacing sulfur by carbon followed by structural relaxation decreases the number of degenerate bands near EF because some of the metallic electrons that were delocalized in the H3S framework now become localized in covalent C-H bonds. Whereas 14 bands (some of which are degenerate) cross EF − 0.17 eV in \(Im\bar{3}m\) H3S at 270 GPa, only 11 bands intersect with the Fermi level within both Oh- and Td-CS15H48 (Fig. 3a–c).

Fig. 3: Band structure and density of states at 270 GPa.
figure 3

a \(Im\bar{3}m\) H3S in a 2 × 2 × 2 supercell of the standard conventional lattice, b \(Pm\bar{3}m\) Oh-CS15H48, and c Amm2 Td-CS15H48. To compare the band structures of the three phases, which all possess different space-groups, simple cubic symmetry is assumed and the high symmetry special points used are Γ (0,0,0), X (0.5,0,0), M (0.5,0.5,0) and R (0.5,0.5,0.5). d Densities of states of these phases where Oh denotes CS15H48 with hexacoordinate carbon and Td with tetracoordinate carbon. The black horizontal dashed line denotes EF and the green dashed line EF − 0.17 eV, which corresponds to the top of the peak in the DOS in \(Im\bar{3}m\) H3S.

We also investigated how the vibrational properties of \(Im\bar{3}m\) H3S are affected by carbon doping. The ΘD of the phase where carbon is four-coordinate is larger than that containing six-coordinated carbon, which is higher than that of pure H3S (Table 1). The highest vibrational modes in Td-CS15H48 corresponded to the asymmetric ( ~ 3125 and 3290 cm−1), and symmetric H–C–H stretch ( ~ 3140 and 3170 cm−1). Oh-CS15H48 possessed a high frequency C-H stretching mode at ~ 2360 cm−1. Because the quasi-molecular CH4 species possesses stronger and shorter C–H bonds as compared to the octahedrally coordinated carbon, these vibrations are found at higher frequencies.

Table 1 Electronic, vibrational, and superconducting properties of dynamically stable phases at 270 GPa.

CxS1−xH3 phases as a function of doping and pressure

We now consider the dynamic stability of the CxS1−xH3 stoichiometries as a function of doping at 270 GPa, beginning with phases where carbon is octahedrally coordinated. Both the H–S and H–C bond lengths in the 50% doped dynamically unstable CSH6 structure measured 1.37 Å. A majority of the phonon modes that were imaginary at some point within the Brillouin zone turned out to be related to the motions of the hydrogen atoms bonded to carbon. Decreasing the doping level to 25% allowed the C–H and S–H bonds to assume different lengths so that some of the imaginary modes in the 50% doped structure became real, specifically the asymmetric and symmetric H–C–H stretching modes.

For 25 (12.5)% doping a structure with P4/mmm symmetry was found to be 78 (18) meV/atom less stable than one with \(Fm\bar{3}m\) (\(Im\bar{3}m\)) symmetry. The dynamic instability in P4/mmm CS3S12 was associated with the movement of a hydrogen atom sandwiched between two carbons resulting in the lengthening of one, and contraction of another C–H bond that measured 1.41 Å. In \(Fm\bar{3}m\) CS3S12 such C–H–C contacts are absent, but a mode emerges around 2345 cm−1 corresponding to the symmetric H–C–H stretching mode where the C–H bonds measure 1.17 Å. However, the asymmetric H–C–H stretching modes, which are triply degenerate at Γ, are imaginary. They are coupled with the motion of an isolated S atom (S–H distances of 1.65 Å) that attempts to achieve higher coordination and form CH–S bonds. The 12.5% doped P4/mmm phase is dynamically unstable as well, but in \(Im\bar{3}m\) CS7S24 C–H–C contacts are absent, while the S atoms that are undercoordinated in the 25% doped structure are all stabilized by the formation of S–H–S motifs. The symmetric H–C–H stretch is at ~ 2350 cm−1 with a C–H bond length of 1.17 Å, while the asymmetric stretch, which is coupled to the asymmetric H–S–H stretch, appears at ~ 1980 cm−1. At ~ 1850 cm−1 a symmetric scissoring H–C–H mode appears. This phase becomes dynamically stable above 260 GPa.

CS15H48, which was dynamically stable between 255 and 270 GPa (Supplementary Fig. 4), was also considered. In it, the carbon atoms were far enough apart to prevent the formation of unstable environments such as C–H–C bonds or undercoordinated S atoms. At 240 GPa visualization of one of the triply degenerate imaginary modes at Γ revealed that it can be described as a lengthening/contraction of the CH–S distance, which measured 1.73 Å in the optimized structure, with the other two modes corresponding to the same vibration but along the other crystallographic axes. Upon decreasing pressure from 270 to 240 GPa the C–H bond length increased minimally (Δd = 0.005 Å, -ΔiCOHP = 0.02 eV/bond), whereas the increase in the CH–S distance was an order of magnitude larger (Δd = 0.03 Å, -ΔiCOHP = 0.10 eV/bond). These results suggest that the instability that emerges near 255 GPa is primarily a result of decreased S-H interaction at lower pressures.

We also considered Oh-CS53H162, which corresponds to 1.85% doping, with calculated C-H bond lengths of 1.16 Å and S–H bonds ranging from 1.43 to 1.48 Å. Unsurprisingly, its DOS at EF of 0.048 states eV−1 Å−3 and its ΘD of 1368 K approach the values obtained for \(Im\bar{3}m\) H3S (Table 1). Phonon calculations revealed that this phase was dynamically stable at 270 GPa, and it could be stabilized to lower pressures than Oh-CS15H48, becoming unstable by 160 GPa.

The 25% doped CS3H12 phase with four-coordinate carbon was stable between 160 and 270 GPa and visualization of the largest magnitude imaginary mode found at the R point at 140 GPa illustrated that it corresponded to a symmetric/asymmetric H–S–H stretch. For 12.5% doping three different structures, which could be described by the distribution of the CH4 units relative to each other, were considered (Supplementary Fig. 8). The methane molecules could be isolated, or form CH4 chains or CH4 sheets, with Fmm2, Pm or Amm2 symmetries, respectively. At 270 GPa the Amm2 structure was more stable by 10/16 meV/atom with respect to Pm/Fmm2, suggesting that “phase separation” is preferred. However, Amm2-CS7H24 became dynamically unstable near 250 GPa, Fmm2 at 160 GPa, and Pm at 140 GPa. CS15H48 became dynamically unstable near 160 GPa via a softening of the longitudinal acoustic mode at an off Γ point, and Td-CS53H162 was stable (unstable) at 200 (160) GPa.

CxS1−xH3+x phases: doping H3S via Substituting SH3 by CH4

Instead of replacing a fraction of the S atoms by C atoms, another way to dope H3S would be to replace some of the SH3 units by CH4 units. Indeed, XRD and equation of state analysis show that the precursor phases of the C-S-H superconductor are (H2S)2H2 and (CH4)2H2 van der Waals compounds that have identical volumes at the synthesis pressure, thereby allowing readily mixed (H2S,CH4)2H2 alloys11. This leads to the possibility that CH4 molecules persist well into the superconducting H3S-based phase or phases with H2 taken up in the structure. First-principles calculations have previously been employed to investigate the properties of metastable phases that correspond to 50% SH3 → CH4 substitution, wherein methane molecules were intercalated in an H3S framework35,36. Lower dopings could be derived from the Td-CxS1−xH3 phases discussed above by adding a single hydrogen atom to the S-H lattice.

For the 25% and 12.5% CH4 dopings two different structures were considered; those where CH4 does not possess any neighbours (R3m) and where it forms chains Cm (Supplementary Fig. 13). Unlike structures where C replaced S, the CH4 dopings we considered (25, 12.5, 6.25, and 1.85% C) were all found to be dynamically stable at 270 GPa and many of them remained stable to at least 140 GPa (Table 1, Supplementary Figs. 14, and 1617). The Bader charge on the C3v symmetry methane molecule in CS15H49 was nearly the same as in Td-CS15H48, −0.10, but the bonds were somewhat shorter and stronger (1.03 Å and 6.92 eV/bond ( ×1), 1.04 Å and 6.98 eV/bond ( ×3)) and the angles were closer to those of a perfect tetrahedron (105°, 113°). The DOS at EF of CS15H49 (0.034 states eV−1 Å−3) is quite comparable to that of Td-CS15H48, but its ΘD is significantly higher (1792 K, Table 1), suggesting that its Tc may be higher as well.

Thermodynamic properties and equation of states

The relative enthalpies of the doped C-S-H structures (Fig. 4) illustrate that doping is thermodynamically unfavorable within the pressure range considered, consistent with previous studies of carbon doped SH3 phases35,36,44. For a given number of C+S atoms the phase where CH4 replaced H3S was always the most stable, followed by phases where a tetrahedrally coordinated C replaced an S atom, and lastly those where C was octahedrally coordinated. Exploratory calculations suggested that it was not enthalpically favorable to add another hydrogen to the SH3 → CH4 doped phases by forming an S-H bond (e.g. ΔH for the reaction \({{{{\rm{CS}}}}}_{3}{{{{\rm{H}}}}}_{13}+\frac{1}{2}{{{{\rm{H}}}}}_{2}\to {{{{\rm{CS}}}}}_{3}{{{{\rm{H}}}}}_{14}\) was +17.8 meV/atom).

Fig. 4: ΔH as a function of pressure.
figure 4

Formation enthalpies are calculated via the following reaction: \({{{\rm{C}}}}+x({{{{\rm{H}}}}}_{3}{{{\rm{S}}}})+\left(\frac{y-3x}{2}\right){{{{\rm{H}}}}}_{2}\to {{{{\rm{CS}}}}}_{x}{{{{\rm{H}}}}}_{y}\) in meV/atom using the diamond phase of carbon73, C2/c phase of H274 and \(Im\bar{3}m\) phase of H3S16 as a reference. The open (closed) circles correspond to structures that were found to be dynamically unstable (stable). For a plot of the full enthalpy range see Supplementary Fig. 26.

The enthalpies of the phases with the lowest levels of doping were within < 8 meV/atom of each other, and they were the closest to the threshold for thermodynamic stability, with ΔH for the formation of CS53H163 being 0.14 and 6.82 meV/atom at 140 and 270 GPa, respectively. At 270 GPa the zero-point-energy disfavored the doped species where carbon was tetrahedrally coordinated (Supplementary Table 3) but this had less of an effect on the octahedrally coordinated systems, such that for S → C replacements, the structures in which C was six coordinate generally became slightly preferred. Even though the carbon doped phases are not thermodynamically stable, their enthalpies of formation are generally within the ~70 meV/atom threshold corresponding to the 90th percentile of DFT-calculated metastability for inorganic crystalline materials at 1 atm61. Moreover, the increase of configurational entropy upon substituting C or CH4 into the SH3 framework will favor the ternary. Statistical analysis of the AFLOW data repository has shown that stability for three or four component systems is typically due to entropic factors62.

Superconducting properties

In addition to the phonon band structures and phonon densities of states, we calculated the Eliashberg spectral function, α2F(ω), and the EPC integral, λ(ω), for the model structures whose unit cell sizes were small enough so that we could obtain converged results (Supplementary Figs. 8a and 13a–d). In a recent theoretical study the highest Tc calculated for Oh-CS7H24 was 170 K at 250 GPa45. Other phases with octahedrally coordinated carbon, but lower doping levels, possessed NF values that fell below that of \(Im\bar{3}m\) H3S and ΘDs that were only slightly higher than that of R3m H3S (Table 1), in-line with computations suggesting that their superconducting response is unlikely to surpass that of the undoped binary45. Because of this, we did not investigate the superconducting properties of the Oh family of structures.

The two sets of phases with tetrahedrally coordinated carbon atoms possessed NF values similar to the octahedral family, but their estimated ΘDs were higher. Nonetheless, the logarithmic average frequency, \({\omega }_{\ln }\), of Td-CS3H12 was lower than that of H3S resulting in a substantially lower Tc. Even though decreasing the doping increases NF, once again it is unlikely that compounds belonging to this family of structures could be superconducting at temperatures higher than those found for H3S. However, adding one more hydrogen atom per unit cell to members of this family leads to a remarkable improvement. Both \({\omega }_{\ln }\) and λ of CS3H13 are higher than that of Td-CS3H12, yielding a Tc up to 142 K at 270 GPa.

To better understand how adding a single hydrogen atom can dramatically increase Tc by 60 K, we compare λ(ω) and \({\omega }_{\ln }(\omega )\) of these two model structures (Supplementary Fig. 22). At ~ 1550 cm−1 their \({\omega }_{\ln }(\omega )\) are almost identical. At higher frequencies \({\omega }_{\ln }(\omega )\) for CS3H13 increases much faster until a near plateau region is attained at 2220 cm−1 (1670 K). In Td-CS3H12, on the other hand, \({\omega }_{\ln }(\omega )\) reaches 1309 K at 2450 cm−1. Beyond ~ 2500 cm−1, the flat high-frequency bands contribute less than 40 K to \({\omega }_{\ln }(\omega )\) for both structures. Therefore, the main difference in the total \({\omega }_{\ln }\) for the two phases arises from modes in the 1550–2500 cm−1 frequency range. From the projected phonon density of states (Supplementary Fig. 24) modes associated with motions of the H atoms in the H-S lattice (H1) primarily comprise this region, with some contribution from H atoms in the CH4 molecule (H2). At ~ 1410 cm−1λ(ω) was almost the same for the two structures ( ~ 0.45). At higher frequencies the λ(ω) for CS3H13 increases much faster until 2220 cm−1 where it reaches a value of 1.00, while for Td-CS3H12 λ(ω) reaches 0.83 at 2450 cm−1. Beyond ~2500 cm−1, the high-frequency flat bands contribute less than 0.005 towards λ for both structures.

Additional insight into the types of motions that result in a larger λ within CS3H13 can be obtained by visualizing selected vibrational modes that have a notable λqν, e.g., modes about halfway along the Y → Z (1412 cm−1) and Z → L (1361 cm−1) paths, which have very large contributions (Fig. 5). Both of these involve H2 vibrations between neighboring S atoms, leading to a snakelike undulation of the H1/H2 chains. The addition of the extra S-bonded H atom expands the S-H lattice in the ab plane, leaving looser contacts between the S and H atoms (1.44 Å and 1.43 Å as opposed to 1.41–1.43 Å in Td-CS3H12), thereby softening the phonon frequencies. The c axis is largely unchanged by the addition of an extra H, but the H–S distances that are relatively even in CS3H12 (1.43–1.44 Å) become disproportionate in CS3H13 to 1.41 and 1.46 Å. Within the methane fragments, two H1 atoms possessed mirrored circular motions that were part of the undulating H chains.

Fig. 5: Superconducting properties of Cm CS3H13.
figure 5

Phonon band structure, phonon density of states (PHDOS), Eliashberg spectral function in the form of \(\frac{2{\alpha }^{2}F(\omega )}{\omega }\), and the electron phonon integral, λ(ω), for Cm CS3H13 at 270 GPa. Red circles indicate the electron-phonon coupling constant, λqν, at mode ν and wavevector q, and their radii are proportional to the strength. H1 are the hydrogen atoms in the S-H lattice, and H2 are the hydrogen atoms in CH4. The percentages given were calculated via \(\left(\int\nolimits_{{\omega }_{1}}^{{\omega }_{2}}\lambda (\omega )d\omega /\lambda \right)\times 100 \%\); and the frequency regions spanning ω1 and ω2 are color coded in the PHDOS.

Notably, the Tc of R3m CS3H13 is ~20–30 K lower than that of the Cm symmetry structure even though the NF and λ of both is approximately the same. Our analysis (Supplementary Discussion 4) illustrates the main reason for this difference arises from the increased \({\omega }_{\ln }\) of the Cm phase, which again is a result of the aforementioned snakelike undulations of the H1/H2 chains. The H-S distances in the Cm phase are more even (Supplementary Fig. 13) than in R3m, which possesses some S-H-S contacts that are beginning to disproportionate. Comparison of the results obtained for R3m CSH7 and Cm CS7H25 shows that NF does not necessarily correlate with λ. However, analysis of the λ(ω) plots (Supplementary Fig. 23) of all of the phases considered show they begin to deviate near 1300 cm−1 with the contributions in this intermediate frequency regime being key for increasing λ. Using the \({\omega }_{\ln }\), f1 and f2 parameters obtained for Cm CS3H13 we find that a λ = 2.25 yields Tc = 280 K via the Allen-Dynes modified McMillan equation. Within the Eliashberg formalism, somewhat smaller λ values would yield a similar result. Given that λ = 2.19 for \(Im\bar{3}m\) H3S at 200 GPa17, it is plausible that a C–S–H phase possessing a similar EPC, but significantly larger \({\omega }_{\ln }\) could be found by maximizing the Eliashberg spectral function between ~1300 and 2500 cm−1.

In summary, our detailed computations have shown that doping H3S by 1.85–25% carbon at 270 GPa leads to a plethora of metastable phases where carbon can be either six-coordinated or four-coordinated to hydrogen. In the first case we see the remarkable emergence of an Oh symmetry CH6 motif reminiscent of a di-carbocation, but stabilized in the solid state under pressure via weak interactions by the negatively charged environment of the surrounding host H3S-like lattice. The second case is an example of methane intercalated within an H3S-like framework. These doping schemes split degenerate bands thereby decreasing NF, and localizing electrons in covalent C-H bonds whose signatures are far removed from the Fermi energy.

The \({\omega }_{\ln }\) and λ of Td-CS3H12 were smaller than the values computed for \(Im\bar{3}m\) H3S, as was the resulting Tc. Remarkably, adding a single hydrogen atom to Td-CS3H12 increased Tc by 60 K. The larger λ and \({\omega }_{\ln }\) of the resulting CS3H13 phase could be traced back to the emergence of soft phonon modes, a consequence of the weaker and longer S-H bonds in the host lattice caused by the insertion of the extra S-bonded hydrogen atom. At 270 GPa the Tc of CS3H13 was about the same as that of R3m H3S despite its much lower DOS at EF. At this pressure the predicted Tcs of the metastable phases considered here spanned ~ 80 K, a variation that depends on the coordination of the carbon and the hydrogen stoichiometry. We hope that the present results will stimulate further theoretical studies, large supercell calculations of the superconducting properties of these structures, as well as additional experiments in search of still higher Tcs and phases that may be stable over a broader range of conditions.

Methods

Electronic structure calculations

Geometry optimizations and electronic structure calculations were performed using density functional theory (DFT) with the Perdew-Burke-Ernzerhof (PBE) exchange correlation functional63 as implemented in the Vienna Ab initio Simulation Package (VASP) 5.4.164. The valence electrons (H 1s1, S 3s23p4, and C 2s2p2) were treated explicitly using plane wave basis sets with a cutoff energy of 800 eV (as previously employed by Cui et al.35), while the core states were treated with the projector-augmented wave (PAW)65 method. The reciprocal space was sampled using a Γ-centered Monkhorst-Pack scheme, and the number of divisions along each reciprocal lattice vector was chosen such that the product of this number with the real lattice constant was 70 Å for the density of states (DOS) calculations, and 50 Å otherwise. The crystal orbital Hamilton populations (COHPs)66, the negative of the COHPs integrated to the Fermi level (-iCOHPs), and the crystal orbital bond index (COBI)46 were calculated using the LOBSTER package (v2.2.1 for -iCOHP and v4.1.0 for COBI)67, and the results used to analyze the bonding. The dynamic stability of the phases was investigated via phonon calculations performed using the finite difference scheme as implemented in the PHONOPY software package68. For the DFT-raMO procedure47, single point calculations were carried out in VASP with coarse k-point grids sampling the full Brillouin zone with dimensions equal to the supercell used in the raMO analysis, corresponding to 3 × 3 × 3 for CS15H48 and 5 × 5 × 5 for H3S.

Superconducting properties

Phonon calculations were performed using the Quantum Espresso (QE)69 program to obtain the dynamical matrix and the electron-phonon coupling (EPC) parameters. The pseudopotentials were obtained from the PSlibrary70 using H 1s1, S 3s23p4, and C 2s22p2 valence electrons and the PBE exchange-correlation functional63. Plane-wave basis set cutoff energies were set to 80 Ry for all systems. We employed a Γ-centered Monkhorst-Pack Brillouin zone sampling scheme, along with Methfessel-Paxton smearing with a broadening width of 0.02 Ry. Density functional perturbation theory as implemented in QE was employed for the phonon calculations. The EPC matrix elements were calculated using the k and q-meshes, and Gaussian broadenings listed in Supplementary Table 1. The EPC parameter (λ) converges to within 0.05 for differences of the Gaussian broadening that are less than 0.02 Ry. Here, the critical superconducting temperature, Tc, has been estimated using the Allen–Dynes equation, \({T}_{{{{\rm{c}}}}}=\frac{{f}_{1}{f}_{2}{\omega }_{\ln }}{1.2}\exp \left[-\frac{1.04(1+\lambda )}{\lambda -{\mu }^{* }(1+0.62\lambda )}\right]\), where \({\omega }_{\ln }\) is the logarithmic average frequency, μ* was set to 0.1–0.13 and the f1 and f2 correction factors for strong coupling and shape dependence are functions of ω, λ, and μ* (equaling unity for the weak coupling limit, see Ref. 71). The Tcs were also obtained by solving the Eliashberg equations72 numerically based on the spectral function, α2F(ω), obtained from the QE calculations. The Debye temperature in Table 1 was obtained using the PHONOPY software package68, as described in the computational details in Supplementary Methods.