where q is the charge of the defect D, E D (q) is the energy of the defect cell, E H is the energy of the host cell, i is the elements added to or removed from the host cell, n i is the number of element i removed from the cell, E i is the reference energy of element i, µ i is the chemical potential of element i, E F is the Fermi level, and E VBM is the energy of the valence band maximum (VBM). E pot corr is the potential alignment correction aligning the defect potential to that of the bulk and E IC corr is the image charge correction calculated within the formalism developed by Lany and Zunger and adapted for non-cubic cells by Murphy and Hine. 66