sponge.control.BerendsenThermostat
======================================

.. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg
    :target: https://gitee.com/mindspore/mindscience/blob/master/MindSPONGE/docs/api/api_python/control/sponge.control.BerendsenThermostat.rst
    :alt: 查看源文件


.. py:class:: sponge.control.BerendsenThermostat(system: :class:`sponge.system.Molecule`, temperature: float = 300, control_step: int = 1, time_constant: float = 0.5, scale_min: float = 0.8, scale_max: float = 1.25, **kwargs)

    Berendsen(弱耦合)恒温调节器,是`Thermostat <sponge.control.Thermostat>`_的子类。

    参考文献 Berendsen, H. J. C.; Postma, J. P. M.; van Gunsteren, W. F.; DiNola, A.; Haak, J. R..,
    Molecular Dynamics with Coupling to an External Bath.,
    The Journal of Chemical Physics, 1984, 81.

    参数:
        - **system** ( :class:`sponge.system.Molecule`) - 模拟系统。
        - **temperature** (float, 可选) - 温度耦合参考温度 :math:`T_ref` 。单位为开尔文。默认值: ``300.0``。
        - **control_step** (int, 可选) - 控制器执行的步骤间隔。默认值: ``1``。
        - **time_constant** (float, 可选) - 温度耦合的时间常数。默认值: ``0.5``。
        - **scale_min** (float, 可选) - 剪裁速度范围因子的最小值。默认值: ``0.8``。
        - **scale_max** (float, 可选) - 剪裁速度范围因子的最大值。默认值: ``1.25``。
        - **kwargs** (dict) - 关键字参数。

    输入:
        - **coordinate** (Tensor) - 坐标。shape为 :math:`(B, A, D)` 的Tensor。数据类型是float。这里 :math:`B` 是分子模拟中walker的数目, :math:`A` 是原子数目, :math:`D` 是模拟系统的空间维数,通常为3。
        - **velocity** (Tensor) - 速度。shape为 :math:`(B, A, D)` 的Tensor。数据类型是float。
        - **force** (Tensor) - 原子力。shape为 :math:`(B, A, D)` 的Tensor。数据类型是float。
        - **energy** (Tensor) - 能量。shape为 :math:`(B, 1)` 的Tensor。数据类型是float。
        - **kinetics** (Tensor) - 动能。shape为 :math:`(B, D)` 的Tensor。数据类型是float。
        - **virial** (Tensor) - 维里。shape为 :math:`(B, D)` 的Tensor。数据类型是float。
        - **pbc_box** (Tensor) - 周期性边界条件盒子。shape为 :math:`(B, D)` 的Tensor。数据类型是float。
        - **step** (int) - 模拟步数。默认值: ``0``。

    输出:
        - **coordinate** (Tensor) - 坐标。shape为 :math:`(B, A, D)` 的Tensor。数据类型是float。
        - **velocity** (Tensor) - 速度。shape为 :math:`(B, A, D)` 的Tensor。数据类型是float。
        - **force** (Tensor) - 原子力。shape为 :math:`(B, A, D)` 的Tensor。数据类型是float。
        - **energy** (Tensor) - 能量。shape为 :math:`(B, 1)` 的Tensor。数据类型是float。
        - **kinetics** (Tensor) - 动能。shape为 :math:`(B, D)` 的Tensor。数据类型是float。
        - **virial** (Tensor) - 维里。shape为 :math:`(B, D)` 的Tensor。数据类型是float。
        - **pbc_box** (Tensor) - 周期性边界条件盒子。shape为 :math:`(B, D)` 的Tensor。数据类型是float。

    .. py:method:: set_time_step(dt)

        设置模拟单步时间。

        参数:
            - **dt** (float) - 单步所需时间。