On Tue, Nov 15, 2011 at 10:59 AM, samuel <[email protected]> wrote:
> Hi,
>
> I have the following matrix and want to determine the eigenvalues of
> it.
>
> M3=matrix(RR,[
> [0, 0.095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.905],
> [0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0],
> [0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0],
> [0, 0, 0.905, 0, 0.095, 0, 0, 0, 0, 0, 0, 0],
> [0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0],
> [0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0],
> [0, 0, 0, 0, 0, 0.905, 0, 0.095, 0, 0, 0, 0],
> [0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0],
> [0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0],
> [0, 0, 0, 0, 0, 0, 0, 0, 0.905, 0, 0.095, 0],
> [0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745],
> [0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255,0]])
> M3.eigenvalues()
>
> I got the following message:
>
> NotImplementedError: eigenvalues() is not implemented for matrices
> with
> eigenvalues that are not in the fraction field of the base ring or in
> QQbar
>
> I have no idea what the message mean as I don't have enough math
> backgrounds to make sense of it. I tried to do the same thing on
> Mathematica and I got several complex eigenvalues. I wonder if sage
> does not support determining complex eigenvalues.
>

I think you want this:

sage: M3=matrix(CC,[
[0, 0.095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.905],
[0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0.905, 0, 0.095, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0.905, 0, 0.095, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0.905, 0, 0.095, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255, 0, 0.745],
[0.745, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.255,0]])
sage: M3.eigenvalues()
[0.999999999999981, 0.942581873717902 + 0.00344425422968659*I,
0.942581873717902 - 0.00344425422968659*I,
0.872055103445802, 0.127944896554073, 0.00688850845748007*I,
-0.00688850845748007*I, -0.127944896554073,
-0.872055103445802, -0.942581873717902 + 0.00344425422968659*I,
-0.942581873717902 - 0.00344425422968659*I, -0.999999999999981]
sage:


> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to 
> [email protected]
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to