On 4 December 2014 at 17:44, Colin Macdonald <macdon...@maths.ox.ac.uk> wrote:
>> In [4]: M = Matrix([[y, 0], [0, z]])
>>
>> In [5]: M
>> Out[5]:
>> ⎡y  0⎤
>> ⎢    ⎥
>> ⎣0  z⎦
>>
>> In [6]: M.eigenvals()
>> Out[6]:
>> ⎧           __________                __________   ⎫
>> ⎪          ╱        2                ╱        2    ⎪
>> ⎨y   z   ╲╱  (y - z)       y   z   ╲╱  (y - z)     ⎬
>> ⎪─ + ─ - ─────────────: 1, ─ + ─ + ─────────────: 1⎪
>> ⎩2   2         2           2   2         2         ⎭
>
> I think this has been improved in the dev version after 0.7.6.  I
> remember commenting on an old issue on this which was then recently
> closed, but I cannot locate at the moment...  test on git master?

Yes, you're right. git master shows:

In [3]: Matrix([[y, 0], [0, z]]).eigenvals()
Out[3]: {y: 1, z: 1}

And also:

In [8]: (M - x*eye(2)).det()
Out[8]:
 2
x  - x⋅y - x⋅z + y⋅z

In [9]: solve((M - x*eye(2)).det(), x)
Out[9]: [y, z]

Thanks for that,
Oscar

-- 
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 post to this group, send email to sympy@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/CAHVvXxQ3p4bkzy8rLETuy-3b6QkhxbYHW-71khcuWJdMr%2BAC9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to