jaxdem.integrators.velocity_verlet_rescaling#

Velocity Verlet integrator with periodic velocity-rescaling thermostat.

Classes

VelocityVerletRescaling(k_B, temperature, ...)

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: VelocityVerlet

Velocity Verlet with periodic velocity-rescaling thermostat.

Every rescale_every steps, the translational (and optionally rotational) velocities are uniformly rescaled so that the instantaneous kinetic temperature matches temperature. Between rescalings the dynamics are purely Newtonian (standard Velocity Verlet, inherited from VelocityVerlet).

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.

static step_after_force(state: State, system: System) tuple[State, System][source]#