Langevin

class hoomd.md.methods.Langevin(filter, kT, tally_reservoir_energy=False, default_gamma=1.0, default_gamma_r=(1.0, 1.0, 1.0))

Bases: Method

Langevin dynamics.

Parameters:
  • filter (hoomd.filter.filter_like) – Subset of particles to apply this method to.

  • kT (hoomd.variant.variant_like) – Temperature of the simulation [energy][\mathrm{energy}].

  • tally_reservoir_energy (bool) – When True, track the energy exchange between the thermal reservoir and the particles. Defaults to False [energy][\mathrm{energy}].

  • default_gamma (float) – Default drag coefficient for all particle types [masstime1][\mathrm{mass} \cdot \mathrm{time}^{-1}].

  • default_gamma_r ([float, float, float]) – Default rotational drag coefficient tensor for all particles [masslength2time1][\mathrm{mass} \cdot \mathrm{length}^{2} \cdot \mathrm{time}^{-1}].

Langevin integrates particles forward in time according to the Langevin equations of motion, modelling a canonical ensemble (NVT).

The translational degrees of freedom follow:

mdvdt=FCγv+FRFR=0FR2=2dkTγ/δt\begin{split} m \frac{d\vec{v}}{dt} &= \vec{F}_\mathrm{C} - \gamma \cdot \vec{v} + \vec{F}_\mathrm{R} \\ \langle \vec{F}_\mathrm{R} \rangle &= 0 \\ \langle |\vec{F}_\mathrm{R}|^2 \rangle &= 2 d kT \gamma / \delta t \end{split}

where FC\vec{F}_\mathrm{C} is the force on the particle from all potentials and constraint forces, γ\gamma is the drag coefficient, v\vec{v} is the particle’s velocity, FR\vec{F}_\mathrm{R} is a uniform random force, and dd is the dimensionality of the system (2 or 3). The magnitude of the random force is chosen via the fluctuation-dissipation theorem to be consistent with the specified drag and temperature, kTkT.

About axes where Ii>0I^i > 0, the rotational degrees of freedom follow:

Idωdt=τCγrω+τRτR=0,τRiτRi=2kTγri/δt,\begin{split} I \frac{d\vec{\omega}}{dt} &= \vec{\tau}_\mathrm{C} - \gamma_r \cdot \vec{\omega} + \vec{\tau}_\mathrm{R} \\ \langle \vec{\tau}_\mathrm{R} \rangle &= 0, \\ \langle \tau_\mathrm{R}^i \cdot \tau_\mathrm{R}^i \rangle &= 2 k T \gamma_r^i / \delta t, \end{split}

where τC=τnet\vec{\tau}_\mathrm{C} = \vec{\tau}_\mathrm{net}, γri\gamma_r^i is the i-th component of the rotational drag coefficient (gamma_r), τRi\tau_\mathrm{R}^i is a component of the uniform random torque, ω\vec{\omega} is the particle’s angular velocity and II is the the particle’s moment of inertia. The magnitude of the random torque is chosen via the fluctuation-dissipation theorem to be consistent with the specified drag and temperature, kTkT.

Langevin numerically integrates the translational degrees of freedom using Velocity-Verlet and the rotational degrees of freedom with a scheme based on Kamberaj 2005.

The attributes gamma and gamma_r set the translational and rotational damping coefficients, respectively, by particle type.

Example:

langevin = hoomd.md.methods.Langevin(filter=hoomd.filter.All(), kT=1.5)
simulation.operations.integrator.methods = [langevin]

Members inherited from AutotunedObject:

property kernel_parameters

Kernel parameters. Read more...

property is_tuning_complete

Check if kernel parameter tuning is complete. Read more...

tune_kernel_parameters()

Start tuning kernel parameters. Read more...


Members defined in Langevin:

filter

Subset of particles to apply this method to.

Type:

hoomd.filter.filter_like

kT

Temperature of the simulation [energy][\mathrm{energy}].

Examples:

langevin.kT = 1.0
langevin.kT = hoomd.variant.Ramp(
    A=2.0, B=1.0, t_start=0, t_ramp=1_000_000
)
Type:

hoomd.variant.Variant

tally_reservoir_energy

When True, track the energy exchange between the thermal reservoir and the particles.

Example:

langevin.tally_reservoir_energy = True
Type:

bool

gamma

The drag coefficient for each particle type [masstime1][\mathrm{mass} \cdot \mathrm{time}^{-1}].

Example:

langevin.gamma["A"] = 0.5
Type:

TypeParameter[ particle type, float ]

gamma_r

The rotational drag coefficient tensor for each particle type [masslength2time1][\mathrm{mass} \cdot \mathrm{length}^{2} \cdot \mathrm{time}^{-1}].

Example:

langevin.gamma_r["A"] = [1.0, 2.0, 3.0]
Type:

TypeParameter[particle type,[float, float , float]]

property reservoir_energy

Energy absorbed by the reservoir [energy][\mathrm{energy}].

Set tally_reservoir_energy to True to track the reservoir energy.

Example:

langevin.tally_reservoir_energy = True
logger.add(obj=langevin, quantities=["reservoir_energy"])

Warning

When continuing a simulation, the energy of the reservoir will be reset to zero.

(Loggable: category=”scalar”)