Element wise matrix operations

67 views
Skip to first unread message

Alexander Loschilov

unread,
Jul 12, 2015, 11:00:21 AM7/12/15
to sy...@googlegroups.com
Hello,

Does anybody analyzed the possibility of implementation element wise operations that are present in Maple?
Any chance that somebody is already implementing such functionality?

I am primarily interested in binary element wise operations.

best regards,
Alexander.

Jason Moore

unread,
Jul 12, 2015, 5:13:15 PM7/12/15
to sy...@googlegroups.com
Alexander,

We are bound by the Python language on what operators are available for overloading. Python 3.5 has a new @ operator for matrix multiplication, but other than that you will have to use the functions that implement these operators. This is unfortunately one downside to building at CAS that conforms to the Python language.

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/06fd5b5a-8e91-493e-97cb-701d376024ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Meurer

unread,
Jul 13, 2015, 1:46:26 PM7/13/15
to sy...@googlegroups.com
Maybe we could add some syntactic sugar for this, like M.e would
create a proxy object on which operations would act element-wise (so
A.e | B.e would perform element-wise OR on A and B).

Aaron Meurer
> https://groups.google.com/d/msgid/sympy/CAP7f1AgbEsZeN7-UHJjkSxzL2stKYLD9YZcb34f8%2BFemHRApVg%40mail.gmail.com.

Jason Moore

unread,
Jul 13, 2015, 2:07:03 PM7/13/15
to sy...@googlegroups.com

Alexander Loschilov

unread,
Jul 13, 2015, 3:39:33 PM7/13/15
to sy...@googlegroups.com
Jason, Aaron, thank you for your feedback.

Let us consider the scenario, where we need to make an element wise function call against arbitrary number of matrices.

I though in a little bit different direction.

We are already able to make a Function object.
Any objections about making it element wise via the same ~ operator?
So having Function object f, we could make an element wise version of it via __invert__ (~) call.

best regards,
Alexander.
Reply all
Reply to author
Forward
0 new messages