Re: [sage-support] Re: How to convert complex_root_of to QQbar (algebraic number)

2023-04-01 Thread William Stein
Thanks Vincent!What version of Sage are you using? With sage-9.8 I get: --- from sympy import sympify exp = sympify("CRootOf(x**5 + x + 1, 0)") sage_poly = QQ['x'](list(map(QQ, reversed(exp.poly.rep.rep sage_approx = RIF(exp.n()) + RIF(-1e-30, 1e-30) QQbar.polynomial_root(sage_poly,

[sage-support] Re: How to convert complex_root_of to QQbar (algebraic number)

2023-04-01 Thread vdelecroix
Dear Marcel, It is a pity that this does not work more directly. Here is a work around to achieve what you want to do sage: exp = sympify("CRootOf(x**5 + x + 1, 0)") sage: sage_poly = QQ['x'](list(map(QQ, reversed(exp.poly.rep.rep sage: sage_approx = RIF(exp.n()) + RIF(-1e-30, 1e-30) sage:

Re: [sage-support] How to convert complex_root_of to QQbar (algebraic number)

2023-04-01 Thread William Stein
On Sat, Apr 1, 2023 at 6:34 AM Emmanuel Charpentier < emanuel.charpent...@gmail.com> wrote: > Le vendredi 31 mars 2023 à 15:19:51 UTC+2, William Stein a écrit : > > [ Snip… ] > > Meta comment -- I added this "Help me fix this..." feature to cocalc > jupyter notebooks a week ago, and it's been

Re: [sage-support] How to convert complex_root_of to QQbar (algebraic number)

2023-04-01 Thread Emmanuel Charpentier
Le vendredi 31 mars 2023 à 15:19:51 UTC+2, William Stein a écrit : [ Snip… ] Meta comment -- I added this "Help me fix this..." feature to cocalc jupyter notebooks a week ago, and it's been extremely popular with 1000+ uses a day. It's exactly the sort of thing that ChatGPT can be very