Enumeration of totally real fields: data¶
AUTHORS:
John Voight (2007-09-01): Initial version
John Voight (2007-09-19): various optimization tweaks
John Voight (2007-10-09): improvements: Smyth bound, Lagrange multipliers for b
Craig Citro and John Voight (2007-11-04): type checking and other polishing
- sage.rings.number_field.totallyreal_data.easy_is_irreducible_py(f)[source]¶
Used solely for testing easy_is_irreducible.
EXAMPLES:
sage: sage.rings.number_field.totallyreal_data.easy_is_irreducible_py(pari('x^2+1')) 1 sage: sage.rings.number_field.totallyreal_data.easy_is_irreducible_py(pari('x^2-1')) 0
>>> from sage.all import * >>> sage.rings.number_field.totallyreal_data.easy_is_irreducible_py(pari('x^2+1')) 1 >>> sage.rings.number_field.totallyreal_data.easy_is_irreducible_py(pari('x^2-1')) 0
- sage.rings.number_field.totallyreal_data.hermite_constant(n)[source]¶
Return the \(n\)-th Hermite constant.
The \(n\)-th Hermite constant (typically denoted \(\gamma_n\)), is defined to be
\[\max_L \min_{0 \neq x \in L} ||x||^2\]where \(L\) runs over all lattices of dimension \(n\) and determinant \(1\).
For \(n \leq 8\) it returns the exact value of \(\gamma_n\), and for \(n > 9\) it returns an upper bound on \(\gamma_n\).
INPUT:
n
– integer
OUTPUT:
(an upper bound for) the Hermite constant \(\gamma_n\)
EXAMPLES:
sage: hermite_constant(1) # trivial one-dimensional lattice 1.0 sage: hermite_constant(2) # Eisenstein lattice 1.1547005383792515 sage: 2/sqrt(3.) 1.15470053837925 sage: hermite_constant(8) # E_8 2.0
>>> from sage.all import * >>> hermite_constant(Integer(1)) # trivial one-dimensional lattice 1.0 >>> hermite_constant(Integer(2)) # Eisenstein lattice 1.1547005383792515 >>> Integer(2)/sqrt(RealNumber('3.')) 1.15470053837925 >>> hermite_constant(Integer(8)) # E_8 2.0
AUTHORS:
John Voight (2007-09-03)
- sage.rings.number_field.totallyreal_data.int_has_small_square_divisor(d)[source]¶
Return the largest \(a\) such that \(a^2\) divides \(d\) and \(a\) has prime divisors \(< 200\).
EXAMPLES:
sage: from sage.rings.number_field.totallyreal_data import int_has_small_square_divisor sage: int_has_small_square_divisor(500) 100 sage: is_prime(691) True sage: int_has_small_square_divisor(691) 1 sage: int_has_small_square_divisor(691^2) 1
>>> from sage.all import * >>> from sage.rings.number_field.totallyreal_data import int_has_small_square_divisor >>> int_has_small_square_divisor(Integer(500)) 100 >>> is_prime(Integer(691)) True >>> int_has_small_square_divisor(Integer(691)) 1 >>> int_has_small_square_divisor(Integer(691)**Integer(2)) 1
- sage.rings.number_field.totallyreal_data.lagrange_degree_3(n, an1, an2, an3)[source]¶
Private function. Solves the equations which arise in the Lagrange multiplier for degree 3: for each \(1 \leq r \leq n-2\), we solve
\[r*x^i + (n-1-r)\cdot y^i + z^i = s_i \quad (i = 1,2,3)\]where the \(s_i\) are the power sums determined by the coefficients \(a\). We output the largest value of \(z\) which occurs. We use a precomputed elimination ideal.
EXAMPLES:
sage: ls = sage.rings.number_field.totallyreal_data.lagrange_degree_3(3,0,1,2) sage: [RealField(10)(x) for x in ls] [-1.0, -1.0] sage: sage.rings.number_field.totallyreal_data.lagrange_degree_3(3,6,1,2) # random [-5.8878, -5.8878]
>>> from sage.all import * >>> ls = sage.rings.number_field.totallyreal_data.lagrange_degree_3(Integer(3),Integer(0),Integer(1),Integer(2)) >>> [RealField(Integer(10))(x) for x in ls] [-1.0, -1.0] >>> sage.rings.number_field.totallyreal_data.lagrange_degree_3(Integer(3),Integer(6),Integer(1),Integer(2)) # random [-5.8878, -5.8878]
- class sage.rings.number_field.totallyreal_data.tr_data[source]¶
Bases:
object
This class encodes the data used in the enumeration of totally real fields.
We do not give a complete description here. For more information, see the attached functions; all of these are used internally by the functions in
totallyreal
, so see that file for examples and further documentation.- increment(verbose=False, haltk=0, phc=False)[source]¶
‘Increment’ the totally real data to the next value which satisfies the bounds essentially given by Rolle’s theorem, and return the next polynomial as a sequence of integers.
The default or usual case just increments the constant coefficient; then inductively, if this is outside of the bounds we increment the next higher coefficient, and so on.
If there are no more coefficients to be had, returns the zero polynomial.
INPUT:
verbose
– boolean to print verbosely computational detailshaltk
– integer; the level at which to halt the inductive coefficient boundsphc
– boolean, if PHCPACK is available, use it when \(k = n-5\) to compute an improved Lagrange multiplier bound
OUTPUT: the next polynomial, as a sequence of integers
EXAMPLES:
sage: T = sage.rings.number_field.totallyreal_data.tr_data(2,100) sage: T.increment() [-24, -1, 1] sage: for i in range(19): _ = T.increment() sage: T.increment() [-3, -1, 1] sage: T.increment() [-25, 0, 1]
>>> from sage.all import * >>> T = sage.rings.number_field.totallyreal_data.tr_data(Integer(2),Integer(100)) >>> T.increment() [-24, -1, 1] >>> for i in range(Integer(19)): _ = T.increment() >>> T.increment() [-3, -1, 1] >>> T.increment() [-25, 0, 1]
- printa()[source]¶
Print relevant data for
self
.EXAMPLES:
sage: T = sage.rings.number_field.totallyreal_data.tr_data(3,2^10) sage: T.printa() k = 1 a = [0, 0, -1, 1] amax = [0, 0, 0, 1] beta = [...] gnk = [...]
>>> from sage.all import * >>> T = sage.rings.number_field.totallyreal_data.tr_data(Integer(3),Integer(2)**Integer(10)) >>> T.printa() k = 1 a = [0, 0, -1, 1] amax = [0, 0, 0, 1] beta = [...] gnk = [...]