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,

2 | No.2 Revision |

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,

3 | No.3 Revision |

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,

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.