\(p\)-adic Base Generic¶
A superclass for implementations of \(\ZZ_p\) and \(\QQ_p\).
AUTHORS:
- David Roe 
- class sage.rings.padics.padic_base_generic.pAdicBaseGeneric(p, prec, print_mode, names, element_class, category=None)[source]¶
- Bases: - pAdicGeneric- Initialization. - absolute_discriminant()[source]¶
- Return the absolute discriminant of this \(p\)-adic ring. - EXAMPLES: - sage: Zp(5).absolute_discriminant() 1 - >>> from sage.all import * >>> Zp(Integer(5)).absolute_discriminant() 1 
 - discriminant(K=None)[source]¶
- Return the discriminant of this \(p\)-adic ring over - K.- INPUT: - self– a \(p\)-adic ring
- K– a sub-ring of- selfor- None(default:- None)
 - OUTPUT: - integer; the discriminant of this ring over - K(or the absolute discriminant if- Kis- None)- EXAMPLES: - sage: Zp(5).discriminant() 1 - >>> from sage.all import * >>> Zp(Integer(5)).discriminant() 1 
 - exact_field()[source]¶
- Return the rational field. - For compatibility with extensions of \(p\)-adics. - EXAMPLES: - sage: Zp(5).exact_field() Rational Field - >>> from sage.all import * >>> Zp(Integer(5)).exact_field() Rational Field 
 - exact_ring()[source]¶
- Return the integer ring. - EXAMPLES: - sage: Zp(5).exact_ring() Integer Ring - >>> from sage.all import * >>> Zp(Integer(5)).exact_ring() Integer Ring 
 - gen(n=0)[source]¶
- Return the \(n\)-th generator of this extension. For base rings/fields, we consider the generator to be the prime. - EXAMPLES: - sage: R = Zp(5); R.gen() 5 + O(5^21) - >>> from sage.all import * >>> R = Zp(Integer(5)); R.gen() 5 + O(5^21) 
 - has_pth_root()[source]¶
- Return whether or not \(\ZZ_p\) has a primitive \(p\)-th root of unity. - EXAMPLES: - sage: Zp(2).has_pth_root() True sage: Zp(17).has_pth_root() False - >>> from sage.all import * >>> Zp(Integer(2)).has_pth_root() True >>> Zp(Integer(17)).has_pth_root() False 
 - has_root_of_unity(n)[source]¶
- Return whether or not \(\ZZ_p\) has a primitive \(n\)-th root of unity. - INPUT: - self– a \(p\)-adic ring
- n– integer
 - OUTPUT: - boolean; whether - selfhas primitive \(n\)-th root of unity- EXAMPLES: - sage: R=Zp(37) sage: R.has_root_of_unity(12) True sage: R.has_root_of_unity(11) False - >>> from sage.all import * >>> R=Zp(Integer(37)) >>> R.has_root_of_unity(Integer(12)) True >>> R.has_root_of_unity(Integer(11)) False 
 - is_abelian()[source]¶
- Return whether the Galois group is abelian, i.e. - True. #should this be automorphism group?- EXAMPLES: - sage: R = Zp(3, 10,'fixed-mod'); R.is_abelian() True - >>> from sage.all import * >>> R = Zp(Integer(3), Integer(10),'fixed-mod'); R.is_abelian() True 
 - is_isomorphic(ring)[source]¶
- Return whether - selfand- ringare isomorphic, i.e. whether- ringis an implementation of \(\ZZ_p\) for the same prime as- self.- INPUT: - self– a \(p\)-adic ring
- ring– a ring
 - OUTPUT: - boolean– whether- ringis an implementation of ZZ_p` for the same prime as- self- EXAMPLES: - sage: R = Zp(5, 15, print_mode='digits'); S = Zp(5, 44, print_max_terms=4); R.is_isomorphic(S) True - >>> from sage.all import * >>> R = Zp(Integer(5), Integer(15), print_mode='digits'); S = Zp(Integer(5), Integer(44), print_max_terms=Integer(4)); R.is_isomorphic(S) True 
 - is_normal()[source]¶
- Return whether or not this is a normal extension, i.e. - True.- EXAMPLES: - sage: R = Zp(3, 10,'fixed-mod'); R.is_normal() True - >>> from sage.all import * >>> R = Zp(Integer(3), Integer(10),'fixed-mod'); R.is_normal() True 
 - modulus(exact=False)[source]¶
- Return the polynomial defining this extension. - For compatibility with extension fields; we define the modulus to be \(x-1\). - INPUT: - exact– boolean (default:- False); whether to return a polynomial with integer entries
 - EXAMPLES: - sage: Zp(5).modulus(exact=True) x - >>> from sage.all import * >>> Zp(Integer(5)).modulus(exact=True) x 
 - plot(max_points=2500, **args)[source]¶
- Create a visualization of this \(p\)-adic ring as a fractal similar to a generalization of the Sierpi'nski triangle. - The resulting image attempts to capture the algebraic and topological characteristics of \(\ZZ_p\). - INPUT: - max_points– the maximum number or points to plot, which controls the depth of recursion (default: 2500)
- **args– color, size, etc. that are passed to the underlying point graphics objects
 - REFERENCES: - Cuoco, A. ‘’Visualizing the \(p\)-adic Integers’’, The American Mathematical Monthly, Vol. 98, No. 4 (Apr., 1991), pp. 355-364 
 - EXAMPLES: - sage: Zp(3).plot() # needs sage.plot Graphics object consisting of 1 graphics primitive sage: Zp(5).plot(max_points=625) # needs sage.plot Graphics object consisting of 1 graphics primitive sage: Zp(23).plot(rgbcolor=(1,0,0)) # needs sage.plot Graphics object consisting of 1 graphics primitive - >>> from sage.all import * >>> Zp(Integer(3)).plot() # needs sage.plot Graphics object consisting of 1 graphics primitive >>> Zp(Integer(5)).plot(max_points=Integer(625)) # needs sage.plot Graphics object consisting of 1 graphics primitive >>> Zp(Integer(23)).plot(rgbcolor=(Integer(1),Integer(0),Integer(0))) # needs sage.plot Graphics object consisting of 1 graphics primitive 
 - uniformizer()[source]¶
- Return a uniformizer for this ring. - EXAMPLES: - sage: R = Zp(3,5,'fixed-mod', 'series') sage: R.uniformizer() 3 - >>> from sage.all import * >>> R = Zp(Integer(3),Integer(5),'fixed-mod', 'series') >>> R.uniformizer() 3 
 - uniformizer_pow(n)[source]¶
- Return the \(n\)-th power of the uniformizer of - self(as an element of- self).- EXAMPLES: - sage: R = Zp(5) sage: R.uniformizer_pow(5) 5^5 + O(5^25) sage: R.uniformizer_pow(infinity) 0 - >>> from sage.all import * >>> R = Zp(Integer(5)) >>> R.uniformizer_pow(Integer(5)) 5^5 + O(5^25) >>> R.uniformizer_pow(infinity) 0 
 - zeta(n=None)[source]¶
- Return a generator of the group of roots of unity. - INPUT: - self– a \(p\)-adic ring
- n– integer or- None(default:- None)
 - OUTPUT: - element; a generator of the \(n\)-th roots of unity, or a generator of the full group of roots of unity if- nis- None- EXAMPLES: - sage: R = Zp(37,5) sage: R.zeta(12) 8 + 24*37 + 37^2 + 29*37^3 + 23*37^4 + O(37^5) - >>> from sage.all import * >>> R = Zp(Integer(37),Integer(5)) >>> R.zeta(Integer(12)) 8 + 24*37 + 37^2 + 29*37^3 + 23*37^4 + O(37^5)