Thanks, Dima.

On Tuesday, September 25, 2012 10:08:13 AM UTC-7, Dima Pasechnik wrote:
>
>  So this is a bug...


Maybe more like: my mistake. I had my print versions of the complex/real 
algebraic numbers mixed up.  

Here is the essence of how these (exact) eigenvalues are computed for 
rational matrices (not just adjacency matrices of graphs).  It would be a 
definite improvement to recognize symmetric matrices (through a keyword or 
an optional check) and then create these roots in AA rather than QQbar.

sage: G = graphs.GridGraph([3,2])
sage: p = G.am().fcp(); p
(x - 1) * (x + 1) * (x^2 - 2*x - 1) * (x^2 + 2*x - 1)
sage: f = p[2][0]; f
x^2 - 2*x - 1
sage: evs = f.root_field('t').gen(0).galois_conjugates(QQbar); evs
[-0.4142135623730951?, 2.414213562373095?]
sage: evs[0].parent()
Algebraic Field
sage: evs = f.root_field('t').gen(0).galois_conjugates(AA)
sage: evs[0].parent()
Algebraic Real Field

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to