The transition from shallow to deep centers as a function of pressure
or alloying is investigated for oxygen and silicon donors in GaN and A
lN, based on first-principles total-energy calculations. The stability
of the localized deep state (DX center) is found to depend on interac
tions between the impurity and third-nearest neighbor atoms, which occ
ur in different positions in the zinc-blende and the wurtzite phase. D
X-center formation is suppressed in the zinc-blende phase, as well as
for silicon donors. The results strengthen the identification of oxyge
n as the unintentional dopant in n-type GaN, and shed new light on the
driving force for DX formation.