This equation implies that in principle, in order to obtain the IR absorption spectra, one needs to generate enough sampling from the canonical ensemble. This is usually achieved by running an NVT trajectory at a given temperature, and then performing NVE simulations starting from each sampled configuration. The final absorption spectra can be obtained by taking the average of the Fourier transformed dipole derivative autocorrelation function, with a prefactor that is essentially frequency independent if the refractive index n(ω) does not significantly vary with frequency. This equation is the theoretical foundation for the calculations of vibrational spectra with the NVT-NVE scheme. The NVT-NVE scheme may sound easy to perform, but to achieve enough sampling from the canonical ensemble, the number of configurations needed as well as subsequent NVE trajectories is very large even in model systems. In order to reduce the computational cost, Kirchner and coworkers introduced the direct NVT scheme for spectrum calculations. Instead of an NVT simulation followed by many NVE simulations, the direct NVT scheme only uses one equilibrated NVT trajectory to calculate the ensemble averaged dipole derivative autocorrelation function. In principle, this scheme is not theoretically rigorous because the thermostat will affect the evolution of the system and thus bring artifacts into the spectrum. However, in practical simulations and especially those in the condensed phase, if a weak thermostat is used, the artifacts are negligible.