Introduction

The proposal by Ashcroft that hydrogen-rich compounds could host high-temperature phonon-mediated superconductivity under pressure1,2 has stimulated a profusion of theoretical proposals for high-pressure superconducting hydrides3,4,5,6,7,8,9 and the subsequent experimental discovery of some of these10,11,12. This new class of hydride superconductors has re-ignited the search for superconductivity at ambient conditions, and Dasenbrock-Gammon and co-workers have recently reported superconductivity in nitrogen-doped lutetium hydride with a maximum critical temperature of 294 K at a moderate pressure of 10 kbar13. Interestingly, superconductivity is reported to coincide with drastic colour changes in the reflectivity of the sample: increasing pressure transforms a non-superconducting blue metal to a superconducting pink metal at 3 kbar, and a further transformation to a non-superconducting red metal above 30 kbar.

This remarkable report has sparked a growing number of experimental14,15,16,17,18,19,20,21,22,23,24 and theoretical25,26,27,28,29,30 investigations, most of which have so far failed at reproducing or explaining near-ambient superconductivity. On the experimental front, most measurements of resistivity and magnetic susceptibility find no superconductivity near ambient conditions, with the exception of a recent work in which resistivity changes consistent with high-temperature superconductivity are reported24. Puzzlingly, multiple studies report pressure-driven colour changes, but these include a wide range of seemingly incompatible colour sequences and pressure conditions: blue-to-pink at 3 kbar and pink-to-red at 30 kbar in the original report13; blue-to-pink at 22 kbar and pink-to-red at 40 kbar14; blue-to-violet upon contact with a diamond culet, violet-to-red at 30 kbar and red-to-orange at 120 kbar15; blue-to-violet at 94 kbar15; blue-to-violet at 120 kbar, violet-to-pink-to-red gradually between 160 kbar and 350 kbar and red persisting up to 420 kbar16,17; blue-to-violet-to-pink-to-red with transition pressures differing by up to 60 kbar depending on the pressure medium used18; and persistent blue colour up to 65 kbar19. Growing evidence suggests that the colour changes are significantly affected by the initial compression procedure15 and by the pressure medium used in the diamond anvil cell18.

On the theoretical front there have been multiple reports of structure searches in the Lu–H binary and the Lu–H–N ternary systems25,26,27,28,29. Most studies only report metastable ternary structures, but Ferreira and co-workers report a ternary Lu4N2H5 stable structure29. The roles of pressure and nitrogen doping30 and of quantum and thermal ionic vibrations31 in stabilising the cubic LuH3 structure have also been studied. None of the predicted stable or metastable structures are found to be phonon-mediated superconductors near room temperature.

Given the claimed association between superconductivity and colour changes in the original superconductivity report, understanding colour changes in nitrogen-doped lutetium hydride holds the key to clarifying the possible superconductivity in this compound. However, experimental reports provide an inconsistent picture regarding pressure-driven colour changes, and there are no theoretical studies yet. In this work, we provide a full microscopic theory of colour in lutetium hydride.

Results

LuH2 under ambient conditions

Lutetium hydride under ambient conditions crystallises in the LuH2 stoichiometry with cubic space group \(Fm\overline{3}m\). As shown in Fig. 1, LuH2 adopts the fluorite structure with the lutetium atoms occupying the sites of an fcc lattice, and the hydrogen atoms occupying the tetrahedral interstitial sites.

Fig. 1: Structure, reflectivity, and colour of LuH2.
figure 1

a Crystal structure of \(Fm\overline{3}m\) LuH2. b Reflectivity of LuH2 calculated using semilocal density functional theory (DFT), DFT corrected with a Hubbard U term (DFT + U), and DFT including electron–phonon coupling (DFT + EPC). The experimental reflectivity is taken from ref. 15. c Colour and photorealistic rendering of LuH2 calculated using DFT, DFT + U, and DFT + EPC. The photorealistic rendering is shown as LuH2 surrounding a grey ball with an opening in the centre.

LuH2 is a metal whose reflectivity endows it with a blue appearance. We demonstrate the validity of our computational approach by reporting the calculated colour of LuH2 at ambient conditions in Fig. 1. We show results using three distinct computational models to explore the potential role of electron correlation due to the presence of lutetium 5d electrons and the potential role of strong electron–phonon coupling due to the presence of hydrogen.

The first model we consider uses semilocal density functional theory (DFT) in the generalised-gradient approximation, labelled DFT in Fig. 1. This model provides a basic description of the electronic structure without a detailed treatment of electron correlation and without the inclusion of electron–phonon effects. The calculated reflectivity is large in the infrared region above 800 nm, is strongly suppressed in the red part of the visible spectrum with a calculated minimum at 710 nm, and increases gradually towards the blue part of the visible spectrum. The overall shape of the reflectivity is consistent with that observed experimentally15 and directly leads to the blue colour of LuH2.

Lutetium has an electronic configuration with a partially filled 5d shell, which suggests that electronic correlation beyond that captured by standard DFT may contribute to the electronic properties of LuH2. To explore the possible role of electron correlation, we repeat our calculations using DFT corrected with a Hubbard U term, labelled as DFT + U in Fig. 1, which captures static correlation. The reflectivity curve has a similar shape to that obtained at the DFT level, but the minimum reflectivity has a lower value and occurs at a slightly shorter wavelength of 690 nm. Combined with a slighly larger reflectivity in the blue part of the visible spectrum, we obtain a slightly brighter blue colour for LuH2 using the DFT + U model. These results indicate that static electron correlation arising from lutetium only plays a minor role in LuH2. We have also performed dynamical mean field theory calculations that capture dynamical correlation and also find that they can be neglected. We rationalise these results by noting that 5d orbitals have a large electron bandwidth spanning multiple eV (see Supplementary Fig. S1) which implies that the spatial extent of the orbitals is large and the corresponding local correlations weak.

Hydrogen is the lightest of all elements, and as such it exhibits significant nuclear motion, even at zero temperature, due to quantum zero-point effects. This significant nuclear motion can lead to strong electron–phonon coupling, and this is indeed the prime motivation behind the proposal that hydrogen-rich compounds could be high-temperature phonon-mediated superconductors. To explore the possible role of electron–phonon interactions in LuH2, we repeat our calculations including contributions from both zero-point quantum nuclear motion at 0 K and thermal nuclear motion at finite temperature, labelled DFT + EPC in Fig. 1. The reflectivity curve has a similar shape to those obtained with DFT and DFT + U, but exhibits a lower value in the infrared region and a larger value in the red region. We again obtain a blue colour, indicating that electron–phonon coupling does not significantly modify the reflectivity of LuH2.

Overall, we find that electronic correlation and electron–phonon interactions make a small contribution, and that the main features of the reflectivity curve and the resulting blue colour of LuH2 are correctly captured by semilocal DFT. Therefore, our subsequent discussion neglects electron correlation and electron–phonon interactions, but further details about these contributions are included in the Supplementary Information.

Lutetium hydride colour changes under pressure

To build a microscopic theory of colour in lutetium hydride, we first explore the pressure-driven colour changes in the lutetium–hydrogen system. We have performed extensive structure searches for stoichiometries ranging from LuH0 to LuH3 at multiple pressures. The results are summarised in the convex hull diagrams depicted in Fig. 2a. At 0 kbar, the only thermodynamically stable structures are LuH2 (\(Fm\overline{3}m\) space group) and LuH3 (\(P\overline{3}c1\) space group; not cubic). There are multiple metastable structures in the entire composition space from LuH0 to LuH3 that are within 60 meV/atom of the convex hull. Increasing pressure leads to multiple additional stable structures with stoichiometries intermediate between LuH2 and LuH3. We highlight that substoichiometric LuH2−δ structures are close to the convex hull at both 0 and 400 kbar (within 11 and 42 meV/atom, respectively, up to δ = 0.25). We have also checked their dynamical stability (see Supplementary Fig. S14), so we expect that they can be accessible experimentally.

Fig. 2: Pressure dependence of the convex hull diagram, colour, and reflectivity of the lutetium–hydrogen binary system.
figure 2

a Convex hull diagrams as a function of pressure for compositions in the range LuH0 to LuH3. Dark blue circles indicate thermodynamically stable structures and red circles indicate metastable structures. The dashed vertical lines for selected stoichiometries are shown for guidance only. b Colour of LuHn compounds as a function of pressure. c Reflectivity of LuHn compounds as a function of pressure.

We show the calculated colour as a function of pressure for the most stable structure at each composition between LuH0 and LuH3 in Fig. 2b. Consistently with experimental observations, we find that pure lutetium has a silvery white colour20 (see also Supplementary Fig. S17) and, as described above in Fig. 1, LuH2 has a blue colour. Across the entire composition space, the only compositions that exhibit a blue colour at ambient pressure occur for stoichiometries close to LuH2. Similarly, the only stoichiometries that exhibit a violet colour at high pressure are those close to LuH2. Specifically, we find this trend is present for substoichiometric LuH2−δ, but not present for suprastoichimoetric LuH2+δ. We also note that LuH3 has a grey-green colour at ambient pressure that becomes grey with increasing pressure.

Figure 2c shows reflectivity curves for selected stoichiometries in the range LuH0 to LuH3 at multiple pressures. We note that only the reflectivity of LuH2 has a minimum in the red part of the visible spectrum leading to an overall blue colour, as already discussed in Fig. 1 above. The reflectivities of all other compositions show relatively flat curves across the visible spectrum, which lead to colours with various tones of grey.

Overall, the results depicted in Fig. 2 show that the only compounds in the lutetium–hydrogen binary space that are blue at ambient conditions and violet at high pressure have stoichiometries close to LuH2 with a moderate amount of hydrogen vacancies. This conclusion still holds when structures in the ternary lutetium–hydrogen-nitrogen system are considered. To demonstrate this, we perform extensive crystal structure searches in the full Lu–H-N ternary space (see Supplementary Fig. S12), and note that our structure searches are the only ones of all those published that identify a stable ternary compound at ambient pressure29. We have calculated the colour of this stable compound and also the colour of multiple other ternary compounds that are not on the convex hull but whose simulated X-ray diffraction data is consistent with experimental reports. We find that none of these structures exhibit colours that are consistent with experiment (see Supplementary Fig. S13).

These observations allow us to conclude that the colour changes in the lutetium–hydrogen–nitrogen system are dominated by the LuH2 stoichiometry. In particular, we discard the LuH3 composition proposed by Dasenbrock-Gammon and co-workers to explain high-temperature superconductivity13 as this structure has a grey-green colour at all pressures. LuH2 has also been identified as the relevant stoichiometry by comparing the calculated equation of state28 and X-ray diffraction patterns25,26,28,29 to experiment, and we also note a recent experimental work that uses LuH2-based samples and that has successfully reproduced the Raman spectrum and colour sequence with pressure reported in the original work16.

Hydrogen-deficient LuH2−δ

The calculated colour changes from blue-to-violet in LuH2 are also observed in multiple experiments15,16,17,18, but they occur at different pressures in different experiments, ranging from 0 to at least 190 kbar, but possibly higher as some experiments only observe a blue phase. Furthermore, some experimental observations reveal additional colour changes with increasing pressure, which include pink13,14,18, red13,14,15,18 and orange15. The pink colour is particularly important as it is associated with the superconducting phase in the original report13. Based on these observations, we next explore the pressure-driven colour changes of substoichiometric LuH2 in more detail.

We show the pressure evolution of the reflectivity and colour of LuH2 and hydrogen-deficient LuH1.875 and LuH1.750 in Fig. 3. At ambient conditions LuH2 has the reflectivity described in Fig. 1 and repeated in Fig. 3 with a minimum in the red part of the spectrum that leads to an overall blue colour. With increasing pressure, the reflectivity minimum shifts towards shorter wavelengths, and the reflectivity from the red part of the spectrum increases, in agreement with experiment15. This leads to a gradual colour change from blue-to-violet with increasing pressure. LuH2 undergoes a structural phase transition at 732 kbar to a phase of space group P4/nmm, which has a grey colour with an orange-red hue (reflectivity and colour shown in Supplementary Fig. S7).

Fig. 3: Pressure dependence of the reflectivity and colour of pure and hydrogen-deficient lutetium dihydrides.
figure 3

ac Reflectivity as a function of pressure (in kbar) for a LuH2, b LuH1.875 and c LuH1.750. df Colour and photorealistic rendering of d LuH2, e LuH1.875 and f LuH1.750 as a function of pressure.

At ambient conditions, LuH1.875 exhibits a reflectivity with a shape similar to that of LuH2 but with the minimum occurring at somewhat shorter wavelenghts of 600 nm. The resulting colour is still blue. Similar to LuH2, increasing pressure leads to an overall shift of the reflectivity minimum to shorter wavelengths and to an increase in the reflectivity in the red part of the spectrum. As a result we observe a blue-to-violet colour change at a pressure of about 100 kbar, significantly lower than the corresponding colour change in pure LuH2 and in the experimentally observed pressure range. Increasing pressure further leads to a gradual transition to pink (peaking at about 300 kbar), followed by red (peaking at about 500 kbar) and tending towards orange approaching 1000 kbar. Therefore, hydrogen-deficient LuH2 exhibits a sequence of colour changes that includes all colours reported experimentally.

The sequence and pressure of colour changes in hydrogen-deficient LuH2 is strongly dependent on the concentration of hydrogen vacancies. Figure 3 also depicts the pressure evolution of the reflectivity and colour changes of LuH1.750 with a higher concentration of hydrogen vacancies. In this case, the reflectivity minimum occurs at a wavelength of 550 nm at ambient conditions, giving a pink colour. Increasing pressure suppresses the reflectivity in the blue region, turning the colour from pink towards orange at lower pressures than those necessary for LuH1.875.

These results suggest that the seemingly contradictory experimental observations of colour changes in lutetium hydride are likely due to varying hydrogen vacancy concentrations in LuH2. In particular, Dasenbrock-Gammon and co-workers observe a pink phase starting with a pressure of 3 kbar13, significantly lower than the pressure reported in multiple subsequent experiments. Our results suggest that this is due to a higher concentration of hydrogen vacancies in the original work compared to subsequent studies.

The concentration of nitrogen dopants also induces colour changes in LuH2 (see Supplementary Fig. S10), but the colour changes driven by nitrogen doping only play a secondary role compared to hydrogen vacancies. We have also tested the role that hydrogen vacancies and nitrogen doping have on the reflectivity and colour of cubic \(Fm\overline{3}m\) LuH3 (see Supplementary Fig. S11), as this phase has been tentatively identified as the parent phase responsible for the superconductivity claim13. Our results show that the LuH3 phase retains a grey colour under nitrogen doping, further discarding it as a relevant phase.

Absence of phonon-mediated superconductivity in the lutetium–hydrogen–nitrogen system

Most experimental reports since the original announcement of near-ambient conditions superconductivity in the lutetium–hydrogen–nitrogen system have been unable to confirm this claim. Similarly, no calculation of stable and metastable phases in the lutetium–hydrogen-nitrogen system has predicted a high superconducting critical temperature within a phonon-mediated framework.

Our results suggest that hydrogen-deficient LuH2 is responsible for the colour changes observed experimentally. Given the claim by Dasenbrock-Gammon and co-workers that it is the pink phase that is a room-temperature superconductor, we calculate the superconducting critical temperature of LuH1.875 under pressure, which exhibits the pink phase. We find no room-temperature superconductivity, with a calculated critical temperature of the order of 0.1 K (Table 1; see also details in Supplementary Note 7).

Table 1 Calculated superconducting properties of hydrogen-deficient LuH2 at various pressures

Discussion

Dasenbrock-Gammon and co-workers report superconductivity in nitrogen-doped lutetium hydride over the pressure range 3–30 kbar13. Importantly, the claimed pressure-driven transition to and from the superconducting phase occurs simultaneously with drastic colour changes in the sample, which is pink in the claimed superconducting phase, compared to blue below 3 kbar and red above 30 kbar. In addition, they attribute the claimed superconductivity to a cubic LuH3 phase with some unknown concentration of nitrogen dopants and some unknown concentration of hydrogen vacancies.

Our calculations show that the cubic LuH3 phase is not consistent with the colour changes observed experimentally. In addition, our results suggest that the only phase that is consistent with the observed colour changes is hydrogen-deficient cubic LuH2, and that the concentration of hydrogen vacancies and nitrogen dopants controls the colour at each pressure. Finally, we also show that hydrogen-deficient LuH2 is unlikely to be a high-temperature phonon-mediated superconductor.

Our work presents a compelling demonstration of how the first principles prediction of the colour of a material can be exploited to effectively identify the microscopic characteristics of the corresponding experimental samples. Given that colour is readily accessible experimentally, while other structural characterisation techniques can be challenging to implement (particularly under pressure), our work provides a promising new avenue for identifying composition and structure of complex samples. It would be interesting to further explore the applicability of this method to study the colour of other compounds, including strongly correlated materials32,33 and magnetic materials34,35.

Methods

Electronic structure calculations

We perform density functional theory (DFT) calculations using the Vienna abinitio simulation package (vasp)36,37 implementing the projector-augmented wave (PAW) method38. We treat the 4f states of lutetium as valence by employing PAW pseudopotentials with 25 valence electrons (4f145s25p65d16s2). For the exchange-correlation energy, we use the generalised-gradient approximation functional of Perdew-Burke-Ernzerhof modified for solids (PBEsol)39. Converged results are obtained with a kinetic energy cutoff for the plane-wave basis of 400 eV and a k-point grid of size 40 × 40 × 40 for the LuH2 primitive cell and commensurate grids for other cell sizes and shapes (see convergence tests in Supplementary Fig. S20). The geometry of the structures is optimised until all forces are below 0.01 eV/Å and the pressure is below 1 kbar. We also perform select calculations using DFT corrected with a Hubbard U term, and for these we use a value of U = 3 eV. We also perform select calculations using dynamical mean field theory with the edmft code40,41, which implements density functional theory with embedded dynamical mean field theory (DFT + eDFMT). For the DFT part we have used the wien2k code42.

Reflectivity and colour

Our reflectivity calculations follow the methodology described in ref. 43. We calculate the complex dielectric function within the independent-particle approximation as implemented in vasp. In the optical limit (q → 0), the dielectric function ε(q, ω) is given by the sum of an intraband Drude-like term εintra(q, ω) due to the electrons at the Fermi surface and an interband term εinter(q, ω) describing vertical transitions between valence and conduction bands. The explicit form of each term is given by44,45:

$${\varepsilon }^{{{{{{{{\rm{intra}}}}}}}}}({{{{{{{\bf{q}}}}}}}},\omega )=-\frac{{\omega }_{D}^{2}(\hat{{{{{{{{\bf{q}}}}}}}}})}{\omega (\omega+i\gamma )},$$
(1)

where the independent-particle approximation Drude plasma frequency is

$${\omega }_{D}^{2}(\hat{{{{{{{{\bf{q}}}}}}}}})=\frac{4\pi }{V}\mathop{\sum}\limits_{{{{{{{{\bf{k}}}}}}}}}\mathop{\sum}\limits_{n}{\left|\left\langle {\psi }_{n{{{{{{{\bf{k}}}}}}}}}\right|\hat{{{{{{{{\bf{q}}}}}}}}}\cdot {{{{{{{\bf{v}}}}}}}}\left|{\psi }_{n{{{{{{{\bf{k}}}}}}}}}\right\rangle \right|}^{2}\left(-\frac{\partial {f}_{n{{{{{{{\bf{k}}}}}}}}}}{\partial {E}_{n{{{{{{{\bf{k}}}}}}}}}}\right),$$
(2)

and

$${\varepsilon }^{{{{{{{{\rm{inter}}}}}}}}}({{{{{{{\bf{q}}}}}}}},\omega )=1-\frac{4\pi }{V}\mathop{\sum}\limits_{{{{{{{{\bf{k}}}}}}}}}\mathop{\sum}\limits_{n;n\ne {n}^{{\prime} }}\mathop{\sum}\limits_{{n}^{{\prime} }}\frac{{\left|\left\langle {\psi }_{n{{{{{{{\bf{k}}}}}}}}}\right|\hat{{{{{{{{\bf{q}}}}}}}}}\cdot {{{{{{{\bf{v}}}}}}}}\left|{\psi }_{{n}^{{\prime} }{{{{{{{\bf{k}}}}}}}}}\right\rangle \right|}^{2}}{{({E}_{n{{{{{{{\bf{k}}}}}}}}}-{E}_{{n}^{{\prime} }{{{{{{{\bf{k}}}}}}}}})}^{2}}\frac{{f}_{n{{{{{{{\bf{k}}}}}}}}}-{f}_{{n}^{{\prime} }{{{{{{{\bf{k}}}}}}}}}}{\omega+{E}_{n{{{{{{{\bf{k}}}}}}}}}-{E}_{{n}^{{\prime} }{{{{{{{\bf{k}}}}}}}}}+i\eta }.$$
(3)

In these equations, V is the volume of the system, \(\left|{\psi }_{n{{{{{{{\bf{k}}}}}}}}}\right\rangle\) is an electronic state with associated energy Enk and labelled with quantum numbers (n, k), \({{{{{{{\bf{v}}}}}}}}\) is the velocity operator, and fnk is the Fermi–Dirac distribution. We use the empirical broadening parameters γ = η = 0.1 eV. To obtain the reflectivity, we average the dielectric function and the Drude plasma frequency as

$$\varepsilon (\omega )=\frac{\varepsilon (\hat{{{{{{{{\bf{x}}}}}}}}},\omega )+\varepsilon (\hat{{{{{{{{\bf{y}}}}}}}}},\omega )+\varepsilon (\hat{{{{{{{{\bf{z}}}}}}}}},\omega )}{3} \, {{{{{{{\rm{and}}}}}}}} \, {\omega }_{D}^{2}=\frac{{\omega }_{D}^{2}(\hat{{{{{{{{\bf{x}}}}}}}}})+{\omega }_{D}^{2}(\hat{{{{{{{{\bf{y}}}}}}}}})+{\omega }_{D}^{2}(\hat{{{{{{{{\bf{z}}}}}}}}})}{3}.$$
(4)

Using the relation ε(ω) = [n(ω)+ik(ω)]2 with the refractive index n(ω) and the optical extinction coefficient k(ω), we compute the reflectivity at normal incidence by assuming a vacuum-material interface as

$$R(\omega )=\frac{{[n(\omega )-1]}^{2}+k{(\omega )}^{2}}{{[n(\omega )+1]}^{2}+k{(\omega )}^{2}}.$$
(5)

We follow the method described in ref. 43 to obtain the colour from the reflectivity and we assign names to the calculated colours based on the online tool ArtyClick (https://colors.artyclick.com/color-hue-finder). We note that the intensity of the colour can change slightly using different exchange-correlation functionals (see Supplementary Fig. S19).

We use the MITSUBA 3 renderer for the photorealistic rendering46. The photorealistic images presented in the main text are rendered by assuming an ideal bulk system with a clean surface. We have also considered the effects of surface roughness on the colour and find no significant changes (see Supplementary Fig. S18). We note that colour perception is subjective and that colour appearance depends on many effects including surface roughness and thickness of the sample. For this reason, we include all calculated dielectric functions as Supplementary Data, which allows readers to independently explore the resulting colours using their own setup.

Electron–phonon coupling calculations

We use the finite displacement method in conjunction with nondiagonal supercells47 to calculate the phonon frequencies ωqν and eigenvectors eqν of a phonon mode labelled by wave vector q and branch ν. The electronic structure parameters are the same as those reported above, and we use a 4 × 4 × 4 coarse q-point grid to construct the matrix of force constants. Representative phonon dispersions are reported in Supplementary Note 6. We evaluate the imaginary part of the dielectric function at temperature T renormalized by electron–phonon coupling using the Williams–Lax theory48,49:

$${\varepsilon }_{2}(\omega ;T)=\frac{1}{{{{{{{{\mathcal{Z}}}}}}}}}\mathop{\sum}\limits_{{{{{{{{\bf{s}}}}}}}}}\left\langle {{{\Phi }}}_{{{{{{{{\bf{s}}}}}}}}}({{{{{{{\bf{u}}}}}}}})\left|{\varepsilon }_{2}(\omega ;{{{{{{{\bf{u}}}}}}}})\right|{{{\Phi }}}_{{{{{{{{\bf{s}}}}}}}}}({{{{{{{\bf{u}}}}}}}})\right\rangle {e}^{-{E}_{{{{{{{{\bf{s}}}}}}}}}/{k}_{{{{{{{{\rm{B}}}}}}}}}T},$$
(6)

where \({{{{{{{\mathcal{Z}}}}}}}}\) is the partition function, \(\left|{{{\Phi }}}_{{{{{{{{\bf{s}}}}}}}}}({{{{{{{\bf{u}}}}}}}})\right\rangle\) is a harmonic eigenstate s of energy Es, u = {uqν} is a vector containing all atomic positions expressed in terms of normal mode amplitudes uqν, and kB is Boltzmann’s constant. We evaluate Eq. (6) by Monte Carlo integration accelerated with thermal lines50: we generate atomic configurations in which the atoms are distributed according to the harmonic nuclear wave function in which every normal mode has an amplitude of \({(\frac{1}{2{\omega }_{{{{{{{{\bf{q}}}}}}}}\nu }}[1+2{n}_{{{{{{{{\rm{B}}}}}}}}}({\omega }_{{{{{{{{\bf{q}}}}}}}}\nu },T)])}^{1/2}\), where nB(ω, T) is the Bose–Einstein factor. We note that the two terms in the Bose–Einstein factor imply that the electron–phonon renormalised dielectric function includes the effects of both quantum zero-point nuclear vibrations at T = 0 K and thermal nuclear vibrations at finite temperature. We build the electron–phonon renormalised reflectivity using the electron–phonon renormalised dielectric function.

For the superconductivity calculations, we evaluate the electronic and vibrational properties using QUANTUM ESPRESSO51 together with GBRV ultrasoft pseudopotentials52 and the PBE exchange-correlation functional53. We use a plane-wave cutoff of 50 Ry, a 4 × 4 × 4 k-point grid, and a Gaussian smearing of 0.02 Ry for geometry optimisations and electronic structure calculations. We use phonon q-grids of size 4 × 4 × 4 and dense electron k-grids of size 8 × 8 × 8 for the superconductivity calculations. In the calculation of the Eliashberg spectral function,

$${\alpha }^{2}F(\omega )=\frac{1}{2}\mathop{\sum}\limits_{\nu }{\int}_{{{{{{{{\rm{BZ}}}}}}}}}\frac{d{{{{{{{\bf{q}}}}}}}}}{{{{\Omega }}}_{{{{{{{{\rm{BZ}}}}}}}}}}{\lambda }_{{{{{{{{\bf{q}}}}}}}}\nu }\delta (\omega -{\omega }_{{{{{{{{\bf{q}}}}}}}}\nu }),$$
(7)

the integral is calculated by a sum over the q-grids and the Dirac–delta functions are replaced by Gaussians with a width of 0.1 THz, where λqν is the electron–phonon coupling parameter for vibrational mode ν at q. These parameters provide converged values of λ and \({\omega }_{\log }\) derived from moments of α2F(ω). We estimate the superconducting critical temperature \({T}_{c}^{{{{{{{{\rm{AD}}}}}}}}}\) using the McMillan–Allen–Dynes formula54,

$${k}_{{{{{{{{\rm{B}}}}}}}}}{T}_{c}^{{{{{{{{\rm{AD}}}}}}}}}\,=\,\frac{{\omega }_{\log }}{1.2}\,\exp \left[-\,\frac{1.04\,(1+\lambda )}{\lambda (1-0.62\,{\mu }^{*})-{\mu }^{*}}\,\right],$$
(8)

where μ* = 0.125. We also calculate \({T}_{c}^{{{{{{{{\rm{E}}}}}}}}}\) from a numeric solution to the isotropic Eliashberg equations. The values of Tc do not change significantly for a range of μ* values from 0.06 to 0.18.

Structure searches

In the study of the lutetium–hydrogen binary system, we perform structure searches using the same Ephemeral Data-Derived Potential (EDDP)55 as used by some of us in Ferreira and co-workers29. To generate the initial binary structures, we remove hydrogen atoms in cubic LuH3. Starting with a 2 × 2 × 2 supercell of the pristine cubic LuH3 structure, we enumerate all possible symmetrically inequivalent defect structures with hydrogen vacancies using the disorder code56,57. This results in 55,066 unique structures for compositions in the range LuH0 to LuH3, reducing the original count from 17,777,214 through symmetry considerations. These structures are then optimised using the potential. The low energy structures resulting from the machine-learned potential relaxation are carried forward for subsequent DFT calculations.

We further use the ab initio random structure searching (AIRSS) method58,59 to explore lutetium–hydrogen-nitrogen ternary compounds with cubic symmetry matching that reported in experimental X-ray diffraction data. We generate 1000 cubic structures by randomly replacing all Lu and H sites with H, N, or a vacancy, which supplements the 200,000 randomly generated Lu–H-N structures sampled in previous work29. We then relax these additional structures using DFT.