Text this: Electrical and optical characterization of Mg doping in GaN