# Simulation of Nuclear Quantum Effects in Condensed Matter Systems via Quantum Baths
## 3 Enforcing Quantum Statistics via Generalized Bath
### The Quantum Thermostat
In more general non-linear cases, a numerical algorithm based on the symmetric Trotter decomposition of the Liouvillian can be used, where the linear drift and the random force terms in \((\dot{p},\dot{\mathbf{s}})\) are integrated exactly according to the theory of Ornstein-Uhlenbeck processes, whereas the evolution of \(x\) and the non-linear part of \(\dot{p}\) are integrated via a velocity Verlet scheme [34]. As described in detail in appendix in [34], by integrating away the auxiliary momenta \(\mathbf{s}\), Equation (16) reduces to a GLE in the form of (6) for the physical degree of freedom \(x\), with a memory kernel:  
\[K(\tau)=2a_{pp}\delta(\tau)-\mathbf{a_{p}}^{T}e^{-|\tau|\mathbf{A}}\mathbf{ \bar{a}_{p}}\]  
In Appendix B, we illustrate the method by examining two simple cases for \(N=1\) and \(N=2\), which correspond to an exponentially decaying memory kernel and to a damped oscillatory kernel, respectively, and we explicitly write the associated \(\mathbf{A}\) and \(\mathbf{B}\) matrices. Generally, the kernels that can build via the extended variable formalism include (although not exclusively) functions of the form \(K(\tau)=\mathrm{Re}\Big{[}c_{k}e^{-\alpha_{k}|\tau|+i\omega_{k}t}\Big{]}\) with arbitrary parameters \(c_{k}\), \(\alpha_{k}\) and \(\omega_{k}\). Appendix A of ref. [34] provides a detailed mathematical formalism. The classical FDT (8) is enforced when  
\[\mathbf{B}_{p}\mathbf{B}_{p}^{T}=mk_{B}T(\mathbf{A}_{p}+\mathbf{A}_{p}^{T}), \tag{17}\]  
where \(\mathbf{B}_{p}\) is the \((N+1)\times(N+1)\) matrix that comprises \(b_{pp}\), \(\mathbf{b}_{p}\), \(\mathbf{\bar{b}}_{p}\) and \(\mathbf{B}\) (and similarly for \(\mathbf{A}_{p}\)). However, the noise matrix \(\mathbf{B}_{p}\) can also be chosen not to fulfill the classical FDT, so that the GLE can be arbitrarily tuned in order to thermalize the different frequencies of the system with well-chosen effective temperatures. While in [13], the focus was on the thermalization of _classical_ degrees of freedom at different temperatures, in the following paper [14] the same authors applied the colored baths strategy in order to include quantum corrections to the classical dynamics of ions in systems that are weakly anharmonic, such as diamond and ordinary ice \(lh\). In order to design this quantum thermostat (QT), they considered the particular case of the harmonic oscillator \(V(x)=\frac{1}{2}m\omega^{2}x^{2}\) for which the stochastic equations of motion (16) can be solvedanalytically and the exact kinetic and potential energies of the physical system explicitly computed. The parameters of the GLE are then tuned in order for the average position and momentum distributions to be as close as possible to that of a quantum harmonic oscillator that is Gaussian, as in the classical case, but with a width that is a function of the oscillation period \(\omega\):  
\[\frac{1}{m}\langle p^{2}\rangle=m\omega^{2}\ \langle x^{2}\rangle\ =\ \frac{\hbar \omega}{2}\ \coth\biggl{(}\frac{\hbar\omega}{2k_{B}T}\biggr{)}=\theta(\omega,T) \tag{18}\]  
By properly adjusting \(K(\tau)\) and the noise correlation function, one can tune the average fluctuations in position and in momentum so as to reproduce the quantum-mechanical behavior in Equation (18) over a wide range of vibrational frequencies. In practice, this is done via a fitting procedure of the \(\mathbf{A_{p}}\) and \(\mathbf{B_{p}}\) matrices that have been introduced in Equation (16). This method is general and versatile and offers a wide choice for the friction and random force kernels; nonetheless, it requires a fine tuning of the characteristic matrices, which might depend on the system under consideration. The QT method has been made available in the open-source i-PI suite [35], which has enabled its wider use [36; 37; 38].