On 4 December 2014 at 17:44, Colin Macdonald <
macd...@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