#14239: symbolic radical expression for algebraic number
-----------------------------+----------------------------------------------
Reporter: gagern | Owner: davidloeffler
Type: enhancement | Status: new
Priority: major | Milestone: sage-5.9
Component: number fields | Keywords:
Work issues: | Report Upstream: N/A
Reviewers: | Authors:
Merged in: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------------------------
It would be nice to have a function which converts algebraic numbers to
symbolic expressions using radicals, at least for those cases where this
is possible (i.e. the cases where the minimal polynomial of the algebraic
number has a degree less than 5). For the quadratic case, I have a code
snippet to illustrate what I'm asking for:
{{{
def AA2SR(x):
x = AA(x)
p = x.minpoly()
if p.degree() < 2:
return SR(QQ(x))
if p.degree() > 2:
raise TypeError("Cannot handle degrees > 2")
c, b, a = p.coeffs()
y = (-b+sqrt(b*b-4*a*c))/(2*a)
if x == AA(y):
return y
y = (-b-sqrt(b*b-4*a*c))/(2*a)
assert x == AA(y)
return y
def QQbar2SR(x):
x = QQbar(x)
return AA2SR(x.real()) + I*AA2SR(x.imag())
}}}
These functions could then be applied to vectors or matrices over
algebraic real or complex numbers in order to obtain an exact description
of the relevant values using radicals.
This request is a spin-off from [http://ask.sagemath.org/question/2209
/radical-expression-for-algebraic-number my question on Ask Sage].
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14239>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.