Matrix power seems to give different answers for A**(4) and A**(4.0).

31 views
Skip to first unread message

Sreehari S

unread,
Oct 2, 2016, 12:44:27 PM10/2/16
to sympy

I've been trying to work on issue #11677.
1. I'm unable to understand the exact difference between what an integer symbol and an integer value is.
2. There is a difference between what m.__pow__(4 )returns and what m.__pow__(4.0) returns.

The first executes an if-block which does exponentiation by squaring while the second executes an elif block and finds the power using Jordan normal form matrices. Why exactly are the return values different (Or do they mean the same thing)?

I am unable to make sense of the output when m.__pow__(4.0) is executed.

Thank you!



Francesco Bonazzi

unread,
Oct 3, 2016, 3:20:10 AM10/3/16
to sympy
They are the same, if you approximate the value:

In [9]: (A**(4.0)).n()
Out[9]:
Matrix([
[ 844.0, 1113.0],
[1484.0, 1957.0]])

Reply all
Reply to author
Forward
0 new messages