Calculations of formation energies and charge transition levels of defects
routinely rely on density functional theory (DFT) for describing the electronic
structure. Since bulk band gaps of semiconductors and insulators are not well
described in semilocal approximations to DFT, band-gap correction schemes or
advanced theoretical models which properly describe band gaps need to be
employed. However, it has become apparent that different methods that reproduce
the experimental band gap can yield substantially different results regarding
charge transition levels of point defects. We investigate this problem in the
case of the (+2/0) charge transition level of the O vacancy in ZnO, which has
attracted considerable attention as a benchmark case. For this purpose, we
first perform calculations based on non-screened hybrid density functionals,
and then compare our results with those of other methods. While our results
agree very well with those obtained with screened hybrid functionals, they are
strikingly different compared to those obtained with other band-gap corrected
schemes. Nevertheless, we show that all the different methods agree well with
each other and with our calculations when a suitable alignment procedure is
adopted. The proposed procedure consists in aligning the electron band
structure through an external potential, such as the vacuum level. When the
electron densities are well reproduced, this procedure is equivalent to an
alignment through the average electrostatic potential in a calculation subject
to periodic boundary conditions. We stress that, in order to give accurate
defect levels, a theoretical scheme is required to yield not only band gaps in
agreement with experiment, but also band edges correctly positioned with
respect to such a reference potential