where N D is the density of possible sites for defect D, g D,q is the degeneracy of the defect state, k B is Boltzmann's constant, and T is temperature. The formation energy of charge state q is dependent on the Fermi energy (E F ) which can itself be determined self consistently within the charge neutrality condition: