import operator


def dot(u, v):
    """
    Return the dot product of two equal-dimensional vectors.
    """

    uDim = len(u)
    vDim = len(v)

    # http://reference.wolfram.com/language/ref/Dot.html
    if uDim == vDim:
        u_dot_v = sum(map(operator.mul, u, v))
    else:
        raise IndexError('Vector has invalid dimensions')
    return u_dot_v