Introduction

Point defects in crystalline solids that possess a bandgap can have positive or negative effects on the electrical, optical, thermal-transport, and atomic-diffusional characteristics of a wide range of devices1,2,3,4. Concentrations of point defects in a crystal can be theoretically derived under thermal equilibrium based on the formation energy of each defect in the dilute limit, using density functional theory (DFT)5. However, quantitative estimation of the formation energies has suffered mainly from two issues associated with the calculation methodology employed: bandgap underestimation in the conventional DFT approximation and cell-size dependence in commonly-used periodic supercell calculations6,7. Through extensive research over a few decades, more accurate and robust estimation procedures have been developed8. For instance, the determination of electronic structures including band gaps can be improved using post-DFT methods such as a hybrid functional approach9, and the size-dependence problem can be overcome by a posteriori correction scheme10.

When the number of atoms in a defective cell is changed from that in the pristine perfect cell, the defect formation energy reflects atomic chemical potentials shared with particle reservoirs11,12,13. The atomic chemical potentials are commonly preselected from a possible range calculated from the energies of reference systems including the atomic species under examination, i.e., a constant-μ approach is taken. For example, the chemical potentials of Zn and O atoms in a ZnO crystal are postulated to lie between the potentials under equilibrium with Zn crystals (Zn-rich limit) and those with O2 gas (O-rich limit)14. Due to this practice, the resultant defect energies and concentrations are represented as a function of atomic chemical potentials. However, this approach imposes a heavy burden on experimenters who want to exploit the insights obtained from calculated defect formation energies because atomic ratios are controllable and measurable parameters in experiments. This situation is analogous to (first-principles) phase diagrams where, as independent parameters, chemical potentials can be used15 instead of molar ratios as in experimental phase diagrams16. In addition, concentrations of atoms obtained in a constant-μ approach, i.e., the number of atoms in the unit cell, can strongly depend on thermodynamic quantities such as the temperature and gas pressure, even at relatively low temperatures where the diffusion rate of atoms becomes quite low. Therefore, the connection between the equilibrium conditions for calculations and experiments has been elusive at least at relatively low temperatures. In addition, functional materials are usually synthesized from a fixed amount of raw materials. It may be expected that if the number of atoms in the cell is fixed at a target value, i.e., a constant-N approach is taken, then it makes DFT-based point-defect analysis more useful and versatile for understanding defect formation behaviors in experiments.

There have been found a few dozen reported works that execute post-processing analyses in a constant-N approach based on DFT-calculated formation energies; for example, for assessing point-defect and carrier concentrations in non-stoichiometric ZnSe17 and Y2Ti2O718 and in n-type and p-type Ga2O319,20. These challenges have been rare so far compared to the overwhelming majority of DFT-based point-defect studies which report defect formation energies and concentrations analyzed in a constant-μ approach. We consider that the rareness of constant-N approach is due not to the powerlessness of the approach but to the lack of a coherent formalism, procedure, and analysis tool adaptable to various systems. Establishing such a foundation enables us to easily reuse and share obtained data, which may push point-defect chemistry toward data-driven materials science21. As a starting point for such direction, a conventional constant-μ approach is required to be extended for tracing the behaviors of point defects in a constant-N approach, along with a formalism generally describing the thermodynamics of the defects.

In this paper, we present a constant-N approach for multiple point-defect systems under thermal and charge equilibrium in order to yield results that are complementary to those obtained in the constant-μ approach. We demonstrate a difference between the two approaches by applying to candidate thermoelectric materials, Mg2Si doped with Li, Na, and Ag. The results indicate that the constant-N approach helps to visualize the dependence of carrier and defect concentrations on the amount of a dopant, leading to an interpretation of experimental results, and suggesting a direction for maximizing the free-carrier concentration. Finally, the advantages, limitations, and extensibility of the developed scheme are discussed.

Results

Calculation framework

The complete formulation for the thermal equilibrium of multiple point defects in a band-gap crystal is summarized in the Methods section. In the conventional formulation, the thermodynamic potential \({G}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\) is the objective function to minimize with respect to the concentration of a point defect Ndef; however, the function also contains parameters that should be predetermined, i.e., the chemical potentials of atoms, μα (α indicates an element), and electrons, μe. While μα are arbitrary variables, μe can be uniquely identified when it is assumed that the charge neutrality condition is satisfied among the examined charged defects and electronic carriers. In this work, we additionally impose a conservation law for the number of lattice sites (lattice site conservation; LSC) (see Methods and Discussion sections for details). Therefore, equilibrium in the constant-μ approach is achieved as the solution to the following problem:

$$\mathop{\min }\limits_{{N}_{{{{\rm{def}}}}}}{G}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\qquad \,{{\mbox{subject to}}}\,Q=0,\{{\mu }_{\alpha }\in {{{\bf{R}}}}\},{{{\rm{LSC}}}},$$
(1)

where Q represents the total charge.

The formulation for equilibrium in the constant-N approach is obtained by a Legendre transformation of thermodynamic variables from μα to the concentration of atoms \({N}_{{{{\rm{atom}}}}}^{\alpha }\):

$${\widetilde{G}}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}={G}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}+\mathop{\sum}\limits_{\alpha }{\mu }_{\alpha }{N}_{{{{\rm{atom}}}}}^{\alpha },$$
(2)

where \({\widetilde{G}}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\) is the transformed thermodynamic potential. The problem for equilibrium in the constant-N approach is thus expressed as follows:

$$\mathop{\min }\limits_{{N}_{{{{\rm{def}}}}}}{\widetilde{G}}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\qquad \,{{\mbox{subject to}}}\,Q=0,\{{N}_{{{{\rm{atom}}}}}^{\alpha }\in {{{\bf{R}}}}\},{{{\rm{LSC}}}}.$$
(3)

The procedure to solve the problem is shown in Fig. 1, which is implemented in the pydecs code (python code for point-like defect equilibria in crystalline solids)22. The analysis tool we developed parses the gathered data, such as information on the crystal structure, density of states (DOS) for the perfect cell, energies of the host and related reference materials, and defect formation energies. The overall framework for investigating point-defect equilibria in a crystal is as follows: (1) modeling perfect and defective cells as well as reference systems; (2) performing DFT calculations for each model and (if adopting) calculating the correction energies; (3) gathering the obtained data; (4) performing analyses of defect formation energies, concentrations, and related quantities under various equilibrium conditions. There already exist several tools that support modeling, calculations, and analyses of point defects23,24,25,26,27,28. Among these tools, the recently opened Spinney tool focuses on post-processing DFT data for point-defect equilibria, coding already existing approaches28. In this work, based on the explicit and general formalism, functionality to fix the number of atoms and the incorporation of LSC are originally implemented. It should be noted that vibrational terms in the defect formation energy and changes in the bandgap at elevated temperatures are not included in this work.

Fig. 1: Flow chart for point-defect equilibria.
figure 1

The atomic chemical potentials μatom are determined in the constant-N approach, by equalizing the number of atoms Natom with the target value \({N}_{{{{\rm{atom}}}}}^{{{{\rm{target}}}}}\). The shaded rectangle corresponds to the flow for the case in the constant-μ approach, where the chemical potential of electrons μe and the site-occupancy numbers Nsite are determined for an input set of atomic chemical potentials. δtol means an arbitrary tolerance.

Demonstration system: p-type Mg2Si

Mg2Si and related Mg2Sn, Mg2Ge, and their solid solutions, represented as Mg2X (X = Si, Sn, Ge), are a series of materials that are composed of lightweight and low-toxic elements, and have been extensively studied for thermoelectric applications at relatively high temperature, roughly from 500 to 900 K29,30. A serious problem regarding device fabrication using both n- and p-type components is the poor performance of p-type materials; the thermoelectric figure of merit zT for p-type Mg2X is <0.8, while larger values of 1.0–1.5 are frequently reported for n-type Mg2X30,31.

For p-type Mg2X, Li, and Ag elements have been mostly investigated as acceptor impurities, and they exhibit higher thermoelectric performance31. These dopants are expected to replace Mg atoms, and generate one hole per dopant atom. However, experimental results have indicated that the carrier concentration is lower than that expected based on the nominal dopant concentration, especially for highly doped cases. This is probably responsible for the lower thermoelectric performance32,33. Therefore, in order to elucidate the underlying mechanism, it is essential to perform DFT calculations for the examination of the thermodynamic stability of point defects and associated carriers in Mg2X. Although there have been a number of such studies, most did not treat the charged states of point defects explicitly, as described in Supplementary Note 1. As for doped Mg2X, Ayachi et al.34 reported the results of calculations using a hybrid functional to determine the defect formation energies for Ag, Li, and Bi in Mg2Si and Mg2Sn, and compared them to those for intrinsic defects. However, they did not stipulate how the chemical potentials of impurity atoms were determined, although the potentials play a decisive role in the evaluation of defect formation energies for impurity defects. Because of these situations, there has been no comprehensive study to rationalize the experimental behavior as yet, especially from a quantitative perspective.

Here, we apply the constant-μ and constant-N approaches to study point-defect equilibria in p-type Mg2Si, where three types of monovalent impurities (Li, Na, and Ag) are examined as acceptors. Mg2Si has a cubic antifluorite-type structure (space group \(Fm\bar{3}m\)) with a narrow bandgap of ~0.78 eV. To reproduce the band gap, a hybrid functional was adopted in the DFT calculations. The unit cell of the Mg2Si crystal is shown in Supplementary Fig. 1, which includes interstitial sites. We examine interstitial and substitutional defects for all atomic species, as well as vacancies for intrinsic species (see Methods section for details).

Point-defect equilibrium in the constant-μ approach

We first present results obtained in the conventional constant-μ approach for undoped and doped Mg2Si, where the Fermi level under equilibrium was determined subject not only to the charge neutrality condition but also to LSC (Equation (1)). The chemical potentials of Si and Mg atoms are considered to be set between the Si-rich (Mg-poor) and Mg-rich (Si-poor) limits which correspond to the equilibrium of Mg2Si with Si and Mg, respectively35. The composition of these materials is experimentally controllable based on the synthesis method and procedure36,37,38. In the following, we show results for the Si-rich limit because higher free-carrier concentrations are obtained at this limit as consistent with an experimental indication that Si-rich samples doped with Li exhibit relatively high zT values32,39. Results obtained at the Mg-rich limit are shown in Supplementary Note 4. The chemical potentials of Li, Na, and Ag dopants were determined for reference phases Li2MgSi, Na, and AgMg, respectively, which were selected based on the DFT-based phase diagrams obtained from the Materials Project database16,40 (see Supplementary Note 3).

Figure 2 shows the defect formation energies as a function of the Fermi-level position, εF, measured from the valence band maximum for Mg2Si. As shown in Fig. 2a, \({{{{\rm{Mg}}}}}_{{{{\rm{int}}}}}^{2+}\) and \({{{{\rm{V}}}}}_{{{{\rm{Mg}}}}}^{2-}\) are the most stable defect types among the examined intrinsic defects. Their charge states would reflect the ionicity of Mg\({}_{2}^{2+}\)Si4−41; ionization of an interstitial Mg atom to form a closed-shell electron configuration results in \({{{{\rm{Mg}}}}}_{{{{\rm{int}}}}}^{2+}\), and \({{{{\rm{V}}}}}_{{{{\rm{Mg}}}}}^{2-}\) is created by the removal of an Mg2+ ion from the crystal. For the doped cases in Fig. 2b–d, \({A}_{{{{\rm{int}}}}}^{+}\) and \({A}_{{{{\rm{Mg}}}}}^{-}\) (A = Li, Na, and Ag) have relatively low energies compared to other intrinsic defects in most range of εF. The figures also show that the Fermi level determined under the charge neutrality and LSC condutions, \({\varepsilon }_{{{{\rm{F}}}}}^{0}\), varies by elemental doping, which induces a simultaneous change in the concentration of electronic carriers, i.e., free electrons at the conduction band e, and holes at the valence band h+. For Li and Na, \({\varepsilon }_{{{{\rm{F}}}}}^{0}\) is positioned at the crossing point of the lines of \({A}_{{{{\rm{int}}}}}^{+}\) and \({A}_{{{{\rm{Mg}}}}}^{-}\), which suggests that charge compensation is completed between the two impurity defects with opposite charges. In contrast, for the Ag and intrinsic cases, \({\varepsilon }_{{{{\rm{F}}}}}^{0}\) is not determined only by the lowest-energy charged defects, so electronic carriers must contribute to charge neutrality.

Fig. 2: Point-defect formation energy diagrams.
figure 2

Defect formation energy as a function of the Fermi level with respect to the valence band maximum, εF, for a non-doped, b Li-doped, c Na-doped, and d Ag-doped Mg2Si under the Si-rich condition. The dashed vertical lines indicate the Fermi levels determined under the charge neutrality and LSC conditions, \({\varepsilon }_{{{{\rm{F}}}}}^{0}\), at 1000 K.

The dependence of the point-defect and electronic carrier concentrations on temperature is plotted by determining \({\varepsilon }_{{{{\rm{F}}}}}^{0}\) at each temperature, as shown in Fig. 3, presenting the dominant defects and carriers. For the undoped case (Fig. 3a), electrons and holes are predominant and the concentration of electrons is slightly larger than that of holes due to the smaller amount of \({{{{\rm{Mg}}}}}_{{{{\rm{int}}}}}^{2+}\) produced, which confirms n-type behavior consistent with previous DFT calculations41,42 and experiments43. For the Li- and Na-doped cases (Fig. 3b, c), \({A}_{{{{\rm{int}}}}}^{+}\) and \({A}_{{{{\rm{Mg}}}}}^{-}\) are predominant, as expected from the formation energy diagrams in Fig. 2b, c; these situations are far from the ideal p-type behavior. For the Ag-doped case (Fig. 3d), holes compensate \({{{\rm{A{g}}}_{\rm{Mg}}^{-}}}\) and the free carriers are well controlled by the dopant (acceptor), although the concentrations of Ag dopants are relatively low compared to those for the Li- and Na-doped cases.

Fig. 3: Dependence of point-defect concentrations on temperature for fixed atomic chemical potentials.
figure 3

Point-defect concentration as a function of temperature for a non-doped, b Li-doped, c Na-doped, and d Ag-doped Mg2Si, calculated in the constant-μ approach under the Si-rich condition.

The significant influence of elemental doping shown in Fig. 3 is naively considered to reflect the solubility of the dopants since the atomic chemical potentials are determined under the postulation that Mg2Si equilibrates with a selected reference phase, i.e., a possible precipitation phase. In this viewpoint, the suggested solubility sequence is Li > Na > Ag, being consistent with the reported experimental solubility limits: x ≈ 0.26 for Li, x ≥ 0.03 for Na, and x ≈ 0.02 for Ag31 (x represents the molar ratio of dopant impurities in the host materials). This trend of the solubility may be simply rationalized by the sequence of Shannon’s ionic radii of Li+, Na+, and Ag+ with six coordination: 0.76 Å, 1.02 Å, and 1.15 Å, respectively44, since cations with a larger ionic radius induce a larger lattice distortion at the interstitial and substitution sites, which results in a lower solubility in Mg2Si. Although this simple explanation is plausible, electronic structure analysis for bonding natures shown in the latter part provides more complicated pictures.

We should note that the calculated solubility can be altered by the choice of the referenced phase diagrams and reference (possible precipitation) phases, i.e., by the procedure to determine atomic chemical potentials. A DFT-based phase diagram, as used in this work, is constructed by phases with energies that can be calculated. For example, a phase diagram produced in Materials Project does not contain solid solutions, solids with the partial disorder, and large unit-cell crystals. Furthermore, the effect of calculation conditions such as the exchange-correlation functional on the diagram (phase stability) is not trivial when energies of related solids lie on the periphery of a convex hull. Either way, the constant-μ approach cannot be applied to investigate the dependence of defect concentrations on dopant concentrations lower than the solubility limit.

Figure 4 shows the relation between the chemical potential and concentration of dopant atoms for the Li case. As shown in Fig. 4a, the Li concentration decreases with decreasing μLi for each temperature, and the slope becomes steeper for lower temperatures. These behaviors reflect that Li atoms move to the reservoir from Mg2Si by the decrease in μLi, and point defects become thermally unstable as decreasing temperature. Figure 4b shows that the dependence of the Li concentration on temperature is significantly affected by the selection of the chemical potential. The evident relation between the chemical potential and concentration corroborates the Legendre transformation in Equation (2).

Fig. 4: Relation between atomic chemical potential and concentration.
figure 4

Concentration of Li atoms as a function of a Li chemical potential μLi and b temperature for Li-doped Mg2Si under the Si-rich condition. The dashed vertical line in a indicates the potential that corresponds to the selection of Li2MgSi as a reference phase.

Point-defect equilibrium in the constant-N approach

The constant-N approach is applied for point defects in Mg2Si doped with Li, Na, and Ag, where the number of impurity atoms in the Mg2Si unit cell was fixed via Equation (3), while the Mg and Si chemical potentials were determined under the Si-rich condition. Figure 5 shows the dependence of the defect concentrations on the number of dopants in the Mg2Si unit cell, Natom, which corresponds to x in AxMg2−δSi (A = Li, Na, and Ag). Figure 5a–c show the results for 700 K, where the dominant defects are \({A}_{{{{\rm{int}}}}}^{+}\) and \({A}_{{{{\rm{Mg}}}}}^{-}\) in a wide Natom range, except for the range within Natom(Ag) < 10−3, and the order of the hole concentration is Ag > Na > Li. These results indicate that the formation of \({A}_{{{{\rm{int}}}}}^{+}\) suppresses the formation of holes in all cases; however, for Natom(Ag) < 2 × 10−4 as shown in Fig. 5c, holes equilibrate with \({{{{\rm{Ag}}}}}_{{{{\rm{Mg}}}}}^{-}\). As shown in Fig. 5d–f for 1000 K, the temperature rise widens the range in which dopants act as acceptors in relatively low Natom ranges for all cases, while the sequence of hole concentration remains the same as that for 700 K. These results clearly demonstrate that the difficulty of controlling free carriers in p-type Mg2Si is attributed to the unintentional incorporation of dopants as interstitial defects. The negative effect due to the interstitial dopants increases with the amount of the dopants.

Fig. 5: Dependence of point-defect concentrations on dopant concentration.
figure 5

Concentration of point defects as a function of the number of dopant atoms per Mg2Si unit, Natom, for a, d Li-, b, e Na-, and c, f Ag-doped Mg2Si, calculated in the constant-N approach under the Si-rich condition at 700 K (ac) and 1000 K (df).

Figure 6 shows the defect concentrations as a function of temperature for a fixed number of dopant atoms at Natom(A) = 10−3. The figure indicates that equilibration between \({A}_{{{{\rm{Mg}}}}}^{-}\) and holes tends to occur at relatively high temperatures. This results from thermal excitation of holes, coinciding with the shift of \({\varepsilon }_{{{{\rm{F}}}}}^{0}\) toward valence bands as shown in the examples for 1000 K in Fig. 2. Therefore, higher hole concentrations would be achieved by annealing at higher temperatures, although the melting temperature of ~1350 K for Mg2Si35 limits high-temperature heat treatment. Since the creation of holes is strongly reduced with increasing the amount of dopants, the optimal dopant amount for each temperature should be identified to realize p-type Mg2Si with a relatively high carrier concentration.

Fig. 6: Dependence of point-defect concentrations on temperature for a fixed dopant concentration.
figure 6

Concentration of point defects as a function of temperature for a Li-, b Na-, and c Ag-doped Mg2Si, calculated in the constant-N approach under the Si-rich condition with the number of dopants at 10−3.

Considering the (net) free-carrier concentration in the Mg2Si unit cell as N(h+)−N(e), dopant activity as a source of holes is measured, which is defined by the ratio of the free-carrier concentration to the amount of dopants, i.e., (N(h+)−N(e))/Natom(A). Figure 7a shows the behavior of the activity at 1000 K, indicating monotonic decreases with increasing Natom(A) for all dopant cases. In this graph, differences between the dopant elements are clearly summarized: Higher activity is achieved for a relatively low dopant amount, and Ag is the most effective among the examined dopants with respect to the activity. A similar trend in experiments has been reported for Li-doped Mg2X solid solutions32,33 and Li-doped Mg2Si45. The extracted data from the latter report, where the samples were prepared via heat treatment at temperatures over 833 K, are compared to the calculated data in the inset of Fig. 7a. This comparison validates the capability of DFT-based point-defect calculations for a prediction of dopant activity.

Fig. 7: Analyses on free-carrier production.
figure 7

a Dopant activity as a source of holes, b ratio of concentrations of summed substitutional and interstitial dopants to the total number of dopants, Ndef(AMg)/Natom(A) and Ndef(Aint)/Natom(A), c difference in the defect formation energies for \({A}_{{{{\rm{Mg}}}}}^{-}\) and \({A}_{{{{\rm{int}}}}}^{+}\), and d the Fermi level εF, as a function of the number of dopants per formula unit for Li-, Na-, and Ag-doped Mg2Si, calculated in the constant-N approach under the Si-rich condition at 1000 K. The inset in a shows the dopant activities for the Li-doped case at various temperatures, compared with the experimental values45. The Fermi level is measured from the valence band maximum, and the shaded area and horizontal dotted line in d indicate the valence or conduction bands and half the bandgap, respectively.

The origin of the low activities of p-type doping in Mg2Si is due to the preferable interstitial defects of dopants, Aint, from the prior analyses. To inspect the behavior more closely, ratios of concentrations of AMg and Aint to the total one of dopants (Natom) are plotted as a function of Natom in Fig. 7b. At small dopant amounts (Natom(A) ~ 10−4), the ratios of AMg and Aint are higher and lower than 0.5, respectively. As Natom(A) increases, the ratio of AMg decreases and that of Aint increases, both of which approach the equimolar ratio (0.5), irrespectively of doped element. These behaviors are connected with their defect formation energies via Equation (6) or Equation (7). The difference between two formation energies for the predominant point defects, \({E}_{{{{\rm{def}}}}}({A}_{{{{\rm{Mg}}}}}^{-})\) and \({E}_{{{{\rm{def}}}}}({A}_{{{{\rm{int}}}}}^{+})\), is proportional to εF (μe) because of cancellation of μA term, derived from the definition in Equation (8). We show plots for the differences and εF in Fig. 7c, d, which indicate the relatively rapid changes occur in the lower Natom(A) range. In the higher Natom(A) range, the energy differences approach zero, i.e., energetic stabilities of the two charged defects become equal, in concurrent with the flattening or pinning of εF. Therefore, the rapid growth of the concentration of the interstitial dopants relative to the substitutional dopants at the low level of doping as observed in Fig. 5 is attributed to the changes in εF, and the limitation of the p-type doping to the Fermi-level pinning which is caused by the increase in the rate of the interstitial dopants to the substitutional ones. The observed self-compensation behavior is also observed in other thermoelectric materials, such as n-type Mg2Sn doped with Sb, where Mg vacancies are identified as compensating defects46. As for the existence of Li interstitial defects in Mg2Si, a neutron diffraction study suggested that substitutional defects are predominantly formed47. In contrast, it has been reported that interstitial Li is also formed in the solid-solution phase of Mg2Si on the Li-Mg-Si phase diagram35,48. The results calculated in this work coincide with the latter report because both defects are simultaneously produced in a similar order.

Bonding characteristics of interstitial and substitutional defects

For elucidating why the interstitial defects have similar stability to the substitutional defects at the Mg sites, bonding characteristics of those defects are analyzed based on electronic states. We use the projected crystal orbital Hamilton population (pCOHP) indicator49, which measures the degrees of bonding or antibonding interactions between arbitrary two atoms for each state and can be represented like DOS. Figure 8a shows −pCOHP for bonds between the focused (defect) atom (D) and nearest Mg and Si atoms, i.e., MgN and SiN, respectively (subscript “N” means “Nearest” in this paper). In the diagrams, right-hand (positive) and left-hand (negative) sides indicate the bonding and antibonding strengths, respectively. Bond length and integrated −pCOHP up to the highest occupied state, denoted as −ICOHP, are listed in Table 1.

Fig. 8: Bonding characteristics of point defects.
figure 8

a −pCOHP diagrams for interstitial defects and substitutional defects on the Mg sites and b differential charge density distribution for \({{{{\rm{Li}}}}}_{{{{\rm{int}}}}}^{+}\) and \({{{{\rm{Li}}}}}_{{{{\rm{Mg}}}}}^{-}\) in units of e3. The former indicators are shown for bonds between a defect atom and the nearest Mg and Si atoms labeled MgN and SiN, respectively, and their energies are aligned by the highest occupied energy to be zero. The density maps in b are drawn on the (011) plane containing doped Li, MgN, and SiN. \({{{\rm{M{g}}}_{\rm{Mg}}^{0}}}\) means the Mg atom in the perfect cell.

Table 1 Bonding characters of interstitial cations and substitutional cations at the Mg site in Mg2Si based on COHP analyses.

The COHP analyses indicate, as an overall trend, that the cationic ions at the interstitial and Mg sites have bonding interactions with the nearest atoms and the bonds are stronger for SiN rather than for MgN, despite that the SiN atoms settle in the second neighboring shell for the interstitial case (Table 1). Such bonding features are obviously visualized by differential charge density Δρ which corresponds to a change in charge density during the incorporation of the focused (defect) atom, as shown in Fig. 8b for the Li cases. These maps indicate that, in both defects, charge densities around the nearest Si atoms are largely redistributed by the incorporation of Li atoms as consistent with the indication from the COHP analyses. Δρ of the other dopant cases has a similar distribution, though there are slight differences in redistribution range and intensity. From the above inspection, the bonding tendency of an interstitial cation would largely contribute to the high stabilization of the interstitial defects by surpassing Coulomb repulsion between the doped cations and surrounding Mg (MgN).

As for the dependence of bonding characteristics on atomic species at the defect site, Ag dopants have a slightly stronger bonding compared to the Li- and Na-doped cases from a quantitative aspect; for the Ag case, high-intensity bonding states at a relatively lower energy in the valence band are observed in −pCOHP as shown in Fig. 8a and slightly higher −ICOHP values are obtained as listed in Table 1. In more detail, while the increases in −ICOHP for \({{{\rm{A{g}}}_{\rm{int}}^{+}}}\) compared to those for \({{{{\rm{Li}}}}}_{{{{\rm{int}}}}}^{+}\) and \({{{\rm{N{a}}}_{\rm{int}}^{+}}}\) are up to ~0.05, the increases for \({{{\rm{A{g}}}_{\rm{Mg}}^{-}}}\) are ~0.2 for the bonds to SiN. This difference may lead to the energetic stabilization of the substitutional Ag compared to the interstitial Ag and hence the relatively high dopant activity as in Fig. 7a.

The dopant-dependent bonding characteristics are further examined by Löwdin’s population analyses for wave functions expanded by plane waves50,51, from an electrostatic point of view. The obtained Löwdin charge of the defect atoms, QL, and electrostatic site-potentials at a defect site, νL, derived from the charges51,52, are listed in Table 1. QL and νL of all examined defects except for \({{{\rm{A{g}}}_{\rm{int}}^{+}}}\) exhibit similar trends to those of the Mg atom in bulk (\({{{\rm{M{g}}}_{\rm{Mg}}^{0}}}\)), though the absolute values are more or less lowered. These suggest that the interstitial cations can be stabilized on the similar order to the cations at the lattice Mg site, from not only covalent-bonding but also ionic-bonding aspects. QL and νL of interstitial Ag are absolutely small values with opposite signs to those values of the other defects. This opposite electronic state indicates that \({{{\rm{A{g}}}_{\rm{int}}^{+}}}\) is energetically unfavorable compared to the other interstitial defects. Based on these indications, a large increase in electrostatic energy of \({{{\rm{A{g}}}_{\rm{int}}^{+}}}\) compared to that of \({{{\rm{A{g}}}_{\rm{Mg}}^{-}}}\) would also contribute to a higher production rate of free holes as mentioned in the former paragraph.

Discussion

The constant-μ and constant-N approaches provide complementary information. While the constant-μ approach predicts the behavior of point defects for arbitrary chemical potentials which are typically determined for representative coexisting phases, the constant-N approach predicts the behavior for arbitrary numbers of atoms without the equilibrium condition of coexisting phases. These two approaches can be mixed to enable intricate analyses of multiple point defects in a more reasonable way. For a doped semiconductor, application of the constant-N approach only for the dopant element with the chemical potentials of host atoms determined for a precipitation limit would simplify the analyses, as demonstrated in this work for doped Mg2Si.

It should be noted that, when using the constant-N approach, the examined range for the number of atoms can be over a precipitation limit. In our examination of Na- and Ag-doped Mg2Si, the concentrations of dopant atoms determined by the constant-N approach exceed the solubility limit determined by the constant-μ approach with reference solids, i.e., Na and AgMg, respectively. However, we consider that these data are valuable because the predicted precipitation phases can be altered by the selection procedure as discussed earlier and highly doped samples may be experimentally realized, depending on the sample preparation procedure such as non-equilibrium synthesis. On the other hand, the disadvantage of the constant-μ approach is already discussed, which is instantiated for Li-doped Mg2Si; while Li2MgSi is here adopted as the coexistent phase based on the DFT-based phase diagram, intermediate alloys between Mg2Si and Li2MgSi and the not-narrow solid-solution range for LixMg2−xSi are found in the experimental Mg-Si-Li phase diagram35,48.

Our calculation framework can be applied straightforwardly to the case including complex and clustered defects. While, in ionic crystals, point-defects with opposite charges are apt to associate by Coulomb interaction, such association between point-defects can occur generally due to local elastic interaction8. Here, we examine the impact of the association of stable donor and acceptor on defect concentrations in Li-doped Mg2Si, coded as \({{{{\rm{Li}}}}}_{{{{\rm{int}}}}}^{+}+{{{{\rm{Li}}}}}_{{{{\rm{Mg}}}}}^{-}\rightleftharpoons {[{{{{\rm{Li}}}}}_{{{{\rm{int}}}}}^{+}+{{{{\rm{Li}}}}}_{{{{\rm{Mg}}}}}^{-}]}^{0}\) reaction. We consider only the neighboring pair to each other with a binding energy of about 0.27 eV. The recalculated defect concentrations are summarized in Supplementary Note 5, deriving a natural consequence that the concentration of the complex defect increases with decrease in temperature and with an increase in the doped amount. While the inclusion of the neutral complex defects has a negligible effect on the concentration of holes and electrons, the limit of dopant solution calculated through the constant-μ approach is affected largely as shown in Fig. 9 as cases (A) and (B) and in Supplementary Fig. 10. When intrinsic and dopant defects have similar formation energies, such association may have a more significant effect on free-carrier concentrations as reported for doped Ga2O319.

Fig. 9: Comparison of dopant solubility among different schemes.
figure 9

Concentration of Li atoms in Li-doped Mg2Si as a function of temperature calculated in the constant-μ approach under the Si-rich condition, comparing three types of calculations; (A) without the association of Li defects (\({[{{{{\rm{Li}}}}}_{{{{\rm{int}}}}}^{+}+{{{{\rm{Li}}}}}_{{{{\rm{Mg}}}}}^{-}]}^{0}\)) and with the lattice site conservation (LSC), (B) with the association and LSC, and (C) with the association and without LSC.

LSC employed in our scheme for point-defect equilibrium is expected to mitigate the overestimation of defect concentrations especially when large amounts of defects are formed, as in the case of CeO2−δ53. In our case, since the dominant donor (\({A}_{{{{\rm{int}}}}}^{+}\)) and acceptor (\({A}_{{{{\rm{Mg}}}}}^{-}\)) occupy different lattice sites, the effect of LSC becomes perceptible only when a complex defect of the dominant point defects, which occupies the interstitial and Mg lattice sites, is included. Solution amounts of Li calculated in the constant-μ approach with and without LSC are shown in Fig. 9 as case (B) and (C), respectively, which are extracted from Supplementary Fig. 10. We clearly find that the overestimation in the calculation without LSC becomes large at high temperatures where a large number of defects are formed: For instance, the composition of Li-doped Mg2Si are near to LiMg1.5Si at about 1100 K and 900 K for the cases with and without LSC, respectively, as shown in Supplementary Fig. 10e,h. The difference in temperature reflects the overestimation of the defect concentrations. As in this case, one should note that the selection of examined point and complex defects and incorporation of LSC can affect the solution limit estimated from point-defect calculations. In contrast, those have a negligible effect on free-carrier concentrations in both approaches in our case. As a further branch, one may incorporate the more direct interaction between charged defects via a mean-field approach53.

In summary, we have developed the calculation flow for thermal and charge equilibrium among point defects in the constant-N (and also constant-μ) approaches for investigating the behaviors of point defects and electronic carriers in crystalline semiconductor materials and have demonstrated analyses for Mg2Si doped with Li, Na, and Ag using the pydecs code22. In the constant-N approach, the defect concentrations are plotted as a function of the number of dopants, which complements the constant-μ approach. In the example for Mg2Si, the origin of the experimentally-observed suppression of free hole concentrations (dopant activity) was inspected. The reason for the inertness of the acceptors is charge self-compensation due to the unintentional formation of interstitial dopants that act as donors. The enhanced stabilization of the interstitial dopants may result from a strong bonding interaction between the dopant at the interstitial site and the nearest Si atoms and, for the Ag case, destabilization of the bonding interaction for the interstitial dopants compared to the substitutional ones occurs, which would lead to the relatively high dopant activity. The developed methodologies can be used to optimize experimental parameters such as dopant species, the number of dopants, annealing temperature, and environmental gas pressures, to increase dopant activity, and provide a way to facilitate the utilization of a DFT-based dataset relating to point-defect chemistry.

Methods

Formulation for point-defect equilibria

We consider an ensemble of various point defects Dq, without any direct interactions, where D and q represent a point-defect species and a charge state, respectively. We first review a general formulation for such multi-component systems under thermal equilibrium, which is scarcely discussed explicitly. The total free energy of the defect system \({G}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\) is represented by summing the contributions of each defect as follows:

$${G}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}=\mathop{\sum}\limits_{{D}^{q}}{N}_{{{{\rm{def}}}}}({D}^{q}){G}_{{{{\rm{def}}}}}({D}^{q})-T{S}_{\rm{{def}}{\hbox{-}}{\rm{conf}}},$$
(4)

where Ndef, Gdef, and Sdef-conf are the defect concentration, the defect formation energy, and the configuration entropy for all defects, respectively. The latter entropy may be given by the combination of the occupation of defects over the related lattice sites (σ) as follows:

$${S}_{{\rm{def}}{\hbox{-}}{\rm{conf}}}={k}_{{{{\rm{B}}}}}\ln \mathop{\prod}\limits_{{D}^{q}}W({N}_{{{{\rm{site}}}}}^{\sigma },{N}_{{{{\rm{def}}}}}({D}^{q})){g({D}^{q})}^{{N}_{{{{\rm{def}}}}}({D}^{q})},$$
(5)

where \({N}_{{{{\rm{site}}}}}^{\sigma }\) and g are the occupiable number of σ sites and the degeneracy, respectively. In most cases, \({N}_{{{{\rm{site}}}}}^{\sigma }\) is simply defined as the number of sites in the perfect lattice, \({N}_{{\rm{site}}{\hbox{-}}{\rm{perf}}}^{\sigma }\), i.e., \({N}_{{{{\rm{site}}}}}^{\sigma } \sim {N}_{{\rm{site}}{\hbox{-}}{\rm{perf}}}^{\sigma }\). This approximation will be discussed later and extended to a more general protocol. \({G}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\) is the thermodynamic potential in terms of Ndef(Dq); therefore, the concentration of Dq is derived from \(\partial {G}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}/\partial {N}_{{{{\rm{def}}}}}({D}^{q})=0\) as follows:

$${N}_{{{{\rm{def}}}}}({D}^{q})=\frac{{N}_{{{{\rm{site}}}}}^{\sigma }}{1+g{({D}^{q})}^{-1}\exp \left({G}_{{{{\rm{def}}}}}({D}^{q})/{k}_{{{{\rm{B}}}}}T\right)}.$$
(6)

Under the high-temperature condition (kBT >> Gdef), the concentration is approximated as:

$${N}_{{{{\rm{def}}}}}({D}^{q})\approx {N}_{{{{\rm{site}}}}}^{\sigma }g({D}^{q})\exp \left(-{G}_{{{{\rm{def}}}}}({D}^{q})/{k}_{{{{\rm{B}}}}}T\right).$$
(7)

The defect formation energy has been commonly defined as8,11:

$${G}_{{{{\rm{def}}}}}({D}^{q})={G}_{{{{\rm{DFT}}}}}({D}^{q})-{G}_{{{{\rm{DFT}}}}}({{{\rm{Perf}}}})+{{\Delta }}{E}_{{{{\rm{corr}}}}}-\mathop{\sum}\limits_{\alpha }{{\Delta }}{n}_{{{{\rm{atom}}}}}^{\alpha }({D}^{q}){\mu }_{\alpha }+q{\mu }_{{{{\rm{e}}}}},$$
(8)

where GDFT(Dq) and \({G}_{{{{\rm{DFT}}}}}({{{\rm{Perf}}}})\) are the DFT energies of cells with Dq defects and without any defects, respectively. ΔEcorr is the correction term usually calculated in a postprocess such as that by Freysoldt, Neugebauer, and Van de Walles (FNV scheme)54,55. \({{\Delta }}{n}_{{{{\rm{atom}}}}}^{\alpha }\) is the difference in the number of α atoms when a Dq defect is formed. μα and μe are the chemical potentials of α atoms and electrons, respectively. μe lies within the bandgap of the host material. When all μα are selected from a possible range determined for arbitrary reference systems, μe can be determined by the charge neutrality condition:

$$Q=\mathop{\sum}\limits_{{D}^{q}}q{N}_{{{{\rm{def}}}}}({D}^{q})+{N}_{{{{\rm{hole}}}}}-{N}_{{{{\rm{elec}}}}}=0.$$
(9)

The concentrations of holes Nhole and electrons Nelec are calculated from the DOS of the host material using the Fermi-Dirac distribution function. (When small polarons are considered, they should be treated as an independent defect species.) The determination of μe leads to the evaluation of defect concentrations for given atomic chemical potentials via Equation (6) or (7). From the derivation, we find that the total free energy (thermodynamic potential) includes atomic chemical potentials (μα) as thermodynamic variables, and therefore defect concentrations are determined for a given set of {μα} (constant-μ approach).

The concentrations in the constant-N approach are obtained by imposing constraints with respect to the number of atoms \({N}_{{{{\rm{atom}}}}}^{\alpha }\), which is expressed by

$${N}_{{{{\rm{atom}}}}}^{\alpha }={N}_{{\rm{atom}} {\hbox{-}} {\rm{perf}}}^{\alpha }+\mathop{\sum}\limits_{{D}^{q}}{{\Delta }}{n}_{{{{\rm{atom}}}}}^{\alpha }({D}^{q}){N}_{{{{\rm{def}}}}}({D}^{q}),$$
(10)

where \({N}_{{\rm{atom}} {\hbox{-}} {\rm{perf}}}^{\alpha }\) is the number of α-atoms in the perfect crystal. In this calculation scheme, \({N}_{{{{\rm{atom}}}}}^{\alpha }\) should be given prior to the calculation, instead of μα. Practical calculations may be performed using the Lagrange multiplier method to find the extremum of \({G}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\) (Equation (4)) with the constraints on \({N}_{{{{\rm{atom}}}}}^{\alpha }\) (Equation (10)). This procedure corresponds to the Legendre transformation of thermodynamic potential \({G}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\) to \({\widetilde{G}}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\) as given in Equation (2), where the defined thermodynamic potential \({\widetilde{G}}_{{{{\rm{def}}}}}^{{{{\rm{tot}}}}}\) takes the number of atoms as thermodynamic variables. This transformation can be applied to part of the total atomic species, so that we can apply a mixture condition: For example, while elements of host materials are solved within the constant-μ approach, dopant elements are solved within the constant-N approach.

Furthermore, to mitigate the roughness of the adopted approximation, we employ additional constraints on the number of lattice sites (LSC), expressed by53

$${N}_{{\rm{site}}{\hbox{-}}{\rm{perf}}}^{\sigma }={N}_{{{{\rm{site}}}}}^{\sigma }+\mathop{\sum}\limits_{{D}^{q}}{N}_{{{{\rm{def}}}}}({D}^{q}){n}_{{{{\rm{site}}}}}^{\sigma }({D}^{q}).$$
(11)

Here, \({n}_{{{{\rm{site}}}}}^{\sigma }\) denotes the number of σ sites occupied by the defect. This restriction inhibits duplicate occupation of one lattice site by point defects. Thus, the competition between point defects is incorporated in an indirect way, which may become important when the amount of the defects increases as in the Discussion section, though the second term on the right-hand side of Equation (11) has been typically ignored.

DFT calculations

All DFT calculations were performed by using the VASP code56,57, where the projector-augmented wave (PAW) method based on plane-wave expansion is applied. For approximation to the exchange-correlation functional, the Heyd-Scuseria-Ernzerhof (HSE) hybrid functional58 was employed, where the range-separation parameter (w) was set to 0.1, while the fraction of exact exchange (α) remains as the original value (α = 1/4). Here, we note that the hybrid functional provides a better description for not only electronic structures such as the band gaps of bulk materials59, but also the formation energies and charge transition states associated with point defects in semiconductor and insulator materials9,60. Cutoff energies for the plane-wave basis were set to 550 eV for simultaneous optimization of the cell parameters and positions, and 410 eV for optimization of internal atomic positions with a fixed cell volume. Energy minimization was repeated while the maximum force on atoms was larger than 0.01 eV/Å.

The lattice constant for the primitive Mg2Si crystal cell was optimized using a 6 × 6 × 6 k-point mesh based on the Monkhorst–Pack (MP) scheme for integration over the Brillouin zone. The calculated lattice constant and band gap are 6.3233 Å and 0.782 eV, which are close to the experimental values of 6.350 Å43 and 0.74–0.784 eV61, respectively. The DOS for the primitive cell was obtained for a 14 × 14 × 14 k-point mesh based on the MP scheme. The electronic and ionic parts of the dielectric constant, ε and ε0, were obtained via self-consistent response calculations of finite electric fields62,63 to be ε = 12.2 and ε0 = 7.28, respectively. While the experimental optical value (ε) of ~13.364 is close to the calculated value, the experimental static values (ε0) of ~2064 and 1265 are higher than the calculated value.

In this work, defect formation Gibbs energy is approximated by ignoring the vibrational contributions. Calculations of defect formation energies were performed using a 2 × 2 × 2 supercell of the conventional unit cell, where MP-based 2 × 2 × 2 k-point meshes were used. The FNV scheme was adopted for the correction term ΔEcorr. The convergence of the formation energy with regard to the cell size and the k-point mesh was checked for \({{{{\rm{V}}}}}_{{{{\rm{Mg}}}}}^{2-}\), and it was confirmed that the difference in the formation energy was <0.2 eV for a larger supercell size and finer k-point mesh. Reference compounds, i.e., Mg, Si, Li2MgSi, Na, and AgSi were also relaxed and calculated energies were used to obtain the atomic chemical potentials as an input for the analyses of point-defect concentrations. The degeneracy of isolated defects (g) is set to be one. The associated complex defect of \({{{{\rm{Li}}}}}_{{{{\rm{int}}}}}^{+}\) and \({{{{\rm{Li}}}}}_{{{{\rm{Mg}}}}}^{-}\), \({[{{{\rm{L{i}}}_{\rm{int}}+{\rm{Mg}}_{\rm{Li}}}}]}^{0}\), is also calculated with the same condition as the above. In equilibrium calculations including the complex defect, the Li complex defect is assigned to the interstitial site on Equation (6) and g of this defect is taken as 8.

COHP analysis was performed by using the LOBSTER tool66. Differential charge density Δρ is defined as Δρ = ρ(AB) − ρ(A) − ρ(B). In this work, AB means a defect system such as \({{{{\rm{Li}}}}}_{{{{\rm{int}}}}}^{+}\) and \({{{{\rm{Li}}}}}_{{{{\rm{Mg}}}}}^{-}\). A and B indicate the defect ion like Li+ and the system without the ion (i.e., pristine host for interstitial case and \({{{{\rm{V}}}}}_{{{{\rm{Mg}}}}}^{2-}\) for substitutional case), respectively. In calculations for the latter two systems, atomic positions and lattice vectors are kept as those in the AB system. The structures and density maps were depicted using VESTA67.