Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Try :

SQ=w.roots(ring=QQbar)

(or, equivalently, replace CC by QQbar in mforest's answer). It turns out that :

sage: SQ[0][0].parent()
Algebraic Field

which is exact :

sage: SQ[0][0].parent().is_exact()
True

a property that holds for all the roots thus obtained :

sage: all(map(lambda r:r[0].parent().is_exact(), SQ))
True

(Here, "exact" means that Sage can give you arbitrary precision for a numerical approximation). However, you won't (always : you might get lucky, but there is no guarantee...) get algebraic expressions for that (ISTR that someone called Galois explained why...).

If you need algebraic expressions of these roots and happen to be able to read French, you might have a look at the excellent "Calcul mathématique avec Sage", which IMHO, should be translated in English, and might benefit from an updated edition : Sage(math) has made huge progress since this book was written).

You might also explicitely work in the ring of polynomials in q, but I'll defer to the official documentation...

HTH,

Try :

SQ=w.roots(ring=QQbar)

(or, equivalently, replace CC by QQbar in mforest's fidbc's answer). It turns out that :

sage: SQ[0][0].parent()
Algebraic Field

which is exact :

sage: SQ[0][0].parent().is_exact()
True

a property that holds for all the roots thus obtained :

sage: all(map(lambda r:r[0].parent().is_exact(), SQ))
True

(Here, "exact" means that Sage can give you arbitrary precision for a numerical approximation). However, you won't (always : you might get lucky, but there is no guarantee...) get algebraic expressions for that (ISTR that someone called Galois explained why...).

If you need algebraic expressions of these roots and happen to be able to read French, you might have a look at the excellent "Calcul mathématique avec Sage", which IMHO, should be translated in English, and might benefit from an updated edition : Sage(math) has made huge progress since this book was written).

You might also explicitely work in the ring of polynomials in q, but I'll defer to the official documentation...

HTH,

Try :

SQ=w.roots(ring=QQbar)

(or, equivalently, replace CC by QQbar in fidbc's answer). It turns out that :

sage: SQ[0][0].parent()
Algebraic Field

which is exact :

sage: SQ[0][0].parent().is_exact()
True

a property that holds for all the roots thus obtained :

sage: all(map(lambda r:r[0].parent().is_exact(), SQ))
True

(Here, "exact" means that Sage can give you arbitrary precision for a numerical approximation). However, you won't (always : you might get lucky, but there is no guarantee...) get algebraic expressions for that (ISTR that someone called Galois explained why...).

If you need algebraic expressions of these roots and happen to be able to read French, you might have a look at the excellent "Calcul mathématique avec Sage", which IMHO, should be translated in English, and might benefit from an updated edition : Sage(math) has made huge progress since this book was written).

You might also explicitely work in the ring of polynomials in q, but I'll defer to the official documentation...

HTH,