Main

The current search for room-temperature superconductivity has progressed due to advances in high-pressure studies. A decade ago, superconductivity was assumed to be a solely low-temperature phenomenon with the highest superconducting critical temperature of Tc ≈ 130 K found in mercury-containing1 and thallium-containing2 cuprate superconductors. The discovery of superconductivity in H3S with Tc of approximately 200 K (ref. 3) suggested that Tc could be much higher in conventional superconductors for which the Bardeen–Cooper–Schrieffer theory4,5,6 was established. Thereafter, Tc up to around 250 K was found in transition metal superhydrides YH9 (ref. 7) and LaH10 (refs. 8,9,10). These experimental discoveries were anticipated by accurate theoretical predictions11,12,13, which became feasible owing to the continuous development of ab initio methods for the prediction of crystal structure and computation of superconducting properties14,15,16.

Although extreme pressure conditions render these record-high-Tc superconductors unsuitable for technological applications, the study of high-temperature superconductivity in various phases of hydrogen-rich compounds has highlighted the fundamental problem of the ultimate value of Tc possible in a superconductor. The latest theoretical predictions suggest that very high multi-megabar pressures are required for superconductivity above room temperature17,18. Another promising direction includes investigating effective methods for the stabilization of high-Tc phases at lower pressures, ideally at ambient conditions, for example, by doping19,20,21. The experimental hydrogenation of Y–La (ref. 22), La–Nd (ref. 23) and Ce–La (refs. 21,24) binary alloys was studied, but without a noticeable enhancement in Tc and pressure range of stability of presumably ternary final superhydrides compared with the parent binary Fm-3m-LaH10 and P63/mmc-LaH~9–10 phases8.

However, high pressures necessitate tiny micrometre-sized samples and drastically limit the available techniques for the experimental study of superconductivity. Electrical transport measurements have been successfully adopted in the multi-megabar pressure range and have become the primary technique to detect superconductivity25,26,27. They provide data on Tc, and the estimates of the upper critical magnetic field μ0Hc2 and coherence length ξ of superconductors, as they are performed in high external magnetic fields. Other key parameters of superconductivity, such as the lower critical field Hc1 and London penetration depth λL, can be obtained from magnetic susceptibility measurements. This type of measurement is crucial for understanding the complex behaviour of type-II superconductors in a magnetic field, particularly for the study of vortices.

Two techniques are currently used for magnetic measurements at high pressures: a double modulation a.c. technique with a system of coils28, and a superconducting quantum interference device (SQUID)29. The first technique provides only a qualitative indication of the superconducting transition and is not widely distributed due to its complexity and low sensitivity30,31. Conversely, static d.c. measurements in the SQUID are simpler, and the results are well interpreted because they comprise absolute values of magnetic susceptibility. Initially, such measurements were limited to the order of 10 GPa, and the signal was severely distorted by the background of a bulky diamond anvil cell (DAC)32,33. The development of a miniature DAC3,29 and recent improvements in background subtraction34 have greatly extended the scope of the method.

Here we improved the studies of superconductors at high pressures by introducing the trapped flux method. This method is based on the detection of magnetic flux that originates from the conjunctive action of several properties and effects in superconductors (the persistent dissipation-free current flow, quantum split of magnetic field into Abrikosov vortices, the pinning of vortices by structural defects and so on) and traps in a sample after switching off an external magnetic field. These measurements have several advantages over typical magnetic susceptibility measurements, as they are performed in a zero magnetic field, and thus, the background signal from the DAC is cancelled. The signal from the trapped flux can be approximately one to two orders of magnitude higher than the response from the zero-field-cooled (ZFC) field-screened state at low magnetic fields, and therefore, substantially smaller samples can be studied. This method is particularly beneficial for the study of superconductors having large pinning (which has been observed in several recently discovered superconductors) and is effective at distinguishing between different phases in multiphase samples, probing critical current densities jc in a wide temperature range and determining Hc1.

The Im-3m-H3S sample showed a pronounced superconducting transition in ZFC m(T) magnetization measurements with Tc ≈ 195 K, 18 months after its synthesis (Fig. 1a). At lower temperatures, the sample underwent the second superconducting transition with Tc ≈ 15 K (seen as a separation of the ZFC and field-cooled (FC) portions of the m(T) data on the background of the DAC signal (Fig. 1b)). The detected low-temperature superconductivity most probably corresponded to elemental sulfur, which was extruded on the bevels of diamond anvils during the pressurization of the sandwiched sample of NH3BH3 + S and remained intact after the pulsed-laser-assisted synthesis (Fig. 1b, inset). The superconducting transition in sulfur was extended in the temperature range of 12–18 K, which could be attributed to the substantial pressure gradients on the beveled slope of the diamond anvils. The measured Tc was in good agreement with previous observations of superconductivity in sulfur at high pressures30,35,36.

Fig. 1: Magnetic measurements of sample containing H3S and elemental sulfur.
figure 1

a, ZFC and FC m(T) data of Im-3m-H3S at 155 ± 5 GPa. b, ZFC and FC m(T) data of sulfur at 95–140 GPa. The error bars represent the standard deviation from multiple measurements. The inset shows a photograph of the sample and the spatial distribution of H3S and S. c,d, Temperature dependence of a trapped magnetic moment at zero field generated under ZFC (run 1; c) and FC (run 2; d) conditions. The open circles of different colours correspond to the temperature dependence of the trapped flux created at different magnetic fields μ0HM (0–6 T). The lower panels reveal the beginning of the penetration of flux lines into the H3S sample above μ0HM = 45.0 mT (run 1) and already at μ0HM = 0.5 mT (run 2).

Source data

Trapped flux measurements

The magnetization of a type-II superconductor is irreversible due to the pinning of vortices if the superconductor contains defects, such as dislocations, precipitates and phase boundaries, which interact with the flux lines penetrating the superconductor above Hc1.

The temperature dependencies of the trapped magnetic moment mtrap(T) generated in H3S under ZFC and FC conditions at different HM values and measured between 10 and 250 K at zero field clearly showed a superconducting transition with Tc ≈ 195 K (Fig. 1c,d and Extended Data Figs. 1 and 2), further revealing a steep upturn below ~15 K, which originated from pure sulfur. The entry of magnetic flux into sulfur occurred at μ0HM = 30.0 mT in the ZFC mode and 0.5 mT in the FC mode, which were the lowest applied magnetic fields in the two runs. This indicated that metallic sulfur belonged to either type-II or dirty type-I superconductors37,38. To exclude the contribution of sulfur to the measured magnetic response, only a portion of the mtrap(T) data collected above 30 K was used to interpret the temperature dependence of the trapped flux in H3S.

In the FC mode, even weak applied magnetic fields as low as 0.5 mT resulted in a positive non-zero magnetic response of the trapped flux in H3S (Fig. 2a). In this mode, the magnetic flux penetrated the sample in the normal state at T > Tc and became trapped at T < Tc due to very strong pinning (as discussed below).

Fig. 2: Trapped magnetic moment in Im-3m-H3S sample at 30 K.
figure 2

a, Dependence of a trapped magnetic moment at zero field on magnetization field μ0HM measured in the ZFC and FC modes (runs 1 and 2). The circles correspond to the experimental data, and the magenta and grey curves are guides for the eye. The trapped flux was created in the ZFC (black circles) and FC (red circle) modes at several applied magnetic fields HM. The inset with the enlarged plot shows the entry of the magnetic field into the sample at low HM. The error bars represent uncertainties in the estimation of values of \({{m}_{{\mathrm{trap}}}/m}_{{\mathrm{trap}}}^{\mathrm{s}}\). b, Profile of magnetic field in the disc-shaped sample in applied magnetic field HM = 2H* + Hp (ZFC mode) and HM = H* (FC mode) (area below the blue lines) and after removing the applied magnetic field (hatched red area).

Source data

Contrary to the FC mode, the ZFC magnetization provided valuable data for estimating Hp, when the applied magnetic field starts to penetrate the sample39,40,41 (Fig. 1c). No trapped flux in ZFC H3S was observed up to μ0HM = 45 mT. In this range, the external magnetic field was completely repelled from the H3S phase. We estimated μ0Hp(10 K) = 42 ± 3 mT from the data measured at 45 ≤ HM ≤ 125 mT (Fig. 1 and inset in Fig. 2a).

At higher HM, the magnetic flux penetrated the superconductor from the outer edges of the disc-shaped sample and gradually propagated towards its centre. The entry of magnetic flux led to a reduction in the Meissner currents, and being trapped to the appearance of superconducting current loops and a corresponding increase in sample magnetization at zero field. The absence of steps in the mtrap(HM) data and smooth increase in mtrap with an increase in HM implied the absence of a weak-link network in the superconducting sample42.

The observed trapped magnetic moment in the superconducting Im-3m-H3S phase saturated under the ZFC and FC conditions at different values of HM. We qualitatively interpreted this behaviour of the magnetization process in terms of the classical critical-state Bean model43,44 and considering the reversible part of magnetization in type-II superconductors39,45. According to the model, flux trapping saturates if the applied magnetic field reaches the value HM = 2H* + Hp in the ZFC mode and HM = H* in the FC mode, where H* is the full penetration field (Fig. 2b).

The trapped magnetic moment became saturated (\({m}_{{\mathrm{trap}}}^{\mathrm{s}}\)) at μ0HM ≈ 1.50 T under ZFC conditions and at μ0HM ≈ 0.65 T under FC conditions, and did not vary with a further increase in μ0HM up to 6.00 T (Figs. 1c,d and 2a). Thus, μ0H* = 700 ± 50 mT. The observed saturation is defined by the maximum value of the trapped magnetic field in the sample and corresponds to the in-field critical current density jc(B,T) and density of pinning centres in the superconductor.

We also estimated Hc1, which is proportional to Hp using the relation \({H}_{\mathrm{c1}}=\frac{1}{1-N}{H}_{\mathrm{p}}\). We used the same estimations for the size of samples and demagnetization factor N as in another work34. Using the estimated demagnetization correction of 8.5 (although it could range between 7.7 and 11.4; Methods), μ0Hc1(10 K) ≈ 0.36 T (0.32–0.48 T).

The obtained value of μ0Hp ≈ 42 mT was noticeably lower than that derived from the virgin curves of hysteretic magnetization loops (≈ 95 mT) in classical m(H) measurements29,34. We considered the trapped flux method to be more sensitive to the determination of the onset of magnetic flux entry because a large linear contribution of the initial portion of m(H) was cancelled. The advantage of this method for type-II superconductors having strong pinning was illustrated in another work45. Additionally, the signal of the trapped magnetic moment at zero field does not contain the field-dependent magnetic background arising from the DAC, which is unavoidable in classical m(H) magnetization measurements. It should be noted that the presence of tiny, fragmented parts of the superconducting phase and the ragged edges of the bulky sintered sample (Fig. 1b, inset) could influence the observed Hp. The contribution of these imperfections to the total measured magnetic moment was almost negligible in m(H) experiments because the magnetic flux penetrated these areas at substantially low applied magnetic fields due to the extremely large demagnetization factor. In the trapped flux method, these areas conversely accommodated magnetic flux at lower applied magnetic fields and provided a magnetic response before the magnetic flux entered into the massive sample. We expected the true value of Hp and the derived values of λL and Ginzburg–Landau parameter \({\kappa }=\frac{{{\lambda }}_{\mathrm{L}}}{{\xi }}\) to approximately lie between the values observed in the two types of measurement. Using the estimated value of coherence length ξ(10 K) ≈ 1.85 nm (ref. 46), we obtained λL(10 K) ≈ 37 nm (31–40 nm within the estimated limits of h) and κ(10 K) ≈ 20 (17–22). The corresponding values estimated from the m(H) magnetization measurements34 were λL(0) ≈ 22 nm (18–23 nm) and κ(0) ≈ 12 (10–13).

Critical current density

In addition to the determination of fundamental characteristics Tc and λL, we deduced another important characteristic of a superconductor from the measured mtrap(µ0HM,T) data—the critical current density over a wide temperature range. According to the critical-state Bean model43,44, a concentric screening current pattern having current density jc averaged over a sample thickness creates a magnetic moment expressed as \(m=\frac{\uppi }{3}{j}_{\mathrm{c}}h{\left(\frac{d}{2}\right)}^{3}\).

Thus, the value of \({m}_{\mathrm{trap}}^{\mathrm{s}}\)(30 K) ≈ 1.60(1) × 10–8 A m2 measured in run 1 corresponds to jc(30 K) ≈ 7.1(1) × 1010 A m−2. The extrapolation of the experimental data to 0 K for \({m}_{\mathrm{trap}}^{\mathrm{s}}\) (Fig. 3, red dashed curve) provides values of \({m}_{\mathrm{trap}}^{\mathrm{s}}(0)\) ≈ 1.64(2) × 10–8 A m2 and jc(0) ≈ 7.3(1) × 1010 A m−2. The calculated values of jc in H3S exceed jc(4.2 K) in single crystals of iron-based superconductors by two orders of magnitude47,48 and are approximately two times lower than jc(20 K) in rare-earth-barium-copper-oxide-coated conductors (second-generation wires) of similar thickness49.

Fig. 3: Temperature dependence of the normalized zero-field critical current density jc(T)/jc(0) in Im-3m-H3S sample.
figure 3

The black circles are the experimental data (trapped flux is created at TM = 10 K and μ0HM = 3 T). The dashed blue and green curves correspond to the temperature dependence of critical current density limited by δTc-type and δl-type pinning; the red dashed curve is the fit of experimental data by the δTc + δl model.

Source data

The ultimate critical current density is limited by the depairing currents50 as \({j}_{\mathrm{d}}=\frac{{{\phi }}_{0}}{3\sqrt{3{\uppi }}{{\mu }}_{0}}\frac{1}{{{\lambda }}_{\mathrm{L}}^{2}{\xi }}\), where ϕ0 is the magnetic flux quantum. Substituting the estimated values of λL and ξ, we obtained jd ≈ 4 × 1013 A m−2. The ratio between jc(0) and jd provided additional information. The values of jc(0)/jd, being approximately in the order of 10−2–10−1, are conventionally observed in low-temperature superconductors, which are characterized by relatively low κ of ~20 and strong pinning that stems from the interaction of vortices with extended defects51. However, lower values of jc(0)/jd of approximately 10−3–10−2 are characteristic for high-temperature superconductors, for example, the cuprate family in which κ is large (of the order of 100) and relatively weaker pinning originates from point defects, such as oxygen vacancies52. To improve the in-field critical current performance of cuprates, different types of artificial pinning centre were introduced into the sample structure. The synthesized sample of H3S was characterized by strong pinning (as discussed below), but the ratio of jc(0)/jd was fairly small (of the order of 10−3). This suggested that the density of defect centres in the sintered sample was not the maximum and could be further enhanced, for example, by modifying the synthesis protocol.

The different factors influencing the flux pinning in type-II superconductors are divided into two main types: δTc and δl (refs. 51,53). The δl-type pinning arises from a spatial variation in the mean free path of charge carriers, and the defects are small and point sized, for example, hydrogen vacancies in hydrides. The δTc-type pinning is caused by a spatial variation in κ due to fluctuations in Tc, and the defects are larger than ξ, such as dislocations, grain boundaries and deviations in the chemical composition. Pressure gradients can also cause variations in Tc in the case of samples in DACs. We compared the temperature dependence of the normalized critical current density jc(T)/jc(0) in the H3S sample with the simulated curves for δTc and δl types of pinning (Fig. 3). Both theoretical curves for pure δTc and δl types of pinning deviate from the experimental data; however, the resulting fit of the data showed that the δTc type of pinning dominates over the δl type.

Pinning and thermally activated motion of vortices

The kinetics of mtrap demonstrates an extremely slow rate of flux creep even at temperatures in the vicinity of Tc, at which thermal fluctuations must be substantially higher (Fig. 4c). The estimated creep rate \(S=\frac{1}{{m}_{{\mathrm{trap}},0}}\frac{\mathrm{d}{m}_{{\mathrm{trap}}}}{\mathrm{d}{\rm{ln}}t}\) in Im-3m-H3S varied from ≈ 0.002 (or 500 ppm h–1) at 165 and 180 K to ≈ 0.005 (or 2,000 ppm h–1) at 185 K, which was comparable with the lowest values of S measured in type-II superconductors54, including the extremely slow creep rate in high-jc MgB2 films at substantially lower T/Tc < 0.5 (ref. 55). The scale of fluctuations responsible for vortex melting56 and vortex creep54 in a superconductor can be quantified using the Ginzburg–Levanyuk number as \({\mathrm{Gi}}=\frac{1}{2}{\left(\frac{2\uppi {\mu }_{0}{k}_{\mathrm{B}}{T}_{\mathrm{c}}{\lambda }_{\mathrm{L}}^{2}}{{\phi }_{0}^{2}\xi }\right)}^{2}\), where kB is the Boltzmann constant. Here Gi ≈ 7 × 10−6 in H3S was substantially lower than the values reported for cuprate-based (of the order of 10−2) and iron-based (of the order of 10−5–10−2) high-temperature superconductors54,56, and comparable with those reported in low-temperature superconductors (10−9–10−6) and MgB2 (10−6). The observed slow creep rate S in H3S was close to the theoretical limit demarcated by the approximate \({{\mathrm{Gi}}}^{\frac{1}{2}}\frac{T}{{T}_{\mathrm{c}}}\) line54 and was in good agreement with the lower values of λL and κ (larger values of λL would lead to the theoretical limit of S being higher than the observed value). Additionally, electrical transport measurements of Im-3m-H3S at high magnetic fields46 showed weak vortex fluctuations and narrow vortex liquid regions due to the low values of κ and Gi.

Fig. 4: Vortex pinning in H3S.
figure 4

a, Temperature dependence of a trapped magnetic moment created at different temperatures TM and magnetic fields HM of magnetization. The arrows show the change in temperature in different warming/cooling cycles. b, Temperature dependence of a trapped magnetic moment in H3S generated at μ0HM = 2 T and TM = 8 K (black data, cycle Va). The trapped flux can be restored if the sample is magnetized again (red data, cycle Vb). c, Creep of the trapped flux in H3S at several temperatures near Tc (the trapped flux was generated at μ0HM = 1 T and TM = 165 K). The error bars represent the standard deviation from multiple measurements.

Source data

On account of the strong pinning of vortices in the H3S sample, the amount of the trapped flux solely depended on HM at which the flux was generated and the maximum temperature at which the sample was exposed after the magnetization step (Fig. 4). For example, mtrap created at μ0HM = 1 T by three different protocols merged at 100 K and above on subsequent warming (Fig. 4a, brown and orange curves of cycle II, purple curve of cycle III and green curve of cycle IV). The behaviour of mtrap was found to be independent of temperature if the sample was warmed to a certain temperature below Tc and cooled down again (Fig. 4a,b shows the horizontal trend of mtrap(T)). No pronounced hysteresis was observed for the magnetic moment during the cooling/warming cycles. This memory effect, which allows one to control the amount of trapped flux in the superconducting sample, stems from the very strong pinning of the vortices.

Trapped flux in lanthanum superhydrides

The trapped magnetic flux was further probed in the lanthanum–hydrogen system. The ZFC curve of the m(T) data measured at an applied magnetic field of 10 mT demonstrate an extended transition with the onset of Tc ≈ 200 K at 120 ± 5 GPa (Fig. 5a). The observed Tc was in good agreement with the values of the C2/m-LaH10 phase at similar pressures measured by electrical transport measurements57. The transition at Tc ≈ 200 K was notably broader than that measured in the initial sample of Fm-3m-LaH10 at 130 ± 8 GPa with Tc ≈ 231 K (ref. 34), thus indicating the poorer quality of the superconducting phase. Probably, the high-temperature superconducting Fm-3m-LaH10 phase sustained structural distortions into the C2/m-LaH10 phase and partial decomposition into the hydrogen-deficient phases due to the unexpected drop in pressure during transportation from the synchrotron (Methods).

Fig. 5: Magnetic measurements of sample containing C2/m-LaH10 and LaHx.
figure 5

a, ZFC and FC m(T) data of C2/m-LaH10 and LaHx (3 < x < 10) at 120 ± 5 GPa. The inset shows a photograph of the sample. b, Temperature dependence of a trapped magnetic moment at zero field. The red and black open circles correspond to the temperature dependence of the trapped flux created under ZFC conditions at magnetic fields of μ0HM = 1 and 2 T, respectively. The blue open circles are the data of the same sample at ~10 GPa after magnetization at μ0HM = 4 T, showing the absence of a nonlinear magnetic background from the DAC without the superconducting sample. The error bars represent the standard deviation from multiple measurements.

Source data

Contrarily, the trapped flux method demonstrates more pronounced superconducting transitions in this sample (Fig. 5b and Extended Data Fig. 3). In addition to the detection of the transition at ~200 K in the C2/m-LaH10 phase, it revealed a superconducting state of another phase below ~70 K. Superconductivity with Tc ≈ 70 K was previously observed in several samples prepared from La and H2 (taken in a large deficiency) at approximately 150–178 GPa by four-probe electrical transport measurements and could be related to LaHx (where 3 < x < 10)8. We were unable to perform the full set of measurements of the trapped flux generated at different HM values as we did for the H3S sample. At magnetization of the sample at μ0HM = 4 T, one of the diamonds cracked, and the pressure dropped below ~10 GPa. However, this allowed us to measure the background response of the DAC body induced after sweeping off a high magnetic field of 4 T. No remnant nonlinear magnetic background of the DAC body or other anomalies in the reference mtrap(T) curve were detected at ~10 GPa when the sample was evidently not superconducting (Fig. 5b, cycle III). Furthermore, we clearly demonstrated that the observed superconducting transitions in the mtrap(T) data collected at 120 ± 5 GPa (Fig. 5b, cycles I and II) belonged to the sample and not to the high-pressure assembly (DAC, gasket, diamonds and so on).

Discussion

The Meissner effect is one of the most fundamental visualizations of superconductivity and it has been considered as the proof for bulk superconductivity. However, the magnitude of the Meissner effect in type-II superconductors substantially varies in experiments from almost complete expulsion in pinning-free conventional type-II superconductors58,59 to practically no expulsion in iron pnictides60 or even to magnetic moment enhancement in various materials with extreme sensitivity to disorder61,62,63,64. The specific features of the Meissner effect in high-temperature superconductors and its strong suppression by external magnetic fields in the mixed state are associated with the strong pinning, which prevents the vortices inside the sample from shifting towards the sample surface even after crossing the Hc1(T) line65,66. The subtle or scarcely observable Meissner effect (in the FC mode) in H3S (ref. 34) agrees with the very strong pinning observed in the present work in H3S even at temperatures near Tc. Under FC conditions, the strong pinning leads to the trapping of magnetic flux in the superconducting H3S already at 0.5 mT, that is, much lower than Hp. Such strong pinning of vortices may also be promoted by the high-pressure conditions. The absence of a pronounced Meissner effect in elemental sulfur and LaH10 supports this hypothesis, although the systematic measurements of different high-pressure superconductors are required to prove it.

Standard m(T) and m(H) magnetization measurements at applied magnetic fields, which demonstrate the shielding of external magnetic fields by a sample in the Meissner state, unavoidably yield a large background of the body of the DAC in the registered value of magnetic moment. Therefore, the measured magnetic moment needs to be corrected using the reference measurements either of the same sample above its Tc (refs. 3,29) or of non-superconducting precursors29,34. The background subtraction can, however, be difficult if the DAC environment is contaminated by magnetic impurities or if the background becomes disproportionally larger than the response of a superconductor (at higher applied magnetic fields, when the penetration of magnetic flux into a superconductor suppresses the signal from screening Meissner currents).

Importantly, the response from the trapped flux at zero magnetic field was almost not perturbed by the background stemming from the DAC, including diamond anvils and a rhenium gasket. This substantially simplifies the measurements of superconducting samples at high pressures in a SQUID.

Additionally, unlike electrical transport measurements, the trapped flux method is sensitive to a particular superconducting phase in mixtures because it does not require the specific arrangement of different phases relative to electrical leads. The analysis of the mtrap(T) data provides estimations for important characteristics of superconductivity, such as Hc1, λL, pinning of vortices and especially jc, which can be probed in a wide temperature range. We believe that the trapped flux method, which shows great benefit for high-pressure studies, has also been underestimated for the study of superconductivity at ambient pressure. It can be a powerful tool for the routine screening of new superconducting materials, the study of multiphase, contaminated samples or samples with a low superconducting fraction.

Methods

Samples

We used the same samples that were studied in our previous work34. The superconducting Im-3m-H3S and Fm-3m-LaH10 phases were synthesized from sandwiched S + NH3BH3 and LaH3 + NH3BH3 samples pressurized in miniature DACs, which were specially designed for a standard commercial SQUID magnetometer3,34.

Sulfur (99.999%, Alfa), NH3BH3 (97.000%, Sigma-Aldrich) and LaH3 (synthesized from La (99.900%, Alfa Aesar) and H2 (99.999%, Spectra Gases)) were used as the initial reactants. The loading of samples into the DACs was handled in an inert Ar atmosphere with residual O2 and H2O contents of <0.1 ppm. NH3BH3 acted both as a source of H2 and a thermal isolator from the diamonds during laser heating. The thin plates of S, LaH3 and NH3BH3 for the sandwiched samples were moulded out from the corresponding powder samples by squeezing them between two large 1-mm-diameter diamond anvils. The thickness of the plates was monitored by the interference of visible light.

The sandwiched samples, in which 8-µm-thick S or 6-µm-thick LaH3 plates were interposed between two ~10–15-µm-thick layers of NH3BH3 were put in the hole of pre-indented metallic gaskets. Then, these samples were pressurized to ≈ 167 GPa with a pressure gradient across the culet of about ±7 GPa. The decomposition of NH3BH3 and the synthesis of superconducting Im-3m-H3S and Fm-3m-LaH10 phases were performed using one-side heating with a Nd:YAG pulse laser (wavelength, λ = 1.064 μm; pulse duration, 3 µs; frequency, 104 Hz). We heated the samples by horizontally and vertically traversing the ≈ 5-µm-diameter laser spot across the diamond culets. The pressure was estimated using the universal diamond edge Raman scale67. Further details of the preparation of DACs, chemical synthesis of samples, estimation of pressure values and characterization of the initial reactants and final products are available elsewhere34.

The DAC with the Im-3m-H3S sample retained the same pressure value of P = 155 ± 5 GPa throughout the measurements, whereas the DAC with the Fm-3m-LaH10 sample did not survive the transportation from the Advanced Photon Source synchrotron. The pressure decreased from P = 130 ± 8 GPa to P = 120 ± 5 GPa. We attempted to restore the sample and pressurized the DAC to P = 125 ± 5 GPa and heated the sample to ~2,000 K by a pulsed YAG laser. However, the sample demonstrated lower Tc ≈ 200 K and probably corresponded to the structurally distorted C2/m phase of LaH10, which formed from Fm-3m-LaH10 on decompression at pressures below ≈ 130 GPa (ref. 57). One of the diamond anvils cracked, and the pressure dropped to ~10 GPa during the magnetization step at μ0HM = 4 T after two successful measurements of the trapped flux generated at 1 and 2 T. The subsequent measurements of the DAC with the decomposed non-superconducting sample magnetized at μ0HM = 4 T demonstrated the linear background signal of the DAC with no anomalies in the mtrap(T) curve over the entire temperature range of 10–280 K.

Magnetization measurements

Magnetization measurements m(T) were performed using the S700X SQUID magnetometer (Cryogenic), and a miniature DAC was attached to a 140-mm-long straw made of a Kapton polyimide film, which was specially designed to minimize the end effects. The position of the sample relative to the pickup coil of the SQUID magnetometer was determined using the ferromagnetic signal from a small steel piece with a size of approximately 140 × 100 × 25 μm3 directly attached to the rhenium gasket surrounding the sample. The steel piece was removed after the centring procedure. The accuracy of sample positioning is approximately ±0.2 mm. The superconducting transition in H3S and LaH10 was probed by ZFC and FC m(T) measurements at 4 and 10 mT, respectively. Here Tc ≈ 195 K in the Im-3m-H3S phase, which was determined as the offset of the diamagnetic transition on the ZFC curves of m(T), was in good agreement with the values estimated in our previous measurements34. The much broader superconducting transition in the sample with LaH10 and the lower Tc (≈ 200 K) indicated the deterioration of the superconducting phase of LaH10 after altering the pressure in the DAC, which probably sustained the monoclinic structural distortions57.

The trapped flux was generated in two different protocols under ZFC (run 1) and FC (run 2) conditions. The typical ZFC protocol included cooling of the sample at zero field from T > Tc to the desired temperature TM below the corresponding Tc, namely, TM = 10 K for the Im-3m-H3S sample and at TM = 4 K for the C2/m-LaH10 sample. Additional experiments were performed where the magnetic flux was trapped in H3S at TM = 4 K in cycle I, TM = 100 K in cycles II and IV and TM = 8 and 25 K in cycles Va and Vb. A typical magnetization cycle in the ZFC mode consisted of a gradual increase in the applied magnetic field HM perpendicular to the sample surface at the lowest temperature point TM, standing at the target value of HM for an hour, and a gradual decrease in the magnetic field to 0 T. In the FC mode, the sample was cooled from its normal state (T > Tc) at the applied magnetic field HM to the target temperature TM < Tc. Then, HM was gradually decreased to 0 T. After removing the applied magnetic field HM in both ZFC and FC modes, the SQUID magnetometer was allowed to stand at 0 T for approximately 5 h to prevent successive measurements of mtrap(T) from outliers associated with jumps of flux in the SQUID superconducting magnet. Magnetization flux density μ0HM ranged from 0.5 mT to 6 T. The mtrap(T) measurements were performed on warming (cooling) of the sample with a temperature step of 0.3–3.0 K (a smaller step in the vicinity of Tc) and 3–4 iterations at each temperature point. Additionally, the reference mtrap(T) data were measured for the Im-3m-H3S sample by skipping the magnetization cycle (μ0HM = 0 T). The trapped magnetic moment was determined as the difference between the measured magnetic moment after the magnetization cycle and the residual magnetic moment, which arose from the body of the miniature DAC above the corresponding Tc (Extended data Figs. 13). Before each cycle of magnetization, the sample was converted to the normal state by warming to ambient temperature, and the superconducting magnet of the SQUID was degaussed to eliminate the remaining fields.

Measurements of the trapped flux created in the sample of H3S in runs 1 and 2 were separated in a time of 6 months. The small discrepancy in the value of \({m}_{{trap}}^{s}\) between the two runs probably arose from the slightly different positions of the superconducting sample relative to the pickup coil of the SQUID magnetometer, which were found at the centring procedure, and not from the different conditions of the creation of the trapped flux (FC or ZFC). Experimental facts that the same values of \({m}_{{trap}}^{s}\) were measured in run 1 under ZFC (2, 3 and 6 T) and FC (4 T) conditions support this explanation.

To determine the background magnetic response of the DAC environment, we released the pressure in the DAC with the superconducting Im-3m-H3S phase down to the atmospheric pressure, that is, transformed the sample into a non-superconducting state and keeping the rest of the DAC environment intact. The released DAC was magnetized following the typical protocol for generating a trapped flux under ZFC and FC conditions at μ0HM = 2 T, that is, above μ0H* when the magnetic response of the trapped flux was the maximum. Both ZFC and FC m(T) dependencies revealed the quasi-linear behaviour without anomalies (Extended Data Figs. 1 and 2). Thus, the trapped flux observed for the same DAC with the Im-3m-H3S phase at P = 155 ± 5 GPa before decompression belongs to the superconducting phase and not to the DAC environment.

Estimation of sample size and demagnetization correction

The diameter and thickness of the thin disc-shaped Im-3m-H3S sample were estimated from optical microscopy and X-ray diffraction data as ≈ 85.0 and ≈ 2.8 µm, respectively (theoretical lower and upper limits of h were ≈ 2.1 and ≈ 3.1 µm, respectively). Only the geometry of the ideal disc-shaped sample yielded high values of demagnetization correction (\(\frac{1}{1-N}\)) of ≈ 20 using the proposed equation for the effective demagnetization factor in another work68. However, the real shape of the sample can deviate from the ideal disc, for example, the alteration of the thickness and not perfectly rounded edge of the sample, and that leads to a decrease in the demagnetization factor. Therefore, we further considered the absolute value of Δm, the difference in m(T) between a normal metal state (above Tc) and a superconducting state (below Tc), which includes geometrical imperfections in the sample shape. This approach gives more reasonable and reliable values of the demagnetization correction as \(\frac{1}{1-N}\) ≈ 8.5 (~7.7–11.4 for the estimated limits of h), which we use for the estimation of Hc1 (ref. 34).