Magneto-ionics1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17, i.e., the change in the magnetic properties of materials due to electric field-induced ion motion, is acquiring a leading role, among other magnetoelectric mechanisms (intrinsic18 or extrinsic19 multiferroicity, electric charge accumulation20,21,22), to control magnetism with voltage23,24. This is triggered by its capability to largely modulate magnetic properties in a permanent and energy-efficient way2,25. Usually, magneto-ionic systems comprise layered heterostructures built around a ferromagnetic target material, such as Co or Fe, grown adjacent to solid-state electrolyte films (e.g., GdOx2 or HfO226). Depending on the voltage polarity, these electrolytes accept or donate oxygen, acting as ion reservoirs. In this way, for instance, the effective magnetic easy axis of ferromagnetic layers can be precisely controlled2. However, room-temperature ionic response is slow (102–103 s)2. Therefore, since ion migration is a thermally activated process27, ion diffusion is commonly assisted with heat2, which is detrimental in terms of energy efficiency. Sometimes cyclability is limited due to cumulative irreversible changes that the target materials undergo from structural/compositional viewpoints2. Recently, through a proton-based route, 101 s ionic motion has been demonstrated at room-temperature, with good endurance, despite restricted hydrogen retention9. Hydrogen is mainly adsorbed rather than absorbed, which imposes stringent limitations on the thickness of the ferromagnet. Other approaches relying on the insertion/removal of ions, such as Li11,12,13,28 or F14, into a ferromagnet are promising in terms of reversibility. However, due to incompatibilities with complementary metal-oxide semiconductor (CMOS) architectures, applications in electronics in these cases are limited9.

An alternative approach is to use target materials, which are already oxidized. Magneto-ionics using structural oxygen (i.e., oxygen incorporated in the crystallographic structure of the actuated material) exhibits outstanding stability and reversibility7,8. This has been demonstrated in electrolyte-gated20,29,30,31,32,33, thick (≥100 nm) paramagnetic Co3O4 films, in which room-temperature voltage-controlled ON-OFF ferromagnetism has been achieved, benefiting from defect-assisted voltage-driven transport of structural oxygen. Nevertheless, there is an inherent voltage trade-off between induced magnetization, speed and cyclability. Specifically, the generated magnetization increases with voltage, whereas cyclability degrades for exceedingly high voltages due to irreversible losses of oxygen (i.e., bubbling)7,8.

Here, nitrogen magneto-ionics is demonstrated as an improved alternative to oxygen magneto-ionics. CoN and Co3O4 single-layer films are voltage-actuated to compare nitrogen vs. oxygen magneto-ionic performances. These materials were selected since they both exhibit voltage-induced ON-OFF ferromagnetic transitions. Both films were grown by sputtering, have the same thickness and exhibit a similar (nanocrystalline, face-centered cubic) microstructure. Remarkably, voltage-driven transport of structural nitrogen is energetically more favorable than oxygen, resulting in lower operating voltages and enhanced cyclability. This together with the lower electronegativity (i.e., weaker bonds with Co) of nitrogen with respect to oxygen leads to overall enhanced magneto-ionic effects. Controlled motion of nitrogen ions with voltage might enable the use of magneto-ionics in new technological areas that require endurance and moderate operation speeds (e.g., neuromorphic computing34 or micro-electro-mechanical systems35).


Oxygen vs. nitrogen magneto-ionics: magnetoelectric characterization

Structural and magnetic characterization of the as-deposited films reveals that both Co3O4 and CoN films are polycrystalline (with cubic structure) and non-ferromagnetic (Supplementary Information, Figs. S1–S4). The voltage actuation is carried out via electrolyte-gating using an electrochemical capacitor configuration8 (Fig. 1a). In this way, the overall film area exposed to the liquid electrolyte29,30 is activated, establishing a well-defined out-of-plane electric field8. To investigate magneto-ionic motion, the films were electrolyte-gated at –50 V for 12 h and, during this time, consecutive magnetic hysteresis loops (25 min duration each) were sequentially recorded. In Fig. 1b, c, the red loops correspond to the first measurement under voltage and the black arrows indicate the first sweeping leg of the cycle. In this timeframe (during the descending branch of the loop), the magnetization (M) of the CoN film significantly increases, whereas Co3O4 still remains paramagnetic, evidencing that nitrogen motion is significantly faster than oxygen transport. This is demonstrated in Fig. 1d, which shows the saturation magnetization, MS, as a function of time (Supplementary Fig. S5 shows details on MS quantification). MS evolves with time for both films, reaching, after the magneto-ionic motion has stabilized, maximum values of 588 and 637 emu cm–3 for Co3O4 and CoN, respectively (Table 1). By linearly fitting MS vs. t during the first minutes of voltage application (wherein MS in CoN fully saturates), magneto-ionic rates of 467 and 2602 emu cm–3 h–1 are obtained for oxygen in Co3O4 and nitrogen in CoN, respectively (Table 1), i.e., a five-fold enhancement for the latter. For both systems, when gating at –50 V, bubbling occurs. Oxygen (in Co3O4) and nitrogen (in CoN) gas evolution is most likely the major source of bubbling. When a large negative voltage is applied, high concentrations of oxygen and nitrogen anions accumulate near the counter-electrode. If their concentration is high enough, bubbles form when the oxygen (or nitrogen) solubility limits36,37 are exceeded. When this happens, these elements are irreversibly lost from the system (sample + electrolyte) and this is the main reason causing the lack of reversibility of magneto-ionic effects when positive voltage is applied. Partial decomposition of electrolyte gate (i.e., propylene carbonate) at high voltages cannot be completely ruled out38, although no electron-transfer reactions can be observed in the cyclic voltammetry curve when using Pt as working electrode (Supplementary Fig. S6) and no bubbling was observed in this case. Bubbling is, in fact, more pronounced for CoN than for Co3O4, where the magneto-ionic response is stronger. The hysteresis cycles from electrolyte-gated CoN are more square-shaped than for Co3O4 (Fig. 1b, c). They exhibit larger squareness [defined as the ratio between the remnant magnetization (MR) and MS (MR/MS)], and larger slopes at the coercivity (HC) normalized to MS [dM/dH(H = HC) MS1] than the loops of Co3O4 throughout the time the voltage was applied (Fig. 1e).

Fig. 1: Oxygen vs. nitrogen magneto-ionics: magnetoelectric characterization.
figure 1

a Schematic representation of the electrolyte-gating process in the Co3O4 and CoN films. b, c Hysteresis loops (each of 25 min of duration) of the as-prepared film (black) and under –50 V gating (the first (0–25 min) and the third (50–75 min) cycles are shown only) for the Co3O4 and CoN films, respectively, obtained by in-plane vibrating sample magnetometry. d Time evolution of the saturation magnetization (MS vs. t) and e squareness (MR/MS) and slope of hysteresis loop at HC normalized to MS (dM/dH[H = HC] MS–1) for each film. f, g Time evolution of MS when the gating is monotonically increased in steps of –2 V to determine the onset voltage required to display ferromagnetism for Co3O4 and CoN, respectively.

Table 1 Oxygen vs. nitrogen magneto-ionics by magnetoelectric measurements.

Additionally, the HC corresponding to Co3O4 scales monotonically with time, while in CoN HC shows a maximum at the initial stages of gating and decreases afterwards (Supplementary Fig. S7). The case of CoN bears a resemblance to the characteristic dependence of HC with particle size in magnetic systems, consistent with a homogeneous generation of ferromagnetic regions, uniformly evolving in size, starting from a superparamagnetic behavior (zero HC), followed by a single domain state (maximum HC) and, afterwards, reaching a multi-domain state with reduced HC39. The squareness of the loops and the rather small HC for CoN indicate an in-plane anisotropy and likely a reversal by domain wall motion, which hints at the uniformity of the generated metallic Co phase (Table 1). Such low coercivities might be also associated with a highly nanostructured or even amorphous-like Co40. In contrast, the generated ferromagnetism in Co3O4 shows much larger HC, which results from the formation of isolated Co clusters immersed in a residual Co3O4 matrix7,8.

The onset voltage for magneto-ionic motion was determined in as-prepared films by monotonically increasing the absolute value of the negative gating in steps of –2 V to observe when the films started to display ferromagnetism (Fig. 1f, g and Supplementary Fig. S3). Interestingly, the onset voltage for CoN (–4 V) is lower than for Co3O4 (–6 V). To investigate reversibility of the magneto-ionic process, both systems were kept at their respective onset voltages for one hour and, then, the polarity was inverted (i.e., +4 and +6 V). Remarkably, while Co3O4 recovers only partially at +6 V, CoN fully recuperates the pristine paramagnetic state at +4 V. These results anticipate a higher activation energy for oxygen transport than for nitrogen. In fact, to recover the paramagnetic state in Co3O4 + 20 V are required (Table 1). The need to actuate at a higher voltage induces irreversible losses of oxygen since the liquid electrolyte has a limited solubility of oxygen41. Note that if –50 V are applied, none of the treated films is recoverable in agreement with the irreversible loss of oxygen and nitrogen through bubbling.

Magneto-ionic cyclability

To investigate the cyclability, the CoN and Co3O4 films were subjected to –4 V/ +4 V and –8 V/ +8 V pulses of relatively short duration (≈8.5 min/cycle). The duration of the onset negative voltage pulse was selected in each material to give a ΔM of approximately 1 emu cm–3 in the first cycle. This resulted in times of approximately 4.1 min for CoN and 6.2 min for Co3O4 (evidencing that the response of Co3O4 is delayed with respect to that of CoN). As seen in Fig. 2, cycling at –/+4 V results in a very stable periodic response for CoN. Conversely, at this voltage, no traces of magneto-ionic effects are observed in Co3O4, corroborating the need of a higher onset voltage. Good cyclability is observed for Co3O4 at –8 V/ +8 V. Note that, in contrast to Fig. 1f, short pulses at –/+8 V allow recovering the initial state in Co3O4 after each cycle. Both materials show no progressive irreversible gain/loss of magnetic signal upon successive cycling. However, while the ΔM amplitude in each cycle remains stable for CoN, a loss of about 25% is observed in Co3O4 after the first cycle. As a first approach, a simple calculation considering the overall magnetization induced in CoN when applying – 50 V (i.e., 637 emu cm−3, Table 1, when the whole CoN is affected, as will be shown in the forthcoming section) suggests that during this reversible cycling (1 emu cm−3, Fig. 2), only the uppermost 0.1–0.2 nm of the CoN layer are involved in the observed reversible effect. If the threshold negative voltage is applied for longer times (Fig. 1g), the induced magnetization from nitrogen ion migration leads to  an equivalent CoN thickness of 2–3 nm. Similar affected thicknesses during reversible voltage-driven magnetization cycling can be estimated for Co3O4. In any case, overall, Fig. 2 corroborates that magneto-ionic rates, onset voltages and endurance are better when using nitrogen than oxygen migration.

Fig. 2: Cyclability.
figure 2

Magneto-ionic cyclability of the Co3O4 and CoN films subjected to –4 V/+4 V and –8 V/+8 V, and to –4 V/+4 V, respectively, with pulses of short duration (≈8.5 min/cycle). The pale yellow lines represent the average curves. Horizontal lines (red, green) are guides to the eye and span 1 emu cm−3. The data are shifted in ΔM-axis to make them distinguishable. Cyclability was carried out under the application of 5 kOe to ensure being above the anisotropy field and, thus, in saturation.

Ion transport mechanisms

Cross-section lamellae of the as-prepared and electrolyte-gated samples treated at –50 V for 75 min were studied by transmission electron microscopy (TEM) (Fig. 3). The as-prepared Co3O4 shows regular, columnar-shaped grains (Fig. 3a and Supplementary Fig. S8a). Co (red) and O (blue) are homogeneously distributed in the as-grown film (Fig. 3b). Conversely, upon gating at –50 V, this morphology drastically changes redistributing the elements into O-rich channels in agreement with previously reported results7,8 (Fig. 3c, d and Supplementary Fig. S7c). This confirms that oxygen transport takes place via a two-fold mechanism: (i) uniform oxygen transport towards the electrolyte and (ii) localized oxygen migration along diffusion channels. High-resolution TEM (Fig. S9) shows remaining Co3O4 after applying –50 V. Electric-field induced oxygen ions exchange with the liquid electrolyte is the main reason of the increased current densities observed in the cycling voltammetry curves (Supplementary Fig. S10).

Fig. 3: Compositional characterization by high-angle annular dark-field scanning transmission electron microscopy (HAADF-STEM) and electron energy loss spectroscopy (EELS).
figure 3

ab, cd, ef, and gh are the HAADF-STEM images and corresponding elemental EELS mappings of the areas marked in orange, respectively, of the as-prepared Co3O4 film, Co3O4 film subjected to a −50 V for 75 min, as-prepared CoN film and CoN film subjected to a −50 V for 75 min, respectively. The colors corresponding to each element for the EELS analyses are depicted at the bottom of the figure.

The as-prepared CoN film shows an isotropic and highly nanostructured morphology with homogeneous composition (Fig. 3e, f and Supplementary Fig. S7b). Remarkably, upon gating at –50 V for 75 min, a well-defined interface (resembling a diffusion front) parallel to the surface is distinguished, dividing the film in two sublayers with different microstructures (Supplementary Figs. S8d and S11). No traces of nitrogen are detected in either of the two sublayers, evidencing a full denitriding process, consistent with the magnetoelectric characterization. While sublayer 2 is nanocrystalline, sublayer 1 (in contact with the electrolyte during magnetoelectric measurements) is amorphous-like and exhibits lower density (decrease of Co signal in Fig. 3h), possibly due to free volume or nanoporosity. This suggests a complex denitriding process in which, under large negative voltages, not only does nitrogen migrate from the sample to the electrolyte, but also Co is redistributed across the film thickness. Similar to Co3O4, these processes are essentially non-Faradaic and do not cause pronounced peaks in the cyclic voltammetry curves (Supplementary Fig. S10).

To further asses the microstructure of the films upon magneto-ionic actuation, variable energy positron annihilation lifetime spectroscopy experiments42,43 were performed (Methods). In the as-prepared CoN sample, only τ1 and τ2 lifetime components are observed, indicating the absence of void-like structures (no τ3) in the pre-biasing state (Fig. 4). τ1 is around 0.28 ns in the top half of the film, which could correspond to a cluster of more than 4 vacancies7. For the bottom half, τ1 is slightly lower, indicating clusters with less than 4 vacancies. The second lifetime τ2 represents a mixture of signals from surface states and grain boundaries. In the first tens of nm, τ2 is larger than 0.5 ns, indicating the presence of small voids. As seen in Fig. 4b, the relative intensity I1 decreases, while I2 increases reaching similar intensities at the interface with the buffer layer, reflecting the influence of the buffer polycrystallinity in the CoN growth, whose extent decreases with film thickness.

Fig. 4: Defect characterization by variable energy positron annihilation lifetime spectroscopy (VEPALS).
figure 4

a Positron lifetime components τi=1–3 and b their relative intensities Ii=1–3 as a function of positron implantation energy Ep for as-prepared and –20 V and –50 V biased CoN films. The non-monotonic change of intensity I2 with depth is linked to the position of the interface between Co sublayers reminiscent of an ionic migration front as highlighted in b.

Negative biasing of –20 V and –50 V increases τ1 and τ2 and this increase scales with voltage, indicating that the initial open volumes become larger. Already for –20 V, τ3 emerges, showing the presence of large voids as it happens in Co3O47. However, for Co3O4, a monotonic increase of relative intensity I2 across the film thickness is observed7, whereas relative maxima (marked with arrows in Fig. 4b) are found for CoN. The depth position of these relative maxima increases with the applied voltage, suggesting the occurrence of an interface migration front, in agreement with TEM observations. For –50 V, the migration front moves deeper into the film in agreement with a more intense denitriding/amorphization process. I3 tends to decrease and vanishes with thickness, evidencing that larger voids are only present at the top surface (as hinted by the TEM-EELS analysis; Fig. 3h). The ionic transport upon electrolyte-gating in CoN is thus consistent with a uniform nitrogen migration through vacancies and grain boundaries (τ1 and τ2 increase), leaving behind larger grain boundaries and voids.

Co-O vs. Co-N formation energy

Neither Co3O4 nor CoN are ferromagnetic at room-temperature. The magnetic properties of these systems are strongly correlated to the amount of either oxygen or nitrogen in the films. According to the virtual crystal approximation, for CoN, beyond 50 at. % of nitrogen in the unit cell, the magnetic moment becomes negligible (Fig. 5a). This explains why the as-prepared CoN film is not magnetic and it also sets a limit for irreversible losses of nitrogen beyond which successive voltage-driven ON-OFF-ON ferromagnetism would be compromised.

Fig. 5: Ab initio calculations: magnetism in the Co-N system and Co-O vs. Co-N formation energy.
figure 5

a Variation of magnetic moment in Bohr magneton, μB, per Co atom as a function of increasing the N percentage in the CoN unit cell, shown in the inset, calculated within Virtual Crystal Approximation (VCA). b Calculated total energy per atom, normalized to the minimum energy value, as a function of the displacement between the reference Co outermost surface atom and the inserted O or N atom. Both HCP (0001) and FCC (111) surfaces are considered represented by filled and open symbols, respectively. The black squares (red circles) correspond to the O (N) energetic path, respectively. The five-monolayer-thick Co slab is shown in the right panel, where the dashed line indicates the reference z position, which is the outermost Co surface monolayer.

To simulate the Co-O and Co-N formation energy (which occurs when the dissolved oxygen and nitrogen ions are re-introduced to the films with positive voltage), the insertion of an atom of either oxygen or nitrogen into a cobalt slab, with either (0001) HCP or (111) FCC orientation, has been considered. Minimum energy paths were calculated by the nudged elastic band method (Methods). The obtained total energies per atom normalized to the global minimum value are plotted in Fig. 5b as a function of the displacement z of the oxygen or nitrogen atom from the cobalt reference layer. The reference z = 0 Å is assigned to the position of the outermost cobalt layer. The global energy minimum is found at z = 1.14 Å for both oxygen and nitrogen cases. Another local minimum is located around z = –0.75 Å for oxygen and z = –1 Å for nitrogen. In turn, the calculated energy barriers between the two minima are 1.54 (1.85) and 1.14 (1.37) eV/atom for oxygen and nitrogen displacement into HCP (FCC) Co surface, respectively. Thus, inserting nitrogen into cobalt is energetically more favorable (i.e., less energy required) compared to inserting oxygen. Using the calculated energy barrier values, one can infer the critical electric fields, EC, needed to overcome the energy barrier by oxygen and nitrogen atoms. These electric fields can be estimated as \(E_C = \frac{{{\Delta}V}}{{{\Delta}z}}\) where ΔV and Δz represent, respectively, the electric potential per atom to overcome the energy barrier and the distance between minima that an atom must migrate25. EC is found to be 8.1 (8.5) V  nm–1 and 5.3 (6.3) V nm–1 for oxygen and nitrogen migration into HCP (FCC) Co, respectively, in good agreement with the onset voltages from magnetoelectric measurements (Fig. 1f, g) (thickness of the electric double layer <1 nm). It is important to point out that due to the limitations of the applied density-functional theory and in particular the nudged elastic band method, the CoN and Co3O4 crystallographic structures were not reproduced, starting initially from the Co film while calculating the presented energy considerations. However, with the chosen method we were able to provide both a good explanation of the ionic energetics and reasonable agreement with the experiment. More importantly, the calculations allowed estimating the critical electric field needed to overcome the barrier. It is worth noting that the same method was efficiently used to describe the voltage control of the magnetic anisotropy by O migration at Fe/MgO25. Therefore, we believe that the applied approach is plausible to compare O vs. N magneto-ionics.

Since the ionic radii of nitrogen ions are larger than the ionic radius of O2–, once the energy barrier for ion diffusion is overcome ionic motion would be, in first approximation, expected to be larger for oxygen than for nitrogen. However, the simulation results indicate the opposite, revealing that other parameters, such as electronegativity, might play a more dominant role than ion size in ionic motion. In fact, the Pauling electronegativity of nitrogen is lower than that of oxygen, resulting in weaker bonds with cobalt, allowing for an enhanced ionic motion.


Our work demonstrates robust room-temperature nitrogen magneto-ionics in CoN. Nitrogen magneto-ionics shows reduced activation energies for ionic transport, thus requiring lower voltage actuation. Moreover, the magneto-ionic rates are faster than for oxygen magneto-ionics. This is linked to the conjugation of a lower critical electric field to overcome the energy barrier for ion diffusion and a lower electronegativity of nitrogen with respect to oxygen. The dissimilar electric properties of CoN and Co3O4 are also likely to play a role in the way ions diffuse in the two layers. Thus, nitrogen magneto-ionics represents a robust alternative for efficient voltage-driven effects and may enable the use of magneto-ionics in devices that require endurance and moderate speeds of operation, such as brain-inspired/stochastic computing or magnetic micro-electro-mechanical systems. The reported effects are also appealing to extend the use of nitride semiconductors in diverse applications such as electrochemical sensors, catalysis, batteries, spintronics, or iontronics.


Sample preparation

Eighty-five nanometer thick Co3O4 and CoN films were grown by reactive sputtering on B-doped, highly conducting [100]-oriented Si wafers (0.5 mm thick), previously coated with 20 nm of Ti and 60 nm of Cu. Depositions were carried always out while partly masking the Cu layer to serve as working electrode.

The Co3O4 films were grown at room-temperature in an AJA International ATC 2400 Sputtering System with a base pressure in the 10–8 Torr range. High purity Ar and O2 gases were used. The target to substrate distance was around 8 cm and the sputtering rate of about 5 Å s−1. Co3O4 was grown in a 7% O2/93% Ar atmosphere at a total pressure of 2.5 × 10–3 Torr.

The CoN films were grown in a homemade triode sputtering system with a base pressure in the 10–8  Torr range. Ultra-high vacuum was ensured to minimize oxygen contamination and, thus, to rule out traces of oxygen magneto-ionics. The target to substrate distance was around 10 cm and the sputtering rate about 1 Å s−1. CoN was grown in a 50% N2/50% Ar atmosphere at a total pressure of 8 × 10–3 Torr.

Magnetoelectric characterization

Magnetoelectric measurements were carried out by performing vibrating sample magnetometry while electrolyte gating the films in a capacitor configuration at room-temperature. A magnetometer from Micro Sense (LOT-Quantum Design), with a maximum applied magnetic field of 2 T, was used. The samples are mounted in a homemade electrolytic cell filled with anhydrous propylene carbonate with Na+ solvated species (5–25 ppm). The magnetic properties were measured along the film plane upon applying different voltages, using an external Agilent B2902A power supply, between the Cu working electrode and the counter-electrode (Pt wire). The sign of voltage was such that negative charges accumulate at the working electrode when negative voltage was applied (and vice versa for positive voltages). The Na+ solvated species in the electrolyte are aimed at reacting with any traces of water30. The magnetic signal is normalized to the volume of the sample exposed to the electrolyte. Note that the hysteresis loops were background-corrected using the signal at high fields (i.e., fields always far above saturation fields) to eliminate linear contributions.

Structural and compositional measurements

θ/2θ X-ray diffraction (XRD) patterns were recorded on a Materials Research Diffractometer (MRD) from Malvern PANalytical company, equipped with a PIXcel1D detector, using Cu Kα radiation. The patterns were analyzed using a full-pattern Rietveld refinement method.

High-resolution transmission electron microscopy (HRTEM), high-angle annular dark-field scanning transmission electron microscopy (HAADF-STEM), and electron energy loss spectroscopy (EELS) were performed on a TECNAI F20 HRTEM/STEM microscope operated at 200 kV. Cross sectional lamellae were prepared by focused ion beam and placed onto a Cu transmission electron microscopy grid.

Transport measurements

To determine electric properties, both films (Co3O4 and CoN) were deposited onto high resistivity Si substrates. To assess the semiconducting/metallic behavior of CoN, resistivity values were acquired from 30 to 300 K. In all cases, the van der Pauw configuration was used.

Variable energy positron annihilation lifetime spectroscopy

Variable energy positron annihilation lifetime spectroscopy (VEPALS) measurements were conducted at the mono-energetic positron source (MePS) beamline, which is an end station of the radiation source ELBE (Electron Linac for beams with high Brilliance and low Emittance) at Helmholtz-Zentrum Dresden-Rossendorf (Germany)42 using a digital lifetime CeBr3 scintillator detector with a homemade software employing a SPDevices ADQ14DC-2X with 14 bit vertical resolution and 2GS s–1 (GigaSamples per second) horizontal resolution and with a time resolution function down to about 0.205 ns. The resolution function required for spectrum analysis uses two Gaussian functions with distinct intensities depending on the positron implantation energy, Ep, and appropriate relative shifts. All spectra contained at least 1 × 107 counts. The spectra were deconvoluted using the non-linearly least-squared-based package PALSfit fitting software43 into discrete lifetime components, which directly confirm different defect types—i.e., sizes—(Fig. 4).

The corresponding relative intensities (Ii) reflect to a large extent the concentration of each defect type. In general, positron lifetime (τi) is directly proportional to defect size, i.e., the larger the open volume, the lower the probability and the longer it takes for positrons to be annihilated with electrons42,43,44,45,46,47. The positron lifetime and its intensity are probed as a function of positron implantation energy Ep or, in other words, implantation depth (thickness). The shortest lifetime component (τ1 < 0.32 ns) represents positron annihilation inside vacancy clusters (likely within grains). The intermediate lifetime (0.35 < τ2 < 0.90 ns) accounts for annihilation at larger vacancy clusters (linked to grain boundaries), surface states, and small voids/pores (0.28−0.37 nm in diameter, calculated based on the shape-free model for pore-size estimation of Wada et al.48). The longest lifetime component (2.3 < τ3 < 3.3 ns) indicates contributions of larger voids (0.58–0.74 nm in diameter).

Ab initio calculations

The first-principles calculations were based on the projector-augmented wave (PAW) method49 as implemented in the VASP package50,51,52 using the generalized gradient approximation53. We used cubic unit cell with a F\(\bar 4\)3 m space group for CoN. The full structural relaxation was performed until the forces became smaller than 1 meV Å−1, yielding a lattice constant of 4.41 Å. The virtual crystal approximation54 was used to model the variation of nitrogen per unit cell. To compare the Co-O and Co-N formation energy, the nudged elastic band method (NEB)55,56 was employed on the oxygen and nitrogen pathway into a five-monolayer thick (0001) hexagonal close-packed Co slab. At each step, the atomic coordinates were relaxed until the forces became smaller than 1 meV Å−1. A kinetic energy cut-off of 500 eV was used for the plane-wave basis set and 25 × 25 × 25 and 25 × 25 × 1 k-point meshes were used to construct the first Brillouin zone in CoN unit cell and the Co slab in the NEB calculations, respectively.

Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.