  We present a first-principles study of defect formation and electronic
structure of erbium (Er)-doped yttria (Y$_2$O$_3$). This is an emerging
material for spin-photon interfaces in quantum information science due to the
narrow linewidth optical emission from Er dopants at standard telecommunication
wavelengths and their potential for quantum memories and transducers. We
calculate formation energies of neutral, negatively, and positively charged Er
dopants and find the charge neutral configuration to be the most stable,
consistent with experiment. Of the two substitutional sites of Er for Y, the
$C_2$ (more relevant for quantum memories) and $C_{3i}$ (more relevant for
quantum transduction), we identify the former as possessing the lowest
formation energy. The electronic properties are calculated using the
Perdew-Burke-Ernzerhof (PBE) functional along with the Hubbard $U$ parameter
and spin-orbit coupling (SOC), which yields a $\sim$ 6 $\mu_B$ orbital and a
$\sim$ 3 $\mu_B$ spin magnetic moment, and 11 electrons in the Er $4f$ shell,
confirming the formation of charge-neutral Er$^{3+}$. This standard density
functional theory (DFT) approach underestimates the band gap of the host and
lacks a first-principles justification for $U$. To overcome these issues, we
performed screened hybrid functional (HSE) calculations, including a negative
$U$ for the $4f$ orbitals, with mixing ($\alpha$) and screening ($w$)
parameters. These produced robust electronic features with slight modifications
in the band gap and the $4f$ splittings depending on the choice of tuning
parameters. We also computed the many-particle electronic excitation energies
and compared them with experimental values from photoluminescence.
