  In material sciences, spectroscopic approaches combining ab initio
calculations with experiments are commonly used to accurately analyze the
experimental spectral data. Most state-of-the-art first-principle calculations
are usually performed assuming an equilibrium static lattice. Yet, nuclear
motion affects spectra even when reduced to the zero-point motion at 0 K. We
propose a framework based on Density-Functional Theory that includes quantum
thermal fluctuations in theoretical X- ray Absorption Near-Edge Structure
(XANES) and solid-state Nuclear Magnetic Resonance (NMR) spectroscopies and
allows to well describe temperature effects observed experimentally. Within the
Born-Oppenheimer and quasi-harmonic approximations, we incorporate the nuclear
motion by generating several non-equilibrium configurations from the dynamical
matrix. The averaged calculated XANES and NMR spectral data have been compared
to experiments in MgO, proof-of-principle compound. The good agreement obtained
between experiments and calculations validates the developed approach, which
suggests that calculating the XANES spectra at finite temperature by averaging
individual non-equilibrium configurations is a suitable approximation. This
study high- lights the relevance of phonon renormalization and the relative
contributions of thermal expansion and nuclear dynamics on NMR and XANES
spectra on a wide range of temperatures.
