nvt
===

.. py:module:: nvt

.. autoapi-nested-parse::

   Thermostats



Classes
-------

.. autoapisummary::

   nvt.AndersenThermostat
   nvt.BerendsenThermostat
   nvt.LangevinThermostat
   nvt.CSVRThermostat
   nvt.GLEThermostat
   nvt.NHChain
   nvt.NHCThermostat
   nvt.NHCAttributeStateItem


Module Contents
---------------

.. py:class:: AndersenThermostat(*args, **kwargs)

   Bases: :py:obj:`IMLCV.new_yaff.verlet.ThermostatHook`


   Specialized Verlet hook.

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


   .. py:attribute:: name
      :type:  str


   .. py:attribute:: kind
      :type:  str


   .. py:attribute:: method
      :type:  str


   .. py:attribute:: select
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: annealing
      :type:  jax.Array

      This is an implementation of the Andersen thermostat. The method
      is described in:

              Andersen, H. C. J. Chem. Phys. 1980, 72, 2384-2393.

      **Arguments:**

      temp
              The average temperature of the NVT 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.

      select
              An array of atom indexes to indicate which atoms controlled by
              the thermostat.

      annealing
              After every call to this hook, the temperature is multiplied
              with this annealing factor. This effectively cools down the
              system.


   .. py:method:: init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)


   .. py:method:: pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


   .. py:method:: post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


.. py:class:: BerendsenThermostat(*args, **kwargs)

   Bases: :py:obj:`IMLCV.new_yaff.verlet.ThermostatHook`


   Specialized Verlet hook.

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


   .. py:attribute:: name
      :type:  str


   .. py:attribute:: kind
      :type:  str


   .. py:attribute:: method
      :type:  str


   .. py:attribute:: timecon
      :type:  jax.Array

      This is an implementation of the Berendsen thermostat. The algorithm
      is described 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:**

      temp
              The temperature of thermostat.

      **Optional arguments:**

      start
              The step at which the thermostat becomes active.

      timecon
              The time constant of the Berendsen thermostat.


   .. py:method:: init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)


   .. py:method:: pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


   .. py:method:: post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


.. py:class:: LangevinThermostat(*args, **kwargs)

   Bases: :py:obj:`IMLCV.new_yaff.verlet.ThermostatHook`


   Specialized Verlet hook.

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


   .. py:attribute:: name
      :type:  str


   .. py:attribute:: kind
      :type:  str


   .. py:attribute:: method
      :type:  str


   .. py:attribute:: key
      :type:  jax.Array


   .. py:attribute:: timecon
      :type:  jax.Array


   .. py:method:: init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)


   .. py:method:: pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


   .. py:method:: post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


   .. py:method:: thermo(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)


.. py:class:: CSVRThermostat(*args, **kwargs)

   Bases: :py:obj:`IMLCV.new_yaff.verlet.ThermostatHook`


   Specialized Verlet hook.

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


   .. py:attribute:: name
      :type:  str


   .. py:attribute:: kind
      :type:  str


   .. py:attribute:: method
      :type:  str


   .. py:attribute:: timecon
      :type:  jax.Array


   .. py:attribute:: kin
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: key
      :type:  jax.Array

      



      This is an implementation of the CSVR thermostat. The equations are
          derived in:

              Bussi, G.; Donadio, D.; Parrinello, M. J. Chem. Phys. 2007,
              126, 014101

          The implementation (used here) is derived in

              Bussi, G.; Parrinello, M. Comput. Phys. Commun. 2008, 179, 26-29

      **Arguments:**

      temp
              The temperature of thermostat.

      **Optional arguments:**

      start
              The step at which the thermostat becomes active.

      timecon
              The time constant of the CSVR thermostat.


   .. py:method:: init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)


   .. py:method:: pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


   .. py:method:: post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


.. py:class:: GLEThermostat(*args, **kwargs)

   Bases: :py:obj:`IMLCV.new_yaff.verlet.ThermostatHook`


   Specialized Verlet hook.

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


   .. py:attribute:: name
      :type:  str


   .. py:attribute:: kind
      :type:  str


   .. py:attribute:: method
      :type:  str


   .. py:attribute:: timecon
      :type:  jax.Array


   .. py:attribute:: kin
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: a_p
      :type:  jax.Array


   .. py:attribute:: c_p
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: ns
      :type:  int | None
      :value: None



   .. py:attribute:: key
      :type:  jax.Array


   .. py:attribute:: t
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: S
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: n_atoms
      :type:  int | None
      :value: None


      This hook implements the coloured noise thermostat. The equations
      are derived in:

          Ceriotti, M.; Bussi, G.; Parrinello, M J. Chem. Theory Comput.
          2010, 6, 1170-1180.

      **Arguments:**

      temp
          The temperature of thermostat.

      a_p
          Square drift matrix, with elements fitted to the specific problem.


      **Optional arguments:**

      c_p
          Square static covariance matrix. In equilibrium, its elements are fixed.
          For non-equilibrium dynamics, its elements should be fitted.

      start
          The step at which the thermostat becomes active.


   .. py:method:: init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)


   .. py:method:: pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


   .. py:method:: post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


   .. py:method:: thermo(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)


.. py:class:: NHChain(*args, **kwargs)

   Bases: :py:obj:`IMLCV.base.datastructures.MyPyTreeNode`


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


   .. py:attribute:: length
      :type:  int
      :value: 3



   .. py:attribute:: timestep
      :type:  jax.Array


   .. py:attribute:: temp
      :type:  jax.Array


   .. py:attribute:: timecon
      :type:  jax.Array


   .. py:attribute:: restart_pos
      :type:  bool
      :value: False



   .. py:attribute:: restart_vel
      :type:  bool
      :value: False



   .. py:attribute:: pos0
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: vel0
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: pos
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: vel
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: masses
      :type:  jax.Array | None
      :value: None



   .. py:attribute:: ndof
      :type:  int
      :value: 0



   .. py:attribute:: key
      :type:  jax.Array


   .. py:method:: __post_init__()


   .. py:method:: set_ndof(ndof: int) -> NHChain


   .. py:method:: get_random_vel_therm() -> tuple[jax.Array, NHChain]


   .. py:method:: update(ekin, vel, G1_add) -> tuple[jax.Array, jax.Array, NHChain]


   .. py:method:: get_econs_correction()


.. py:class:: NHCThermostat(*args, **kwargs)

   Bases: :py:obj:`IMLCV.new_yaff.verlet.ThermostatHook`


   Specialized Verlet hook.

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


   .. py:attribute:: name
      :type:  str


   .. py:attribute:: kind
      :type:  str


   .. py:attribute:: method
      :type:  str


   .. py:attribute:: chain
      :type:  NHChain

      This hook implements the Nose-Hoover chain thermostat. The equations
      are derived in:

          Martyna, G. J.; Klein, M. L.; Tuckerman, M. J. Chem. Phys. 1992,
          97, 2635-2643.

      The implementation (used here) of a symplectic integrator of the
      Nose-Hoover chain thermostat is discussed in:

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

      **Arguments:**

      temp
          The temperature of thermostat.

      **Optional arguments:**

      start
          The step at which the thermostat becomes active.

      timecon
          The time constant of the Nose-Hoover thermostat.

      chainlength
          The number of beads in the Nose-Hoover chain.

      chain_pos0
          The initial thermostat chain positions

      chain_vel0
          The initial thermostat chain velocities

      restart
          Indicates whether the initalisation should be carried out


   .. py:method:: init(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)


   .. py:method:: pre(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


   .. py:method:: post(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, G1_add=None)


.. py:class:: NHCAttributeStateItem(*args, **kwargs)

   Bases: :py:obj:`IMLCV.new_yaff.iterative.StateItem`


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


   .. py:attribute:: attr
      :type:  str


   .. py:method:: get_value(iterative: IMLCV.new_yaff.verlet.VerletIntegrator)


