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 translational (and optionally rotational) velocities are uniformly rescaled so that the instantaneous kinetic temperature matchestemperature. Between rescalings the dynamics are purely Newtonian (standard Velocity Verlet, inherited fromVelocityVerlet).The rescaling is applied at the end of
step_after_force, after the second Verlet half-kick, so that the terminal velocities on rescaling steps are exactly at the target temperature.Fixed particles are excluded from the thermostat statistics (kinetic energy sums and drift mean) and their prescribed velocities are never modified.
- 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, angular velocities are rescaled together with linear velocities and rotational KE counts toward the temperature.
subtract_drift (jax.Array) – Whether to remove centre-of-mass drift before rescaling (0 or 1). When 1, the COM velocity is subtracted on rescaling steps before measuring 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 centre-of-mass drift before rescaling.