  Formation energies of charged point defects in semiconductors are calculated
using periodic supercells, which entail a divergence arising from long-range
Coulombic interactions. The divergence is typically removed by the so-called
jellium approach. Recently, Wu, Zhang and Pantelides [WZP, Phys. Rev. Lett.
119, 105501 (2017)] traced the origin of the divergence to the assumption that
charged defects are formed by physically removing electrons from or adding
electrons to the crystal, violating charge neutrality, a key principle of
statistical mechanics that determines the Fermi level. An alternative theory
was constructed by recognizing that "charged" defects form by trading carriers
with the energy bands, whereby supercells are always charge-neutral so that no
divergence is present and no ad-hoc procedures need to be adopted for
calculations. Here we give a more detailed exposition of the foundations of
both methods and show that the jellium approach can be derived from the
statistical-mechanics-backed WZP definition by steps whose validity cannot be
assessed a priori. In particular, the divergence appears when the charge
density of band carriers is dropped, leaving a supercharged crystal. In the
case of charged defects in two-dimensional (2D) materials, unphysical fields
appear in vacuum regions. None of these pathological features are present in
the reformulated theory. Finally, we report new calculations in both bulk and
2D materials. The WZP approach yields formation energies that differ from
jellium values by up to ~1 eV. By analyzing the spatial distribution of wave
functions and defect potentials, we provide insights into the inner workings of
both methods and demonstrate that the failure of the jellium approach to
include the neutralizing electron density of band carriers, as is the case in
the physical system, is responsible for the numerical differences between the
two methods.
