Package sage :: Package rings :: Module padic :: Class pAdic
[show private | hide private]
[frames | no frames]

Type pAdic

object --+    
         |    
   Element --+
             |
            pAdic


The field of p-adic numbers of either finite or infinite precision. We represent p-adic numbers as product (p**r)*unit, where r is an integer or Infinity and unit is a p-adic unit known to some precision. If r=Infinity, then (p**r)*unit is the 0 element.

Binary operations on two elements of Qp reduce the precision of the unit part of the argument with larger precision to that of the one with lesser precision. This applies to all operations, including equality testing, so, e.g., the element O(p) is equal to every p-adic integer, since comparison will truncate the other p-adic integer to precision O(p).
Method Summary
  __init__(self, parent, x, big_oh, ordp)
The parent is a p-adic field.
  __add__(self, right)
  __cmp__(self, other)
  __div__(self, right)
  __invert__(self)
  __mod__(self, right)
  __mul__(self, right)
  __neg__(self)
  __pos__(self)
  __pow__(self, right)
  __radd__(self, left)
  __rdiv__(self, left)
  __repr__(self)
  __rmul__(self, left)
  __rsub__(self, left)
  __sub__(self, right)
  big_oh(self)
  copy(self)
  denominator(self)
  is_unit(self)
  is_zero(self)
  lift(self)
  log(self)
Compute the p-adic logarithm of a unit in Z_p.
  order(self)
The order of this as an element of the multiplicative group.
  ordp(self)
  rational_reconstruction(self)
Try to lift the p-adic number to the rationals using rational reconstruction, as follows: Suppose the p-adic number is p^r*(u+O(p^n)), where u is a unit.
  unit_part(self)
The unit part of (p**r)*u, which is simply u.
  valuation(self)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, parent, x, big_oh=Infinity, ordp=None)
(Constructor)

The parent is a p-adic field. The second argument, x, is anything that can be coerced to a p-adic number. The third argument big_oh is such that, e.g. 3^(-1)+1+2*3+O(3^2) has big_oh equal to 2.
Overrides:
sage.ext._element.Element.__init__

log(self)

Compute the p-adic logarithm of a unit in Z_p.

The usual power series for log with values in the additive
group of Q_p only converges for 1-units (units congruent to 1
modulo p).  However, there is a unique extension of log to a
homomorphism defined on all the units.  If u = a*v is a
unit with v = 1 (mod p), then we define log(u) = log(v).
This is the correct extension because the units U of Z_p
splits as a product U = V x <w>, where V is the subgroup
of 1-units and w is a (p-1)st root of unity.  The <w> factor
is torsion, so must go to 0 under any homomorphism to the
torsion free group (Q_p, +).

Notes -- What some other systems do:
   PARI:  Seems to define log the same way as we do.
   MAGMA: Gives an error when unit is not a 1-unit.

Algorithm:
   Input: Some p-adic unit u.
   1. Check that the input p-adic number is really a unit
      (i.e., valuation 0)
   2. Let 1-x = u**(p-1), which is a 1-unit.
   3. Use the series expansion
   
        log(1-x) = F(x) = -x - 1/2*x^2 - 1/3*x^3 - 1/4*x^4 - 1/5*x^5 - ...
        
      to compute the logarithm log(u**(p-1)).  Use enough
      terms so that terms added on are zero (to the default
      precision, if the input has infinite precision).
   4. Then log(u) = log(u**(p-1))/(p-1) = F(1-u**(p-1))/(p-1).

Examples:

order(self)

The order of this as an element of the multiplicative group. If the element is known to infinite precision, then it is truncated to the parent precision before the order is computed.
>>> K = Qp(13)
>>> a = K(-1)
>>> a.order()
2

We immediately know that 13 has infinite order, since it is 0 modulo 13. >>> b = K(13) >>> b.order() Infinity

The following element has finite order modulo 5**2. >>> c = 3 + 3*5 + 2*5**2 + O(5**3) >>> c.order() 4
Overrides:
sage.ext._element.Element.order

rational_reconstruction(self)

Try to lift the p-adic number to the rationals using rational reconstruction, as follows: Suppose the p-adic number is p^r*(u+O(p^n)), where u is a unit. Using rational reconstruction, try to find the unique rational number a/b such that a/b is congruent to u modulo p^n, and abs(a), abs(b) are both at most sqrt{p/2}. If such a/b exists, return p^r*(a/b).

unit_part(self)

The unit part of (p**r)*u, which is simply u. >>> x = 9*(2+3+O(3**7)) >>> x.unit_part() 2 + 3 + O(3^7)

Generated by Epydoc 2.1 on Fri Jun 24 17:58:45 2005 http://epydoc.sf.net