[Python-ideas] Fwd: [RFC] draft PEP: Dedicated infix operators for matrix multiplication and matrix power

Nick Coghlan ncoghlan at gmail.com
Fri Mar 14 21:46:26 CET 2014


On 15 Mar 2014 06:18, "Serhiy Storchaka" <storchaka at gmail.com> wrote:
>
> 14.03.14 03:59, Nathaniel Smith написав(ла):
>
>> PEP: XXXX
>> Title: Dedicated infix operators for matrix multiplication and matrix
power
>
>
> This is about matrix multiplication and matrix power. But what about
matrix division? It is needed to distinguish elementwise division from left
and right matrix divisions. And what about concatenation? Python lists and
tuples use ``+`` for this, but NumPy arrayse use ``+`` for bitwise addition.
>
> Matrix multiplication is only defined on 2d arrays (matrices). But why
not on arbitrary tensors (except scalars)?

These are covered in the PEP - the relatively simple "just a new matrix
multiplication operator" proposal is due to the fact that, after long
experience, matrix multiplication is the only operator the numeric
community really feel they miss in Python compared to working in more
special purpose languages like Matlab or R.

Everything else can continue to use appropriately named methods and
functions, just as it does today.

That does raise a question for me though: does Julia have syntax for matrix
multiplication? If so, what does that look like?

Cheers,
Nick.

>
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140315/7a0768f0/attachment.html>


More information about the Python-ideas mailing list