@@ -830,18 +830,22 @@ def dot(a, b, out=None):
830
830
831
831
@array_function_from_c_func_and_dispatcher (_multiarray_umath .vdot )
832
832
def vdot (a , b ):
833
- """
833
+ r """
834
834
vdot(a, b, /)
835
835
836
836
Return the dot product of two vectors.
837
837
838
- The vdot(`a`, `b`) function handles complex numbers differently than
839
- dot(`a`, `b`). If the first argument is complex the complex conjugate
840
- of the first argument is used for the calculation of the dot product.
838
+ The `vdot` function handles complex numbers differently than `dot`:
839
+ if the first argument is complex, it is replaced by its complex conjugate
840
+ in the dot product calculation. `vdot` also handles multidimensional
841
+ arrays differently than `dot`: it does not perform a matrix product, but
842
+ flattens the arguments to 1-D arrays before taking a vector dot product.
841
843
842
- Note that `vdot` handles multidimensional arrays differently than `dot`:
843
- it does *not* perform a matrix product, but flattens input arguments
844
- to 1-D vectors first. Consequently, it should only be used for vectors.
844
+ Consequently, when the arguments are 2-D arrays of the same shape, this
845
+ function effectively returns their
846
+ `Frobenius inner product <https://en.wikipedia.org/wiki/Frobenius_inner_product>`_
847
+ (also known as the *trace inner product* or the *standard inner product*
848
+ on a vector space of matrices).
845
849
846
850
Parameters
847
851
----------
@@ -883,7 +887,7 @@ def vdot(a, b):
883
887
>>> 1*4 + 4*1 + 5*2 + 6*2
884
888
30
885
889
886
- """
890
+ """ # noqa: E501
887
891
return (a , b )
888
892
889
893
0 commit comments