Realization of p-type gallium nitride by magnesium ion implantation for vertical power devices