Hysteretic photochromic switching of Eu-Mg defects in GaN links the shallow transient and deep ground states of the Mg acceptor