Developing GaN based dilute magnetic semiconductors by making use of the preparation techniques for GaN materials,and combining the electrical and optical properties of existing GaN electronic devices with magnetic property will enable various novel spintronic devices to be made.The key enabler for the wide application of dilute magnetic semiconductors is room temperature ferromagnetism.Many research groups have reported numerous samples of GaN based dilute magnetic semiconductors with distinctively different magnetic properties.It may be argued that no consensus exists on the origin and control of ferromagnetism in these materials.There exists little work focusing on different doping modes for double-Mn doped GaN,GaN co-doped with Mn and non magnetic elements,and Mn doped GaN with vacancy defects,although such a doping method can significantly modify the electronic structures,magnetic and optical properties of these materials.Therefore,it is meaningful to study the effects of these different doping techniques on the electronic structure,magnetic and optical properties of Mn doped GaN so as to understand the magnetic exchange interaction in Mn doped GaN and improve its physical properties.In the calculation in this paper,the generalized gradient approximation (GGA+U) plane wave pseudopotential method under the framework of spin density functional theory is used.Models for the geometric structures of undoped wurtzite GaN supercell,three different doping modes of double Mn doped GaN, (Mn,Mg) co-doped GaN,and Mn-doped GaN with vacancy defects are constructed.The band structures,densities of states,energies and optical properties of these models are analyzed.The results show that the Curie temperature of the Mn doped GaN system can reach above room temperature.Compared with that of pure GaN,the volume of the Mn doped GaN system increases slightly.It is also discovered that the total energy and formation energy of the doped system increase with the Mn-Mn distance increasing,thereby lowering the stability of the system and making doping more difficult.Analysis reveals that co-doping the GaN with (Mn,Mg) can neither effectively increase the total magnetic moment of the doped system,nor improve the Curie temperature effect.The defects induced by Ga vacancies and N vacancies in the doped system hinder the stable ferromagnetic coupling from forming.In addition,the incorporation of Mn ions forms the spin polarized impurity band near the Fermi level.Due to the transitions between different electronic states in the spin polarized impurity band,the peak around 0.6868 eV in the imaginary part of the dielectric function and the peak near 1.25 eV in the optical absorption spectrum appear,respectively.This work offers a new insight into the understanding of the magnetic mechanisms and optical properties of Mn doped GaN,and will be conducible to improving its physical properties.