p-Adic Capped Absolute Element.

Elements of p-Adic Rings with Absolute Precision Cap

AUTHORS:

  • David Roe
  • Genya Zaytman: documentation
  • David Harvey: doctests
sage.rings.padics.padic_capped_absolute_element.clear_mpz_globals()
sage.rings.padics.padic_capped_absolute_element.gmp_randrange(n1, n2)
sage.rings.padics.padic_capped_absolute_element.init_mpz_globals()
sage.rings.padics.padic_capped_absolute_element.make_pAdicCappedAbsoluteElement(parent, x, absprec)

Unpickles a capped absolute element.

EXAMPLES:

sage: from sage.rings.padics.padic_capped_absolute_element import make_pAdicCappedAbsoluteElement
sage: R = ZpCA(5)
sage: a = make_pAdicCappedAbsoluteElement(R, 17*25, 5); a
2*5^2 + 3*5^3 + O(5^5)
class sage.rings.padics.padic_capped_absolute_element.pAdicCappedAbsoluteElement

Bases: sage.rings.padics.padic_base_generic_element.pAdicBaseGenericElement

add_bigoh(absprec)

Returns a new element with absolute precision decreased to prec. The precision never increases.

INPUT:

  • self – a p-adic element
  • prec – an integer

OUTPUT:

  • elementself with precision set to the minimum of self's precision and prec

EXAMPLES:

sage: R = Zp(7,4,'capped-abs','series'); a = R(8); a.add_bigoh(1)
1 + O(7)

sage: k = ZpCA(3,5)
sage: a = k(41); a
2 + 3 + 3^2 + 3^3 + O(3^5)
sage: a.add_bigoh(7)
2 + 3 + 3^2 + 3^3 + O(3^5)
sage: a.add_bigoh(3)
2 + 3 + 3^2 + O(3^3)            
is_equal_to(right, absprec=None)

Returns whether self is equal to right modulo p^absprec.

INPUT:

  • self – a p-adic element
  • right – a p-adic element with the same parent
  • absprec – an integer

OUTPUT:

  • boolean – whether self is equal to right

EXAMPLES:

sage: R = ZpCA(2, 6)
sage: R(13).is_equal_to(R(13))
True
sage: R(13).is_equal_to(R(13+2^10))
True
sage: R(13).is_equal_to(R(17), 2)
True
sage: R(13).is_equal_to(R(17), 5)
False
is_zero(absprec=None)

Returns whether self is zero modulo p^absprec.

INPUT:

  • self – a p-adic element
  • prec – an integer

OUTPUT:

  • boolean – whether self is zero

EXAMPLES:

sage: R = ZpCA(17, 6)
sage: R(0).is_zero()
True
sage: R(17^6).is_zero()
True
sage: R(17^2).is_zero(absprec=2)
True
lift()

Returns an integer congruent to this p-adic element modulo p^self.absprec().

EXAMPLES:

sage: R = ZpCA(3)
sage: R(10).lift()
10
sage: R(-1).lift()
3486784400
lift_to_precision(absprec)

Returns a p-adic integer congruent to this p-adic element modulo p^absprec with precision at least absprec.

If such lifting would yield an element with precision greater than allowed by the precision cap of self‘s parent, an error is raised.

EXAMPLES:

sage: R = ZpCA(17)
sage: R(-1,2).lift_to_precision(10)
16 + 16*17 + O(17^10)
sage: R(1,15).lift_to_precision(10)
1 + O(17^15)
sage: R(1,15).lift_to_precision(30)
...
PrecisionError: Precision higher than allowed by the precision cap.
list(lift_mode='simple')

Returns a list of coefficients of p starting with p^0

INPUT:

  • self – a p-adic element
  • lift_mode'simple', 'smallest' or 'teichmuller' (default 'simple')

OUTPUT:

  • list – the list of coefficients of self

NOTES:

  • Returns a list [a_0, a_1, \ldots, a_n] so that:
    • If lift_mode = 'simple', a_i is an integer with 0
\le a_i < p.
    • If lift_mode = 'smallest', a_i is an integer with -p/2 < a_i \le p/2.
    • If lift_mode = 'teichmuller', a_i has the same parent as self and a_i^p \equiv a_i modulo p^(self.precision_absolute() - i)
  • \sum_{i = 0}^n a_i \cdot p^i = self, modulo the precision of self.

EXAMPLES:

sage: R = ZpCA(7,6); a = R(12837162817); a
3 + 4*7 + 4*7^2 + 4*7^4 + O(7^6)
sage: L = a.list(); L
[3, 4, 4, 0, 4]
sage: sum([L[i] * 7^i for i in range(len(L))]) == a
True
sage: L = a.list('smallest'); L
[3, -3, -2, 1, -3, 1]
sage: sum([L[i] * 7^i for i in range(len(L))]) == a
True
sage: L = a.list('teichmuller'); L
[3 + 4*7 + 6*7^2 + 3*7^3 + 2*7^5 + O(7^6),
O(7^5),
5 + 2*7 + 3*7^3 + O(7^4),
1 + O(7^3),
3 + 4*7 + O(7^2),
5 + O(7)]
sage: sum([L[i] * 7^i for i in range(len(L))])
3 + 4*7 + 4*7^2 + 4*7^4 + O(7^6)
multiplicative_order()

Returns the minimum possible multiplicative order of self.

INPUT:

  • self – a p-adic element

OUTPUT:

  • the multiplicative order of self. This is the minimum multiplicative order of all elements of \mathbb{Z}_p lifting self to infinite precision.

EXAMPLES:

sage: R = ZpCA(7, 6)
sage: R(1/3)
5 + 4*7 + 4*7^2 + 4*7^3 + 4*7^4 + 4*7^5 + O(7^6)
sage: R(1/3).multiplicative_order()
+Infinity
sage: R(7).multiplicative_order()
+Infinity
sage: R(1).multiplicative_order()
1
sage: R(-1).multiplicative_order()
2
sage: R.teichmuller(3).multiplicative_order()
6
padded_list(n, list_mode='simple')

Returns a list of coefficients of p starting with p^0 up to p^n exclusive (padded with zeros if needed)

INPUT:

  • self – a p-adic element
  • n - an integer

OUTPUT:

  • list – the list of coefficients of self

EXAMPLES:

sage: R = Zp(7,4,'capped-abs'); a = R(2*7+7**2); a.padded_list(5)
[0, 2, 1, 0, 0]

NOTE:

this differs from the padded_list method of padic_field_element

the slice operators throw an error if asked for a slice above the precision, while this function works

precision_absolute()

Returns the absolute precision of self.

This is the power of the maximal ideal modulo which this element is defined.

INPUT:

  • self – a p-adic element

OUTPUT:

  • integer – the absolute precision of self

EXAMPLES:

sage: R = Zp(7,4,'capped-abs'); a = R(7); a.precision_absolute()
4
precision_relative()

Returns the relative precision of self.

This is the power of the maximal ideal modulo which the unit part of self is defined.

INPUT:

  • self – a p-adic element

OUTPUT:

  • integer – the relative precision of self

EXAMPLES:

sage: R = Zp(7,4,'capped-abs'); a = R(7); a.precision_relative()
3
residue(absprec=1)

Reduces self modulo p^absprec

INPUT:

  • self – a p-adic element
  • absprec - an integer

OUTPUT:

  • element of \mathbb{Z}/p^{\mbox{absprec}} \mathbb{Z}self reduced modulo p^absprec.

EXAMPLES:

sage: R = Zp(7,4,'capped-abs'); a = R(8); a.residue(1)
1
unit_part()

Returns the unit part of self.

INPUT:

  • self – a p-adic element

OUTPUT:

  • p-adic element – the unit part of self

EXAMPLES:

sage: R = Zp(17,4,'capped-abs', 'val-unit')
sage: a = R(18*17)
sage: a.unit_part()
18 + O(17^3)
sage: type(a)
<type 'sage.rings.padics.padic_capped_absolute_element.pAdicCappedAbsoluteElement'>
val_unit()

Returns a 2-tuple, the first element set to the valuation of self, and the second to the unit part of self.

If self = 0, then the unit part is O(p^0).

EXAMPLES:

sage: R = ZpCA(5)
sage: a = R(75, 6); b = a - a
sage: a.val_unit()
(2, 3 + O(5^4))
sage: b.val_unit()
(6, O(5^0))
valuation()

Returns the valuation of self, ie the largest power of p dividing self.

EXAMPLES:

sage: R = ZpCA(5)
sage: R(5^5*1827).valuation()
5

TESTS:

sage: R(1).valuation()
0
sage: R(2).valuation()
0
sage: R(5).valuation()
1
sage: R(10).valuation()
1
sage: R(25).valuation()
2
sage: R(50).valuation()
2            
sage: R(0).valuation()
20

Previous topic

p-Adic Capped Relative Element.

Next topic

p-Adic Fixed-Mod Element.

This Page