The structural and electronic properties of beryllium substitutional accept
ers and interstitial donors in GaN are investigated using first-principles
calculations based on pseudopotentials and density-functional theory. In p-
type GaN, Be interstitials, which act as donors, have formation energies co
mparable to that of substitutional Be on the Ga site, which is an acceptor.
In thermodynamic equilibrium, incorporation of Be interstitials will there
fore result in severe compensation. To investigate the kinetics of Be inter
stitial incorporation and outdiffusion we have explored the total-energy su
rface. The diffusivity of Be interstitials is highly anisotropic, with a mi
gration barrier in planes perpendicular to the c axis of 1.2 eV, while the
barrier for motion along the c axis is 2.9 eV. We have also studied complex
formation between interstitial donors and substitutional accepters, and be
tween hydrogen and substitutional beryllium. The results for wurtzite GaN a
re compared with those for the zinc-blende phase. Consequences for p-type d
oping using Be accepters are discussed.