I. INTRODUCTION
Hydrogen is an ideal energy carrier due to the abundance of its compounds on Earth, its high energy density, and pollution-free utilization.Reference He, Pachfule, Wu, Xu and Chen1–Reference He, Kuang and Chen3 The entire hydrogen energy chain used in practical applications includes hydrogen production, storage, transportation, and utilization processes. In a hydrogen energy system, the hydrogen storage problem has been regarded as a major challenge. Hydrogen storage technology is still deficient, which requires significant improvement for the large-scale application of hydrogen energy systems.Reference Alonso, Cabria and López4–Reference Gierlotka and Lee6 Cutting down the cost and simultaneously improving energy efficiency under the precondition of ensuring safety are difficult tasks for the traditional high-pressure and cryogenic liquefaction hydrogen storage technologies. By contrast, solid-state hydrogen storage technology is a cost-affordable, efficient, and safe method. Among the various solid-state hydrogen storage materials, Mg-based hydride is regarded as one of the most promising candidates for hydrogen storage because of its high capacity, low cost, and good reversibility.Reference Jia, Sun, Shen, Jin, Mao and Yao7,Reference Tran, McDonald, Gu, Matsumura and Nogita8 For instance, the hydride MgH2 has a high theoretical hydrogen capacity of 7.6 wt% H2. However, the sluggish hydrogen absorption/desorption kinetic behaviors and high reaction temperature limit the practical applications of this hydride.Reference Chen, Huang, Fu, Guo, Pan, Deng, Li and Zhao9,Reference Tan, Zhu, Yuan and Li10 In 1968, Reilly et al.Reference Reilly and Wiswall11 first reported a new Mg-based hydride Mg2NiH4 and its high potential for hydrogen storage. Upon the addition of Ni, H atoms preferentially bond with Ni, resulting in the formation of NiH4 clusters. The hydride Mg2NiH4 has enhanced hydrogen absorption/desorption kinetics and lower operating temperatures compared with MgH2.Reference Wu, Yang, Zhang and Bao12–Reference Shang, Bououdina, Song and Guo14 Nevertheless, the interactions between Mg and Ni/NiH4 are still rather strong, causing a high thermal stability of Mg2NiH4.
To reduce the thermal stability of the hydride Mg2NiH4, a method of partially substituting metal elements for Mg or Ni has been proposed and intensively studied for decades. For example, through a first-principles study, Zeng et al. found that the partial substitution of Mg with Al or Ag in the Mg2Ni alloy and its hydride helps to reduce the thermal stability and thereby improve the thermodynamic behavior.Reference Zeng, Fan, Li, Xu, Gao and Meng15 Zhang et al. investigated Mg3MNi2 (M = Al, Ti, and Mn) compounds with cubic structure and their hydrides using the first-principles calculations. Their results showed that Mn-substituted Mg-based alloys and their hydrides with larger formation enthalpies present lower thermal stability than pure, Ti- and Al-substituted Mg-based alloys and their hydrides.Reference Zhang, Huang, Mao, Peng, Shao and Zhou16 Jiang et al. reported the influences of rare-earth and alkaline-earth metal elements M (M = Yb, Ca, and Sr) on the destabilization of Mg2NiH4. Electronic structure calculations clearly showed the existence of ionic interactions between M (M = Yb, Ca, and Sr) and NiH4 clusters.Reference Jiang, Zhang, Huang, Wang and Tian17 Hou et al. studied the Ti- and Zn-substituted alloys Mg1.8333M0.1667Ni and Mg2Ni0.8333M0.1667 (M = Ti and Zn) and hydrides Mg1.875M0.125NiH4 and Mg2Ni0.875M0.125H4 (M = Ti and Zn) by the first-principles study and found that the addition of transition metals (TMs) to replace either Mg or Ni could reduce the stability of the Mg2Ni alloy and its hydride to different degrees.Reference Hou, Kou, Zhang, Hu, Li and Xue18 Zhang et al. investigated the energies and electronic structures of Nb-doped Mg2Ni by the first-principles study. The addition of Nb atoms significantly decreased the thermal stability of the Mg-based alloy due to the increased formation enthalpy.Reference Zhang, Liang, Yan, Gong and Sun19 Li et al. reported the structures and properties of Y-substituted Mg2Ni alloys and the corresponding hydrides based on the first-principles study. The results for the formation enthalpy implied that the partial substitution of Y for Mg atoms destabilizes the structure and consequently reduces the thermal stability of the Mg-based hydride.Reference Li, Sun and Mi20 These studies showed that partially substituting metals for Mg or Ni could help to reduce the thermal stability of the Mg-based hydrides.
Recently, another method of partially doping a single interstitial nonmetal element (NE) into the Mg2Ni alloy and its hydride has been attracting more and more attentions. Compared with substituting metals for Mg or Ni, interstitially doping a small amount of NE—with a light weight, a small atomic radius, and high electronegativity—has less influence on the hydrogen storage capacity and crystal structure of Mg-based systems. Ding et al. designed the addition of nonmetals X (X = B, C, and Si) to Mg2Ni and its hydride and further investigated the influences of nonmetal X on the crystal structure and electronic and thermodynamic properties using the first-principles calculations.Reference Ding, Zhang, Zhang, Huang, Wang and Tian21 The results demonstrated that doping interstitial nonmetals effectively reduces the thermal stability and promotes the dehydrogenation reaction of the hydride. Additionally, it was reported that interstitially doping nonmetals yields a more effective improvement than substitutionally doping metals. Our previous work also analyzed the influences of interstitial light nonmetals N or B on the crystal structure, thermal stability, and electronic and thermodynamic properties of the Mg2Ni alloy and its corresponding hydrides.Reference Wu, Zhu, Yang, Jiang and Zhang22,Reference Wu, Zhu, Yang, Zhang and Jiang23 The results showed that the strong bonding effects between the matrix and NE (B or N) atoms play an important role in relaxing the interactions between Mg and Ni/NiH4 and therefore reduce the thermal stability of the Mg-based system. The dehydrogenation temperature was reduced by approximately 95–166 K because of the breaking of stable NiH4 clusters, which was caused by the strong hybridization between NE and H orbital electrons. In addition, we compared the effects of NE (B or N) and the earlier reported metals (Al, Ag, Ti, Cu, Co, Mn, Yb, Ca, Sr, etc.) on the reduction of the thermal stability and found that interstitially doping NE has a stronger effect for the Mg2Ni alloy and its hydride.
Although interstitially doping single NE can reduce the thermal stability of the Mg-based hydrides to some extent, the practical applications of the hydrides are still limited due to their high thermal stability. In the latest reports,Reference Bhihi, Khatabi, Lakhal, Naji, Labrim, Benyoussef, Kenz and Loulidi24,Reference Abdellaoui, Lakhal, Bhihi, Khatabi, Benyoussef, Kenz and Loulidi25 it was found that co-substitution of different elements could further reduce the thermal stability of the magnesium hydride compared with single-substitution. In the past few years, the first-principles calculations have been increasingly used for the design and performance prediction of advanced functional materials.Reference Mannepalli, Raghunathan, Ramadurai, David and Prellier26–Reference Fan, Wang, Yang and Ni29 Considering the superior effects of nonmetals B and N on lowering the thermal stability of the Mg2NiH4 hydride, we introduced a new method of co-doping interstitial NE [B and N with electronegativity values of 2.04 and 3.04, respectively, both of which are higher than those of the matrix elements (Mg: 1.31, Ni: 1.91)Reference Allred30] for the Mg-based hydride by the first-principles calculations. It was found that the method of co-doping nonmetals also presents better improvement effect on reducing the thermal stability than that of the single-doping nonmetal. However, the detailed influence mechanism of individual nonmetal B or N is still unclear due to different doping amounts of B and N in the co-doped system. In such a context, the double nonmetals co-doped Mg-based system with equal doping amount of B and N is further developed to confirm the influence mechanism and determine which nonmetal dominates the improvement in this work. The resulting understanding of the influence of NE co-doping on the thermodynamics of Mg-based hydrides could be applied for the design and development of advanced Mg-based hydrogen storage materials. Hence it is of importance to further investigate the influences of interstitial NE co-doping on Mg-based alloys and their hydrides.
II. COMPUTATIONAL DETAILS
A. Computational model
Computational models of pure Mg2Ni with the hexagonal space group P6222 (No. 180) and its hydride Mg2NiH4 with the monoclinic space group C2/c (No. 15) were built first. The experimental lattice parameters are a = b = 5.219 Å, c = 13.293 Å, α = β = 90°, and γ = 120° for Mg2NiReference Simičić, Zdujić, Dimitrijević, Nikolić-Bujanović and Popović31 and a = 14.343 Å, b = 6.404 Å, c = 6.483 Å, α = γ = 90°, and β = 113.52° for Mg2NiH4.Reference Zolliker, Yvon, Jorgensen and Rotella32 There are 12 Mg and 6 Ni atoms in the Mg2Ni unit cell and 16 Mg, 8 Ni, and 32 H atoms in the Mg2NiH4 unit cell. The detailed atomic positions of all the atoms in the unit cells of Mg2Ni and Mg2NiH4 are listed in Tables SI and SII of the Supplementary Material. The corresponding computational models of Mg2Ni and Mg2NiH4 are also shown in Fig. S1 of the Supplementary Material.
Because the NE-doped Mg-based system with an atomic ratio of NE to Mg of 1:4 has a superior effect in improving hydrogen storage properties,Reference Wu, Zhu, Yang, Jiang and Zhang22 0.5 mol of double NE with an equal amount of B and N was interstitially co-doped into 1 mol of Mg2Ni and its hydride, thereby forming the new phases Mg2NiB0.25N0.25 alloy and its hydride Mg2NiB0.25N0.25H4. The crystal structures of the new phases Mg2NiB0.25N0.25 and Mg2NiB0.25N0.25H4 were built by taking P1 as the initial space group to break the symmetry of the pure Mg2Ni and Mg2NiH4 crystal structures and then adding NE atoms into the pure Mg-based unit cells. Accordingly, the symmetry of the new phases Mg2NiB0.25N0.25 alloy and its hydride Mg2NiB0.25N0.25H4 is changed. However, the crystal structures of Mg2NiB0.25N0.25 and Mg2NiB0.25N0.25H4 have almost the same lattice parameters as their NE-free counterparts because interstitially doping a small amount of NE with a small atomic radius has a minor influence on the lattice parameters of the Mg-based alloy and its hydride.Reference Bouaricha, Dodelet, Guay, Huot, Boily and Schulz33 In our previous study, the interstitial positions of doping NE were determined to be the center of the octahedron with two Ni and four Mg atoms as vertexes in the Mg2Ni alloy and the center of the dodecahedron with two NiH4 clusters and two Mg atoms in the Mg2NiH4 hydride.Reference Wu, Zhu, Yang, Zhang and Jiang23 Figures 1 and 2 display all the possible crystal structures of the B + N co-doped Mg-based alloy Mg2NiB0.25N0.25 and its hydride Mg2NiB0.25N0.25H4, respectively.
All possible crystal structures of Mg2NiB0.25N0.25 unit cells. (a) 2-#1, (b) 2-#2, (c) 2-#3, (d) 2-#4, (e) 2-#5, and (f) 2-#6 (green—Mg, blue—Ni, magenta—B, and orange—N, a—the atom consists of 50% B and 50% N).

All possible crystal structures of Mg2NiB0.25N0.25H4 unit cells. (a) 3-#1, (b) 3-#2, (c) 3-#3, (d) 3-#4, (e) 3-#5, and (f) 3-#6 (green—Mg, blue—Ni, magenta—B, orange—N, and cyan—H).

B. Computational method
In this study, the Cambridge Sequential Total Energy Package (CASTEP)Reference Segall, Lindan, Probert, Pickard, Hasnip, Clark and Payne34 and DMol3 (Ref. Reference Delley35) modules of Materials Studio (MS) software were applied to calculate the crystal structure, energy, electronic properties, and thermodynamic properties (by DMol3) using density functional theory (DFT). In the DFT calculations, all the ground-state properties of matter are functionals of the charge density ρ. The Hohenberg–Kohn theorem,Reference Hohenberg and Kohn36 the basis of DFT, describes how to obtain the ground-state properties of matter from ρ. Based on the Hohenberg–Kohn theorem, Kohn and Sham proposed the specific expression of total energy, called the Kohn–Sham (K–S) equation.Reference Kohn and Sham37 The total energy E t[ρ] of crystals usually consists of the kinetic energy T[ρ], electrostatic energy U[ρ], and exchange-correlation energy EXC[ρ], among which the exchange-correlation energy EXC[ρ] is an important component of the total energy. For a good approximation of the exchange-correlation energy, the PW91Reference Perdew and Wang38,Reference Perdew, Chevary, Vosko, Jackson, Pederson, Singh and Fiolhais39 relationship of the generalized gradient approximation (GGA)Reference Perdew and Yue40 was chosen in this work. This is because the PW91 relationship has more accurate results than the PBE relationship for predicting Mg-based hydrides.Reference Herbst and Hector41 The self-consistent field (SCF) iteration method was used to solve the K–S equation for the calculation of total energy. During the iterative process, the Pulay mixture densityReference Franscis and Payne42 was chosen in the SCF approximation to address the electron relaxation. It is important to note that the crystal structure was optimized using the Broyden–Fletcher–Goldfarb–Shanno (BFGS) methodReference Monkhorst and Pack43 prior to the energy calculation.
Before the geometry optimization, we first carried out a convergence test of the cutoff energy (shown in Fig. S2 in the Supplementary Material). It is suggested to choose 310 eV as the cutoff energy in view of the balance between computational burden and accuracy. The other main parameters for the calculations are as follows: 4 × 4 × 2 Monkhorst–Pack mesh k-points for the Mg-based alloys and 6 × 6 × 3 for their hydrides, 2.0 × 10−6 eV/atom for energy convergence tolerances and 0.05 eV/Å for the maximum force, 0.1 GPa for the maximum stress and 2.0 × 10−3 Å for the maximum displacement convergence tolerances. During the geometry optimization, atomic optimizations, including atomic coordinates and cell structures, were performed with the atomic position unfixed to reach all the convergence tolerances of the energy, maximum force, stress, and displacement. This approach was taken for the convenience of free adjustment of the atomic position to achieve the most stable structure. In addition, a 3 × 3 × 3 k-point mesh was applied for free hydrogen and nitrogen molecules. To ignore the interaction between the molecules, these molecules were put into a huge cubic unit cell of a = b = c = 20 Å under the periodic boundary condition to isolate them.
III. RESULTS
A. Crystal structure
The total energies of all the possible crystal structures after the geometry optimization were calculated and compared to ascertain the interstitial sites of doping NE in the unit cells of Mg2Ni and its hydride. It was found that the crystal structures of 2-#2 for Mg2NiB0.25N0.25 and 3-#6 for Mg2NiB0.25N0.25H4 have the lowest total energies, which are −3389.38 and −3456.90 eV, respectively (listed in Table SIII in the Supplementary Material). The minimum energy indicates that the structures shown in Figs. 1(b) and 2(f) are the most stable for the B + N co-doped Mg2Ni alloy and its hydride according to the criterion of the total energy minimization.Reference Karamertzanis and Price44 Figure 1(b) shows the computational models for the B + N co-doped Mg-based alloy Mg2NiB0.25N0.25 and Fig. 2(f) for its hydride Mg2NiB0.25N0.25H4. The crystallographic information on the structures and atomic positions of the Mg2NiB0.25N0.25 alloy and its hydride after the optimization is provided in Tables SIV and SV in the Supplementary Material. As is clearly shown in Figs. 1(b) and 2(f), the nonmetal N is most likely to occupy the on-face site, while B atoms prefer to hold in-cell or side-boundary sites in the unit cells of Mg2Ni and its hydride.
Table I shows the optimized lattice parameters, total energies, and hydrogen storage capacities of pure Mg2Ni and its hydride and their B + N co-doped counterparts. The optimized lattice parameters of a = b = 5.22 Å and c = 13.28 Å for pure Mg2Ni and a = 14.47 Å, b = 6.42 Å, and c = 6.55 Å for its hydride agree well with the experimental dataReference Simičić, Zdujić, Dimitrijević, Nikolić-Bujanović and Popović31,Reference Zolliker, Yvon, Jorgensen and Rotella32 and the theoretical data in Refs. Reference Zeng, Fan, Li, Xu, Gao and Meng15, Reference Jiang, Zhang, Huang, Wang and Tian17, Reference Li, Sun and Mi20, and Reference Ding, Zhang, Zhang, Huang, Wang and Tian21. This good agreement validates the reliability of our simulation calculations based on the first-principles study.
Optimized lattice parameters, total energies, and hydrogen storage capacities of the pure and B + N co-doped Mg-based systems.

a Experimental values.
b Theoretical values.
When a small amount of double nonmetals B and N were interstitially co-doped into the Mg2Ni alloy and its hydride, the optimized lattice parameters became a = b = 5.39 Å and c = 16.20 Å for the alloy and a = 14.92 Å, b = 7.41 Å, and c = 7.16 Å for the hydride. Compared with the NE-free counterparts, NE-co-doped Mg2Ni and its hydride appear to exhibit a slight expansion in the lattice parameters and the unit cell volume due to the insertion of the double NE. Moreover, the expansion occurs mainly along the c-axis lattice orientation for the alloy and the b- and c-axis lattice orientations for the hydride. This is because the crystal structures have to adjust the unit cell to different degrees to achieve the most stable state after co-doping of NE atoms. In addition, it should be noted that co-doping of interstitial NE with a light weight has little influence on the hydrogen storage capacity of the Mg2NiH4 hydride, as listed in Table I.
B. Thermodynamic properties
1. Thermal stability
The influences of interstitial NE co-doping on the thermal stability of the Mg2Ni alloy and its hydride were investigated first. The formation enthalpy ΔH, defined as the difference between the total energies of the compound and its components, is a quantitative index for evaluating thermal stability. Generally, an increase in the formation enthalpy of a compound suggests a lowering of its thermal stability. Please note that the effects of the zero-point energy and temperature on the formation enthalpy are ignored in this paper. On the basis of the definition, the formation enthalpy per atom of the pure Mg2Ni alloy and its hydride can be calculated using, the following equations:
respectively.
Similarly, the formation enthalpy per atom of the B + N co-doped counterparts can be expressed as follows:
where
${E_{{\rm{M}}{{\rm{g}}_{\rm{2}}}{\rm{Ni}}}}$,
${E_{{\rm{M}}{{\rm{g}}_{\rm{2}}}{\rm{Ni}}{{\rm{H}}_{\rm{4}}}}}$,
${E_{{\rm{M}}{{\rm{g}}_{\rm{2}}}{\rm{Ni}}{{\rm{B}}_{{\rm{0}}{\rm{.25}}}}{{\rm{N}}_{{\rm{0}}{\rm{.25}}}}}}$, and
${E_{{\rm{M}}{{\rm{g}}_{\rm{2}}}{\rm{Ni}}{{\rm{B}}_{{\rm{0}}{\rm{.25}}}}{{\rm{N}}_{{\rm{0}}{\rm{.25}}}}{{\rm{H}}_{\rm{4}}}}}$ represent the total energies of the Mg2Ni, Mg2NiH4, Mg2NiB0.25N0.25, and Mg2NiB0.25N0.25H4 unit cells, respectively, after the geometry optimization. The values are listed in Table I. Through the calculations by CASTEP, the values of the total energy E Mg for the Mg unit cell, E Ni for the Ni unit cell,
${E_{{{\rm{H}}_2}}}$ for the H2 molecule,
${E_{{{\rm{N}}_2}}}$ for the N2 molecule, and E B for the B unit cell are −974.60, −1356.72, −31.77, −541.88, and −70.49 eV, respectively.
According to Eqs. (1)–(4), the formation enthalpies of the pure alloy and its hydride were calculated to be −0.21 and −0.29 eV/atom, respectively. When double NE was interstitially co-doped into the pure Mg-based system, the formation enthalpies were increased to 0.54 eV/atom for the alloy and −0.27 eV/atom for the hydride. The increase in the formation enthalpies of both the B + N co-doped Mg2Ni alloy and its hydride indicates that the method of co-doping B and N favors the lowering of their thermal stability.
In general, the improvement effect can be quantitatively estimated by using the parameter termed the relative formation enthalpy, which is defined as the variation of the formation enthalpy before and after element components change. The relative formation enthalpies of B + N co-doping are 0.75 eV/atom for the alloy and 0.02 eV/atom for its hydride. It is clearly found that the improvement effect of co-doping on the alloy is more prominent than that on its hydride, as revealed by the larger relative formation enthalpy of the alloy Mg2NiB0.25N0.25. We also compared the relative formation enthalpies of B + N co-doping and metal or nonmetal single doping,Reference Ding, Zhang, Zhang, Huang, Wang and Tian21–Reference Wu, Zhu, Yang, Zhang and Jiang23,Reference Huang, Elkedim and Hamzaoui45–Reference Wu, Yang, Bao, Nyamsi and Zhang47 as shown in Fig. 3. The relative formation enthalpies of B or N single doping with different NE concentrations are 0.30 eV/atom for Mg2NiB0.25, 0.51 eV/atom for Mg2NiB0.5, 0.06 eV/atom for Mg2NiN0.25, and 0.21 eV/atom for Mg2NiN0.5, all of which are lower than the relative formation enthalpy of the B + N co-doping. The results indicated that double NE co-doping has a better effect on the destabilization than single doping of NE. Moreover, it can also be confirmed from Fig. 3 that the addition of interstitial NE has a superior effect on the destabilization compared to doping substitutional TMs. In conclusion, interstitial NE co-doping has a better effect on lowering the thermal stability than NE or TM single doping for the Mg-based alloy.
Comparison of improvement effects on the thermal stability of Mg-based alloys between different doping elements including TM and NE.

2. Heat capacity, vibration entropy, and free energy
The important thermodynamic properties, such as heat capacity, vibration entropy, and free energy, as functions of temperature were also predicted based on the vibrational analysis of frequency calculations by DMol3. Figure 4(a) displays the variations of the heat capacities with increasing temperature for the pure and B + N co-doped Mg2Ni alloys under normal pressure. The results showed that the heat capacity of the Mg-based alloys rapidly rises with the increase in temperature at the initial stage and then remains nearly the same at temperatures higher than 400 K. The rate of the rise is gradually reduced. By comparison, the heat capacity of the Mg-based alloy after co-doping becomes much smaller, strongly indicating that co-doping interstitial NE could significantly reduce the heat capacity of the Mg-based alloy, thus improving the thermodynamics. In the same manner, the B + N co-doped hydride Mg2NiB0.25N0.25H4 has a smaller heat capacity than the NE-free counterpart, as shown in Fig. 4(b). However, the extent of the variation caused by co-doping NE for the hydride is much smaller compared with the alloy. Thus, co-doping interstitial NE has a more powerful influence on the heat capacity for the Mg-based alloy than its hydride.
Variations of the heat capacity and vibration entropy with temperature for the pure Mg2Ni and its hydride and their B + N co-doped counterparts. (a) Heat capacity for the alloys, (b) heat capacity for the hydrides, (c) vibration entropy for the alloys, and (d) vibration entropy for the hydrides.

The vibration entropy is another important thermodynamic parameter reflecting thermal stability. The variations of the vibration entropy with the increase in temperature for the pure and B + N co-doped Mg-based systems are plotted under normal pressure in Figs. 4(c) and 4(d). By comparison, it was found that the vibration entropies of the B + N co-doped Mg-based alloy and its hydride decrease after the addition of double NE. The smaller entropy represents a reduction in the thermal stability and an improvement in the thermodynamic properties. As shown in Fig. 4, the extent of the variation caused by co-doping NE for the hydride is also much smaller compared with the alloy, which is similar to the influence on the free energy (shown in Fig. S3 in the Supplementary Material). Therefore, the method of interstitial NE co-doping improves the thermodynamic properties of the Mg-based alloy more than its hydride, which is consistent with the abovementioned conclusion obtained from the analysis of thermal stability.
C. Electronic properties
The method of interstitial NE co-doping was found to present superior effects on improving the thermodynamic properties of the Mg2Ni alloy and its hydride. To understand the mechanism for the improvement, the influences of double NE on the electronic properties, such as bonding effects and charge characteristics, are also discussed in this work.
1. Bonding effects
Bonding effects can be reflected by the density of states (DOS) which describes the distribution of orbital electrons in some energy regions. Because the atomic orbits are mainly separated by their energy level, the DOS can effectively reflect the distribution of valence electrons in different orbits and thus reveal the degree of interactions between the orbital electrons of different atoms.Reference Orchin, Macomber, Pinhas and Wilson48 Moreover, the overlap integral S ij between the electronic orbitals i and j of two different atoms can visually show the bonding effects of the two atoms.Reference Matar and Galy49
Figures 5(a) and 5(b) display the DOS of the pure and B + N co-doped Mg-based alloys, respectively. In the DOS, the Fermi level (E F) is set as zero and used as a reference. The absence of a gap between the conduction and valence bands implies Mg-based alloys with a conductor character, which agrees well with the reported conclusion.Reference Lan, Xiao, Su, Chen and Guo50 For the pure Mg2Ni alloy, the peak value of the total DOS is 45.6 states eV−1, which is mainly contributed by Ni-d orbital electrons. Evident overlaps in the DOS appear between Mg-s and Ni-s orbitals as well as between Mg-p and Ni-p orbitals. The overlaps of DOS indicate the strong hybridizations between Mg-s and Ni-s orbitals as well as between Mg-p and Ni-p orbitals, leading to the strong interaction of Mg–Ni bonds. This is also why the Mg2Ni alloy has high thermal stability. By comparison, the peak value of the total DOS of the Mg2NiB0.25N0.25 alloy is reduced to 43.8 states eV−1 due to the addition of double NE. In addition, the overlap integral S ij between the orbitals of Mg and Ni after NE co-doping is reduced for both the s and p orbitals. The larger the overlap integral S ij between two atomic orbitals is, the stronger the bonding effect of the two atoms. Thus, the strong interaction between Mg and Ni atoms is weakened. This mainly occurs because of the strong hybridizations between the orbitals of the matrix and NE atoms appearing in the energy regions of −13 to −12 eV and −6 to −3 eV. In the former region, the hybridization mainly originates from the orbitals between N-s and Mg-(s and p). For the latter, the hybridizations between N-p and Mg-p orbitals, as well as between B-p and Ni-p orbitals, are the main contributors. Moreover, it should be noted that the B atom has more interactions with the Ni atom, while N mainly bonds with Mg. This could be pictured as Mg moving in one direction due to the pull of the N atom, while Ni moves in the opposite direction under the action of the B atom. The combination of B–Ni and N–Mg bonds reduces the strong bonding effect of Mg–Ni from both sides. In this paper, the dual interaction of B–Ni and N–Mg bonds is called criss-cross action which is shown in Fig. 3. The criss-cross action suggests a dual effect on relaxing the connection of the Mg–Ni bond. It is exactly because of the criss-cross action that the variation of the formation enthalpy of the Mg2Ni alloy after B and N co-doping increases to 0.75 eV/atom, which is much higher than the values caused by NE or TM single doping.Reference Ding, Zhang, Zhang, Huang, Wang and Tian21–Reference Wu, Zhu, Yang, Zhang and Jiang23,Reference Huang, Elkedim and Hamzaoui45–Reference Wu, Yang, Bao, Nyamsi and Zhang47 This is also why the method of interstitial NE co-doping has better effect on improving the thermodynamic properties of the Mg2Ni alloy than those of NE or TM single-doping. Therefore, it was concluded that the criss-cross action between B–Ni and N–Mg bonds could lower the thermal stability of the Mg2Ni alloy and consequently improve the thermodynamic properties.
DOS of the Mg-based alloys. (a) Pure Mg2Ni and (b) Mg2NiB0.25N0.25.

Figure 6 shows the DOS of the pure and B + N co-doped Mg-based hydrides. There are not only strong interactions between Mg and Ni atoms but also obvious hybridizations between the orbitals of Ni and H atoms. The strong interactions of the Mg–Ni bonds are also the main reason for the high thermal stability of the Mg-based hydride. In addition, the strong hybridizations between Ni-(s, p) and H-s orbitals in the energy region of −9 to −3 eV lead to the stability of NiH4 clusters, causing difficulties in H2 release from the hydride. Actually, the poor thermodynamic properties of the pure hydride Mg2NiH4 are mainly attributed to the strong interactions between Mg and Ni/NiH4 as well as to the stable NiH4 clusters. When a small amount of B and N was co-doped into the hydride, the peak value of the total DOS was found to decrease from 27.5 to 24 states eV−1. The reduction in the DOS is closely associated with the influences of the double NE on the bonding effects of Mg–Ni and Ni–H. On the one hand, the hybridizations between N-s and Mg-s orbitals in the region of −14 to −13 eV, between B-s and Ni-s in −11 to −9 eV and between B-p and Ni-p in −4 to −3 eV weaken the strong interactions between Mg and Ni/NiH4, thereby lowering the thermal stability of the Mg2NiH4 hydride. Here, we also found the criss-cross action between B–Ni and N–Mg bonds in the hydride, as revealed by the hybridizations between B and Ni orbitals as well as between N and Mg orbitals. However, the hybridizations are not as strong as those appearing in the Mg-based alloy shown in Fig. 5. Therefore, the criss-cross action existing in the B + N co-doped Mg-based alloy is stronger than that in its hydride. This result corresponds to the calculation result that the B + N co-doped alloy has a larger relative formation enthalpy than its hydride. On the other hand, evident overlaps of the orbitals between NE and H atoms appear in the partial density of states (PDOS) of the Mg2NiB0.25N0.25H4 hydride. For example, B-(s, p) and H(B)-s orbitals have hybridizations in the −11 to −1 eV energy region, while N-(s, p) and H(N)-s orbitals have them in the −14 to −5 eV region. The hybridizations of the orbitals between the NE and H atoms indicate the formation of NE–H bonds. Accordingly, the previous strong hybridizations between the Ni-(s, p) and H(Ni)-s orbitals are weakened due to the NE–H bonds causing H to move away from the Ni atoms, as is revealed by the reduced overlap integral S ij between H(Ni)-s and Ni-p orbitals (Fig. 6). Therefore, the bonding effects of B–H and N–H effectively weaken the strong bonding effect of Ni–H and stimulate the breaking of the stable NiH4 clusters, thereby facilitating H2 release from the Mg-based hydride.
DOS of the Mg-based hydrides (the label on the right side is for H atoms). (a) Pure Mg2NiH4 and (b) Mg2NiB0.25N0.25H4 [H(Ni): the H atom near the Ni atom; H(B): the H atom near the B atom; H(N): the H atom near the N atom].

To understand in depth the influences of NE co-doping on the interactions of Ni–H bonds, the variations of Ni–H1–4 bond lengths before and after the addition of NE were analyzed. As shown in Table II, the optimized Ni–H1–4 bond lengths in the NiH4 clusters of the pure hydride Mg2NiH4 are 1.58 Å for Ni–H1, 1.57 Å for Ni–H2, 1.56 Å for Ni–H3, and 1.55 Å for Ni–H4, which agree well with the experimental data of 1.57, 1.54, 1.52, and 1.52 Å.Reference Herbst and Hector41 When a small amount of double nonmetals B and N was interstitially co-doped into the hydride, the bond lengths of Ni–H1–4 became 1.66, 1.62, 1.59, and 1.57 Å for the NiH4 clusters near B atoms (henceforth denoted as Mg2NiB0.25N0.25H4B) and 1.70, 1.65, 1.60, and 1.57 Å for Mg2NiB0.25N0.25H4N. Compared with the Ni–H bond lengths in the pure hydride, the Ni–H bonds in the NE co-doped hydride are lengthened, especially the Ni–H1 bond. The Ni–H1 bond length is increased from 1.58 to 1.66 Å for Mg2NiB0.25N0.25H4B and from 1.58 to 1.70 Å for Mg2NiB0.25N0.25H4N. The increase in the Ni–H bond lengths indicates a reduction in the strong interaction between Ni and H atoms, which is mainly caused by the strong bonding effects between NE and H1 atoms. In addition, it should be noted that the bonding effect of N–H1 with a bond length of 1.36 Å is stronger than the B–H1 bonding effect with a longer bond length (1.63 Å), indicating that the nonmetal N plays a more important role in weakening the interactions of Ni–H bonds. From the above-mentioned analyses, it can be concluded that the mutual interactions between double NE and H atoms could result in the reduction of the Ni–H bonding effects and then stimulate the breaking of the NiH4 clusters. The destruction of the stable NiH4 structure helps to release hydrogen from the clusters.
The variations of Ni–H bond lengths before and after co-doping NE into the hydrides.

a Experimental results.
b Simulation results.
Ni–H1–4: Ni–H bonds in the same NiH4 cluster.
B–H1: the shortest B–H bond.
N–H1: the shortest N–H bond.
2. Charge characteristics
The charge density difference refers to the redistribution of charge when the crystal structure or component of the compound is changed. The charge transfer between different atoms can be presented in the plots of the charge density difference.Reference Fan, Chen, Zhang, Li, Liu and Xiao51 Consequently, the charge density difference can visually reflect the charge characteristics, thus revealing the variations of the bonding effects between the atoms.
The charge density difference of the crystal plane (0 1 0) of the pure and B + N co-doped Mg2Ni alloys and their hydrides are shown in Fig. 7. Figure 7(a) shows that some electrons transfer from Mg to Ni atoms for the pure alloy. After the addition of the double NE, Mg atoms start to transfer the electrons to N atoms, which is evidenced by the charge density difference of Mg2NiB0.25N0.25 shown in Fig. 7(b). The electron transfer between Mg and N atoms indicates that two kinds of atoms participate in the bonding effect. By contrast, few electrons transfer from Mg to B atoms. Therefore, the charge density difference of the alloys suggests that Mg atoms mainly interact with N atoms, which confirms the criss-cross action of Mg mainly bonding with N.
Charge density difference of the crystal plane (010) of the Mg-based alloys and their hydrides. (a) Pure Mg2Ni, (b) Mg2NiB0.25N0.25, (c) pure Mg2NiH4, and (d) Mg2NiB0.25N0.25H4.

The release of hydrogen from the NiH4 clusters is always the research focus for Mg-based hydrides. The difficulty in H2 release caused by the stable structure of NiH4 is one of the main reasons for poor thermodynamics of the dehydrogenation reaction. In this work, the charge density difference of the crystal plane (010) with the NiH4 clusters was also discussed to confirm the influences of double NE co-doping on the breaking of the clusters. Figures 7(c) and 7(d) show the charge density difference of the crystal plane (010) of the Mg-based hydrides with/without the double NE. Electron transfer can be clearly seen between NE (B, N) and H atoms and the amount of electrons transferring between NE and H atoms can be estimated by the charge transfer of atoms listed in Table III. The charge transfer of NiB (the atom of Ni near the B atom, similarly hereinafter) is reduced from 1.28 to 0.86 e, and HB is reduced from 0.33 to 0.16 e after the addition of B atoms accordingly. Similarly, the charge transfer is reduced from 1.28 to 0.78 e for NiN and from 0.33 to 0.20 e for HN. By contrast, the charge transfer of B and N is increased to 0.81 and 1.00 e, respectively. These results indicate that the bonding effects of NE–H become strong and the Ni–H interaction is weakened accordingly. It is noteworthy that the amount of charge transfer of N atoms is larger than that of B atoms, indicating that N atoms play a greater role in the reduction of the Ni–H interaction and the destruction of the NiH4 clusters. The results obtained from the charge characteristics are also in accordance with the analysis results of bond lengths. It is important to note that the dehydrogenation pathway is still H2 release from the NiH4 clusters for the B + N co-doped Mg2NiH4 hydride due to the small amount of NE doping.
Charge transfer of Ni, H, B, and N atoms in the pure and B + N co-doped Mg2NiH4 hydrides.

In brief, the method of co-doping nonmetals B and N has better improvement effects on improving the performance of Mg-based hydrides than the single-doping method. The criss-cross interaction occurring in the nonmetals co-doped Mg-based system is found to account for the improvement. Through the DOS analysis, it was found that the hybridization between Mg and Ni orbitals is weakened. The charge characteristics also showed that the amount of the charge transferring from Mg to Ni is reduced after co-doping B and N. The strong hybridizations appear between B and Ni orbitals as well as between N and Mg orbitals. Therefore, the atoms of B have more interactions with the atoms of Ni, while N atoms mainly bond with Mg atoms. This could be pictured as that Mg moves to one direction under the action of N atoms, while Ni moves to the opposite direction under the action of B atoms. The combination of B–Ni and N–Mg bonds alienates the bonding effect of Mg–Ni from both sides. The interaction between B–Ni and N–Mg bonds, called as ‘criss-cross action’, suggests a synergistic effect between B–Ni and N–Mg bonds on relaxing the connection of the Mg–Ni bond. Interestingly, Kang et al.Reference Kang, Luo, Zhang and Wang52 also found that M (M = Na or K) coordinates solely with B moieties, while Mg bonds exclusively to N moieties in M2Mg(NH2BH3)4 hydride. The addition of double metal cations shows a greater complementary modification in the thermal decomposition of the hydride than a single cation. In addition, co-doping the nonmetals B and N into Mg2NiH4 presents a positive influence on the breaking of stable NiH4 moieties. Both the DOS and the charge characteristics showed that there are bonding effects between double nonmetals and H atoms. The interactions of B–H and N–H bonds weaken the strong bonding effect of Ni–H, stimulating the break of the stable NiH4 moieties and thereby facilitating H2 release from the Mg-based hydride. It is exactly because of the criss-cross action between B–Ni and N–Mg bonds that the thermal stability of Mg-based hydrides is effectively reduced and the dehydrogenation performance is improved accordingly.
IV. CONCLUSIONS
In summary, the influences of interstitial NE co-doping on the crystal structure and the thermodynamic properties of the Mg2Ni alloy and its hydride were investigated by the first-principles study in this paper. The influence mechanism of the interstitial double NE on the thermodynamics was further discussed based on analyses of the bonding effects and charge characteristics. The following conclusions can be drawn:
(1) Co-doping NE effectively reduces the thermal stability of Mg2Ni and its hydride, which is revealed by the formation enthalpy increasing from −0.21 to 0.54 eV/atom for the alloy and from −0.29 to −0.27 eV/atom for the hydride. This occurs mainly because of the weakened interactions between Mg and Ni/NiH4 caused by the strong hybridizations of electronic orbitals between NE and matrix atoms.
(2) The method of interstitial NE co-doping is more effective in lowering the thermal stability of the Mg2Ni alloy than those of nonmetal or TM single-doping. The superior improvement effect is mainly attributed to the criss-cross action between B–Ni and N–Mg bonds existing in the NE co-doped Mg-based system.
(3) The method of interstitial NE co-doping also contributes to the destabilization of the stable NiH4 clusters under the influence of interactions between NE and H atoms, which facilitates hydrogen release from the Mg-based hydride.
Supplementary Material
To view supplementary material for this article, please visit https://doi.org/10.1557/jmr.2018.353.
ACKNOWLEDGMENTS
This work was financially supported by the National Natural Science Foundation of China (Nos. 51506174 and 21736008) and the Natural Science Foundation of Shaanxi Province (No. 2017JQ5059). The authors acknowledge Prof. Y.H. Chen from School of Electrical Engineering, Xi'an Jiaotong University for providing molecular simulation system and computational resources.










