where E X q tot is the total energy of a supercell containing defect X in charge state q, and E bulk tot is the total energy of the defect free supercell. ∆µ i are chemical potentials of each atomic species i that are added to (n i > 0) or removed from (n i < 0) the supercell to form defect X. µ i are elemental reference energies, calculated for each element in its standard state. E F is the Fermi energy, with this term accounting for the energy to add (q < 0) or remove (q > 0) electrons to or from the supercell. E vbm is the DFT-calculated energy of the valence-band maximum of the host system. ∆V pot is a potential alignment term that accounts for differences in background electrostatic potentials between the host and defective supercells . E q corr is a correction term accounting for the finite size of the supercell. Image-charge corrections were determined using the method of Lany and Zunger and electrostatic potentials were aligned with respect to average core potentials for sets of atoms far from the defect.