'Returns the dot product of this Vector, either with another
Vector, or a Dyadic, or a Del operator.
If \'other\' is a Vector, returns the dot product scalar (Sympy
expression).
If \'other\' is a Dyadic, the dot product is returned as a Vector.
If \'other\' is an instance of Del, returns the directional
derivative operator as a Python function. If this function is
applied to a scalar expression, it returns the directional
derivative of the scalar field wrt this Vector.
Parameters
other: Vector/Dyadic/Del
The Vector or Dyadic we are dotting with, or a Del operator .
Examples
>>> from sympy.vector import CoordSys3D, Del
>>> C = CoordSys3D(\'C\')
>>> delop = Del()
>>> C.i.dot(C.j)
0
>>> C.i & C.i
1
>>> v = 3*C.i + 4*C.j + 5*C.k
>>> v.dot(C.k)
5
>>> (C.i & delop)(C.x*C.y*C.z)
C.y*C.z
>>> d = C.i.outer(C.i)
>>> C.i.dot(d)
C.i'

def dot(self, other):

    from sympy.vector.functions import express
    if isinstance(other, Dyadic):
        if isinstance(self, VectorZero):
            return Vector.zero
        outvec = Vector.zero
        for (k, v) in other.components.items():
            vect_dot = k.args[0].dot(self)
            outvec += ((vect_dot * v) * k.args[1])
        return outvec
    from sympy.vector.deloperator import Del
    if ((not isinstance(other, Vector)) and (not isinstance(other, Del))):
        raise TypeError(((str(other) + '    is    not    a    vector,    dyadic    or    ') + 'del    operator'))
    if isinstance(other, Del):
        def directional_derivative(field):
            from sympy.vector.functions import directional_derivative
            return directional_derivative(field, self)
        return directional_derivative
    if (isinstance(self, VectorZero) or isinstance(other, VectorZero)):
        return S(0)
    v1 = express(self, other._sys)
    v2 = express(other, other._sys)
    dotproduct = S(0)
    for x in other._sys.base_vectors():
        dotproduct += (v1.components.get(x, 0) * v2.components.get(x, 0))
    return dotproduct
