Package sage :: Package rings :: Package padics :: Module padic_ZZ_pX_CR_element
[hide private]
[frames] | no frames]

Module padic_ZZ_pX_CR_element



File: sage/rings/padics/padic_ZZ_pX_CR_element.pyx (starting at line 1)

This file implements elements of eisenstein and unramified extensions of Zp 
and Qp with capped relative precision.

For the parent class see padic_extension_leaves.pyx.

The underlying implementation is through NTL's ZZ_pX class.  
Each element contains the following data:
  ordp (long)    -- A power of the uniformizer to scale the unit by.  For 
                     unramified extensions this uniformizer is p, for 
                     eisenstein extensions it is not.  A value equal to the 
                     maximum value of a long indicates that the element is 
                     an exact zero.
  relprec (long) -- A signed integer giving the precision to which this 
                     element is defined.  For nonzero relprecs, the absolute 
                     value gives the power of the uniformizer modulo which 
                     the unit is defined.  A positive value indicates that 
                     the element is normalized (ie unit is actually a unit: 
                     in the case of eisenstein extensions the constant term 
                     is not divisible by p, in the case of unramified 
                     extensions that there is at least one coefficient that 
                     is not divisible by p).  A negative value indicates that 
                     the element may or may not be normalized.  A zero value 
                     indicates that the element is zero to some precision.
                     If so, ordp gives the absolute precision of the element.  
                     If ordp is the maximum value for a long, then the element
                     is an exact zero.
  unit (ZZ_pX_c) -- An ntl ZZ_pX storing the unit part.  The varible x is the 
                     uniformizer in the case of eisenstein extensions. If the 
                     element is not normalized, the "unit"  may or may not 
                     actually be a unit.  This ZZ_pX is created with global 
                     ntl modulus determined by the absolute value of relprec.  
                     If relprec is 0, unit IS NOT INITIALIZED, or destructed 
                     if normalized and found to be zero.  Otherwise, let r be 
                     relprec and e be the ramification index over Qp or Zp.  
                     Then the modulus of unit is given by p^ceil(r/e).  Note 
                     that all kinds of problems arise if you try to mix moduli.
                     ZZ_pX_conv_modulus gives a semi-safe way to convert 
                     between different moduli without having to pass through 
                     ZZX (see sage/libs/ntl/decl.pxi and c_lib/src/ntl_wrap.cpp)
    prime_pow (some subclass of PowComputer_ZZ_pX) -- a class, identical among 
                     all elements with the same parent, holding common data.
    prime_pow.deg -- The degree of the extension
    prime_pow.e   -- The ramification index
    prime_pow.f   -- The inertia degree
    prime_pow.prec_cap -- the unramified precision cap.  For eisenstein 
                      extensions this is the smallest power of p that is zero.
    prime_pow.ram_prec_cap -- the ramified precision cap.  For eisenstein 
                      extensions this will be the smallest power of x that is
                     indistinugishable from zero.
    prime_pow.pow_ZZ_tmp, prime_pow.pow_mpz_t_tmp, prime_pow.pow_Integer
                      -- functions for accessing powers of p.
                      The first two return pointers. 
                      See sage/rings/padics/pow_computer_ext for examples and 
                      important warnings.
    prime_pow.get_context, prime_pow.get_context_capdiv, prime_pow.get_top_context
                      -- obtain an ntl_ZZ_pContext_class corresponding to p^n.
                       The capdiv version divides by prime_pow.e as appropriate.
                       top_context corresponds to prec_cap.
    prime_pow.restore_context, prime_pow.restore_context_capdiv, prime_pow.restore_top_context 
                      -- restores the given context.
    prime_pow.get_modulus, get_modulus_capdiv, get_top_modulus 
                      -- Returns a ZZ_pX_Modulus_c* pointing to a polynomial 
                         modulus defined modulo p^n (appropriately divided by 
                         prime_pow.e in the capdiv case).

EXAMPLES:
An eisenstein extension:
    sage: R = Zp(5,5)
    sage: S.<x> = R[]
    sage: f = x^5 + 75*x^3 - 15*x^2 +125*x - 5
    sage: W.<w> = R.ext(f); W
    Eisenstein Extension of 5-adic Ring with capped relative precision 5 in w defined by (1 + O(5^5))*x^5 + (3*5^2 + O(5^7))*x^3 + (2*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + O(5^6))*x^2 + (5^3 + O(5^8))*x + (4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + O(5^6))
    sage: z = (1+w)^5; z
    1 + w^5 + w^6 + 2*w^7 + 4*w^8 + 3*w^10 + w^12 + 4*w^13 + 4*w^14 + 4*w^15 + 4*w^16 + 4*w^17 + 4*w^20 + w^21 + 4*w^24 + O(w^25)
    sage: y = z >> 1; y
    w^4 + w^5 + 2*w^6 + 4*w^7 + 3*w^9 + w^11 + 4*w^12 + 4*w^13 + 4*w^14 + 4*w^15 + 4*w^16 + 4*w^19 + w^20 + 4*w^23 + O(w^24)
    sage: y.valuation()
    4
    sage: y.precision_relative()
    20
    sage: y.precision_absolute()
    24
    sage: z - (y << 1)
    1 + O(w^25)
    sage: (1/w)^12+w
    w^-12 + w + O(w^13)
    sage: (1/w).parent()
    Eisenstein Extension of 5-adic Field with capped relative precision 5 in w defined by (1 + O(5^5))*x^5 + (3*5^2 + O(5^7))*x^3 + (2*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + O(5^6))*x^2 + (5^3 + O(5^8))*x + (4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + O(5^6))

An unramified extension:
    sage: g = x^3 + 3*x + 3
    sage: A.<a> = R.ext(g)
    sage: z = (1+a)^5; z
    (2*a^2 + 4*a) + (3*a^2 + 3*a + 1)*5 + (4*a^2 + 3*a + 4)*5^2 + (4*a^2 + 4*a + 4)*5^3 + (4*a^2 + 4*a + 4)*5^4 + O(5^5)
    sage: z - 1 - 5*a - 10*a^2 - 10*a^3 - 5*a^4 - a^5
    O(5^5)
    sage: y = z >> 1; y
    (3*a^2 + 3*a + 1) + (4*a^2 + 3*a + 4)*5 + (4*a^2 + 4*a + 4)*5^2 + (4*a^2 + 4*a + 4)*5^3 + O(5^4)
    sage: 1/a
    (3*a^2 + 4) + (a^2 + 4)*5 + (3*a^2 + 4)*5^2 + (a^2 + 4)*5^3 + (3*a^2 + 4)*5^4 + O(5^5)

Different printing modes:
    sage: R = Zp(5, print_mode='digits'); S.<x> = R[]; f = x^5 + 75*x^3 - 15*x^2 + 125*x -5; W.<w> = R.ext(f)
    sage: z = (1+w)^5; repr(z)
    '...4110403113210310442221311242000111011201102002023303214332011214403232013144001400444441030421100001'
    sage: R = Zp(5, print_mode='bars'); S.<x> = R[]; g = x^3 + 3*x + 3; A.<a> = R.ext(g)
    sage: z = (1+a)^5; repr(z)
    '...[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 4, 4]|[4, 3, 4]|[1, 3, 3]|[0, 4, 2]'
    sage: R = Zp(5, print_mode='terse'); S.<x> = R[]; f = x^5 + 75*x^3 - 15*x^2 + 125*x -5; W.<w> = R.ext(f)
    sage: z = (1+w)^5; z
    6 + 95367431640505*w + 25*w^2 + 95367431640560*w^3 + 5*w^4 + O(w^100)
    sage: R = Zp(5, print_mode='val-unit'); S.<x> = R[]; f = x^5 + 75*x^3 - 15*x^2 + 125*x -5; W.<w> = R.ext(f)
    sage: y = (1+w)^5 - 1; y
    w^5 * (2090041 + 19073486126901*w + 1258902*w^2 + 674*w^3 + 16785*w^4) + O(w^100)

You can get at the underlying ntl unit:
    sage: z._ntl_rep()
    [6 95367431640505 25 95367431640560 5]
    sage: y._ntl_rep()
    [2090041 19073486126901 1258902 674 16785]
    sage: y._ntl_rep_abs()
    ([5 95367431640505 25 95367431640560 5], 0)
    
NOTES:
    If you get an error 'internal error: can't grow this _ntl_gbigint,' it 
    indicates that moduli are being mixed inappropriately somewhere.
    For example, when calling a function with a ZZ_pX_c as an argument, it 
    copies.  If the modulus is not set to the modulus of the ZZ_pX_c, you 
    can get errors.

AUTHORS:
    -- David Roe  (2008-01-01) initial version



Classes [hide private]
  pAdicZZpXCRElement
Functions [hide private]
 
make_ZZpXCRElement(...)
File: sage/rings/padics/padic_ZZ_pX_CR_element.pyx (starting at line 2959)