  We present a robust reciprocal-space implementation of the
temperature-dependent effective potential method. Our implementation can scale
easily to large cell and long sampling time. It is interoperable with standard
ab-initio molecular dynamics and with Langevin dynamics. We prove that both
sampling methods can be efficient and accurate if a thermostat is used to
control temperature and dynamics parameters are used to optimize the sampling
efficiency. By way of example, we apply it to study anharmonic phonon
renormalization in weakly and strongly anharmonic materials, reproducing the
temperature effect on phonon frequencies, crossing of phase transition, and
stabilization of high-temperature phases.
