[Numpy-discussion] dot function or dot notation, matrices, arrays?

Anne Archibald peridot.faceted@gmail....
Tue Dec 22 21:13:42 CST 2009

2009/12/21 David Goldsmith <d.l.goldsmith@gmail.com>:
> On Mon, Dec 21, 2009 at 9:57 AM, Christopher Barker
> <Chris.Barker@noaa.gov> wrote:
>> Dag Sverre Seljebotn wrote:
>>> I recently got motivated to get better linear algebra for Python;
>> wonderful!
>>> To me that seems like the ideal way to split up code -- let NumPy/SciPy
>>> deal with the array-oriented world and Sage the closer-to-mathematics
>>> notation.
>> well, maybe -- but there is a lot of call for pure-computational linear
>> algebra. I do hope you'll consider building the computational portion of
>> it in a way that might be included in numpy or scipy by itself in the
>> future.
> My personal opinion is that the LA status quo is acceptably good:
> there's maybe a bit of an adjustment to make for newbies, but I don't
> see it as a very big one, and this list strikes me as very efficient
> at getting people over little bumps (e.g., someone emails in: "how do
> you matrix-multiply two arrays?" within minutes (:-)) Robert or
> Charles replies with "np.dot: np.dot([[1,2],[3,4]],[[1,2],[3,4]]) =
> array([[7,10],[15,22]])").  Certainly any significant changes to the
> base should need to run the gauntlet of an NEP process.

I think we have one major lacuna: vectorized linear algebra. If I have
to solve a whole whack of four-dimensional linear systems, right now I
need to either write a python loop and use linear algebra on them one
by one, or implement my own linear algebra. It's a frustrating lacuna,
because all the machinery is there: generalized ufuncs and LAPACK
wrappers. Somebody just needs to glue them together. I've even tried
making a start on it, but numpy's ufunc machinery and generic type
system is just too much of a pain for me to make any progress as is.

I think if someone wanted to start building a low-level generalized
ufunc library interface to LAPACK, that would be a big improvement in
numpy/scipy's linear algebra. Pretty much everything else strikes me
as a question of notation. (Not to trivialize it: good notation makes
a tremendous difference.)


More information about the NumPy-Discussion mailing list