eigenvalues of a symmetric matrix returns empty set.

78 views
Skip to first unread message

Bharath M R

unread,
Oct 12, 2012, 1:34:50 PM10/12/12
to sy...@googlegroups.com
Hi, 
   I was trying to implement rational chebychev series approximation to a function. This 
involves finding the eigen values of a symmetric matrix(for svd). I always get an empty set of
eigen values. 

Here is an example. The matrix is an symmetric matrix and hence it should have real eigen values.
```
from sympy import *
a = [[               40,  59.0372649711174,  91.9159715266083, -18.3586972981465, -26.5974423018762],
[ 59.0372649711174,  91.9159715266083,  149.966034521936, -26.5974423018762, -40.6785676729709],
[ 91.9159715266083,  149.966034521936,   254.33769719335, -40.6785676729709, -65.3185292247321],
[-18.3586972981465, -26.5974423018762, -40.6785676729709,  8.47893318890501,  12.0617341323178],
[-26.5974423018762, -40.6785676729709, -65.3185292247321,  12.0617341323178,  18.1185091129712]]
a = Matrix(a)
print a.eigenvals()
```
This return an empty eigen value set. Is this a bug? Is there any way around it?

Thanks,
Bharath M R

Matthew Rocklin

unread,
Oct 12, 2012, 2:11:12 PM10/12/12
to sy...@googlegroups.com
I'm not familiar with how the eigenvalue functions are written but I've used them on complex matrices and gotten results similar to yours. If your elements are numeric (as they appear to be in your example) then I would suggest doing this computation in numpy if that's possible. 

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/R0aWpRkLDrEJ.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.

Bharath M R

unread,
Oct 13, 2012, 1:09:27 AM10/13/12
to sy...@googlegroups.com
Thanks.

Doing it in numpy will add a numpy dependency for sympy. I think I should use the ``import_module``
and add the series expansion, which will only work if numpy is installled.

Thanks,
Bharath M R

Matthew Rocklin

unread,
Oct 13, 2012, 8:02:55 AM10/13/12
to sy...@googlegroups.com
Ah, I assume that this was for personal work and not for SymPy development. You could always improve the eigen-decomposition algorithm :)


Thanks,
Bharath M R

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/0HCUdIXUknAJ.
Reply all
Reply to author
Forward
0 new messages