p-Adic Base Generic Element.

A common superclass for features shared among all elements of \mathbb{Z}_p and \mathbb{Q}_p (regardless of implementation).

AUTHORS:

  • David Roe
class sage.rings.padics.padic_base_generic_element.pAdicBaseGenericElement

Bases: sage.rings.padics.padic_generic_element.pAdicGenericElement

abs(prec=None)

Returns the p-adic absolute value of self.

This is normalized so that the absolute value of p is 1/p.

INPUT:

  • prec – Integer. The precision of the real field in which the answer is returned. If None, returns a rational for absolutely unramified fields, or a real with 53 bits of precision if ramified.

EXAMPLES: sage: a = Qp(5)(15); a.abs() 1/5 sage: a.abs(53) 0.200000000000000

exp()

Compute the p-adic exponential of any element of \mathbb{Z}_p where the series converges.

EXAMPLES:

Borrowed from log.:

sage: Z13 = Zp(13, 10, print_mode='series')
sage: a = Z13(13 + 6*13**2 + 2*13**3 + 5*13**4 + 10*13**6 + 13**7 + 11*13**8 + 8*13**9).add_bigoh(10); a
13 + 6*13^2 + 2*13^3 + 5*13^4 + 10*13^6 + 13^7 + 11*13^8 + 8*13^9 + O(13^10)
sage: a.exp()
1 + 13 + O(13^10)
sage: Q13 = Qp(13, 10, print_mode='series')
sage: a = Q13(13 + 6*13**2 + 2*13**3 + 5*13**4 + 10*13**6 + 13**7 + 11*13**8 + 8*13**9).add_bigoh(10); a
13 + 6*13^2 + 2*13^3 + 5*13^4 + 10*13^6 + 13^7 + 11*13^8 + 8*13^9 + O(13^10)
sage: a.exp()
1 + 13 + O(13^10)

The next few examples illustrate precision when computing p-adic exps. First we create a field with emph{default} precision 10.:

sage: R = Zp(5,10, print_mode='series')
sage: e = R(2*5 + 2*5**2 + 4*5**3 + 3*5**4 + 5**5 + 3*5**7 + 2*5**8 + 4*5**9).add_bigoh(10); e
2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 5^5 + 3*5^7 + 2*5^8 + 4*5^9 + O(5^10)
sage: e.exp()*R.teichmuller(4)
4 + 2*5 + 3*5^3 + O(5^10)
sage: K = Qp(5,10, print_mode='series')
sage: e = K(2*5 + 2*5**2 + 4*5**3 + 3*5**4 + 5**5 + 3*5**7 + 2*5**8 + 4*5**9).add_bigoh(10); e
2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 5^5 + 3*5^7 + 2*5^8 + 4*5^9 + O(5^10)
sage: e.exp()*K.teichmuller(4)
4 + 2*5 + 3*5^3 + O(5^10)

TESTS:

Check that results are consistent over a range of precision:

sage: max_prec = 40
sage: p = 3
sage: K = Zp(p, max_prec)
sage: full_exp = (K(p)).exp()
sage: for prec in range(2, max_prec):
...       ll = (K(p).add_bigoh(prec)).exp()
...       assert ll == full_exp
...       assert ll.precision_absolute() == prec
sage: K = Qp(p, max_prec)
sage: full_exp = (K(p)).exp()
sage: for prec in range(2, max_prec):
...       ll = (K(p).add_bigoh(prec)).exp()
...       assert ll == full_exp
...       assert ll.precision_absolute() == prec

AUTHORS:

  • Genya Zaytman (2007-02-15)
log(branch=None)

Compute the p-adic logarithm of any unit in \mathbb{Z}_p. (See below for normalization.)

The usual power series for log with values in the additive group of \mathbb{Z}_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 \cdot v is a unit with v \equiv 1 \pmod{p} and a a Teichmuller representative, then we define log(u) =
log(v). This is the correct extension because the units U of \mathbb{Z}_p split as a product U = V \times \langle w
\rangle, where V is the subgroup of 1-units and w is a (p-1)`st root of unity.  The `\langle w \rangle factor is torsion, so must go to 0 under any homomorphism to the torsion free group (\mathbb{Z}_p, +).

INPUTS:

  • self – a p-adic element.
  • branch – A choice of branch, ie a choice of logarithm of the uniformizer. This choice can be made arbitrarily.

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 (or non-unit if branch is specified).

  1. Check that the input p-adic number is really a unit (i.e., valuation 0), or take the unit part and multiply by branch * self.valuation() if not and branch specified.
  2. Let 1-x = u^{p-1}, which is a 1-unit.
  3. Use the series expansion

..math

\log(1-x) = F(x) = -x - 1/2*x^2 - 1/3*x^3 - 1/4*x^4 - 1/5*x^5 - \cdots

to compute the logarithm log(u^{p-1}). Use enough terms so that terms added on are zero

  1. Then

..math

\log(u) = \log(u^{p-1})/(p-1) = F(1-u^{p-1})/(p-1).

EXAMPLES:

sage: Z13 = Zp(13, 10, print_mode='series')
sage: a = Z13(14); a
1 + 13 + O(13^10)

Note that the relative precision decreases when we take log: it is the absolute precision that is preserved.:

sage: a.log()
13 + 6*13^2 + 2*13^3 + 5*13^4 + 10*13^6 + 13^7 + 11*13^8 + 8*13^9 + O(13^10)
sage: Q13 = Qp(13, 10, print_mode='series')
sage: a = Q13(14); a
1 + 13 + O(13^10)
sage: a.log()
13 + 6*13^2 + 2*13^3 + 5*13^4 + 10*13^6 + 13^7 + 11*13^8 + 8*13^9 + O(13^10)

The next few examples illustrate precision when computing p-adic logs. First we create a field with emph{default} precision 10.:

sage: R = Zp(5,10, print_mode='series')
sage: e = R(389); e
4 + 2*5 + 3*5^3 + O(5^10)
sage: e.log()
2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 5^5 + 3*5^7 + 2*5^8 + 4*5^9 + O(5^10)
sage: K = Qp(5,10, print_mode='series')
sage: e = K(389); e
4 + 2*5 + 3*5^3 + O(5^10)
sage: e.log()
2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 5^5 + 3*5^7 + 2*5^8 + 4*5^9 + O(5^10)

Check that results are consistent over a range of precision:

sage: max_prec = 40
sage: p = 3
sage: K = Zp(p, max_prec)
sage: full_log = (K(1 + p)).log()
sage: for prec in range(2, max_prec):
...       ll = (K(1 + p).add_bigoh(prec)).log()
...       assert ll == full_log
...       assert ll.precision_absolute() == prec

AUTHORS:

  • William Stein: initial version
  • David Harvey (2006-09-13): corrected subtle precision bug (need to take denominators into account! – see trac #53)
  • Genya Zaytman (2007-02-14): adapted to new p-adic class

TODO:

  • Currently implemented as O(N^2). This can be improved to soft-O(N) using algorithm described by Dan Bernstein: http://cr.yp.to/lineartime/multapps-20041007.pdf
minimal_polynomial(name)

Returns a minimal polynomial of this p-adic element, i.e., x - self

INPUT:

  • self – a p-adic element
  • name – string: the name of the variable

OUTPUT:

  • polynomial – a minimal polynomial of this p-adic element, i.e., x - self

EXAMPLES:

sage: Zp(5,5)(1/3).minimal_polynomial('x')
(1 + O(5^5))*x + (3 + 5 + 3*5^2 + 5^3 + 3*5^4 + O(5^5))
norm(ground=None)

Returns the norm of this p-adic element over the ground ring.

NOTE! This is not the p-adic absolute value. This is a field theoretic norm down to a ground ring. If you want the p-adic absolute value, use the abs() function instead.

INPUT:

  • self – a p-adic element
  • ground – a subring of the ground ring (default: base ring)

OUTPUT:

  • element – the norm of this p-adic element over the ground ring

EXAMPLES:

sage: Zp(5)(5).norm()
5 + O(5^21)
trace(ground=None)

Returns the trace of this p-adic element over the ground ring

INPUT:

  • self – a p-adic element
  • ground – a subring of the ground ring (default: base ring)

OUTPUT:

  • element – the trace of this p-adic element over the ground ring

EXAMPLES:

sage: Zp(5,5)(5).trace()
5 + O(5^6)

Previous topic

p-Adic Generic Element.

Next topic

p-Adic Capped Relative Element.

This Page