Local Generic

Superclass for \(p\)-adic and power series rings.

AUTHORS:

  • David Roe
class sage.rings.padics.local_generic.LocalGeneric(base, prec, names, element_class, category=None)

Bases: sage.rings.ring.CommutativeRing

Initializes self.

EXAMPLES:

sage: R = Zp(5) #indirect doctest
sage: R.precision_cap()
20

In trac ticket #14084, the category framework has been implemented for p-adic rings:

sage: TestSuite(R).run()
sage: K = Qp(7)
sage: TestSuite(K).run()
change(**kwds)

Return a new ring with changed attributes.

INPUT:

The following arguments are applied to every ring in the tower:

  • type – string, the precision type
  • p – the prime of the ground ring. Defining polynomials
    will be converted to the new base rings.
  • print_mode – string
  • print_pos – bool
  • print_sep – string
  • print_alphabet – dict
  • show_prec – bool
  • check – bool

The following arguments are only applied to the top ring in the tower:

  • var_name – string
  • res_name – string
  • unram_name – string
  • ram_name – string
  • names – string
  • modulus – polynomial

The following arguments have special behavior:

  • prec – integer. If the precision is increased on an extension ring,
    the precision on the base is increased as necessary (respecting ramification). If the precision is decreased, the precision of the base is unchanged.
  • field – bool. If True, switch to a tower of fields via the fraction field.
    If False, switch to a tower of rings of integers.
  • q – prime power. Replace the initial unramified extension of \(\QQ_p\) or \(\ZZ_p\)
    with an unramified extension of residue cardinality \(q\). If the initial extension is ramified, add in an unramified extension.
  • base – ring or field. Use a specific base ring instead of recursively
    calling change() down the tower.

See the constructors for more details on the meaning of these arguments.

EXAMPLES:

We can use this method to change the precision:

sage: Zp(5).change(prec=40)
5-adic Ring with capped relative precision 40

or the precision type:

sage: Zp(5).change(type="capped-abs")
5-adic Ring with capped absolute precision 20

or even the prime:

sage: ZpCA(3).change(p=17)
17-adic Ring with capped absolute precision 20

You can switch between the ring of integers and its fraction field:

sage: ZpCA(3).change(field=True)
3-adic Field with capped relative precision 20

You can also change print modes:

sage: R = Zp(5).change(prec=5, print_mode='digits')
sage: repr(~R(17))
'...13403'

Changing print mode to ‘digits’ works for Eisenstein extensions:

sage: S.<x> = ZZ[]
sage: W.<w> = Zp(3).extension(x^4 + 9*x^2 + 3*x - 3)
sage: W.print_mode()
'series'
sage: W.change(print_mode='digits').print_mode()
'digits'

You can change extensions:

sage: K.<a> = QqFP(125, prec=4)
sage: K.change(q=64)
Unramified Extension in a defined by x^6 + x^4 + x^3 + x + 1 with floating precision 4 over 2-adic Field
sage: R.<x> = QQ[]
sage: K.change(modulus = x^2 - x + 2, print_pos=False)
Unramified Extension in a defined by x^2 - x + 2 with floating precision 4 over 5-adic Field

and variable names:

sage: K.change(names='b')
Unramified Extension in b defined by x^3 + 3*x + 3 with floating precision 4 over 5-adic Field

and precision:

sage: Kup = K.change(prec=8); Kup
Unramified Extension in a defined by x^3 + 3*x + 3 with floating precision 8 over 5-adic Field
sage: Kup.base_ring()
5-adic Field with floating precision 8

If you decrease the precision, the precision of the base stays the same:

sage: Kdown = K.change(prec=2); Kdown
Unramified Extension in a defined by x^3 + 3*x + 3 with floating precision 2 over 5-adic Field
sage: Kdown.precision_cap()
2
sage: Kdown.base_ring()
5-adic Field with floating precision 4

Changing the prime works for extensions:

sage: x = polygen(ZZ)
sage: R.<a> = Zp(5).extension(x^2 + 2)
sage: S = R.change(p=7)
sage: S.defining_polynomial(exact=True)
x^2 + 2
sage: A.<y> = Zp(5)[]
sage: R.<a> = Zp(5).extension(y^2 + 2)
sage: S = R.change(p=7)
sage: S.defining_polynomial(exact=True)
y^2 + 2
sage: R.<a> = Zq(5^3)
sage: S = R.change(prec=50)
sage: S.defining_polynomial(exact=True)
x^3 + 3*x + 3
defining_polynomial(var='x')

Returns the defining polynomial of this local ring, i.e. just x.

INPUT:

  • self – a local ring
  • var – string (default: 'x') the name of the variable

OUTPUT:

  • polynomial – the defining polynomial of this ring as an extension over its ground ring

EXAMPLES:

sage: R = Zp(3, 3, 'fixed-mod'); R.defining_polynomial('foo')
(1 + O(3^3))*foo + (O(3^3))
degree()

Returns the degree of self over the ground ring, i.e. 1.

INPUT:

  • self – a local ring

OUTPUT:

  • integer – the degree of this ring, i.e., 1

EXAMPLES:

sage: R = Zp(3, 10, 'capped-rel'); R.degree()
1
e(K=None)

Returns the ramification index over the ground ring: 1 unless overridden.

INPUT:

  • self – a local ring
  • K – a subring of self (default None)

OUTPUT:

  • integer – the ramification index of this ring: 1 unless overridden.

EXAMPLES:

sage: R = Zp(3, 5, 'capped-rel'); R.e()
1
ext(*args, **kwds)

Constructs an extension of self. See extension for more details.

EXAMPLES:

sage: A = Zp(7,10)
sage: S.<x> = A[]
sage: B.<t> = A.ext(x^2+7)
sage: B.uniformiser()
t + O(t^21)
f(K=None)

Returns the inertia degree over the ground ring: 1 unless overridden.

INPUT:

  • self – a local ring
  • K – a subring (default None)

OUTPUT:

  • integer – the inertia degree of this ring: 1 unless overridden.

EXAMPLES:

sage: R = Zp(3, 5, 'capped-rel'); R.f()
1
ground_ring()

Returns self.

Will be overridden by extensions.

INPUT:

  • self – a local ring

OUTPUT:

  • the ground ring of self, i.e., itself

EXAMPLES:

sage: R = Zp(3, 5, 'fixed-mod')
sage: S = Zp(3, 4, 'fixed-mod')
sage: R.ground_ring() is R
True
sage: S.ground_ring() is R
False
ground_ring_of_tower()

Returns self.

Will be overridden by extensions.

INPUT:

  • self – a \(p\)-adic ring

OUTPUT:

  • the ground ring of the tower for self, i.e., itself

EXAMPLES:

sage: R = Zp(5)
sage: R.ground_ring_of_tower()
5-adic Ring with capped relative precision 20
inertia_degree(K=None)

Returns the inertia degree over K (defaults to the ground ring): 1 unless overridden.

INPUT:

  • self – a local ring
  • K – a subring of self (default None)

OUTPUT:

  • integer – the inertia degree of this ring: 1 unless overridden.

EXAMPLES:

sage: R = Zp(3, 5, 'capped-rel'); R.inertia_degree()
1
inertia_subring()

Returns the inertia subring, i.e. self.

INPUT:

  • self – a local ring

OUTPUT:

  • the inertia subring of self, i.e., itself

EXAMPLES:

sage: R = Zp(5)
sage: R.inertia_subring()
5-adic Ring with capped relative precision 20
is_capped_absolute()

Returns whether this \(p\)-adic ring bounds precision in a capped absolute fashion.

The absolute precision of an element is the power of \(p\) modulo which that element is defined. In a capped absolute ring, the absolute precision of elements are bounded by a constant depending on the ring.

EXAMPLES:

sage: R = ZpCA(5, 15)
sage: R.is_capped_absolute()
True
sage: R(5^7)
5^7 + O(5^15)
sage: S = Zp(5, 15)
sage: S.is_capped_absolute()
False
sage: S(5^7)
5^7 + O(5^22)
is_capped_relative()

Returns whether this \(p\)-adic ring bounds precision in a capped relative fashion.

The relative precision of an element is the power of \(p\) modulo which the unit part of that element is defined. In a capped relative ring, the relative precision of elements are bounded by a constant depending on the ring.

EXAMPLES:

sage: R = ZpCA(5, 15)
sage: R.is_capped_relative()
False
sage: R(5^7)
5^7 + O(5^15)
sage: S = Zp(5, 15)
sage: S.is_capped_relative()
True
sage: S(5^7)
5^7 + O(5^22)
is_exact()

Returns whether this p-adic ring is exact, i.e. False.

INPUT:
self – a p-adic ring
OUTPUT:
boolean – whether self is exact, i.e. False.

EXAMPLES:

#sage: R = Zp(5, 3, 'lazy'); R.is_exact()
#False
sage: R = Zp(5, 3, 'fixed-mod'); R.is_exact()
False
is_finite()

Returns whether this ring is finite, i.e. False.

INPUT:

  • self – a \(p\)-adic ring

OUTPUT:

  • boolean – whether self is finite, i.e., False

EXAMPLES:

sage: R = Zp(3, 10,'fixed-mod'); R.is_finite()
False
is_fixed_mod()

Returns whether this \(p\)-adic ring bounds precision in a fixed modulus fashion.

The absolute precision of an element is the power of \(p\) modulo which that element is defined. In a fixed modulus ring, the absolute precision of every element is defined to be the precision cap of the parent. This means that some operations, such as division by \(p\), don’t return a well defined answer.

EXAMPLES:

sage: R = ZpFM(5,15)
sage: R.is_fixed_mod()
True
sage: R(5^7,absprec=9)
5^7 + O(5^15)
sage: S = ZpCA(5, 15)
sage: S.is_fixed_mod()
False
sage: S(5^7,absprec=9)
5^7 + O(5^9)
is_floating_point()

Returns whether this \(p\)-adic ring bounds precision in a floating point fashion.

The relative precision of an element is the power of \(p\) modulo which the unit part of that element is defined. In a floating point ring, elements do not store precision, but arithmetic operations truncate to a relative precision depending on the ring.

EXAMPLES:

sage: R = ZpCR(5, 15)
sage: R.is_floating_point()
False
sage: R(5^7)
5^7 + O(5^22)
sage: S = ZpFP(5, 15)
sage: S.is_floating_point()
True
sage: S(5^7)
5^7
is_lazy()

Returns whether this \(p\)-adic ring bounds precision in a lazy fashion.

In a lazy ring, elements have mechanisms for computing themselves to greater precision.

EXAMPLES:

sage: R = Zp(5)
sage: R.is_lazy()
False
maximal_unramified_subextension()

Returns the maximal unramified subextension.

INPUT:

  • self – a local ring

OUTPUT:

  • the maximal unramified subextension of self

EXAMPLES:

sage: R = Zp(5)
sage: R.maximal_unramified_subextension()
5-adic Ring with capped relative precision 20
precision_cap()

Returns the precision cap for self.

INPUT:

  • self – a local ring

OUTPUT:

  • integer – self’s precision cap

EXAMPLES:

sage: R = Zp(3, 10,'fixed-mod'); R.precision_cap()
10
sage: R = Zp(3, 10,'capped-rel'); R.precision_cap()
10
sage: R = Zp(3, 10,'capped-abs'); R.precision_cap()
10

Note

This will have different meanings depending on the type of local ring. For fixed modulus rings, all elements are considered modulo self.prime()^self.precision_cap(). For rings with an absolute cap (i.e. the class pAdicRingCappedAbsolute), each element has a precision that is tracked and is bounded above by self.precision_cap(). Rings with relative caps (e.g. the class pAdicRingCappedRelative) are the same except that the precision is the precision of the unit part of each element. For lazy rings, this gives the initial precision to which elements are computed.

ramification_index(K=None)

Returns the ramification index over the ground ring: 1 unless overridden.

INPUT:

  • self – a local ring

OUTPUT:

  • integer – the ramification index of this ring: 1 unless overridden.

EXAMPLES:

sage: R = Zp(3, 5, 'capped-rel'); R.ramification_index()
1
residue_characteristic()

Returns the characteristic of self’s residue field.

INPUT:

  • self – a p-adic ring.

OUTPUT:

  • integer – the characteristic of the residue field.

EXAMPLES:

sage: R = Zp(3, 5, 'capped-rel'); R.residue_characteristic()
3
residue_class_degree(K=None)

Returns the inertia degree over the ground ring: 1 unless overridden.

INPUT:

  • self – a local ring
  • K – a subring (default None)

OUTPUT:

  • integer – the inertia degree of this ring: 1 unless overridden.

EXAMPLES:

sage: R = Zp(3, 5, 'capped-rel'); R.residue_class_degree()
1
uniformiser()

Returns a uniformiser for self, ie a generator for the unique maximal ideal.

EXAMPLES:

sage: R = Zp(5)
sage: R.uniformiser()
5 + O(5^21)
sage: A = Zp(7,10)
sage: S.<x> = A[]
sage: B.<t> = A.ext(x^2+7)
sage: B.uniformiser()
t + O(t^21)
uniformiser_pow(n)

Returns the \(n`th power of the uniformiser of ``self`\) (as an element of self).

EXAMPLES:

sage: R = Zp(5)
sage: R.uniformiser_pow(5)
5^5 + O(5^25)