We will review recent developments in the field of ab initio electronic structure theory and its application for studies of complex materials. Basic ideas behind state-of-the-art techniques for first-principles theoretical simulations at finite temperature will be outlined. In particular, we will concentrate on methods that allow for an efficient treatment of chemical and magnetic disorder in studies of phase stabilities and properties of alloys . We will demonstrate the importance of accounting for the finite temperature magnetic excitations in theoretical simulations of structural properties and phase transitions for two systems, Fe-Ni permalloy and CrN. Considering random Ni-rich Fe-Ni alloys, which undergo chemical order-disorder transition approximately 100 K below their Curie temperature, we demonstrate from ab initio calculations that deviations of the global magnetic state from ideal ferromagnetic order due to temperature induced magnetization reduction have a crucial effect on the structural transition temperature . For CrN, a material which undergoes a transition from orthorhombic antiferromagnetic to cubic paramagnetic phase around room temperature, pressure- and temperature-induced structural and magnetic transitions in can be understood when magnetic disorder and strong electron correlations are taken into account simultaneously .
 A. V. Ruban and I. A. Abrikosov, Rep. Prog. Phys. 71, 046501 (2008).
 M. Ekholm, H. Zapolsky, A. V. Ruban, I. Vernyhora, D. Ledue, and I. A. Abrikosov, Phys. Rev. Lett. 105, (2010) 167208.
 B. Alling, T. Marten, and I. A. Abrikosov, Nature Materials 9, (2010) 283; Phys. Rev. B 82, (2010) 184430.