# $$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

Initialization

EXAMPLES:

sage: A = Zp(next_prime(50000),10)
sage: S.<x> = A[]
sage: B.<t> = A.ext(x^2 + next_prime(50000))  # 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: 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)
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: 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)