Thermodynamic and mechanical properties of lanthanum–magnesium phases from density functional theory