ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 20 Jan 2015 23:06:19 -0600How to stop Sage from finding erroneous complex roots?http://ask.sagemath.org/question/25587/how-to-stop-sage-from-finding-erroneous-complex-roots/ Consider the matrix,
A = matrix ( [0,1,w^a,1],[1,0,1,w^(k-b)],[w^(k-a),1,0,w^(k-c)],[1,w^b,w^c,0])
where w is the m^th of the k^th roots of unity, `w = exp((2*pi*I*m )/k`
for some k a positive integer, and 1 <= m <= (k-1)
and 1<= a,b,c <= (k-1)
Then the characteristic polynomial of the above matrix is,
`p(x) = x^4 - 6*x^2 -x *(w^(a-c) + w^(c-a) + w^b + w^(-b) + w^(b-c) + w^(c-b) + w^a + w^(-a)) + (3 -w^c - w^(-c) - w^(a+b-c) - w^(-a-b+c) - w^(a-b) - w^(-a+b) )`
- Is there a way to get sage to be able to calculate the above characteristic polynomial?
Now I try getting roots of the above by doing,
g(x)=real_part(p(x)).simplify()
g.solve(x)
- Now Sage seems to be generically detecting complex eigenvalues as roots of g!
(I tried on say k=6, m=a=b=c=1)
This can't happen since its a characteristic polynomial of a Hermitian matrix!
How to get across this trouble?
PhoenixTue, 20 Jan 2015 23:06:19 -0600http://ask.sagemath.org/question/25587/