#15552: enumerate_totallyreal_fields_prim does not return polynomial as 
elements of
a polynomial ring
-----------------------+----------------------------
   Reporter:  ppurka   |            Owner:
       Type:  defect   |           Status:  new
   Priority:  major    |        Milestone:  sage-6.1
  Component:  algebra  |         Keywords:
  Merged in:           |          Authors:
  Reviewers:           |  Report Upstream:  N/A
Work issues:           |           Branch:
     Commit:           |     Dependencies:
   Stopgaps:           |
-----------------------+----------------------------
 The function `enumerate_totallyreal_fields_prim` is supposed to return,
 according to its description,
 {{{
    OUTPUT:

    the list of fields with entries "[d,f]", where "d" is the
    discriminant and "f" is a defining polynomial, sorted by
    discriminant.
 }}}
 Let us look at an output:
 {{{
 sage: E = enumerate_totallyreal_fields_prim(2, 10); E
 [[5, x^2 - x - 1], [8, x^2 - 2]]
 sage: E[0][1].parent()
 Interface to the PARI C library
 }}}
 We notice from here that the polynomial does not actually belong to the
 polynomial ring of `QQ`. In fact, there is no nice way to directly get the
 polynomial, as in an element of `PolynomialRing(QQ)` from `E[0][1]`, which
 can be then used to construct the number field.

 The only way to do this is this lengthy and tedious procedure:
 {{{
 sage: Ecoef = [QQ(_) for _ in E[0][1].list()]
 sage: x = polygen(QQ)
 sage: Epol = sum(x**i * _ for i,_ in enumerate(Ecoef))
 sage: Epol, Epol.parent()
 (x^2 - x - 1, Univariate Polynomial Ring in x over Rational Field)
 }}}

 The output of the function itself should give back elements of the
 polynomial ring, instead of giving us elements which are simply output of
 pari.

--
Ticket URL: <http://trac.sagemath.org/ticket/15552>
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to