[SciPy-user] complex vector scalar product: wrong implementation
Robert Kern
rkern at ucsd.edu
Wed Jan 12 19:49:18 EST 2005
Lance Boyle wrote:
>
> On Jan 11, 2005, at 2:56 AM, Robert Kern wrote:
>
>> Not everyone using Numeric with dot() and complex numbers is doing
>> linear algebra.
>
>
> Anyone invoking dot() expects a dot product, PERIOD. Unless they have
> adapted to the idiosyncrasy of Python Numeric in order to get their work
> done.
>
> I'm very casual reader of this list so I might have missed something.
> However, the original poster demonstrates a design flaw and it should be
> fixed. There is no math text in existence that promotes a dot product
> that is not an inner product. Sure, names are arbitrary, but bad names
> are bad design. In "sarcasm" mode, I might say, why not name the sine
> function cos() and the cosine function sin().
You won't get any argument from me that the name is bad (well, actually,
the error is duplicated: both "dot" and "innerproduct" are bad names).
If I had been around during Numeric's formative years, I would have
argued strongly for having dot/innerproduct do the conjugation. I would
also have argued that they should implement a proper tensor inner
product for N-D arrays N>2 (dot(A,B) contracting on the last axis of A
and the first axis of B rather than the current implementation).
I don't agree that we should change either of these behaviours at this
time. The amount of code that depends on these well-documented
behaviours is too great.
I have no problem with putting functions into scipy.linalg that do the
right things for linear algebra.
--
Robert Kern
rkern at ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
More information about the SciPy-User
mailing list