Novel quantum-based interatomic potentials applied to magnesium and its alloys