Re: [Python-Dev] Matrix product

2008-08-01 Thread Robert Kern
Terry Reedy wrote: That said, I am curious what working scientists using Python think. Well, we'll let you know more after SciPy '08, but I suspect the answer is that they just want one teensy little wafer-thin operator to do matrix multiplication on numpy arrays or their favorite matrix obj

Re: [Python-Dev] Matrix product

2008-08-01 Thread Terry Reedy
Fernando Perez wrote: re http://www.python.org/dev/peps/pep-0225/ I am hereby volunteering to try to organize a BOF session at the conference on this topic, and can come back later with the summary. I'm also scheduled to give a talk at BayPiggies on Numpy/Scipy soon after the conference, so

Re: [Python-Dev] Matrix product

2008-08-01 Thread Fernando Perez
Guido van Rossum wrote: > On Fri, Jul 25, 2008 at 6:50 PM, Greg Ewing <[EMAIL PROTECTED]> > wrote: >> Sebastien Loisel wrote: >> >>> What are the odds of this thing going in? >> >> I don't know. Guido has said nothing about it so far this >> time round, and his is the only opinion that matters in

Re: [Python-Dev] Matrix product

2008-08-01 Thread Nick Coghlan
Cesare Di Mauro wrote: Nick Coghlan write: Sebastien Loisel wrote: Dear Raymond, Thank you for your email. I think much of this thread is a repeat of conversations that were held for PEP 225: http://www.python.org/dev/peps/pep-0225/ That PEP is marked as deferred. Maybe it's time to bring

Re: [Python-Dev] Matrix product

2008-07-31 Thread Cesare Di Mauro
Nick Coghlan write: > Sebastien Loisel wrote: >> Dear Raymond, >> >> Thank you for your email. >> >>> I think much of this thread is a repeat of conversations >>> that were held for PEP 225: >>> http://www.python.org/dev/peps/pep-0225/ >>> >>> That PEP is marked as deferred. Maybe it's time to >>

Re: [Python-Dev] Matrix product

2008-07-31 Thread Nick Coghlan
Sebastien Loisel wrote: Dear Raymond, Thank you for your email. I think much of this thread is a repeat of conversations that were held for PEP 225: http://www.python.org/dev/peps/pep-0225/ That PEP is marked as deferred. Maybe it's time to bring it back to life. This is a much better PEP

Re: [Python-Dev] Matrix product

2008-07-30 Thread Sebastien Loisel
Dear Raymond, Thank you for your email. > I think much of this thread is a repeat of conversations > that were held for PEP 225: > http://www.python.org/dev/peps/pep-0225/ > > That PEP is marked as deferred. Maybe it's time to > bring it back to life. This is a much better PEP than the one I ha

Re: [Python-Dev] Matrix product

2008-07-30 Thread Raymond Hettinger
Further, while A**B is not so common, A**n is quite common (for integral n, in the sense of repeated matrix multiplication). So a matrix multiplication operator really should come with a power operator cousin. Which obviously should be @@ :-) I think much of this thread is a repeat of conversa

Re: [Python-Dev] Matrix product

2008-07-29 Thread Sebastien Loisel
Dear Greg, Thank you for your email. > In MATLAB, the elementwise operations are probably > used fairly infrequently. But numpy arrays are often > used to vectorise what are otherwise scalar operations, > in which case elementwise operations are used almost > exclusively. Your assessment of poin

Re: [Python-Dev] Matrix product

2008-07-29 Thread Greg Ewing
Fredrik Johansson wrote: Further, while A**B is not so common, A**n is quite common (for integral n, in the sense of repeated matrix multiplication). So a matrix multiplication operator really should come with a power operator cousin. Which obviously should be @@ :-) Well, Fortress probably

Re: [Python-Dev] Matrix product

2008-07-29 Thread Greg Ewing
Sebastien Loisel wrote: let me describe MATLAB's approach to this. It features a complete suite of matrix operators (+-*/\^), and their pointwise variants (.+ .- ./ .* .^) That was considered before as well, but rejected on the grounds that the dot-prefixed operators were too cumbersome to use

Re: [Python-Dev] Matrix product

2008-07-29 Thread Greg Ewing
Guido van Rossum wrote: last time '@' was considered as a new operator, that character had no uses in the language at all. Now it is the decorator marker. The only alternatives left would seem to be ?, ! or $, none of which look particularly multiplicationish. But would it be totally outland

Re: [Python-Dev] Matrix product

2008-07-29 Thread Fredrik Johansson
On Wed, Jul 30, 2008 at 2:26 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On Fri, Jul 25, 2008 at 6:50 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: >> Sebastien Loisel wrote: >> >>> What are the odds of this thing going in? >> >> I don't know. Guido has said nothing about it so far this >> time r

Re: [Python-Dev] Matrix product

2008-07-29 Thread Sebastien Loisel
Dear Guido, Thank you for your email. On Tue, Jul 29, 2008 at 8:26 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > But would it be totally outlandish to propose A**B for matrix > multiplication? I can't think of what "matrix exponentiation" would > mean... Right now, ** is the pointwise power:

Re: [Python-Dev] Matrix product

2008-07-29 Thread Sidnei da Silva
On Tue, Jul 29, 2008 at 9:26 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > But would it be totally outlandish to propose A**B for matrix > multiplication? I can't think of what "matrix exponentiation" would > mean... Before even reading this paragraph, A**B came to my mind, so I suspect it wou

Re: [Python-Dev] Matrix product

2008-07-29 Thread Guido van Rossum
On Fri, Jul 25, 2008 at 6:50 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Sebastien Loisel wrote: > >> What are the odds of this thing going in? > > I don't know. Guido has said nothing about it so far this > time round, and his is the only opinion that matters in the > end. I'd rather stay silent

Re: [Python-Dev] Matrix product

2008-07-27 Thread Greg Ewing
[EMAIL PROTECTED] wrote: How about just making a matrix multiply function that can take many arguments? I think this is pretty readable: mmul(a, b, c, d) The multiplications aren't necessarily all together, e.g. a*b + c*d + e*f would become mmul(a, b) + mmul(c, d) + mmul(e, f) -- Gre

Re: [Python-Dev] Matrix product

2008-07-26 Thread Steven D'Aprano
On Sun, 27 Jul 2008 02:23:11 am [EMAIL PROTECTED] wrote: > How about just making a matrix multiply function that can take many > arguments? I think this is pretty readable: > > mmul(a, b, c, d) > > Additionally, mmul could then optimize the order of the > multiplications (e.g., depending the dime

Re: [Python-Dev] Matrix product

2008-07-26 Thread daniel . stutzbach
The desire for a new operator for matrix mutltiplication is because binary prefix operators are horrible for expressin this kind of thing, right? Stuff like this is hard to write, read, and debug (especially when checking it against an infix formula): mmul(mmul(mmul(a, b), c), d) How about just

Re: [Python-Dev] Matrix product

2008-07-25 Thread Greg Ewing
Sebastien Loisel wrote: What are the odds of this thing going in? I don't know. Guido has said nothing about it so far this time round, and his is the only opinion that matters in the end. I may write a PEP about this. However, since yesterday I've realised that there's a rather serious probl