  To understand the link between doping and electronic properties in high
temperature superconductors, we report first-principles calculations on the
oxygen doping effect for the single layer cuprate HgBa$_2$CuO$_{4+\delta}$. The
doping effect is studied both by supercell and single cell virtual crystal type
approaches. We find ionic behavior of the dopant atom up to an optimal doping
concentration of $\delta=0.22$. The excess oxygen attracts electrons from the
CuO$_2$ plane leading to an increase of the hole concentration in this building
block. The maximum amount of holes is reached when the oxygen $p$-shell is
nearly completely filled. As a consequence the density of states at the Fermi
level exhibits a pronounced maximum at the optimal oxygen content. The
calculated hole content as a function of doping is in accordance with
experimental findings.
