  Ab initio calculations and statistical mechanics are combined to elucidate
the thermodynamics of H vacancies in MgH2. A general method based on a
grand-canonical ensemble of defect configurations is introduced to model the
exchange of hydrogen between crystalline MgH2 and gas-phase H2. We find that,
at temperatures and hydrogen partial pressures of practical interest, MgH2 is
capable of accommodating only very small concentrations of hydrogen vacancies,
which consist mainly of isolated defects rather than vacancy clusters, contrary
to what is expected from a simple energetic analysis.
