Introduction

Over the past few years, hybrid organic-inorganic halide perovskites have attracted overwhelming attention for applications in solar cells, photodetectors, and phototransistors1,2,3,4, because of the outstanding optoelectronic properties and low cost. In particular, the power conversion efficiencies (PCE) of perovskite solar cells have reached over 25%5,6. However, their large-scale deployment is restricted by the toxicity of lead and poor stability. All-inorganic lead-free perovskite CsSnBr3 is regarded as an auspicious alternative due to its similar perovskite structure to Pb-based counterparts and competitive semiconductor characteristics, including a direct bandgap7, suitable bandgap size8, favorable charge-carrier effective masses9, and high thermal stability10.

So far, there have been many experimental reports11,12,13,14,15 on CsSnBr3-based solar cells. Although the long-term stability was well demonstrated, the optimal PCE only reached 3.04%, far from 28% as predicted for single-junction cells by the Shockley-Queisser model theory16. Recently, we showed that intrinsic defects have a great impact on CsSnBr3 and device performance17. Different from other halide perovskite materials with characteristic high defect tolerance18,19, CsSnBr3 is susceptible to defects. In particular, a high concentration of Sn and Cs vacancies are predicted to be electrically active and play a mixed role in affecting the optoelectronic properties. They also exhibit mobile properties, especially under illumination, and tend to accumulate at the contact near the electrode, causing an unfavorable screening-field effect for the device performance.

In turn, CsSnBr3 may also be susceptible to impurities from electrodes, which may have an impact on the related device performance. Many optoelectronic devices, such as photodetectors, adopt an electrode-perovskite-electrode configuration, where electrodes are directly deposited on the perovskites as the back contact for the devices. In usual solar cell configurations, although a hole transport layer (HTL) or electron transport layer (ETL) separates the electrode and CsSnBr3, the organic HTL/ETL are particularly susceptible to the diffusion of electrode ions. Indeed, as found for the MAPbI3 solar cell20, the atoms of the Au electrode can diffuse across the HTL/ETL and cause contamination to the active layer. Recently HTL-free perovskite solar cells have gained momentum due to the high cost and low stability of organic HTL21. As such the “direct contact” device configuration facilitates the interaction between the electrode and active layer. Although most electrodes such as Au and Ag do not directly react with CsSnBr3, the constituent atoms of the electrodes may migrate into CsSnBr3 and be trapped at the interstices or intrinsic vacancies to form electrically active impurities22. These unintentional electrode impurities may influence device performance by introducing deep levels as non-radiative recombination centers, screening the built-in electric field, and so on. Indeed, the trihalide perovskite analog MAPbI3 active layer has been previously demonstrated to be susceptible to electrode impurities23,24.

In this work, we investigated the effects of common electrode impurities on CsSnBr3 device performance by first-principles density functional theory (DFT) calculations. We studied the most widely used electrodes of Au, Ag, Cu, and C11,15,25,26,27 due to their relatively low resistivities28 and suitable work functions for carrier extractions. For carbon electrodes29, we considered graphite and graphene. The Fermi energy levels (−5.10 eV for Au, −4.26 eV for Ag, −4.65 eV for Cu, and −5.00 eV for C)30 are compatibly located above the valence band maximum (VBM) and below the conduction band minimum (CBM) of CsSnBr3 that were measured to be −5.2 eV and −3.4 eV, respectively31. Such electrodes can effectively promote the extraction of photogenerated carriers from active layers and hence are the promising candidates for CsSnBr3 devices.

Phenomenologically, the formation of electrode impurities can be regarded as that the constituent elements first decompose from the electrodes, then diffuse into the bulk of the active layers, and finally form impurities in thermal equilibrium. Correspondingly, such a behavior can be evaluated by the cohesive energy of electrodes, the thermal stabilities, and the kinetic barriers of impurities in CsSnBr3. To this end, we first calculated the cohesive energy for the electrodes to assess the tendency of decomposing and the impurity element provision. Then, we calculated the formation energies of all the possible electrode impurities and their diffusion barriers in CsSnBr3, to understand whether they can diffuse in CsSnBr3 and cause impurity formation. Finally, we calculated the transition energy levels to assess the optoelectronic properties of these impurities. Our results demonstrate that the metal species from the electrodes can effectively diffuse and introduce electrically active impurities in the CsSnBr3 active layer. For carbon species, it requires to overcome higher cohesive energies to escape from the electrodes and higher formation energies to cause impurities in CsSnBr3 and thus will have less influence on the active layer. These appealing features make carbon-based electrodes stand out as promising electrodes for related optoelectronic applications.

Results and discussion

Cohensive energies of electrodes

The calculated cohesive energies of the considered electrodes, Au, Ag, and Cu in equilibrium face-centered cubic geometry (FCC), and C (graphite, graphene), are shown in Table 1. Our results are in good agreement with the previous studies32,33,34. The metal electrodes exhibit relatively low cohesive energies of 2.93 eV, 2.41 eV, and 3.42 eV per atom for Au, Ag, and Cu, respectively. By comparison, carbon electrodes exhibit relatively high cohesive energies, while it does not significantly differ between graphite and graphene, with the values of 7.97 eV per atom and 7.96 eV per atom for graphite and graphene, respectively, indicating atomic carbon requires to overcome higher energy to escape from graphite or graphene electrodes to contaminate the active layer.

Table 1 Ground-state cohesive energy calculated using PBE for Au (FCC), Ag (FCC), Cu (FCC), and C (graphite, graphene), compared with the results of previous DFT studies.

Band structure of CsSnBr3

Before exploring the behaviors of the impurities in CsSnBr3, we study the band structure of bulk CsSnBr3, which is significantly sensitive to defective calculation, especially the transition energy levels. As shown in Fig. 1, CsSnBr3 exhibits a direct bandgap between the CBM and VBM at the R-point in the Brillouin zone. Previous reports35,36,37 suggest that spin-orbit coupling (SOC) is important in lead halide perovskites due to the strong relativistic effects of the heavy Pb elements, which may be relevant for Sn-based perovskites. Therefore, we calculated the PBE band structures with and without SOC, as shown in Fig. 1a, b. It is interesting that, although the PBE calculation sizably underestimates the bandgap value, our PBE calculation in CsSnBr3 without consideration of SOC predicts a value of 1.41 eV, compared with that of 0.60 eV for PBE + SOC, and the experimental one, 1.75 eV13. This is because the incorporation of SOC shifts the conduction band down by ~0.8 eV, while the top of the valence band is almost unchanged. Similar behavior was also found in other trihalide perovskite counterparts38,39,40. Also, the higher level hybrid functionals, Heyd-Scuseria-Ernzerhof (HSE) was performed for bandgap correction (Fig. 1c, d). In this case, HSE overestimates the bandgap to 1.97 eV, while we obtained the bandgap of 1.83 eV when considered spin-orbit coupling. Among the results, PBE and HSE+SOC can predict a closer bandgap with respect to experimental value with a slight difference. Considering that the hybrid functionals are computationally expensive, pure PBE calculations have been widely used to study defects in perovskites41,42,43. In particular, the PBE results for defect formation energy24 and diffusion barrier23 do not significantly differ from those from HSE+SOC. Thus, in the present study, the defect formation energy and diffusion barrier were presented in the PBE values. For the energy transition levels that are sensitive to bandgap error, both PBE and HSE+SOC calculations were conducted.

Fig. 1: The band structures of bulk CsSnBr3.
figure 1

Calculated with the a PBE, achieving a bandgap of 1.41 eV, b PBE+SOC (0.60 eV), c HSE (1.97 eV), and d HSE+SOC (1.83 eV).

Impurity Formation energies

To explore whether the electrode ions can introduce impurities to influence the properties of CsSnBr3, we first calculated the formation energies of the possible point impurities, including the interstitial impurities (\(Au_i\), \(Ag_i\), \(Cu_i\), and \(C_i\)) and the substitutional impurities (\(Au_{Br}\), \(Au_{Sn}\), \(Au_{Cs}\), \(Ag_{Br}\), \(Ag_{Sn}\), \(Ag_{Cs}\), \(Cu_{Br}\), \(Cu_{Sn}\), \(Cu_{Cs}\), \(C_{Br}\), \(C_{Sn}\), and \(C_{Cs}\)).

The calculated formation energies of different impurities in the neutral and charged states as a function of the Fermi level (Ef) are summarized in Fig. 2. The Fermi level depends on the electronic condition of the host material. For example, the hole-rich condition (p-type) moves the Ef close to the VBM, whereas the electron-rich condition (n-type) moves the Ef close to the CBM. Interestingly, as shown in Fig. 2a, we found that all the carbon electrode-induced impurities act as acceptors in CsSnBr3. Graphite is more stable than graphene by 0.01 eV/atom (Table 1) hence lower bulk chemical potential, consequently graphite-induced impurities exhibit slightly higher formation energy, indicating that CsSnBr3 is more susceptible to graphene electrode than graphite electrode. They have relatively high formation energies under both Sn-rich and moderate conditions, compared with that of metal impurities, which may be attributed to the relatively weak binding of carbon atoms with CsSnBr3. In particular, under hole-rich conditions (p-type), carbon atoms are difficult to incorporate as impurities in CsSnBr3 and will have a negligible influence on the active layer. When the host is in electron-rich (n-type) conditions, these impurities tend to be ionized by trapping the electrons and the formation energies decrease. In particular, the formation energies of the \(C_i^{3 - }\) and \(C_{Br}^{3 - }\) impurities are relatively low under n-type conditions, and they become the major impurities of carbon electrodes.

Fig. 2: Impurity formation energies.
figure 2

The calculated formation energies of a carbon (two different carbon sources are considered: graphite (dashed line) or graphene (solid line)), and b metal (Au, Ag, and Cu) impurities as a function of the Fermi level, Ef, under the Sn-rich and Moderate conditions.

In stark contrast to the carbon electrode, the metal electrodes can introduce impurities with much lower formation energies and hence higher concentrations in CsSnBr3. As shown in Fig. 2b, the Sn-related substitutional impurities serve as acceptors with the lowest formation energies. Particularly, under electron-rich conditions (n-type), the negative formation energies indicate a considerable amount of impurities will form in negative divalent states (\(Au_{Sn}^{2 - }\), \(Ag_{Sn}^{2 - }\), and \(Cu_{Sn}^{2 - }\)). The reasons for this are twofold. On one hand, in agreement with the recent experiment14, our calculations predict that CsSnBr3 is susceptible to Sn vacancies17. The high concentration of Sn vacancies facilitates the accommodation of these substitutional impurities. On the other hand, the metal elements compatibly substitute at the Sn-site of CsSnBr3 with almost no structural distortion as shown in the optimized structures. In addition to the Sn-related substitutional impurities, the interstitial impurities from the metal electrodes exhibit the second-lowest formation energies in CsSnBr3. In contrast, they act as donors and each metal element tends to donate an electron to the host to form monovalent impurities (\(Au_i^ +\), \(Ag_i^ +\), \(Cu_i^ +\)), especially under hole-rich conditions (p-type). Moreover, the Br- and Cs-site substitutional impurities (\(Au_{Br}\), \(Au_{Cs}\), \(Ag_{Br}\), \(Ag_{Cs}\), \(Cu_{Br}\), \(Cu_{Cs}\)) exhibit relatively high formation energies. Only under the n-type limit, would there be any appreciable concentrations of \(Ag_{Cs}^ -\), \(Au_{Cs}^ -\), and \(Au_{Br}\) impurities, but they are not the major impurities and will have little influence on the active layer. We noted that negative defect formation energies have been widely reported in halide perovskite systems44,45,46,47. While the exact reason for these seemingly unphysical values from DFT supercell method is still unknown, it could be tentatively attributed to the well-known electron correlation and self-interaction errors associated with DFT48,49.

Kinetic barriers

The static low formation energies of electrode impurities do not necessarily determine whether they have high concentrations in CsSnBr3 because high kinetic barriers are likely to obstruct the migrations of the species from the electrodes into the active layer. Therefore, we next calculated the diffusion barriers to explore whether these low-formation-energy impurities can be formed and influence the bulk properties of CsSnBr3. As mentioned above, the acceptor impurities (\(Au_{Sn}^{2 - }\), \(Ag_{Sn}^{2 - }\), \(Cu_{Sn}^{2 - }\)) are the dominant impurity with particularly low formation energies especially under electron-rich conditions (n-type), while the donor impurities (\(Au_i^ +\), \(Ag_i^ +\), \(Cu_i^ +\)) are thermodynamically favorable in the active layer under hole-rich conditions (p-type). Thus, the diffusion of metal atoms from electrodes into the bulk of the active layer will have two possible mechanisms: hopping via Sn vacancies (\(Au_{Sn}^{2 - }\), \(Ag_{Sn}^{2 - }\), \(Cu_{Sn}^{2 - }\)) and along the interstices (\(Au_i^ +\), \(Ag_i^ +\), \(Cu_i^ +\)). These six charged defects will be considered in our diffusion calculations.

For the diffusion of the class of Sn-related substitutional impurities, it requires the assistance of the hoping of the Sn vacancies, hence, we considered three possible paths as displayed in Fig. 3a. The P1 path represents that the metal element diffuses to the Sn-site in the proximity of the impurities ([100] direction). The P2 path is along the face diagonal of the square planar structure ([110] direction), and the P3 path is along the cubic diagonal of the cubic lattice ([111] direction). For the interstitial metal impurities, one diffusion path is considered in the highly symmetric cubic phase CsSnBr3.

Fig. 3: The diffusion of major impurities.
figure 3

a The diffusion paths for substitutional impurities (M = Au, Ag, Cu) in α-CsSnBr3. The green spheres depict metal elements (Au, Ag, Cu), the red one Br, the gray one Sn, and the purple one Cs. b The calculated diffusion barriers for the metal impurities of \(Au_{Sn}^{2 - }\), \(Ag_{Sn}^{2 - }\), \(Cu_{Sn}^{2 - }\), \(Au_i^ +\), \(Ag_i^ +\), and \(Cu_i^ +\). The red bars stand for the main modes of diffusion (lowest barrier), and the pink ones for the less favorable modes. For the substitutional impurities (\(Au_{Sn}^{2 - }\), \(Ag_{Sn}^{2 - }\), and \(Cu_{Sn}^{2 - }\)), P1, P2, and P3 represent the diffusion directions of [100], [110], and [111], respectively.

As shown in Fig. 3b, all the Sn-related substitutional metal impurities have lower diffusion barriers along the P2 path than those along the P1 and P3 paths, indicating that they prefer to diffuse along the [110] direction, which is in agreement with our previous diffusion study of Sn vacancies17. As expected, the barrier energies of the substitutional impurities are substantially higher than that of Sn vacancy (0.27 eV). Among them, \(Au_{Sn}^{2 - }\) exhibits the highest diffusion barrier, up to 2.13 eV, which may be attributed to the heavier Au atom and the larger structural distortion during the impurity diffusion. To measure the distortions, we used the sizes of the Br–SnBr angle α (β) in the square planar structures, as displayed in Fig. 4. In all the initial/final states, the BrSnBr angles α/β are 90°, in agreement with the perfect structure. When the impurities diffuse, the structures are distorted and the values of angle α/β exhibit significant changes. In the transition states, the model of \(Au_{Sn}^{2 - }\) exhibits the most distortion with the BrSnBr angle α/β significantly shifted to 104.3°/102.3°, compared with 103.8°/98.6° for \(Cu_{Sn}^{2 - }\) and 103.1°/88.5° for \(Ag_{Sn}^{2 - }\). This is followed by \(Cu_{Sn}^{2 - }\) with a barrier of 1.48 eV, and then \(Ag_{Sn}^{2 - }\) also with a relatively high diffusion barrier of 1.28 eV. The low formation energies (Fig. 2b) and the high diffusion barriers indicate the metal atoms from the electrodes will be trapped at Sn vacancies near the contact and will be ionized. These impurities (\(Au_{Sn}^{2 - }\), \(Ag_{Sn}^{2 - }\), \(Cu_{Sn}^{2 - }\)) will slowly diffuse into the bulk of CsSnBr3 over time.

Fig. 4: The diffusion of Sn-site substitutional impurities.
figure 4

The main modes of diffusion for impurities \(Ag_{Sn}^{2 - }\), \(Cu_{Sn}^{2 - }\), and \(Au_{Sn}^{2 - }\), where the initial, transition, and final states are on the left, middle, and right, respectively. The sizes of the Br-Sn-Br angle α (β) in the square planar structures are used to measure the distortion of the structures. The spheres with different colors represent the different elements, yellow-Au, silvery-Ag, pink-Cu, red-Br, and gray-Sn.

Compared to the substitutional impurities in Sn sites, our results show that the interstitial metal impurities (\(Au_i^ +\), \(Ag_i^ +\), \(Cu_i^ +\)) have lower diffusion barriers in CsSnBr3. Especially for \(Ag_i^ +\), its diffusion barrier is only 0.28 eV, indicating the most favorable kinetic conditions. Besides impurity \(Ag_i^ +\), the impurities \(Cu_i^ +\) and \(Au_i^ +\) also exhibit low diffusion barriers of 0.42 eV and 0.67 eV, respectively. These results are close to those found in the MAPbI3 system with the diffusion barriers of 0.27 eV, 0.42 eV, and 0.42 eV for \(Ag_i^ +\), \(Cu_i^ +\), and \(Au_i^ +\), respectively23. Together with the low formation energies (Fig. 2b), such low diffusion barriers (Fig. 3b) allow the metal ions from the electrodes to efficiently diffuse into CsSnBr3 along the interstice and form interstitial impurities in the bulk of the active layer. As shown in Fig. 5a, all the metal interstitial impurities (\(Au_i^ +\), \(Ag_i^ +\), \(Cu_i^ +\)) prefer to locate at the interstitial site of the Sn-Br square plane and take a distorted structure, especially for \(Cu_i^ +\). This may be attributed to the Coulomb attraction between the positively charged metal elements and the negatively charged bromine ions. The diffusion behaviors of the interstitial impurities (\(Au_i^ +\), \(Ag_i^ +\), \(Cu_i^ +\)) can be described as the impurities hopping out of one Sn-Br plane and diffusing to the interstitial site on another Sn-Br plane. Interestingly, as displayed in Fig. 5b–d, the diffusion path involves a meta-stable state where the metal species is located at the middle site between the initial Sn-Br plane and final Sn-Br plane without binding with any bromine ions, resulting in multiple kinetic barriers. The highest one is regarded as the diffusion barrier for the corresponding impurities, as summarized in Fig. 3b.

Fig. 5: The diffusion of interstitial impurities.
figure 5

a Three structural motifs in the ground state for the interstitial impurities of \(Au_i^ + ,\,Ag_i^ + ,\,{\mathrm{and}}\,Cu_i^ +\) on the Sn-Br square plane of α-CsSnBr3. b, c, and d are the potential energy evolutions along the diffusion paths for impurities \(Ag_i^ +\), \(Cu_i^ +\), and \(Au_i^ +\), respectively, in which the insets show the atomic structures of the corresponding NEB images.

The metal ions exhibit particularly mobile properties within the interstices of CsSnBr3. Our previous results17 revealed that the Sn vacancy is of high concentration in CsSnBr3. One may envisage that the metal ions may penetrate CsSnBr3 along the interstice, and then fill the Sn vacancies to form substitutional impurities in the bulk of the active layer. To support this hypothesis, we calculated the energy barriers for these processes, and the results are summarized in Fig. 6. In this case, the energy barrier is the diffusion barrier for the action that an interstitial metal ion \(M_i^ +\) hops and fills a neighboring Sn vacancy \(V_{Sn}^{2 - }\) (\(M_i^ + + V_{Sn}^{2 - } \to M_{Sn}^ -\)). Indeed, as shown in Fig. 6, all these processes are exothermic and the calculated barrier energies are only 0.10, 0.23 eV, and 0.32 eV, respectively, for Ag+, Cu+, and Au+, which indicates that the metal interstitial impurities tend to fill Sn vacancies and form the Sn-site substitutional impurities. Moreover, in contrast to the relatively high diffusion barriers of hopping through Sn sites, the metal species of impurities \(Ag_{Sn}\), \(Cu_{Sn}\) and \(Cu_{Sn}\) are mainly provided by the interstitial impurities diffused from the contact.

Fig. 6: Schematic of interstitials filling Sn vacancies.
figure 6

The energy profile of the interstitial metal ion (M = Au, Ag, and Cu) migration to the neighboring Sn vacancy. The inset is the schematic of the process, where the green spheres are depicted for metal elements (Au, Ag, Cu), the red ones for Br, and the gray ones for Sn.

Charge transition levels

From the aforementioned results, the metal species from the electrodes can effectively diffuse along with the interstice and form the impurities in the bulk of the active layer. In particular, the Sn-site substitutional acceptor impurities (\(Au_{Sn}^{2 - }\), \(Ag_{Sn}^{2 - }\), \(Cu_{Sn}^{2 - }\)) are dominant, especially for n-type CsSnBr3, while the interstitial donor impurities (\(Au_i^ +\), \(Ag_i^ +\), \(Cu_i^ +\)) are also expected to exist with substantial concentrations in CsSnBr3 under hole-rich conditions (p-type). Also, impurities \(C_i\) and \(C_{Br}\) are the major impurities induced by carbon-related electrodes (graphite and graphene). To understand whether these major electrode impurities can influence the optoelectronic properties of CsSnBr3, we calculated the transition energy levels. For the minor impurities, due to the relatively high formation energies and less significant role in device performance, they will not be presented for a detailed discussion. It is well known that the transition energy level calculation is particularly sensitive to bandgap error. To obtain a more reliable value, we performed both PBE and HSE+SOC for this section, in which HSE+SOC calculation was based on the optimized structure of PBE level24. In contrast to those outside the band edges, the transition energy levels within the bandgap are important for the optoelectronic property of the host and related device performance. As shown in Fig. 7, it is noticeable that PBE exhibits a qualitatively similar result to HSE+SOC, while the level values obtained by these two methods exhibit variations, which can be attributed to the different bandgap predictions by PBE and HSE+SOC. Moreover, due to a slight underestimation (1.41 eV) of PBE and overestimation (1.83 eV) of HSE+SOC compared with the experimental result (1.75 eV), we expect that the true level to be located between the values of PBE and HSE+SOC.

Fig. 7: Impurity charge transition levels.
figure 7

The calculated transition energy levels within the bandgap for the major electrode impurities in α-CsSnBr3. The empty circles denote donors, and filled circles for acceptors.

As shown in Fig. 7, as the major impurities induced from Ag electrodes, both results imply that \(Ag_{Sn}\) and \(Ag_i\) introduce deep energy levels inside the bandgap, which serves as nonradiative recombination centers causing energy loss and hence has a detrimental effect on the carrier transport in CsSnBr3. Similarly, for Cu electrodes, both \(Cu_{Sn}\) and \(Cu_i\) can trap electrons and holes at the middle of the bandgap, indicating that Cu electrode-induced impurities jeopardize the device performance as well. For the two Au-related impurities \(Au_i\) and \(Au_{Sn}\), both PBE and HSE+SOC results show that the energy levels (1+/0) of \(Au_i\) is below the VBM while (2+/1+) is above the CBM so that it will be stable only at +1 state yet harmless to CsSnBr3. In contrast, the deep energy level introduced by \(Au_{Sn}\) makes the Au electrode detrimental to the active layer. Thus, it is obvious that when the host is under hole-rich conditions (p-type), the Au electrode has less influence and is preferable for devices. When under electron-rich conditions (n-type), all the metal electrodes can significantly degrade the device performance by giving rise to deep energy level impurities (\(Au_{Sn}^{2 - }\), \(Ag_{Sn}^{2 - }\), \(Cu_{Sn}^{2 - }\)). In this case, the shift of the growth conditions for the host to Sn-rich conditions will suppress the formation of these substitutional impurities, and help mitigate device performance deficiency. Moreover, in the case of carbon-based electrodes, in spite of the difference in the formation energies, the impurities from graphite and graphene exhibit the same transition energy levels. In particular, \(C_i\) and \(C_{Br}\) are the major impurities of carbon electrodes and can induce deep energy level (1-/2-) of 0.90 eV (1.23 eV) and 0.57 eV (1.12 eV) within the bandgap based on PBE (HSE+SOC) calculation. Compared to the metal counterparts, these impurities exhibit relatively high formation energies, thus will have less influence on the active layer and related optoelectronic devices. Furthermore, the merits27 of low-cost, high electrical conductivity, chemical stability, and modifiability enable the carbon materials as the promising electrodes for CsSnBr3-based optoelectronic applications.

In conclusion, based on extensive first-principles calculations, we systematically studied the behavior of the impurities from commonly used electrodes (Au, Ag, Cu, graphite, and graphene) in the bulk of the CsSnBr3 and the possible influence they have on the optoelectronic device performance. For carbon-related electrodes, both graphite and graphene exhibit relatively high cohesive energy, and the related impurities have high formation energies. Within the system, the carbon species tend to be in the form of interstitial and substitutional impurities (\(C_i^{3 - }\) and \(C_{Br}^{3 - }\)) under the n-type limit, which can introduce deep energy levels in the bandgap, yet with limited concentrations. Thus, graphene and graphite stand out as promising electrodes for related optoelectronic applications. By comparison, the decomposition of metal electrodes will provide a considerable amount of metal atoms that can efficiently diffuse into CsSnBr3 along the interstice and form various types of impurities. Among them, the Sn-site substitutional impurities (\(Au_{Sn}^{2 - }\), \(Ag_{Sn}^{2 - }\), and \(Cu_{Sn}^{2 - }\)) are the dominant defects, especially for n-type CsSnBr3, in which it serves as an acceptor. When the host is under the hole-rich conditions (p-type), a significant amount of interstitial impurities (\(Au_i^ +\), \(Ag_i^ +\), and \(Cu_i^ +\)) also will be formed in the active layer and serve as donors. Except for \(I_{Au}^ +\), all these major impurities can introduce deep energy levels as nonradiative recombination centers to significantly cause device performance loss. Although the Sn-rich growth condition for CsSnBr3 will mitigate this effect, more care should be taken to prevent the metal species from contaminating the active layer in related optoelectronic devices.

Methods

First-principle calculations

Our calculations were based on density functional theory (DFT) as implemented in the Vienna ab initio simulation package (VASP) code50. The projector-augmented-plane-wave method was used to describe the core–valence interaction51. The cut-off energy for basis functions was 400 eV. The Perdew-Burke-Ernzerhof (PBE)52 form of the generalized gradient approximation (GGA) and the higher level hybrid functional, Heyd-Scuseria-Ernzerhof (HSE)53 were employed to describe the exchange and correlation functional theory. The HSE calculation was performed based on the optimized structure of PBE level23,24. The effect of spin-orbit coupling was considered. A 2 × 2 × 2 reciprocal space k-point mesh was used for the sampling of the Brillouin zone. CsSnBr3 is in the cubic phase at room temperature7, so we used the cubic phase α-CsSnBr3 for our calculations. We employed a 3 × 3 × 3 135-atom supercell for the impurity simulations. Convergence test using a 4 × 4 × 3 240-atom supercell for the two energetically favorable defects, \(Ag_{Sn}^{2 - }\) and \(Au_i^ +\), reveals that the formation energy deviations between the 135- and 240-atom supercells are less than 0.02 eV. All the structures were fully relaxed until all the forces on the atoms are below 0.01 eV/Å. For charged defects calculations, extra electrons (holes) together with uniform compensating charges were added to the supercell.

Cohensive energies

The cohesive energy is calculated as,

$$E_{coh} = (NE_{atom} - E_{cell})/N$$
(1)

Here, the \(E_{cell}\) stands for the total energy of the unit cell of electrode geometry that contains N atoms. The \(E_{atom}\) is the spin-polarized total energy of a single isolated atom of the corresponding electrode material.

Defect formation energies

To assess the thermal stabilities of the electrode impurities in CsSnBr3, we calculated the formation energies. For an impurity a ionized to a charge state q, its formation energy ∆Hf(a, q) is described as54

$$\Delta H_f\left( {a,\,q} \right) = E\left( {a,\,q} \right) - E\left( {host} \right) - \sum n_i({\mathrm{\mu }}_i + \Delta {\mathrm{\mu }}_i) + q(E_f + E(VBM) + \Delta V)$$
(2)

where the E(a, q) and E(host) are the total energies of the supercells with and without impurities, respectively. The ni is the difference in the number of atoms in these supercells. The Ef is the energy of the Fermi level relative to the VBM, and E(VBM) is the valence band maximum energy. The correction term, ∆V, was introduced for the alignment of potentials in different impurity supercells, which will have a bulklike environment with that in the bulk. The µi is the bulk chemical potential of atoms corresponding to the most stable elemental phase. In particular, the chemical potential of C atom will be calculated by the phases of graphite and graphene. The relative chemical potentials, ∆µi, of component atoms (Cs, Sn, and Br) should be restricted in the green region (see Supplementary Fig. 1), which has been demonstrated from our previous CsSnBr3 defect study17. For the impurity atoms, Au, Ag, Cu, and C, we assumed they are in equilibrium with the “electrode-rich condition” for CsSnBr3 near the electrodes, and thus set their relative chemical potentials ∆µi to be zero. Moreover, for reference purposes, we chose two vastly different chemical conditions for our study. They are the Sn-rich and moderate conditions corresponding to the point A (∆µCs = −2.66 eV, ∆µSn = 0 eV, ∆µBr = −1.18 eV) and the point B (∆µCs = −3.29 eV, ∆µSn = −1.23 eV, ∆µBr = −0.56 eV) in Supplementary Fig. 1, respectively.

Diffusion barriers

The impurity diffusion barrier was calculated using the nudged elastic band method in conjunction with the climbing image method55,56,57, as implemented using the VTST (VASP Transition State Tool) extension of the VASP code, which enables the determination of the minimum energy path between two energetically stable endpoints. For each pathway, we calculated six images intercalated between the relaxed initial state and final state for searching transition state. For the diffusion pathways with multiple kinetic barriers, the highest one is regarded as the diffusion barrier.

Transition energy levels

The transition energy levels (q/q′) of impurities are decided by the position of the Fermi level, where the formation energy of the impurity with the charge state q is equal to that of the charge state q′. Thus, it can be described by54:

$$\upvarepsilon \left( {q/q^\prime } \right) = \left[ {E\left( {a,\,q} \right) - E\left( {a,\,q^\prime } \right) - \left( {q - q^\prime } \right)\left( {E\left( {VBM} \right) + \Delta {\mathrm{V}}} \right)} \right]/(q - q^\prime )$$
(3)