Introduction

Strain engineering, sometimes referred to as ‘straintronics’, is an effective way to control the opto-electronic properties of materials that has been demonstrated to be particularly successful for two-dimensional (2D) materials, see refs. 1,2,3 for an overview. In part, this is due to the ability of 2D materials to withstand much larger elastic strain than bulk systems prior to irreversible deformation or fracture, with prominent examples being graphene (up to 18% elastic strain4) and MoS2 (11% strain5). The methods of strain engineering traditionally used in the semiconductor industry, such as lattice mismatch achieved during materials growth with different thermal expansion coefficients6 or external mechanical load7, can be readily applied to 2D materials8,9. In addition, due to their unique geometry, local strains in 2D materials can be introduced by the tip of atomic force microscope (AFM)5, creation of gas/water bubbles between sheets of the 2D material10 or the substrate11, transfer on pre-patterned substrates with pillars12, or substrate bending13, just to mention a few.

Concurrently with the development of straintronics, controllable introduction of defects and impurities during the growth or by post-synthesis methods, such as ion irradiation14,15,16,17,18, atom deposition19, or chemical treatment,15 has been used to tailor the properties of 2D materials and achieve the desired functionalities. Examples include impurity-mediated doping to tune the electronic structure20,21, defect-induced magnetism22,23, creation of catalytically active sites24 or even improving the mechanical characteristics: a counterintuitive increase in mechanical properties of graphene upon ion irradiation has been reported25. Defects and impurities can also govern the optical properties of 2D materials15,26,27, and, importantly, be responsible for single-photon emission12,28,29,30,31,32.

Strain- and defect-engineering can be combined to provide additional control over materials properties. For example, tensile strain has been applied to quantum emitters embedded in few-layer hexagonal boron nitride, h-BN, films, and reversible tuning of the emission and related photophysical properties has been demonstrated28,33,34. Strain gradients, either unintentionally induced or generated by substrate patterning, were reported35 to result in spatially and spectrally isolated quantum emitters in mono- and bilayer WSe2. Both red and blue spectral shifts were realized with high-tuning magnitudes. Nanoscale positioning of single-photon emitters was also achieved in atomically thin WSe2 and associated with local strains36. The deposition of h-BN sheets on a patterned substrate with protruding nanopillars has been carried out12 to create localized deformations in the material resulting in the quantum confinement of excitons.

In the reports discussed above, the localization of single-photon emitters in specific areas was associated with strain-induced changes in the local electronic structure. At the same time, theory predicts that strain affects the energetics and dynamics of defects and impurities in 2D materials37,38,39,40,41,42, similar to bulk systems43,44. As for the latter, it was theoretically shown44 that the concentrations of native defects, such as vacancies and antisites can be tuned by external strain. However, it is well known that the behavior of a system may be strongly affected by its dimensionality. For vacancies and interstitials in bulk materials it is intuitively clear that such defects will likely give rise to negative/positive dilatation volume and tensile/compressive defect-mediated local strain, but it is not clear a priori what would happen in 2D materials with impurities. For example, the impurity can take a position out of the material plane, as, e.g., Si impurity in graphene45, minimizing defect-induced strain.

This gives rise to a fundamental question: Can strain be used to tune the local characteristics of the 2D materials with defects and impurities and control defect concentration and spatial distribution? Currently, a complete understanding is lacking how strain affects the behavior of defects in 2D materials, and specifically, substitutional impurities.

Here we use first-principles calculations to investigate the response to strain of four 2D materials with substitutional impurities, i.e. h-BN, graphene, MoSe2, and phosphorene. We demonstrate that depending on the atomic radius of the impurity atom, the formation energy of defects can either increase or decrease with strain. The trends in the dependence of the defect formation energy on strain are the same in all studied materials, thus pointing to a general fundamental behavior associated with the compressive or tensile local strains produced by defects that interfere with the externally applied strain.

Results and discussion

Density functional theory (DFT) calculations, as described in the Methods section, have been carried out to gain atomic-level insight into the energetics of defects in 2D materials under mechanical strain. Four distinct well-known 2D materials, such as h-BN, graphene, MoSe2, and phosphorene, have been selected to study the effect of strain on materials with substitutional impurities, which are mechanically more robust and chemically less reactive than vacancy defects due to the absence of dangling bonds, as illustrated by the calculations of the adsorption energy of oxygen and hydrogen atoms on vacancies and impurities in two materials—h-BN and graphene, see Supplementary Table 2. We considered a low concentration of defects (the isolated defect limit) and focus predominantly on the effects of external bi-axial tensile strain, ϵ. Compressive strain is possible in 2D materials46, but large strain values are not likely to occur, as buckling and folding are normally energetically more favorable, so that we simulated the effects of relatively small compressive strain (up to 1.75%).

To get insight into the stability of defects upon strain, we carried out DFT molecular dynamics simulations for each material with single impurity using the following setup: the system was strained to 8%, then the temperature was raised to 500K, and the system was kept at this temperature over 2 ps, followed its quenching to zero temperature. No changes in the geometry were observed. We note that, in principle, this cannot be considered as a solid proof of the stability of the system on a macroscopic time scale (at room temperature), but on the other hand, we aim at the isolated defect limit, so that the behavior of the material with a very low concentration of defects at high values of strain should not be fundamentally different from that of the pristine system.

Substitutional carbon impurities in h-BN

As experimental29 and theoretical47,48,49 papers indicate that carbon substitutional impurities are the likely source of single-photon emitters in h-BN, we studied the response to strain of h-BN with such defects in detail by calculating changes in their formation energy Ef, see Eq. (2) in ‘Methods’. The complexes with three substitutional C atoms appear to be the most promising in the context of single-photon emission from h-BN30,31,32,47,48,49. For completeness, we also considered simpler defects, such as a single C atom replacing B or N atom, which we refer to as CB or CN, respectively, as well as defects with two atoms substituting the neighboring BN atoms. Defect complexes containing two C atoms are denoted as C2 defects, and those with three C atoms as C2CB or C2CN.

As nitrogen molecules are abundant under ambient conditions, all calculations were done in the N-rich limit taking the value of μN for N2 molecule. The chemical potential of the substituted B atoms μB(ϵ) depends on whether they were incorporated in the non-strained (ϵ = 0) or strained lattice (ϵ ≠ 0). The system was assumed to be in the thermal equilibrium so that μB(ϵ) + μN = μBN(ϵ). The chemical potential of C is taken to be that of graphene. The explicit formulae for specific defects are listed in the Supplementary Information. The formation energy for all the defects in the system without external strain is presented in Supplementary Fig. 1. These results agree well with the published data50,51,52,53. As shown previously, the formation energy of CB, either in a neutral or +1 charge state, is lower than for other defects, and thus the formation of CB defects is likely. In contrast, the formation of CN and C2CN is feasible only in the -1 charge state.

The dependence of the defect formation energy Ef on ϵ for the simplest CB or CN defects is shown in Fig. 1 as the changes in Ef with strain, ΔEf = Ef(ϵ) − Ef(ϵ = 0). For CB, ΔEf increases with ϵ independent of the choice of the chemical potential for B (if it depends on strain or not), and for CN the trend is the opposite. Note that ΔEf changes its sign upon transition from compressive to tensile strain. To understand this behavior, we have calculated the bond distribution function following Eqs. (3) and (4) and strain maps for these defects. We note that strain fields localized near point defects in 2D materials have been detected using transmission electron microscopy (TEM)54,55. The results for the neutral CB defect are presented in Fig. 2a. In the strain maps, red color indicates bond contraction with regard to the bonds in the pristine h-BN system, and blue – bond elongation. It is evident that C-N bonds, marked as “X”, are shorter than the B-N bonds in the pristine system, which can be correlated with a smaller atomic radius of C atoms as compared to B, see Supplementary Table 1. Local bond contraction gives rise to the development of the intrinsic tensile strain in the system (overall bond elongation), as follows from the bond distribution function, which is much larger for bond lengths exceeding that in the pristine system (marked as the vertical dashed line) than for shorter bonds. Thus, the system is pre-strained (internal tensile strain), and when external tensile strain is applied formation energy of the defect increases, as these two types of strain have a cooperative effect of increasing the total energy of the system. In the case of compressive strain, the energy of the system goes down, giving rise to negative values of ΔEf.

Fig. 1: Differences in the formation energy (ΔEf) as functions of biaxial strain ϵ(%) (tensile and compressive).
figure 1

ΔEf for neutral CN, CB and charged defects C\({}_{N}^{-1}\) and C\({}_{B}^{+1}\) was calculated under assumption that the B atom is incorporated into either strained or original [μB(ϵ = 0%)] h-BN lattice.

Fig. 2: Bond distribution function difference Δρ and strain maps for substitutional CB impurities in h-BN.
figure 2

Δρ for neutral (a) and charged (b) CB defects in the system without external strain. The vertical dashed lines indicate the bond length value for the pristine structure. In the strain maps, red areas correspond to bond contraction, blue—bond elongation. The shorter C–N bonds labeled as “X” gave rise to overall increase in the length of the bonds next to the defect, as evident from asymmetric (with regard to the pristine system) bond length distribution.

The electronic structure of a positively charged system with defects remains qualitatively the same as that of a neutral defective system, only the position of the defect-induced states with respect to valence band maximum (VBM) and conduction band minimum (CBM) change (see Supplementary Fig. 2). The gap decreases, as evident from the shift of the CBM. The bonding-antibonding analysis carried out using the crystal orbital Hamilton population (COHP)56 of the electronic structure of the defect indicates that the electron localized on the defect (Supplementary Fig. 3) is removed from the antibonding state, which should give rise to a stronger local bonding and shorter C-N bonds (“X”), as clear from Fig. 2b. This leads to further overall increase in the defect-induced strain in the system, thus making ΔEf even larger.

The behavior of the CN defect under strain is different. Contrary to CB, its formation energy decreases, as shown in Fig. 1. The atomic radius of C is greater than that of N, RC > RN, so the B atoms neighboring C atom are pushed away, and the C-B bonds, which are also marked as “X” in Fig. 3, are longer, giving rise to compressive defect-induced strain in the system. This is evident from the difference Δρ in bond distribution for the neutral defect shown in Fig. 3a, which is positive and much larger for shorter bonds as compared to the bond length in the pristine system (vertical dashed line). When external tensile strain is applied, it compensates for the defect-induced strain, thus lowering the formation energy. For compressive strain, the energy of the system goes up, as external and defect-induced strains are of the same type.

Fig. 3: Bond distribution function difference Δρ and strain maps for substitutional CN impurities in h-BN.
figure 3

Δρ for neutral (a) and charged (b) CN defects in the system without external strain. The vertical dashed lines indicate bond length value for the pristine structure. In the strain maps, red areas indicate bond contraction, blue bond elongation.

The changes in the electronic structure of the CN defect under strain are similar to the case of the CB defect; the position of the defect-mediated states in the band gap changes, although with respect to the CBM, and the gap shrinks (Supplementary Fig. 4). For the negatively charged defects, the extra electron goes into the bonding state (Supplementary Fig. 5). However, it is localized not only on the impurity C atom but also on the nearest neighbor N atoms (Supplementary Fig. 6). In addition to the contraction of the C-B bonds labeled as “X”, Fig. 3b, this also gives rise to an increase in the length of the “Y” bonds, so that the overall amount of compressive strain in the system increases, and ΔEf insignificantly decreases. We note that the C atom occupying the position of N atom is slightly displaced out of plane in the system without strain, and the displacement is reduced when strain is applied.

For the C2CB and C2CN defects, qualitatively similar dependence of ΔEf on strain has been found, with the change in the formation energy reaching 2.5 eV when tensile strain of 8% is applied (Fig. 4). For C2, the dependence of ΔEf on strain is much weaker (Supplementary Fig. 7), and the results depend on the choice of the chemical potential for B atom. The bond distribution and electronic structure of the systems containing such defects are shown in Supplementary Fig. 8—Supplementary Fig. 13. Overall, the trends in the strain effects on Δρ and strain maps are similar to those found for the simpler CB and CN defects. The energy difference between the defect-induced states changes slightly for defects with three C atoms amounting to 0.16 eV for C2CB and 0.22 eV for C2CN, thus hinting at a possibility of tuning the wavelength of the emitted single photons.

Fig. 4
figure 4

Differences in the formation energy (ΔEf) as functions of biaxial strain ϵ(%) for neutral and charged defects C2CB, charged defects \({C}_{{{{\rm{2}}}}}\,{C}_{B}^{+1}\) and C2CN, \({C}_{{{{\rm{2}}}}}\,{C}_{N}^{-1}\) calculated under assumption that the displaced B atoms are incorporated into either strained or original [μB(ϵ = 0%)] h-BN lattice.

The local strain created by impurity atoms is always present around an isolated defect, independent of the size of the supercell. Indeed, our test calculations for larger supercells (see Methods for details) gave qualitatively similar results indicating that when ϵ = 5% strain is applied ΔEf changes by less than 1% in the case of CN defect and by 15% for CB defect. For all the systems, the trends in the formation energy change as a function of the applied compressive strain are opposite to those for tensile stain. In this case, ΔEf increases for CN and decreases for CB, which is consistent with the bond distribution picture and our interpretation of the role of the defect-induced strain in the system.

Our results indicate that external strain can strongly influence the formation energy of defects in h-BN, which, importantly, increases for some types of defects and decreases for others. Figure 5 shows defect formation energy for different types of substitutional carbon defects in h-BN as a function of μe for the strained system and without strain. It is evident that in the strained system, e.g. in the limit of strong n-type doping, the formation energy of CN becomes lower than that of CB but it never happens if strain is absent.

Fig. 5: Defect formation energy Ef as a function of electron chemical potential μe for various defects under N-rich condition for 0% strain (dashed lines) and 8% strain (solid lines).
figure 5

The arrows show how defect formation energies change upon strain.

Extension to other archetypal 2D materials

According to our calculations, the observed trends in the dependence of the defect formation energy on biaxial strain persist in other archetypal 2D materials including graphene, transition metal dichalcogenides (as shown in the example of MoSe2), and phosphorene. In all these materials, upon application of bi-axial tensile strain the formation energy of substitutional defect structure increases if the atomic radius of the impurity atom is smaller than that of the host atom and it decreases if the impurity atom is larger than the host atom. To illustrate this general behavior, Fig. 6 summarizes the changes in ΔEf with strain for the appropriate substitutional defects in these 2D materials.

Fig. 6: Differences in the formation energy (ΔEf) as functions of biaxial strain ϵ(%) for substitutional defects in graphene, MoSe2 and phosphorene.
figure 6

As evident from the figure, for all materials Ef increases with strain when the atomic radius of the impurity atoms is smaller than that of the host atom, and the trend is the opposite when the impurity atom is larger than the host atom.

In graphene, the most widely studied impurities are B and N57, as they can give rise to the p- and n-type doping, respectively. For the case of 2D transition metal dichalcogenides (TMDs), we focused on chalcogen atom substitution and considered MoSe2 with substitutional S and Te impurities in the position of Se atom. As we present the difference in the formation energy of the substitutional defect in the strained and non-strained system, the choice of the chemical potential for impurity atoms can be arbitrary. We took the chemical potential of the host atom to be independent of ϵ; the removed atoms were assumed to be incorporated into the area of 2D material which is not strained.

Figure 6 indicates that in MoSe2 the variation in ΔEf with strain is noticeably smaller than in h-BN and graphene. This can be expected as a single MoSe2 sheet consists of three layers of atoms, and we substitute an atom in one layer only. The dependence of the defect formation energy on strain has been also studied41 for the case of MoS2 with Nb and Ta substitutional impurities in the position of Mo. The study concluded that tensile strain gives rise to a decrease in the defect formation energy in this case. This conclusion is in agreement with our general observations as the atomic radius of both impurity atoms (Nb and Ta) is greater than that of the host Mo atom. Note that S and Te impurities in MoSe2, being isovalent to Se, do not give rise to deep impurity-induced states in the band gap, but only shift the position of CBM and VBM, as demonstrated earlier for TMD alloys58,59, so that we do not study charged impurities in MoSe2.

The bond distribution function and strain maps are presented in Fig. 7a for the NC and in Fig. 7b for BC defects in graphene, and in Fig. 8a for the SSe and in Fig. 8b for TeSe defects in MoSe2. If Rimp < Rhost, bonds containing impurity atom are shorter than the corresponding bonds in pristine material. Again, Δρ (Figs. 7a, 8a) indicates that the contraction of bonds localized at the defect causes the development of the intrinsic tensile strain in the system leading to an overall bond elongation. This can be seen in the peaks in the bond distribution function which are formed to the right of the vertical dashed line showing the corresponding bond length in pristine material. When external tensile strain is applied to a 2D material, the cooperative effects from the intrinsic and external tensile strains lead to an increase in the defect formation energy under the applied external strain. Substitutions with impurity atoms where Rimp > Rhost lead to the development of compressive strain in the system, and when external tensile strain is applied, it compensates for the defect-induced strain thus lowering the defect formation energy (Fig. 6). Note that the presence of three layers in MoSe2 structure also caused smaller extension of defect-induced strain fields as compared to graphene and h-BN.

Fig. 7: Bond distribution function difference Δρ and strain maps for defects in graphene.
figure 7

(a) Δρ for Nc and (b) for BC defects in graphene without external strain. The vertical dashed lines indicate bond length value for the pristine structure. In the strain maps, red areas indicate bond contraction, blue—bond elongation. In (a) the shorter N-C bonds labeled as “X” gave rise to overall bond length increase in the system, as evident from asymmetric (with regard to the pristine system) bond length distribution and in (b) the longer B-C bonds labeled as “X” gave rise to overall bond length decrease in the system, as evident from asymmetric (with regard to the pristine system) bond length distribution.

Fig. 8: Bond distribution function difference Δρ and strain maps for defects in MoSe2.
figure 8

Δρ for neutral SSe (a) and TeSe (b) defects in the system without external strain. The vertical dashed lines indicate bond length value for the pristine structure.

To further generalize our conclusions, we also investigated phosphorene, where defects and impurities have received considerable attention60. Specifically, we addressed its responses to substitutional N and As impurities, which have smaller/larger atomic radii as the host P atoms. Unlike other 2D materials studied in this work, phosphorene exhibits large directional anisotropy in tensile stress/strain behavior due to distinct bond types present in its structure. The values of Young’s modulus in phosphorene are 176 GPa in the plane and 48 GPa in zigzag and armchair directions, in agreement with previous calculations61, manifested in strongly anisotropic strain fields near N and As impurities (Fig. 9). Nonetheless, the formation energy of impurities in phosphorene exhibits the same behavior upon applied bi-axial strain as in all other studied 2D materials. The analysis of bond distribution functions, Fig. 9a, b, indicates that the origin of such behavior is in the interaction of the defect-induced strain with the external strain.

Fig. 9: Bond distribution function difference Δρ and strain maps for defects in phosphorene.
figure 9

Δρ for neutral Np (a) and AsP (b) defects in the system without external strain. The vertical dashed lines indicate bond length value for the pristine structure.

We note that the trends common for all four materials we studied can also be explained through the values of electronegativity of the host atoms and impurities, as it is directly related to atomic radius: The closer the electrons are to the nucleus, the stronger is the confining potential and the electrons are correspondingly more tightly bound, thus increasing the electronegativity of the atom, which is also reflected in the bond length. The electronegativity and atomic radii are listed in Supplementary Table 1.

Effects of impurities on mechanical properties of 2D materials

The peculiar dependence of defect formation energy on strain also indicates that the mechanical properties, specifically elastic moduli, such as Young’s modulus Y and 2D bulk modulus Y2D can change upon the introduction of impurities in a non-trivial way. As both quantities are proportional to the second derivative of the total energy with regard to strain, it is immediately clear from equation (2), that if the dependence of atom chemical potentials μ on strain is neglected, that is it is assumed that the removed atoms are incorporated into the area which is not strained, then

$${\partial }^{2}{E}_{{{{\rm{f}}}}}(\epsilon )/\partial {\epsilon }^{2} \sim {Y}_{{{{\rm{def}}}}}-{Y}_{{{{\rm{pristine}}}}},$$
(1)

where Ydef and Ypristine are the elastic moduli of the defective and pristine systems, respectively. This means that if Ef increases with strain, one can expect that Young’s and bulk moduli of the material with impurities will be larger than that of the pristine system, and vice versa. For example, Y should increase for CB and decrease for CN, as evident from Fig. 1. Indeed, our calculations of Young’s moduli for all defective materials showed such a dependence for strain applied in both zigzag and armchair directions. The results are presented in Supplementary Table 3. Thus, one can conclude that substitutional impurities with the atomic radii smaller than the radius of the host atom will increase the elastic moduli of the system and the other way around, impurities with the atomic radii larger than the radius of the host atom will give rise to a decrease in the elastic moduli.

However, the quantification of the effects of impurities on elastic moduli is not straightforward. While defect formation energy should be independent of defect concentration (neglecting the interaction of defects via strain fields and electronic effects62, which is substantial only at a high concentration of defects, elastic moduli are defect concentration-dependent (in our case concentration of defects was about 0.5%). In the isolated defect limit, no changes in the moduli are expected. The effects of impurities can be noticeable only when defect/impurity concentration is high, that is at least a few atomic percent. In this case, however, the simulation setup with fixed supercell size we used is not applicable, as the supercell size must also be optimized. Moreover, random distribution of defects in the system should be used in the calculations, and the results be averaged over many configurations. The anisotropy should also be accounted for, as in Young’s modulus calculations strain is applied in the specific direction. Taking all the above into account, we refrain from the quantification of the effects of impurities on elastic moduli, which will be done elsewhere.

To conclude, by employing DFT calculations, we assessed the energetics of 2D h-BN, graphene, MoSe2 and phosphorene with substitutional impurities under external strain. We demonstrated that for all these materials the formation energy of the defect structures increases with bi-axial tensile strain when the atomic radius of the impurity atom is smaller than that of the host atom, and vice versa, the formation energy decreases when the atomic radius of the impurity atom is larger than that of the host atom. For compressive strain the trend is reversed. Such a behavior can be rationalized through the interplay of the local compressive or tensile local strains induced by the impurities with the external strain. The trends in the dependence of the defect formation energies on strain are the same in all the systems we studied, a result which can likely be generalized to all 2D materials. Strain also gives rise to the changes in the electronic structure of the defective materials. Our results indicate that local strain can be used to not only tune the properties of single-photon emitters by changing the positions of defect-induced states in the band gap, but also create specific types of defect structures in the pre-designed areas. This can be achieved using various approaches for specific materials, depending on their atomic structure and reactivity. If the migration barriers of defects are relatively low, impurities can be first introduced (e.g., by ion implantation), then local strain can be created using AFM or curving the substrate followed by thermal annealing, which should result into migration and agglomeration of defects in specific areas. Alternatively, heating of the non-uniformly strained material in a specific atmosphere can be employed for post-synthesis doping. For example, substitutional impurities can be created in MoSe2 and other transition metal dichalcogenides deposited on pillars (resulting in local compressive/tensile strain) by annealing in S- or Te-rich environments. It should also be viable to produce vacancies first by ion or electron irradiation in the materials with local strain, then anneal the system at temperatures when vacancies become mobile, so that their concentration in specific areas is different, after which the material can be exposed to specific atomic species or molecules, which would interact with vacancies. Overall, a combination of defect- and strain-engineering may open new avenues to develop materials with specific types of defects with spatially non-uniform distribution.

Methods

Defect formation energy

Neglecting the contributions from the electronic and vibronic degrees of freedom, which are normally much smaller than the configurational entropy term, the formation energy Ef of a defect in a charge state q in the system with mechanical strain ϵ can be calculated51,63 as a function of the electron chemical potential through

$${E}_{{{{\rm{f}}}}}(\epsilon ,q)={E}_{{{{\rm{def}}}}}(\epsilon ,q)-{E}_{{{{\rm{pristine}}}}}(\epsilon ,q)\pm \mathop{\sum}\limits_{i}{n}_{i}{\mu }_{i}(\epsilon )+q({E}_{{{{\rm{v}}}}}(\epsilon )+{\mu }_{{{{\rm{e}}}}})+{E}_{{{{\rm{corr}}}}}$$
(2)

Here, Edef is the total energy of the supercell containing one defect, Epristine is the total energy of the pristine supercell, μi and ni are the chemical potential and number of the removed or added atoms (with the proper sign), respectively, and μe is the electron chemical potential. Ev is the energy of the valence band maximum (VBM), and Ecorr is a correction term that accounts for spurious interactions of charged defects in periodic supercells50,63. The sign before the third term in Eq. (2) corresponds to the removed (+) and added (-) atoms.

In our calculations, the formation energy Ef(ϵ, q) as a function of strain is assessed at the fixed volume; an alternative way is to assume constant pressure P and optimize the volume V of the supercell. In this case, the PΔV term should be added to Eq. (2) and modified to the 2D quantity of P2DΔA, where ΔA is the dilatation area, that is the difference between the area of the pristine system and the system with the defect. Aside the case of charge defects64, this approach works well for bulk systems, but for 2D materials it presents a number of conceptual issues, such as the out-of-plane structural relaxation, buckling of the host, as well as numerical instabilities when adjusting the volume. As a test, we also carried out supercell size optimization for CB and CN defects. The dilatation area proved to be negative for the former and positive for the latter. As pressure is negative when external tensile strain is applied to the system, the behavior of ΔEf, that is its linear increase/decrease for μB(ϵ = 0) is consistent with what should be expected from ΔEf ~ P2DΔA.

Structural analyses

The changes in the atomic structure upon introduction of impurities have been calculated by the difference Δρ(r) in the bond distribution function ρ(r) for the defective and pristine systems

$$\Delta \rho (r)={\rho }_{{{{\rm{def}}}}}(r)-{\rho }_{{{{\rm{pristine}}}}}(r),$$
(3)
$$\rho (r)=\mathop{\sum}\limits_{i\ne j}\delta (r-{r}_{ij}),$$
(4)

where rij is the bond length between nearest neighbor atoms i and j at zero temperature, δ(r) is the Dirac delta function, which was smeared for a better visualization.

Density functional theory calculations

Our density functional theory calculations were carried out using generalized gradient approximation (GGA) within the Perdew-Burke-Ernzerhof parametrization65 as implemented in the VASP code66,67. A plane-wave cut-off of 450 eV was used in all the calculations. Vacuum spaces of 16 Å, 17 Å, 13.2 Å, and 15 Å were considered for h-BN, graphene, MoSe2, and phosphorene, respectively, in the directions perpendicular to the planes to avoid the spurious inter-layer interactions. The full geometry optimizations were performed with the force tolerance being set to 0.01 eV Å−1 for h-BN and 0.005 eV Å−1 for graphene, MoSe2, and phosphorene.

The Brillouin zone of the studied systems was sampled using 13 × 13 × 1 and 4 × 4 × 1 k-point meshes for primitive cell and supercell structures.

The electrostatic corrections were accounted for using two different schemes50,63, which gave essentially the same results.

For all the materials rectangular supercells were used. For h-BN, the supercells contained 160 atoms (8 × 5 primitive rectangular cells). Test calculations for a larger supercell containing 392 (14 × 7 primitive rectangular cells) atoms were also carried out. For MoSe2, graphene and phosphorene, the supercells had 168 (7 × 4 primitive rectangular cells), 240 (10 × 6 primitive rectangular cells) and 192 atoms (6 × 8 primitive rectangular cells), respectively.