We have investigated the geometrical structures, the electronic properties, and the formation energies of nN-Mg codoped
ZnO in neutral state by adopting the first-principles calculations based on the density function theory (DFT). The
calculated results indicate that N atoms prefer to occupy the substitution O site and Mg substitutes the Zn site of the
nearest site of N, which act as an acceptor. Compared with the formation energies of various configurations in neutral
state, it is found that 4N-Mg complex has the lowest formation energy using NO as dopant resource under Zn-rich
condition, indicating that 4N-Mg codoping can enhance the N dopant solubility under this condition. Meanwhile, the Znrich
condition is better for p-type doping than the O-rich condition. It demonstrates that 4N-Mg complex is in favor of
achieving p-type conduction in ZnO. Simultaneously, analysis of density of states (DOS) of nN-Mg complex find that
the valence band maximum (VBM) has a little raise near the Fermi energy level, indicating that the complexes are the
typical p-type characteristic. However, for 4N-Mg complex, the Fermi level is located near the top of valence band.
Furthermore, from the band structure and PDOS of 4N-Mg complex, it is observed that the complex produces an
additional impurity band at the top of the valence band. Meanwhile, the PDOS value of 4N-Mg complex at the Fermi
level is relatively large. In addition, 4N-Mg complex has much lower ionization energy of 0.167eV than that of other
complexes. Therefore, better quality p-type conductivity is achieved by codoping 4N-Mg in ZnO.