-
-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #15552: enumerate_totallyreal_fields_prim does not return polyno…
…mial as elements of a polynomial ring 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. ---- Additionally, 1. the first entry of each list should belong to Sage's `Integer` ring instead of being just a python `int`. 2. the functions `enumerate_totallyreal_fields_all` and `enumerate_totallyreal_fields_rel` should get the same fix. URL: http://trac.sagemath.org/15552 Reported by: ppurka Ticket author(s): Punarbasu Purkayastha Reviewer(s): Francis Clarke
- Loading branch information
Showing
2 changed files
with
196 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.