p-Adic Generic¶
A generic superclass for all p-adic parents.
AUTHORS:
- David Roe
- Genya Zaytman: documentation
- David Harvey: doctests
- Julian Rueth (2013-03-16): test methods for basic arithmetic
-
sage.rings.padics.padic_generic.
local_print_mode
(obj, print_options, pos=None, ram_name=None)¶ Context manager for safely temporarily changing the print_mode of a p-adic ring/field.
EXAMPLES:
sage: R = Zp(5) sage: R(45) 4*5 + 5^2 + O(5^21) sage: with local_print_mode(R, 'val-unit'): ....: print(R(45)) 5 * 9 + O(5^21)
NOTES:
For more documentation see localvars in parent_gens.pyx
-
class
sage.rings.padics.padic_generic.
pAdicGeneric
(base, p, prec, print_mode, names, element_class, category=None)¶ Bases:
sage.rings.ring.PrincipalIdealDomain
,sage.rings.padics.local_generic.LocalGeneric
Initialization.
INPUT:
- base – Base ring.
- p – prime
- print_mode – dictionary of print options
- names – how to print the uniformizer
- element_class – the class for elements of this ring
EXAMPLES:
sage: R = Zp(17) #indirect doctest
-
characteristic
()¶ Returns the characteristic of self, which is always 0.
INPUT:
self – a p-adic parentOUTPUT:
integer – self’s characteristic, i.e., 0EXAMPLES:
sage: R = Zp(3, 10,'fixed-mod'); R.characteristic() 0
-
extension
(modulus, prec=None, names=None, print_mode=None, halt=None, implementation='FLINT', **kwds)¶ Create an extension of this p-adic ring.
EXAMPLES:
sage: k = Qp(5) sage: R.<x> = k[] sage: l.<w> = k.extension(x^2-5); l Eisenstein Extension of 5-adic Field with capped relative precision 20 in w defined by (1 + O(5^20))*x^2 + (O(5^21))*x + (4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + 4*5^6 + 4*5^7 + 4*5^8 + 4*5^9 + 4*5^10 + 4*5^11 + 4*5^12 + 4*5^13 + 4*5^14 + 4*5^15 + 4*5^16 + 4*5^17 + 4*5^18 + 4*5^19 + 4*5^20 + O(5^21)) sage: F = list(Qp(19)['x'](cyclotomic_polynomial(5)).factor())[0][0] sage: L = Qp(19).extension(F, names='a') sage: L Unramified Extension of 19-adic Field with capped relative precision 20 in a defined by (1 + O(19^20))*x^2 + (5 + 2*19 + 10*19^2 + 14*19^3 + 7*19^4 + 13*19^5 + 5*19^6 + 12*19^7 + 8*19^8 + 4*19^9 + 14*19^10 + 6*19^11 + 5*19^12 + 13*19^13 + 16*19^14 + 4*19^15 + 17*19^16 + 8*19^18 + 4*19^19 + O(19^20))*x + (1 + O(19^20))
-
frobenius_endomorphism
(n=1)¶ INPUT:
n
– an integer (default: 1)
OUTPUT:
The \(n\)-th power of the absolute arithmetic Frobenius endomorphism on this field.
EXAMPLES:
sage: K.<a> = Qq(3^5) sage: Frob = K.frobenius_endomorphism(); Frob Frobenius endomorphism on Unramified Extension of 3-adic Field ... lifting a |--> a^3 on the residue field sage: Frob(a) == a.frobenius() True
We can specify a power:
sage: K.frobenius_endomorphism(2) Frobenius endomorphism on Unramified Extension of 3-adic Field ... lifting a |--> a^(3^2) on the residue field
The result is simplified if possible:
sage: K.frobenius_endomorphism(6) Frobenius endomorphism on Unramified Extension of 3-adic Field ... lifting a |--> a^3 on the residue field sage: K.frobenius_endomorphism(5) Identity endomorphism of Unramified Extension of 3-adic Field ...
Comparisons work:
sage: K.frobenius_endomorphism(6) == Frob True
-
gens
()¶ Returns a list of generators.
EXAMPLES:
sage: R = Zp(5); R.gens() [5 + O(5^21)] sage: Zq(25,names='a').gens() [a + O(5^20)] sage: S.<x> = ZZ[]; f = x^5 + 25*x -5; W.<w> = R.ext(f); W.gens() [w + O(w^101)]
-
ngens
()¶ Returns the number of generators of self.
We conventionally define this as 1: for base rings, we take a uniformizer as the generator; for extension rings, we take a root of the minimal polynomial defining the extension.
EXAMPLES:
sage: Zp(5).ngens() 1 sage: Zq(25,names='a').ngens() 1
-
prime
()¶ Returns the prime, ie the characteristic of the residue field.
INPUT:
self – a p-adic parentOUTPUT:
integer – the characteristic of the residue fieldEXAMPLES:
sage: R = Zp(3,5,'fixed-mod') sage: R.prime() 3
-
print_mode
()¶ Returns the current print mode as a string.
INPUT:
self – a p-adic fieldOUTPUT:
string – self’s print modeEXAMPLES:
sage: R = Qp(7,5, 'capped-rel') sage: R.print_mode() 'series'
-
residue_characteristic
()¶ Return the prime, i.e., the characteristic of the residue field.
OUTPUT:
integer – the characteristic of the residue field
EXAMPLES:
sage: R = Zp(3,5,'fixed-mod') sage: R.residue_characteristic() 3
-
residue_class_field
()¶ Returns the residue class field.
INPUT:
self – a p-adic ringOUTPUT:
the residue fieldEXAMPLES:
sage: R = Zp(3,5,'fixed-mod') sage: k = R.residue_class_field() sage: k Finite Field of size 3
-
residue_field
()¶ Returns the residue class field.
INPUT:
self – a p-adic ringOUTPUT:
the residue fieldEXAMPLES:
sage: R = Zp(3,5,'fixed-mod') sage: k = R.residue_field() sage: k Finite Field of size 3
-
residue_system
()¶ Returns a list of elements representing all the residue classes.
INPUT:
self – a p-adic ringOUTPUT:
list of elements – a list of elements representing all the residue classesEXAMPLES:
sage: R = Zp(3, 5,'fixed-mod') sage: R.residue_system() [O(3^5), 1 + O(3^5), 2 + O(3^5)]
-
some_elements
()¶ Returns a list of elements in this ring.
This is typically used for running generic tests (see
TestSuite
).EXAMPLES:
sage: Zp(2,4).some_elements() [0, 1 + O(2^4), 2 + O(2^5), 1 + 2^2 + 2^3 + O(2^4), 2 + 2^2 + 2^3 + 2^4 + O(2^5)]
-
teichmuller
(x, prec=None)¶ Returns the teichmuller representative of x.
INPUT:
- self – a p-adic ring
- x – something that can be cast into self
OUTPUT:
- element – the teichmuller lift of x
EXAMPLES:
sage: R = Zp(5, 10, 'capped-rel', 'series') sage: R.teichmuller(2) 2 + 5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10) sage: R = Qp(5, 10,'capped-rel','series') sage: R.teichmuller(2) 2 + 5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10) sage: R = Zp(5, 10, 'capped-abs', 'series') sage: R.teichmuller(2) 2 + 5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10) sage: R = Zp(5, 10, 'fixed-mod', 'series') sage: R.teichmuller(2) 2 + 5 + 2*5^2 + 5^3 + 3*5^4 + 4*5^5 + 2*5^6 + 3*5^7 + 3*5^9 + O(5^10) 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) sage: y = W.teichmuller(3); y 3 + 3*w^5 + w^7 + 2*w^9 + 2*w^10 + 4*w^11 + w^12 + 2*w^13 + 3*w^15 + 2*w^16 + 3*w^17 + w^18 + 3*w^19 + 3*w^20 + 2*w^21 + 2*w^22 + 3*w^23 + 4*w^24 + O(w^25) sage: y^5 == y True sage: g = x^3 + 3*x + 3 sage: A.<a> = R.ext(g) sage: b = A.teichmuller(1 + 2*a - a^2); b (4*a^2 + 2*a + 1) + 2*a*5 + (3*a^2 + 1)*5^2 + (a + 4)*5^3 + (a^2 + a + 1)*5^4 + O(5^5) sage: b^125 == b True
AUTHORS:
- Initial version: David Roe
- Quadratic time version: Kiran Kedlaya <kedlaya@math.mit.edu> (3/27/07)
-
teichmuller_system
()¶ Returns a set of teichmuller representatives for the invertible elements of \(\ZZ / p\ZZ\).
INPUT:
- self – a p-adic ring
OUTPUT:
- list of elements – a list of teichmuller representatives for the invertible elements of \(\ZZ / p\ZZ\)
EXAMPLES:
sage: R = Zp(3, 5,'fixed-mod', 'terse') sage: R.teichmuller_system() [1 + O(3^5), 242 + O(3^5)]
Check that trac ticket #20457 is fixed:
sage: F.<a> = Qq(5^2,6) sage: F.teichmuller_system()[3] (2*a + 2) + (4*a + 1)*5 + 4*5^2 + (2*a + 1)*5^3 + (4*a + 1)*5^4 + (2*a + 3)*5^5 + O(5^6)
NOTES:
Should this return 0 as well?
-
uniformizer_pow
(n)¶ Returns p^n, as an element of self.
If n is infinity, returns 0.
EXAMPLES:
sage: R = Zp(3, 5, 'fixed-mod') sage: R.uniformizer_pow(3) 3^3 + O(3^5) sage: R.uniformizer_pow(infinity) O(3^5)