p-Adic Extension Generic

A common superclass for all extensions of Qp and Zp.

AUTHORS:

  • David Roe
class sage.rings.padics.padic_extension_generic.DefPolyConversion

Bases: sage.categories.morphism.Morphism

Conversion map between p-adic rings/fields with the same defining polynomial.

INPUT:

  • R – a p-adic extension ring or field.
  • S – a p-adic extension ring or field with the same defining polynomial.

EXAMPLES:

sage: R.<a> = Zq(125, print_mode='terse')
sage: S = R.change(prec = 15, type='floating-point')
sage: a - 1
95367431640624 + a + O(5^20)
sage: S(a - 1)
30517578124 + a + O(5^15)
sage: R.<a> = Zq(125, print_mode='terse')
sage: S = R.change(prec = 15, type='floating-point')
sage: f = S.convert_map_from(R)
sage: TestSuite(f).run()
class sage.rings.padics.padic_extension_generic.pAdicExtensionGeneric(poly, prec, print_mode, names, element_class)

Bases: sage.rings.padics.padic_generic.pAdicGeneric

Initialization

EXAMPLES:

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) #indirect doctest
construction(forbid_frac_field=False)

Returns the functorial construction of this ring, namely, the algebraic extension of the base ring defined by the given polynomial.

Also preserves other information that makes this ring unique (e.g. precision, rounding, print mode).

INPUT:

EXAMPLES:

sage: R.<a> = Zq(25, 8, print_mode='val-unit')
sage: c, R0 = R.construction(); R0
5-adic Ring with capped relative precision 8
sage: c(R0)
5-adic Unramified Extension Ring in a defined by x^2 + 4*x + 2
sage: c(R0) == R
True

For a field, by default we return a fraction field functor.

sage: K.<a> = Qq(25, 8) sage: c, R = K.construction(); R 5-adic Unramified Extension Ring in a defined by x^2 + 4*x + 2 sage: c FractionField

If you prefer an extension functor, you can use the forbit_frac_field keyword:

sage: c, R = K.construction(forbid_frac_field=True); R
5-adic Field with capped relative precision 8
sage: c
AlgebraicExtensionFunctor
sage: c(R) is K
True
defining_polynomial(var=None, exact=False)

Returns the polynomial defining this extension.

INPUT:

  • var – string (default: 'x'), the name of the variable
  • exact – boolean (default False), whether to return the underlying exact
    defining polynomial rather than the one with coefficients in the base ring.

EXAMPLES:

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: W.defining_polynomial()
(1 + O(5^5))*x^5 + O(5^6)*x^4 + (3*5^2 + O(5^6))*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^6))*x + 4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + O(5^6)
sage: W.defining_polynomial(exact=True)
x^5 + 75*x^3 - 15*x^2 + 125*x - 5

sage: W.defining_polynomial(var='y', exact=True)
y^5 + 75*y^3 - 15*y^2 + 125*y - 5
exact_field()

Return a number field with the same defining polynomial.

Note that this method always returns a field, even for a p-adic ring.

EXAMPLES:

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: W.exact_field()
Number Field in w with defining polynomial x^5 + 75*x^3 - 15*x^2 + 125*x - 5
exact_ring()

Return the order with the same defining polynomial.

Will raise a ValueError if the coefficients of the defining polynomial are not integral.

EXAMPLES:

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: W.exact_ring()
Order in Number Field in w with defining polynomial x^5 + 75*x^3 - 15*x^2 + 125*x - 5

sage: T = Zp(5,5)
sage: U.<z> = T[]
sage: g = 2*z^4 + 1
sage: V.<v> = T.ext(g)
sage: V.exact_ring()
Traceback (most recent call last):
...
ValueError: each generator must be integral
ground_ring()

Returns the ring of which this ring is an extension.

EXAMPLES:

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: W.ground_ring()
5-adic Ring with capped relative precision 5
ground_ring_of_tower()

Returns the p-adic base ring of which this is ultimately an extension.

Currently this function is identical to ground_ring(), since relative extensions have not yet been implemented.

EXAMPLES:

sage: Qq(27,30,names='a').ground_ring_of_tower()
3-adic Field with capped relative precision 30
modulus(exact=False)

Returns the polynomial defining this extension.

INPUT:

  • exact – boolean (default False), whether to return the underlying exact
    defining polynomial rather than the one with coefficients in the base ring.

EXAMPLES:

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: W.modulus()
(1 + O(5^5))*x^5 + O(5^6)*x^4 + (3*5^2 + O(5^6))*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^6))*x + 4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + O(5^6)
sage: W.modulus(exact=True)
x^5 + 75*x^3 - 15*x^2 + 125*x - 5
polynomial_ring()

Returns the polynomial ring of which this is a quotient.

EXAMPLES:

sage: Qq(27,30,names='a').polynomial_ring()
Univariate Polynomial Ring in x over 3-adic Field with capped relative precision 30
random_element()

Return a random element of self.

This is done by picking a random element of the ground ring self.degree() times, then treating those elements as coefficients of a polynomial in self.gen().

EXAMPLES:

sage: R.<a> = Zq(125, 5); R.random_element()
(3*a^2 + 3*a + 3) + (a^2 + 4*a + 1)*5 + (3*a^2 + 4*a + 1)*5^2 + 
(2*a^2 + 3*a + 3)*5^3 + (4*a^2 + 3)*5^4 + O(5^5)
sage: R = Zp(5,3); S.<x> = ZZ[]; f = x^5 + 25*x^2 - 5; W.<w> = R.ext(f)
sage: W.random_element()
4 + 3*w + w^2 + 4*w^3 + w^5 + 3*w^6 + w^7 + 4*w^10 + 2*w^12 + 4*w^13 + 3*w^14 + O(w^15)