.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEShape


.. _OEShape_OEHermite:

.. oe:class:: OEHermite

   .. oe:api::

      class OEHermite

   This class performs Hermite expansion for a given molecule or a grid
   representation of a molecule, then returns the coefficients of expansion
   and creates a grid representation of Hermite shape.

   .. seealso::

      * :ref:`shapetk_hermite_section` section
      * :ref:`chapter_hermite_shape_examples` examples

   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEHermite(const OEHermite &)
            OEHermite(const OEHermiteOptions& hermOpts = OEHermiteOptions())

      .. oe:language:: python

         .. oe:api:: python

            OEHermite(hermOpts: OEHermiteOptions = OEHermiteOptions()) -> OEHermite
            OEHermite(arg2: OEHermite) -> OEHermite

      This class has three constructors. The first two are default and copy constructors. The third one is a constructor that takes an option class :ref:`OEHermiteOptions <OEShape_OEHermiteOptions>`.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEHermite &operator=(const OEHermite &)

      The assignment operator acts in the context of the equation A = B, where A and B are two object instances of the class :ref:`OEHermite <OEShape_OEHermite>`;
      as such, it copies the contents of object B into object A.


   .. _OEShape_OEHermite_CreateGrid:

      Assignment operator.


   .. oe:method:: CreateGrid

      .. oe:language:: c++ java csharp

         .. oe:api::

            void CreateGrid(OESystem::OEScalarGrid&, const float spacing)
            void CreateGrid(OESystem::OEScalarGrid&, const float spacing,
                            const OEChem::OETrans)

      .. oe:language:: python

         .. oe:api:: python

            CreateGrid(grid: OEScalarGrid, spacing: float) -> None
            CreateGrid(grid: OEScalarGrid, spacing: float, trans: OETrans) -> None

      This method creates a grid representation of the obtained Hermite
      expansion. Depending on the grid ``spacing`` parameter, the number
      of grid points to cover the entire molecule will be calculated. If
      this number exceeds 500 points per space dimension, the user will be
      warned that the maximum allowed value of 500 will be used instead.
      The second overload uses the transform that is applied to transform
      the generated grid.


   .. _OEShape_OEHermite_GetCoefficients:

   .. oe:method:: GetCoefficients

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool GetCoefficients(std::vector <double>& coeffs) const
            const std::vector<double>& GetCoefficients() const

      .. oe:language:: python

         .. oe:api:: python

            GetCoefficients(coeffs: OEDoubleVector) -> bool
            GetCoefficients() -> OEDoubleVector

      Returns the values of Hermite expansion coefficients in the form of an
      STL vector. These are precisely the coefficients :math:`f_{\ell mn}`
      introduced in the :ref:`shapetk_hermite_section`, in the
      following order: :math:`\,N = 0\dots \text{NPolyMax},\, \ell = 0\dots \text{N}, \,m = 0\dots \text{N}-\ell, \,n = \text{N}-\ell-m`.


   .. _OEShape_OEHermite_GetOptions:

   .. oe:method:: GetOptions

      .. oe:language:: c++ java csharp

         .. oe:api::

            const OEHermiteOptions& GetOptions() const

      .. oe:language:: python

         .. oe:api:: python

            GetOptions() -> OEHermiteOptions

      Returns the option class :ref:`OEHermiteOptions <OEShape_OEHermiteOptions>` that the :ref:`OEHermite <OEShape_OEHermite>` class is currently using.


   .. _OEShape_OEHermite_GetSolventOverlap:

   .. oe:method:: GetSelfOverlap

      .. oe:language:: c++ java csharp

         .. oe:api::

            double GetSelfOverlap() const

      .. oe:language:: python

         .. oe:api:: python

            GetSelfOverlap() -> float

      Returns the self-overlap of the molecule corresponding to Hermite
      expansion.


   .. _OEShape_OEHermite_NumCoefficients:
   
   .. oe:method:: NumCoefficients

      .. oe:language:: c++ java csharp

         .. oe:api::

            unsigned int NumCoefficients() const

      .. oe:language:: python

         .. oe:api:: python

            NumCoefficients() -> int

      Returns the size of the Hermite expansion representation. This number is given by :math:`\,(\text{NPolyMax}+1)(\text{NPolyMax}+2)(\text{NPolyMax}+3)/6`, which is the number of possible sets :math:`(\ell, m, n)` such that :math:`\ell + m + n \leq NPolyMax`.


   .. _OEShape_OEHermite_Setup:

   .. oe:method:: Setup

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool Setup(const OEShapeQuery& argQuery)
            bool Setup(const OEChem::OEMolBase& mol)
            bool Setup(const OESystem::OEScalarGrid& grid)

      .. oe:language:: python

         .. oe:api:: python

            Setup(argQuery: OEShapeQuery) -> bool
            Setup(mol: Union[OEGraphMol,OEMol,OEQMol]) -> bool
            Setup(grid: OEScalarGrid) -> bool

      This overloaded method allows a user to input into the :ref:`OEHermite <OEShape_OEHermite>`
      class a molecule as a shape query object or a molecule object, or by using a grid representation.
      The method returns `True` if the setup was successful and `False` otherwise.
