id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
25218,Extract roots in NumberField if possible,gh-BrentBaccala,,"!NumberField previously evaluated integral powers in the !NumberField, and evaluated all fractional powers in the symbolic ring.
This patch makes !NumberField attempt to evaluate the fractional power within the field, and only falls back on the symbolic ring if this fails.
There's a few interesting changes in the test suite.
Old code:
{{{
sage: QQbar((2*I)^(1/2))
1 + 1*I
sage: (2*I)^(1/2)
sqrt(2*I)
sage: I^(2/3)
I^(2/3)
}}}
New code:
{{{
sage: QQbar((2*I)^(1/2))
I + 1
sage: (2*I)^(1/2)
I + 1
sage: I^(2/3)
-1
}}}
The first change is just cosmetic. The second makes good sense, as Sage is now evaluating an expression it didn't before. The third change is more troubling.
The explanation lies in the definition of I:
{{{
sage: I.parent()
Symbolic Ring
sage: I.pyobject().parent()
Number Field in I with defining polynomial x^2 + 1
}}}
In this number field, there is a single cube root of `I` (`-I`). Squaring `-I` gives us `-1`, so `I^(2/3)=-1`.
My opinion is that the new behavior of !NumberField is correct and preferred, but perhaps `I` should be defined in QQbar, not in a !NumberField.",enhancement,closed,minor,sage-8.3,algebra,fixed,NumberField,slelievre,,Brent Baccala,Sébastien Labbé,N/A,,17b93d604a5c2d45a136d171db513681a320f58f,17b93d604a5c2d45a136d171db513681a320f58f,,