On Friday, April 10, 2020 at 8:48:26 PM UTC+2, Aaron Meurer wrote:
>
> On Fri, Apr 10, 2020 at 12:39 PM jlh <j...@gmx.ch <javascript:>> wrote: 
> > Technically even A ** 0 makes sense, which would just return 
> Identity(A.rows) (and funnily return a matrix of a different shape than the 
> power's base). 
>
> Why rows and not columns though? I think A**0 should give an error. 
>

Actually it should be GenericIdentity(), which is also what is returned 
from MatMul() (with no arguments), which is pretty much equivalent to A ** 
0. I don't think it should be an error, it's really the same as n ** 0 
being 1.
 

> Well I wouldn't be surprised if it breaks something somewhere if A**1 
> stops working, since something might assume that A**1 is always the 
> same as A. I guess you can try removing it and seeing what tests fail. 
> But to me, mathematically, A**1 does make sense, even if none of the 
> other powers do. 
>

I tried it, it didn't break any tests other than the ones in test_matpow.py 
explicitly testing for that.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/aeb6c4be-b66e-4f55-961d-b62d8c58939b%40googlegroups.com.

Reply via email to