Discussion: new operators for numerical computation

Charles Boncelet boncelet at eecis.udel.edu
Mon Jul 24 14:59:19 EDT 2000


After reading numerous posts on the subject of adding more 
infix operators to Python (e.g., making Python more like Matlab),
I'm starting to wonder if the proposed solutions are not worse 
than the original problems.

A few comments (some plagiarised from others--but I'll try to
attribute when I remember the source):

1. MatPy currently does a pretty good job of addressing many of
the concerns for linear algebra.  The syntax for inverse (A.I())
and transpose (A.T()) are both simple and allow for class specific
implementations (e.g. for a triangular matrix).

Yes, Matlab is simpler for linear algebra, but MatPy is not bad.

(I wonder how widely used MatPy will become.  It is a nice package
but it deviates from numpy, which is the Python "standard" for
numerical work.  I wish Huaiyu good luck and hope he continues.)

2. A week or so ago, I suggested just @ for matrix multiplication.  
Someone else asked what about all the other operations (left and 
right inverse, power, etc.), but I was traveling and didn't have time
to respond.  Recently, Konrad Hinson and others have given the 
answer I would have: what do you mean by left and right inverses?
matrix power?

These are not uniquely defined concepts.  In the universe of choices,
I strongly believe that accuracy should not be sacrificed for speed.
(Let the user override the defaults and program for speed if 
necessary.)

In my work, I usually want to control which algorithm is used and
would likely "roll my own" anyway.

BTW, in most applications with which I'm familiar, matrix multiplication
is used much more frequently than matrix division.  

3. For multiarray objects, it is not clear what matrix multiplication,
left and right inverse, and power should mean (to me, at least). 
Without
a good consensus for the meaning of these objects on general
nD-multiarray objects (not just 2D matrices), I wonder whether adding
the proposed infix notations is ill-advised (premature?).

The proposals to add dimensional indices to the infix operators are
really ugly.  Sorry.

4. Travis Oliphant is probably right that the biggest problems with
python and numpy are the lack of toolboxes and the basically
non-existent help system.  Hopefully, Paul Plescod develops his proposed
help system.

I'd like to suggest the inclusion of all of blas and lapack in numpy as
a priority.
-- 
Charles Boncelet                              302-831-8008
Dept of Electrical and Computer Engineering   302-831-4316 (fax)
University of Delaware                        boncelet at eecis.udel.edu
http://www.eecis.udel.edu/~boncelet/



More information about the Python-list mailing list