On Tue, Mar 11, 2014 at 5:29 PM, Robert Bradshaw <rober...@gmail.com> wrote:
> First off, to start with a funny anecdote, I remember working with
> some of the early Sage devs way back in the day optimizing matrix
> multiplication and we were baffled by the fact that numpy somehow
> managed to have O(n^2) behavior into the thousand by thousand matrix
> range :).

I remember precisely that happening to me.  I was extremely
impressed.... for a few minutes.

> More serious responses below.
>
>> Sure, fair enough. If you're lucky enough to be dealing only with pure
>> mathematical matrices, then the problem this PEP is addressing doesn't
>> arise. Practical number crunching OTOH isn't so pretty, but it is
>> useful :-).
>
> There are certainly times when one wants to work with arrays like this
> in Sage, and it's perfectly fine to invoke numpy to do so. In general,
> however, x*y (where x and y are of the same type, or coercible to the
> same type) denotes multiplication as defined in the parent (Group,
> Ring, Monoid, whatever) of x and y. This isn't special to matrices: it
> applies to rationals, algebraic numbers, polynomials, permutations,
> etc. The * operator is also used to denote an action, e.g. on scalar
> multiplication of a matrix, a matrix acting on a vector, or the
> integer ring on a abelian group like an elliptic curve. Pretty much
> whatever would be represented on the blackboard by a \cdot or simply
> placing symbols adjacent to each other.

Relevant link is [1].

>
> IMHO it seems odd to try to define a new infix operator that
> specifically has "matrix multiplication" semantics. That seems out of
> the domain of the Python language. If it were to be accepted, there's
> no way Sage would start using * to do element-wise multiplication of
> matrices.

As founder of the project, I second Robert's assertion that no matter
what, "there's no way Sage would start using * to do element-wise
multiplication of matrices."


[1] http://www.sagemath.org/doc/reference/coercion/


-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to