  Extended defects such as stacking faults and anti-site domain boundaries can
perturb the band edges in Cu$_2$ZnSnS$_4$ and Cu$_2$ZnSnSe$_4$, acting as a
weak electron barrier or a source for electron capture, respectively. In order
to find ways to prohibit the formation of planar defects, we investigated the
effect of chemical substitution on the stability of the intrinsic stacking
fault and metastable polytypes and analyze their electrical properties.
Substitution of Ag for Cu makes stacking faults less stable, whereas the other
substitutions (Cd and Ge) promote their formation. Ge substitution has no
effect on the electron barrier of the intrinsic stacking fault, but Cd
substitution reduces the barrier energy and Ag substitution makes the stacking
fault electron capture. While Cd substitution stabilizes the stannite
structure, chemical substitutions make the primitive-mixed CuAu (PMCA)
structure less stable with respect to the ground-state kesterite structure.
