  We present a comparative ab initio study of Li, Na, and Mg storage in tin,
including phononic effects and phase competition between alpha and beta Sn. Mg
doping at low concentration is found to stabilize the beta phase. On the
contrary, Li and Na doping is shown to reverse the stability of the phases at
room temperature: Li/Na-doped alpha-Sn is more stable than Li/Na-doped beta-Sn
up to a temperature of around 380/400 K. This may rationalize the formation of
alpha-Sn upon lithiation and delithiation of beta-Sn anodes reported in
experimental studies. The changes in phase stability with Li/Na/Mg doping are
directly related to the intercalation energies of Li/Na/Mg in one phase versus
the other: at 300 K, Li/Na is easier intercalated in alpha-Sn (-0.37/-0.08 eV)
than in beta-Sn (0.06/0.49 eV), while Mg intercalation energy is, although
positive (i.e. unfavored intercalation), lower in beta-Sn (0.53 eV) than in
alpha-Sn (0.66 eV). The temperature effect is found to affect significantly the
intercalation energy, by up to 0.13 eV at 300 K. Analysis of diffusion barriers
shows that Li, Na, and Mg diffusion in beta-Sn is anisotropic with migration
barriers along the (001) direction (respectively 0.01, 0.22, and 0.07 eV)
significantly lower than those in alpha-Sn (respectively 0.20, 0.52, and 0.40
eV).
