Ab initio investigation of electronic properties of the magnesium hydride molecular ion.