jaxdem.integrators.velocity_verlet_rescaling#
Velocity Verlet integrator with periodic velocity-rescaling thermostat.
Classes
|
Velocity Verlet with periodic velocity-rescaling thermostat. |
- class jaxdem.integrators.velocity_verlet_rescaling.VelocityVerletRescaling(k_B: Array, temperature: Array, rescale_every: Array, can_rotate: Array, subtract_drift: Array)#
Bases:
VelocityVerletVelocity Verlet with periodic velocity-rescaling thermostat.
Every
rescale_everysteps, the integrator uniformly rescales the translational (and optionally rotational) velocities so the instantaneous kinetic temperature matchestemperature. Between rescalings the dynamics are purely Newtonian (standard Velocity Verlet, inherited fromVelocityVerlet).The integrator applies the rescaling at the end of
step_after_force, after the second Verlet half-kick. The terminal velocities on rescaling steps are then exactly at the target temperature.The thermostat statistics (kinetic energy sums and drift mean) exclude fixed particles. The rescaling never modifies their prescribed velocities.
- Parameters:
k_B (jax.Array) – Boltzmann constant (set to 1.0 for reduced units).
temperature (jax.Array) – Target temperature \(T\).
rescale_every (jax.Array) – Rescale velocities every this many steps (scalar integer).
can_rotate (jax.Array) – Whether to include rotational DOF in the thermostat (0 or 1). When 1, the thermostat also rescales the angular velocities and counts rotational kinetic energy toward the temperature.
subtract_drift (jax.Array) – Whether to remove center-of-mass drift before rescaling (0 or 1). When 1, the integrator subtracts the center-of-mass velocity on rescaling steps before it measures the temperature. Mainly relevant for small systems.
- k_B: Array#
- temperature: Array#
- rescale_every: Array#
- can_rotate: Array#
- subtract_drift: Array#
- classmethod Create(temperature: float = 1.0, k_B: float = 1.0, rescale_every: int = 1, can_rotate: bool = False, subtract_drift: bool = False) VelocityVerletRescaling[source]#
Create the thermostat from plain Python values.
- Parameters:
temperature (float, default 1.0) – Target temperature.
k_B (float, default 1.0) – Boltzmann constant (1.0 for reduced units).
rescale_every (int, default 1) – Rescale velocities every this many steps.
can_rotate (bool, default False) – Include rotational DOF in the thermostat.
subtract_drift (bool, default False) – Remove center-of-mass drift before rescaling.