  The calculation of free energies from first principles in materials is a
formidable task which enables the prediction of phase stability with high
accuracy; these calculations are complicated in magnetic materials by the
interplay of electronic, magnetic, and vibrational degrees of freedom. In this
work, we show the feasibility and accuracy of the calculation of phase
stability in magnetic systems with ab initio methods and thermodynamic
integration by sampling the magnetic and vibrational phase space with coupled
atomistic spin dynamics-ab initio molecular dynamics (ASD-AIMD) simulations
[Stockem et al., PRL 121, 125902 (2018)], where energies and interatomic forces
are calculated with density functional theory (DFT). We employ the method to
calculate the phase stability of Fe at ambient pressure from 800 K up to 1800
K. The Gibbs free energy difference between fcc and bcc Fe at zero pressure as
a function of temperature is calculated carrying out thermodynamic integration
over temperature on the energies at the DFT level from ASD-AIMD, using a
reference free energy difference calculated in the paramagnetic state at
temperatures much higher than the magnetic transition temperatures with
thermodynamic integration over stress-strain variables with disordered local
moment (DLM)-AIMD simulations. We show the importance of the magnetic ordering
temperature of bcc Fe on the $\alpha$ to $\gamma$ structural transition
temperature, whereas the $\gamma$ to $\delta$ transition is well reproduced
independently of the exchange interactions. The Gibbs free energy difference
between the two structures is within 5 meV/atom from the CALPHAD estimate, and
both transition temperatures are reproduced within 150 K. The present work
paves the way to free energy calculations in magnetic materials from first
principles with accuracy in the order of 1 meV/atom.
