[Numpy-discussion] Some questions about dot()
Alan G Isaac
aisaac at american.edu
Mon May 1 05:26:01 EDT 2006
On Mon, 1 May 2006, Bill Baxter apparently wrote:
> Seems like it would make more sense to have dot() follow
> the mathematical convention of a.T * b, and have
> a separate function, like mult() or matrixmult(), do what
> dot() does currently. Is there historical baggage of some
> kind here preventing that? Or some maybe there's
> a different definition of dot product from another branch
> of mathematics that I'm not familiar with?
Historically, 'dot' was essentially an alias for
'multiarray.matrixproduct' in Numeric. This is a long
standing use that I would not expect to change. (But I am
just a user.)
I believe you have found a documentation bug, as
matrixproduct either no longer exists or is well hidden.
On the more general point ...
Can you point to a definition that matches your proposed
use? The most common definition I know for 'dot' is between
vectors, which do not "transpose". In numpy this is 'vdot',
which returns a scalar product.
The production of a dot product between two column vectors
in a linear algebra context by transposing and then matrix
multiplying is, I believe, a convenience rather than
a definition of any sort. If we care about the details,
the result is also not a scalar.
Cheers,
Alan Isaac
More information about the NumPy-Discussion
mailing list