\(p\)-adic ZZ_pX Element - $p$-adics

Skip to content
Back to top
View this page
Edit this page

# \(p\)-adic `ZZ_pX Element`

A common superclass implementing features shared by all elements that use NTL’s `ZZ_pX` as the fundamental data type.

AUTHORS:

- David Roe

class sage.rings.padics.padic_ZZ_pX_element.pAdicZZpXElement

  Bases: `pAdicExtElement`

  Initialization.

  EXAMPLES:

  Sage

      sage: A = Zp(next_prime(50000),10)
      sage: S.<x> = A[]
      sage: B.<t> = A.ext(x^2 + next_prime(50000))  # indirect doctest

  Python

      >>> from sage.all import *
      >>> A = Zp(next_prime(Integer(50000)),Integer(10))
      >>> S = A['x']; (x,) = S._first_ngens(1)
      >>> B = A.ext(x**Integer(2) + next_prime(Integer(50000)), names=('t',)); (t,) = B._first_ngens(1)# indirect doctest

  norm(base=None)

    Return the absolute or relative norm of this element.

    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.

    If `base` is given then `base` must be a subfield of the parent \(L\) of `self`, in which case the norm is the relative norm from L to `base`.

    In all other cases, the norm is the absolute norm down to \(\QQ_p\) or \(\ZZ_p\).

    EXAMPLES:

    Sage

        sage: R = ZpCR(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: ((1+2*w)^5).norm()
        1 + 5^2 + O(5^5)
        sage: ((1+2*w)).norm()^5
        1 + 5^2 + O(5^5)

    Python

        >>> from sage.all import *
        >>> R = ZpCR(Integer(5),Integer(5))
        >>> S = R['x']; (x,) = S._first_ngens(1)
        >>> f = x**Integer(5) + Integer(75)*x**Integer(3) - Integer(15)*x**Integer(2) + Integer(125)*x - Integer(5)
        >>> W = R.ext(f, names=('w',)); (w,) = W._first_ngens(1)
        >>> ((Integer(1)+Integer(2)*w)**Integer(5)).norm()
        1 + 5^2 + O(5^5)
        >>> ((Integer(1)+Integer(2)*w)).norm()**Integer(5)
        1 + 5^2 + O(5^5)

  trace(base=None)

    Return the absolute or relative trace of this element.

    If `base` is given then `base` must be a subfield of the parent \(L\) of `self`, in which case the norm is the relative norm from \(L\) to `base`.

    In all other cases, the norm is the absolute norm down to \(\QQ_p\) or \(\ZZ_p\).

    EXAMPLES:

    Sage

        sage: R = ZpCR(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: a = (2+3*w)^7
        sage: b = (6+w^3)^5
        sage: a.trace()
        3*5 + 2*5^2 + 3*5^3 + 2*5^4 + O(5^5)
        sage: a.trace() + b.trace()
        4*5 + 5^2 + 5^3 + 2*5^4 + O(5^5)
        sage: (a+b).trace()
        4*5 + 5^2 + 5^3 + 2*5^4 + O(5^5)

    Python

        >>> from sage.all import *
        >>> R = ZpCR(Integer(5),Integer(5))
        >>> S = R['x']; (x,) = S._first_ngens(1)
        >>> f = x**Integer(5) + Integer(75)*x**Integer(3) - Integer(15)*x**Integer(2) + Integer(125)*x - Integer(5)
        >>> W = R.ext(f, names=('w',)); (w,) = W._first_ngens(1)
        >>> a = (Integer(2)+Integer(3)*w)**Integer(7)
        >>> b = (Integer(6)+w**Integer(3))**Integer(5)
        >>> a.trace()
        3*5 + 2*5^2 + 3*5^3 + 2*5^4 + O(5^5)
        >>> a.trace() + b.trace()
        4*5 + 5^2 + 5^3 + 2*5^4 + O(5^5)
        >>> (a+b).trace()
        4*5 + 5^2 + 5^3 + 2*5^4 + O(5^5)