deepmd.tf.infer.deep_pot
========================

.. py:module:: deepmd.tf.infer.deep_pot


Classes
-------

.. autoapisummary::

   deepmd.tf.infer.deep_pot.DeepPot


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

.. py:class:: DeepPot(model_file: str, *args: Any, auto_batch_size: Union[bool, int, deepmd.utils.batch_size.AutoBatchSize] = True, neighbor_list: Optional[ase.neighborlist.NewPrimitiveNeighborList] = None, **kwargs: Any)

   Bases: :py:obj:`deepmd.infer.deep_eval.DeepEval`


   
   Potential energy model.


   :Parameters:

       **model_file** : :obj:`Path`
           The name of the frozen model file.

       **\*args** : :class:`python:list`
           Positional arguments.

       **auto_batch_size** : :ref:`bool <python:bltin-boolean-values>` or :class:`python:int` or :obj:`AutoBatchSize`, default: :data:`python:True`
           If True, automatic batch size will be used. If int, it will be used
           as the initial batch size.

       **neighbor_list** : :obj:`ase.neighborlist.NewPrimitiveNeighborList`, :obj:`optional`
           The ASE neighbor list class to produce the neighbor list. If None, the
           neighbor list will be built natively in the model.

       **\*\*kwargs** : :class:`python:dict`
           Keyword arguments.













   .. rubric:: Examples

   >>> from deepmd.infer import DeepPot
   >>> import numpy as np
   >>> dp = DeepPot("graph.pb")
   >>> coord = np.array([[1, 0, 0], [0, 0, 1.5], [1, 0, 3]]).reshape([1, -1])
   >>> cell = np.diag(10 * np.ones(3)).reshape([1, -1])
   >>> atype = [1, 0, 1]
   >>> e, f, v = dp.eval(coord, cell, atype)

   where `e`, `f` and `v` are predicted energy, force and virial of the system, respectively.

   ..
       !! processed by numpydoc !!

   .. py:property:: output_def
      :type: deepmd.dpmodel.output_def.ModelOutputDef


      
      Get the output definition of this model.
















      ..
          !! processed by numpydoc !!


   .. py:property:: output_def_mag
      :type: deepmd.dpmodel.output_def.ModelOutputDef


      
      Get the output definition of this model with magnetic parts.
















      ..
          !! processed by numpydoc !!


   .. py:method:: eval(coords: numpy.ndarray, cells: Optional[numpy.ndarray], atom_types: Union[list[int], numpy.ndarray], atomic: Literal[True], fparam: Optional[numpy.ndarray], aparam: Optional[numpy.ndarray], mixed_type: bool, **kwargs: Any) -> tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]
                  eval(coords: numpy.ndarray, cells: Optional[numpy.ndarray], atom_types: Union[list[int], numpy.ndarray], atomic: Literal[False], fparam: Optional[numpy.ndarray], aparam: Optional[numpy.ndarray], mixed_type: bool, **kwargs: Any) -> tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
                  eval(coords: numpy.ndarray, cells: Optional[numpy.ndarray], atom_types: Union[list[int], numpy.ndarray], atomic: bool, fparam: Optional[numpy.ndarray], aparam: Optional[numpy.ndarray], mixed_type: bool, **kwargs: Any) -> tuple[numpy.ndarray, Ellipsis]

      
      Evaluate energy, force, and virial. If atomic is True,
      also return atomic energy and atomic virial.


      :Parameters:

          **coords** : :obj:`np.ndarray <numpy.ndarray>`
              The coordinates of the atoms, in shape (nframes, natoms, 3).

          **cells** : :obj:`np.ndarray <numpy.ndarray>`
              The cell vectors of the system, in shape (nframes, 9). If the system
              is not periodic, set it to None.

          **atom_types** : :class:`python:list`\[:class:`python:int`] :obj:`or` :obj:`np.ndarray <numpy.ndarray>`
              The types of the atoms. If mixed_type is False, the shape is (natoms,);
              otherwise, the shape is (nframes, natoms).

          **atomic** : :ref:`bool <python:bltin-boolean-values>`, :obj:`optional`
              Whether to return atomic energy and atomic virial, by default False.

          **fparam** : :obj:`np.ndarray <numpy.ndarray>`, :obj:`optional`
              The frame parameters, by default None.

          **aparam** : :obj:`np.ndarray <numpy.ndarray>`, :obj:`optional`
              The atomic parameters, by default None.

          **mixed_type** : :ref:`bool <python:bltin-boolean-values>`, :obj:`optional`
              Whether the atom_types is mixed type, by default False.

          **\*\*kwargs** : :class:`python:dict`\[:class:`python:str`, :obj:`Any <typing.Any>`]
              Keyword arguments.



      :Returns:

          :obj:`energy`
              The energy of the system, in shape (nframes,).

          :obj:`force`
              The force of the system, in shape (nframes, natoms, 3).

          :obj:`virial`
              The virial of the system, in shape (nframes, 9).

          :obj:`atomic_energy`
              The atomic energy of the system, in shape (nframes, natoms). Only returned
              when atomic is True.

          :obj:`atomic_virial`
              The atomic virial of the system, in shape (nframes, natoms, 9). Only returned
              when atomic is True.











      ..
          !! processed by numpydoc !!


