A generic superclass for all p-adic parents.
AUTHORS:
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
Bases: sage.rings.ring.PrincipalIdealDomain, sage.rings.padics.local_generic.LocalGeneric
Returns the characteristic of self, which is always 0.
INPUT:
self -- a p-adic parent
OUTPUT:
integer -- self's characteristic, i.e., 0
EXAMPLES:
sage: R = Zp(3, 10,'fixed-mod'); R.characteristic()
0
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))
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)]
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
Returns the prime, ie the characteristic of the residue field.
INPUT:
self -- a p-adic parent
OUTPUT:
integer -- the characteristic of the residue field
EXAMPLES:
sage: R = Zp(3,5,'fixed-mod')
sage: R.prime()
3
Returns the current print mode as a string.
INPUT:
self -- a p-adic field
OUTPUT:
string -- self's print mode
EXAMPLES:
sage: R = Qp(7,5, 'capped-rel')
sage: R.print_mode()
'series'
Returns the prime, i.e., the characteristic of the residue field.
INPUT:
self -- a p-adic ring
OUTPUT:
integer -- the characteristic of the residue field
EXAMPLES:
sage: R = Zp(3,5,'fixed-mod')
sage: R.residue_characteristic()
3
Returns the residue class field.
INPUT:
self -- a p-adic ring
OUTPUT:
the residue field
EXAMPLES:
sage: R = Zp(3,5,'fixed-mod')
sage: k = R.residue_class_field()
sage: k
Finite Field of size 3
Returns the residue class field.
INPUT:
self -- a p-adic ring
OUTPUT:
the residue field
EXAMPLES:
sage: R = Zp(3,5,'fixed-mod')
sage: k = R.residue_field()
sage: k
Finite Field of size 3
Returns a list of elements representing all the residue classes.
INPUT:
self -- a p-adic ring
OUTPUT:
list of elements -- a list of elements representing all the residue classes
EXAMPLES:
sage: R = Zp(3, 5,'fixed-mod')
sage: R.residue_system()
[O(3^5), 1 + O(3^5), 2 + O(3^5)]
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:
Returns a set of teichmuller representatives for the invertible elements of .
INPUT:
OUTPUT:
EXAMPLES:
sage: R = Zp(3, 5,'fixed-mod', 'terse')
sage: R.teichmuller_system()
[1 + O(3^5), 242 + O(3^5)]
NOTES:
Should this return 0 as well?
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)