Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3971 by ryan.gre...@gmail.com: Missing eigenvalues
http://code.google.com/p/sympy/issues/detail?id=3971

When calculating eigenvalues for some matricies I'm working with I get fewer than there should be. For example:

In [10]: W
Out[10]:
Matrix([
[0, 5/8, 3/8,   0,   0,   0,   0,   0, 0,   0, 0,   0, 0],
[0,   0,   0, 4/5, 1/5,   0,   0,   0, 0,   0, 0,   0, 0],
[0,   0,   0,   0,   0, 1/3, 2/3,   0, 0,   0, 0,   0, 0],
[0,   0,   0,   0, 1/4,   0,   0, 3/4, 0,   0, 0,   0, 0],
[0,   0,   0,   0,   0,   0,   1,   0, 0,   0, 0,   0, 0],
[0,   0,   0,   0,   0,   0,   0,   0, 1,   0, 0,   0, 0],
[0,   0,   0,   0,   0, 1/2, 1/2,   0, 0,   0, 0,   0, 0],
[0,   0,   0,   0, 1/3,   0,   0,   0, 0, 2/3, 0,   0, 0],
[0,   0,   0,   0,   0,   0,   0,   0, 0,   0, 1,   0, 0],
[0,   0,   0,   0, 1/2,   0,   0,   0, 0,   0, 0, 1/2, 0],
[0,   0,   0,   0,   0,   0,   0,   0, 0,   0, 0,   0, 1],
[0,   0,   0,   0,   1,   0,   0,   0, 0,   0, 0,   0, 0],
[0,   0,   0,   0,   0,   0,   0,   0, 0,   0, 0,   1, 0]])
In [11]: W.eigenvals()
Out[11]: {0: 6, 1: 1}
In [12]: Wnp = np.array([[np.float(i) for i in row] for row in W.tolist()])
In [13]: np.linalg.eigvals(Wnp)
Out[13]:
array([ 0.00000000+0.j        ,  0.00000000+0.j        ,
        0.00000000+0.j        ,  0.00000000+0.j        ,
        0.00000000+0.j        ,  0.00000000+0.j        ,
        1.00000000+0.j        ,  0.64438276+0.69026752j,
        0.64438276-0.69026752j, -0.13703613+0.86913433j,
       -0.13703613-0.86913433j, -0.75734663+0.38822447j,
       -0.75734663-0.38822447j])
In [14]: sympy.roots(W.charpoly())
Out[14]: {0: 6, 1: 1}
In [15]:

notice that I only get 7 eigenvalues from the 13x13 matrix. numpy reports all 13. furthermore, I only get 7 roots from the characteristic polynomial.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy-issues+unsubscr...@googlegroups.com.
To post to this group, send email to sympy-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to