Trajectory-based simulations are performed in the cavityadiabatic basis, which we define as the representation where Eq. ( ) is diagonal. The model Hamiltonians of Eqs. ( ) and ( ) have been implemented in the QuantumModelLib library . The G-CTMQC code used for all the trajectorybased simulations is interfaced with QuantumModelLib, providing energies, gradients and couplings on-th-fly upon diagonalization of the diabatic Hamiltonian. In G-CTMQC the trajectory-based simulations are performed by solving the photon-nuclear equations with the velocity-Verlet algorithm and the electronic equations with the Runge-Kutta-Gill algorithm. The time step is dt = 0.1 a.t.u., for both photon-nuclear and electronic dynamics. An ensemble of 10000 trajectories were considered for all the calculations presented. The initial positions and momenta are sampled from the (harmonic) quantum distribution determined as the Wigner transform of the initial photon-nuclear probability density used in QD calculations.