o
    8Va                     @   s@   d dl mZ d dlmZ d dlmZmZmZ G dd deZdS )    )SymPyDeprecationWarning)Basic)gradient
divergencecurlc                       sl   e Zd ZdZd fdd	ZdddZeZeje_ddd	ZeZeje_dd
dZ	e	Z
e	je
_dd Z  ZS )Delz
    Represents the vector differential operator, usually represented in
    mathematical expressions as the 'nabla' symbol.
    Nc                    s2   |d urt ddddd  t | }d|_|S )Nz'delop operator inside coordinate systemzit as instance Del classz1.1iB2  )ZfeatureZ
useinsteadZdeprecated_since_versionZissueZdelop)r   warnsuper__new___name)clssystemobj	__class__ :/usr/lib/python3/dist-packages/sympy/vector/deloperator.pyr
      s   zDel.__new__Fc                 C      t ||dS )a  
        Returns the gradient of the given scalar field, as a
        Vector instance.

        Parameters
        ==========

        scalar_field : SymPy expression
            The scalar field to calculate the gradient of.

        doit : bool
            If True, the result is returned after calling .doit() on
            each component. Else, the returned expression contains
            Derivative instances

        Examples
        ========

        >>> from sympy.vector import CoordSys3D, Del
        >>> C = CoordSys3D('C')
        >>> delop = Del()
        >>> delop.gradient(9)
        0
        >>> delop(C.x*C.y*C.z).doit()
        C.y*C.z*C.i + C.x*C.z*C.j + C.x*C.y*C.k

        doit)r   )selfZscalar_fieldr   r   r   r   r         zDel.gradientc                 C   r   )a  
        Represents the dot product between this operator and a given
        vector - equal to the divergence of the vector field.

        Parameters
        ==========

        vect : Vector
            The vector whose divergence is to be calculated.

        doit : bool
            If True, the result is returned after calling .doit() on
            each component. Else, the returned expression contains
            Derivative instances

        Examples
        ========

        >>> from sympy.vector import CoordSys3D, Del
        >>> delop = Del()
        >>> C = CoordSys3D('C')
        >>> delop.dot(C.x*C.i)
        Derivative(C.x, C.x)
        >>> v = C.x*C.y*C.z * (C.i + C.j + C.k)
        >>> (delop & v).doit()
        C.x*C.y + C.x*C.z + C.y*C.z

        r   )r   r   Zvectr   r   r   r   dot:   r   zDel.dotc                 C   r   )a4  
        Represents the cross product between this operator and a given
        vector - equal to the curl of the vector field.

        Parameters
        ==========

        vect : Vector
            The vector whose curl is to be calculated.

        doit : bool
            If True, the result is returned after calling .doit() on
            each component. Else, the returned expression contains
            Derivative instances

        Examples
        ========

        >>> from sympy.vector import CoordSys3D, Del
        >>> C = CoordSys3D('C')
        >>> delop = Del()
        >>> v = C.x*C.y*C.z * (C.i + C.j + C.k)
        >>> delop.cross(v, doit = True)
        (-C.x*C.y + C.x*C.z)*C.i + (C.x*C.y - C.y*C.z)*C.j +
            (-C.x*C.z + C.y*C.z)*C.k
        >>> (delop ^ C.i).doit()
        0

        r   )r   r   r   r   r   cross\   s   z	Del.crossc                 C   s   | j S N)r   )r   Zprinterr   r   r   	_sympystr   s   zDel._sympystrr   )F)__name__
__module____qualname____doc__r
   r   __call__r   __and__r   __xor__r   __classcell__r   r   r   r   r      s    


!r   N)	Zsympy.utilities.exceptionsr   Z
sympy.corer   Zsympy.vector.operatorsr   r   r   r   r   r   r   r   <module>   s    