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 in
step_after_force, after both terminal kicks. System runs the rotational hook before the linear hook. With nonzero kinetic energy, terminal velocities on rescaling steps reach the target temperature. Multiplicative rescaling leaves a zero-kinetic-energy state at zero.The thermostat statistics exclude fixed particles. Center-of-mass drift uses each rigid body’s total mass exactly once, independent of its member count. Rescaling never modifies prescribed velocities of fixed particles.
- 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.