npt

Contents

npt#

Barostats

Classes#

TBCombination

Specialized Verlet hook.

McDonaldBarostat

Specialized Verlet hook.

BerendsenBarostat

Specialized Verlet hook.

LangevinBarostat

Specialized Verlet hook.

MTKBarostat

Specialized Verlet hook.

PRBarostat

Specialized Verlet hook.

TadmorBarostat

Specialized Verlet hook.

MTKAttributeStateItem

Base class for dataclasses that should act like a JAX pytree node.

Module Contents#

class npt.TBCombination(*args, **kwargs)#

Bases: IMLCV.new_yaff.verlet.BarostatHook

Specialized Verlet hook.

This is mainly used for the implementation of thermostats and barostats.

name: str#
temp: jax.Array#
press: jax.Array#
thermostat: IMLCV.new_yaff.verlet.ThermostatHook#
barostat: IMLCV.new_yaff.verlet.BarostatHook#
step_thermo: jax.Array#
step_baro: jax.Array#
baro_expects_call: bool#
thermo_expects_call: bool#
chainvel0: jax.Array | None = None#
G1_add: jax.Array | None = None#

VerletHook combining an arbitrary Thermostat and Barostat instance, which ensures these instances are called in the correct succession, and possible coupling between both is handled correctly.

Arguments:

thermostat

A Thermostat instance

barostat

A Barostat instance

init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)#
pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
__call__(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)#
verify()#
class npt.McDonaldBarostat(*args, **kwargs)#

Bases: IMLCV.new_yaff.verlet.BarostatHook

Specialized Verlet hook.

This is mainly used for the implementation of thermostats and barostats.

name: str#
kind: str#
method: str#
amp: jax.Array#
dim: int | None = 3#
key: jax.Array#

this code is not fully tested yet!

Arguments:

temp

The average temperature of the jnp. ensemble

press

The external pressure of the jnp. ensemble

Optional arguments:

start

The first iteration at which this hook is called

step

The number of iterations between two subsequent calls to this hook.

amp

The amplitude of the changes in the logarithm of the volume.

Type:

Warning

init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)#
pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
class npt.BerendsenBarostat(*args, **kwargs)#

Bases: IMLCV.new_yaff.verlet.BarostatHook

Specialized Verlet hook.

This is mainly used for the implementation of thermostats and barostats.

name: str#
kind: str#
method: str#
timecon_press: jax.Array#
beta: jax.Array#
anisotropic: bool#
vol_constraint: bool#
mass_press: jax.Array | None = None#
cell: jax.Array | None = None#

This hook implements the Berendsen barostat. The equations are derived in:

Berendsen, H. J. C.; Postma, J. P. M.; van Gunsteren, W. F.; Dinola, A.; Haak, J. R. J. Chem. Phys. 1984, 81, 3684-3690

Arguments:

ff

A ForceField instance.

temp

The temperature of thermostat.

press

The applied pressure for the barostat.

Optional arguments:

start

The step at which the thermostat becomes active.

timecon

The time constant of the Berendsen barostat.

beta

The isothermal compressibility, conventionally the compressibility of liquid water

anisotropic

Defines whether anisotropic cell fluctuations are allowed.

vol_constraint

Defines whether the volume is allowed to fluctuate.

init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)#
pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
class npt.LangevinBarostat(*args, **kwargs)#

Bases: IMLCV.new_yaff.verlet.BarostatHook

Specialized Verlet hook.

This is mainly used for the implementation of thermostats and barostats.

name: str#
kind: str#
method: str#
key: jax.Array#
timecon: jax.Array#
anisotropic: bool#
vol_constraint: bool#
vel_press: jax.Array#
timestep_press: jax.Array | None = None#
mass_press: jax.Array#

This hook implements the Langevin barostat. The equations are derived in:

Feller, S. E.; Zhang, Y.; Pastor, R. W.; Brooks, B. R. J. Chem. Phys. 1995, 103, 4613-4621

Arguments:

ff

A ForceField instance.

temp

The temperature of thermostat.

press

The applied pressure for the barostat.

Optional arguments:

start

The step at which the barostat becomes active.

timecon

The time constant of the Langevin barostat.

anisotropic

Defines whether anisotropic cell fluctuations are allowed.

vol_constraint

Defines whether the volume is allowed to fluctuate.

init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)#
pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
baro(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0)#
getR()#
class npt.MTKBarostat(*args, **kwargs)#

Bases: IMLCV.new_yaff.verlet.BarostatHook

Specialized Verlet hook.

This is mainly used for the implementation of thermostats and barostats.

name: str#
kind: str#
method: str#
key: jax.Array#
cell: jax.Array | None = None#
timecon: jax.Array#
anisotropic: bool#
vol_constraint: bool#
vel_press: jax.Array#
baro_thermo: IMLCV.new_yaff.nvt.NHCThermostat | None = None#
timecon_press: jax.Array#

This hook implements the Martyna-Tobias-Klein barostat. The equations are derived in:

Martyna, G. J.; Tobias, D. J.; Klein, M. L. J. Chem. Phys. 1994, 101, 4177-4189.

The implementation (used here) of a symplectic integrator of this barostat is discussed in

Martyna, G. J.; Tuckerman, M. E.; Tobias, D. J.; Klein, M. L. Mol. Phys. 1996, 87, 1117-1157.

Arguments:

ff

A ForceField instance.

temp

The temperature of thermostat.

press

The applied pressure for the barostat.

Optional arguments:

start

The step at which the barostat becomes active.

timecon

The time constant of the Martyna-Tobias-Klein barostat.

anisotropic

Defines whether anisotropic cell fluctuations are allowed.

vol_constraint

Defines whether the volume is allowed to fluctuate.

baro_thermo

NHCThermostat instance, coupled directly to the barostat

vel_press0

The initial barostat velocity tensor

restart

If true, the cell is not symmetrized initially

init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)#
pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
baro(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0)#
add_press_cont()#
_compute_ekin_baro()#
class npt.PRBarostat(*args, **kwargs)#

Bases: IMLCV.new_yaff.verlet.BarostatHook

Specialized Verlet hook.

This is mainly used for the implementation of thermostats and barostats.

name: str#
kind: str#
method: str#
timecon_press: jax.Array#
anisotropic: bool#
vol_constraint: bool#
mass_press: jax.Array | None = None#
cell: jax.Array | None = None#
baro_thermo: IMLCV.new_yaff.nvt.NHCThermostat | None = None#
P: jax.Array | None = None#
S_ani: jax.Array | None = None#
cellinv0: jax.Array | None = None#
vol0: jax.Array | None = None#
Sigma: jax.Array | None = None#
vel_press: jax.Array | None = None#

This hook implements the Parrinello-Rahman barostat for finite strains. The equations are derived in:

Parrinello, M.; Rahman, A. J. Appl. Phys. 1981, 52, 7182-7190.

Arguments:

ff

A ForceField instance.

temp

The temperature of thermostat.

press

The applied pressure for the barostat.

Optional arguments:

start

The step at which the barostat becomes active.

timecon

The time constant of the Tadmor-Miller barostat.

anisotropic

Defines whether anisotropic cell fluctuations are allowed.

vol_constraint

Defines whether the volume is allowed to fluctuate.

baro_thermo

NHCThermostat instance, coupled directly to the barostat

vel_press0

The initial barostat velocity tensor

restart

If true, the cell is not symmetrized initially

init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)#
pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
baro(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0)#
add_press_cont()#
_compute_ekin_baro()#
class npt.TadmorBarostat(*args, **kwargs)#

Bases: IMLCV.new_yaff.verlet.BarostatHook

Specialized Verlet hook.

This is mainly used for the implementation of thermostats and barostats.

name: str#
kind: str#
method: str#
timecon_press: jax.Array | float = 41341.37333664682#
anisotropic: bool#
vol_constraint = False#
mass_press: jax.Array | float | None = None#
baro_thermo: IMLCV.new_yaff.nvt.NHCThermostat | None = None#
vel_press: jax.Array | None = None#
cell: jax.Array | None = None#
cellinv0: jax.Array | None = None#
Strans: jax.Array | None = None#
Vol0: jax.Array | None = None#
key: jax.Array#

This hook implements the Tadmor-Miller barostat for finite strains. The equations are derived in:

Tadmor, E. B.; Miller, R. E. Modeling Materials: Continuum, Atomistic and Multiscale Techniques 2011, 520-527.

Arguments:

ff

A ForceField instance.

temp

The temperature of thermostat.

press

The applied second Piola-Kirchhoff tensor for the barostat.

Optional arguments:

start

The step at which the barostat becomes active.

timecon

The time constant of the Tadmor-Miller barostat.

anisotropic

Defines whether anisotropic cell fluctuations are allowed.

vol_constraint

Defines whether the volume is allowed to fluctuate.

baro_thermo

NHCThermostat instance, coupled directly to the barostat

vel_press0

The initial barostat velocity tensor

restart

If true, the cell is not symmetrized initially

init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)#
pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0=None)#
baro(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0)#
add_press_cont()#
_compute_ekin_baro()#
_compute_angular_tensor(pos, vel, masses)#
class npt.MTKAttributeStateItem(*args, **kwargs)#

Bases: IMLCV.new_yaff.iterative.StateItem

Base class for dataclasses that should act like a JAX pytree node.

key: str = 'MTKattr'#
attr: str#
get_value(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)#