#8344: Factor constant polynomials over QQbar
--------------------------------+-------------------------------------------
Reporter: boothby | Owner: AlexGhitza
Type: defect | Status: needs_info
Priority: critical | Milestone: sage-4.3.4
Component: basic arithmetic | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Comment(by cremona):
Good point, Paul; I had forgotten that no-one had done this yet, which is
silly since it only takes one line:
{{{
sage: x = polygen(QQbar)
sage: f = 3*x^2-2
sage: Factorization([(x-r,e) for r,e in
f.roots()],unit=f.leading_coefficient())
(3) * (x - 0.8164965809277260?) * (x + 0.8164965809277260?)
}}}
But doing this for QQbar would also mean doing it for AAbar, which is a
little more complicated, which is probably why no-one has done it yet.
{{{
sage: f = x^4-2
sage: x = polygen(AA)
sage: f = x^4-2
sage: fr = f.roots(QQbar)
sage: f1 = Factorization([(x-r,e) for r,e in f.roots() if
f.imag().is_zero()],unit=f.leading_coefficient())
sage: f2 = Factorization([(x^2-(r+r.conjugate()).real()*x+r.norm(),e) for
r,e in fr if f.image()>0])
sage: f1*f2
(x - 1.189207115002722?) * (x + 1.189207115002722?) * (x^2 +
1.414213562373095?)
}}}
It is very tempting to add this as a second patch to the ticket. Can you
see anything wrong in my worked examples here?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8344#comment:8>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.