npt
===

.. py:module:: npt

.. autoapi-nested-parse::

   Barostats



Classes
-------

.. autoapisummary::

   npt.TBCombination
   npt.McDonaldBarostat
   npt.BerendsenBarostat
   npt.LangevinBarostat
   npt.MTKBarostat
   npt.PRBarostat
   npt.TadmorBarostat
   npt.MTKAttributeStateItem


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

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

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


   Specialized Verlet hook.

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


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


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


   .. py:attribute:: press
      :type:  jax.Array


   .. py:attribute:: thermostat
      :type:  IMLCV.new_yaff.verlet.ThermostatHook


   .. py:attribute:: barostat
      :type:  IMLCV.new_yaff.verlet.BarostatHook


   .. py:attribute:: step_thermo
      :type:  jax.Array


   .. py:attribute:: step_baro
      :type:  jax.Array


   .. py:attribute:: baro_expects_call
      :type:  bool


   .. py:attribute:: thermo_expects_call
      :type:  bool


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



   .. py:attribute:: G1_add
      :type:  jax.Array | None
      :value: 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


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


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


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


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


   .. py:method:: verify()


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

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


   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:: amp
      :type:  jax.Array


   .. py:attribute:: dim
      :type:  int | None
      :value: 3



   .. py:attribute:: key
      :type:  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


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


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


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


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

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


   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_press
      :type:  jax.Array


   .. py:attribute:: beta
      :type:  jax.Array


   .. py:attribute:: anisotropic
      :type:  bool


   .. py:attribute:: vol_constraint
      :type:  bool


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



   .. py:attribute:: cell
      :type:  jax.Array | None
      :value: 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.


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


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


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


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

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


   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:attribute:: anisotropic
      :type:  bool


   .. py:attribute:: vol_constraint
      :type:  bool


   .. py:attribute:: vel_press
      :type:  jax.Array


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



   .. py:attribute:: mass_press
      :type:  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.


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


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


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


   .. py:method:: baro(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0)


   .. py:method:: getR()


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

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


   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:: cell
      :type:  jax.Array | None
      :value: None



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


   .. py:attribute:: anisotropic
      :type:  bool


   .. py:attribute:: vol_constraint
      :type:  bool


   .. py:attribute:: vel_press
      :type:  jax.Array


   .. py:attribute:: baro_thermo
      :type:  IMLCV.new_yaff.nvt.NHCThermostat | None
      :value: None



   .. py:attribute:: timecon_press
      :type:  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


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


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


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


   .. py:method:: baro(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0)


   .. py:method:: add_press_cont()


   .. py:method:: _compute_ekin_baro()


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

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


   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_press
      :type:  jax.Array


   .. py:attribute:: anisotropic
      :type:  bool


   .. py:attribute:: vol_constraint
      :type:  bool


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



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



   .. py:attribute:: baro_thermo
      :type:  IMLCV.new_yaff.nvt.NHCThermostat | None
      :value: None



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



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



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



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



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



   .. py:attribute:: vel_press
      :type:  jax.Array | None
      :value: 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


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


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


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


   .. py:method:: baro(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0)


   .. py:method:: add_press_cont()


   .. py:method:: _compute_ekin_baro()


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

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


   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_press
      :type:  jax.Array | float
      :value: 41341.37333664682



   .. py:attribute:: anisotropic
      :type:  bool


   .. py:attribute:: vol_constraint
      :value: False



   .. py:attribute:: mass_press
      :type:  jax.Array | float | None
      :value: None



   .. py:attribute:: baro_thermo
      :type:  IMLCV.new_yaff.nvt.NHCThermostat | None
      :value: None



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



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



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



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



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



   .. py:attribute:: key
      :type:  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


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


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


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


   .. py:method:: baro(iterative: IMLCV.new_yaff.verlet.VerletIntegrator, chainvel0)


   .. py:method:: add_press_cont()


   .. py:method:: _compute_ekin_baro()


   .. py:method:: _compute_angular_tensor(pos, vel, masses)


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

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


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


   .. py:attribute:: key
      :type:  str
      :value: 'MTKattr'



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


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


