Anthony,
Thanks. It is clear that the thermostat is not working as you intend.
If there is something fundamentally wrong with Langevin, than I would expect a) the problem to go away with another method like Bussi and b) the problem to manifest in a much smaller test case with a minimal model. This could also achieve 1 billion steps in fewer hours.
If the problem doesn't occur in a minimal test, then the strategy is to add pieces from the full workflow one at a time until you find the one that causes the problem.
Here is my minimal test case:
```
import hoomd
simulation = hoomd.util.make_example_simulation()
lj = hoomd.md.pair.LJ(nlist=hoomd.md.nlist.Cell(buffer=0.4), default_r_cut=2.5)
lj.params[('A', 'A')] = dict(epsilon=1.0, sigma=1.0)
langevin = hoomd.md.methods.Langevin(filter=hoomd.filter.All(), kT=1.0)
simulation.operations.integrator = hoomd.md.Integrator(dt=0.001, forces=[lj], methods=[langevin])
thermodynamic_quantities = hoomd.md.compute.ThermodynamicQuantities(filter=hoomd.filter.All())
simulation.operations.computes.append(thermodynamic_quantities)
end_step = 1_300_000_000
while simulation.timestep < end_step:
simulation.run(1e6)
print(f'Step: {simulation.timestep}, TPS: {simulation.tps}, kT: {thermodynamic_quantities.kinetic_temperature}')
```
Which continues to thermostat the system correctly at the end of the run:
Step: 1296000000, TPS: 2033094.
7157835243, kT: 0.7605570555589607
Step: 1297000000, TPS: 2032297.268186012, kT: 1.4687843601607615
Step: 1298000000, TPS: 2031157.9631547946, kT: 1.0667267743624402
Step: 1299000000, TPS: 2031141.4608781843, kT: 1.8016305882657861
Step: 1300000000, TPS: 2029385.5020699734, kT: 0.699160693949592
Langevin is a very difficult integrator to break. The drag force applied to the velocities can absorb a massive amount of energy and the magnitude of the random force is set to achieve the canonical velocity distribution via the fluctuation-dissipation theorem. It is still possible to have unstable energy production in Langevin simulations when dt is set too large. You can verify your dt selection by performing constant volume simulations with no thermostat starting from some equilibrium configuration. If the system blows up and sends particles flying out of the box, it is too large.
------