Base class for generic
-adic polynomials¶
This provides common functionality for all -adic polynomials, such
as printing and factoring.
AUTHORS:
- Jeroen Demeyer (2013-11-22): initial version, split off from other files, made Polynomial_padic the common base class for all p-adic polynomials.
-
class
sage.rings.polynomial.padics.polynomial_padic.
Polynomial_padic
(parent, x=None, check=True, is_gen=False, construct=False)¶ Bases:
sage.rings.polynomial.polynomial_element.Polynomial
-
factor
()¶ Return the factorization of this polynomial.
EXAMPLES:
sage: R.<t> = PolynomialRing(Qp(3,3,print_mode='terse',print_pos=False)) sage: pol = t^8 - 1 sage: for p,e in pol.factor(): print e, p 1 (1 + O(3^3))*t + (1 + O(3^3)) 1 (1 + O(3^3))*t + (-1 + O(3^3)) 1 (1 + O(3^3))*t^2 + (5 + O(3^3))*t + (-1 + O(3^3)) 1 (1 + O(3^3))*t^2 + (-5 + O(3^3))*t + (-1 + O(3^3)) 1 (1 + O(3^3))*t^2 + (0 + O(3^3))*t + (1 + O(3^3)) sage: R.<t> = PolynomialRing(Qp(5,6,print_mode='terse',print_pos=False)) sage: pol = 100 * (5*t - 1) * (t - 5) sage: pol (500 + O(5^9))*t^2 + (-2600 + O(5^8))*t + (500 + O(5^9)) sage: pol.factor() (500 + O(5^9)) * ((1 + O(5^5))*t + (-1/5 + O(5^5))) * ((1 + O(5^6))*t + (-5 + O(5^6))) sage: pol.factor().value() (500 + O(5^8))*t^2 + (-2600 + O(5^8))*t + (500 + O(5^8))
The same factorization over
. In this case, the “unit” part is a
-adic unit and the power of
is considered to be a factor:
sage: R.<t> = PolynomialRing(Zp(5,6,print_mode='terse',print_pos=False)) sage: pol = 100 * (5*t - 1) * (t - 5) sage: pol (500 + O(5^9))*t^2 + (-2600 + O(5^8))*t + (500 + O(5^9)) sage: pol.factor() (4 + O(5^6)) * ((5 + O(5^7)))^2 * ((1 + O(5^6))*t + (-5 + O(5^6))) * ((5 + O(5^6))*t + (-1 + O(5^6))) sage: pol.factor().value() (500 + O(5^8))*t^2 + (-2600 + O(5^8))*t + (500 + O(5^8))
In the following example, the discriminant is zero, so the
-adic factorization is not well defined:
sage: factor(t^2) Traceback (most recent call last): ... PrecisionError: p-adic factorization not well-defined since the discriminant is zero up to the requestion p-adic precision
More examples over
:
sage: R.<w> = PolynomialRing(Zp(5, prec=6, type = 'capped-abs', print_mode = 'val-unit')) sage: f = w^5-1 sage: f.factor() ((1 + O(5^6))*w + (3124 + O(5^6))) * ((1 + O(5^6))*w^4 + (12501 + O(5^6))*w^3 + (9376 + O(5^6))*w^2 + (6251 + O(5^6))*w + (3126 + O(5^6)))
See trac ticket #4038:
sage: E = EllipticCurve('37a1') sage: K =Qp(7,10) sage: EK = E.base_extend(K) sage: E = EllipticCurve('37a1') sage: K = Qp(7,10) sage: EK = E.base_extend(K) sage: g = EK.division_polynomial_0(3) sage: g.factor() (3 + O(7^10)) * ((1 + O(7^10))*x + (1 + 2*7 + 4*7^2 + 2*7^3 + 5*7^4 + 7^5 + 5*7^6 + 3*7^7 + 5*7^8 + 3*7^9 + O(7^10))) * ((1 + O(7^10))*x^3 + (6 + 4*7 + 2*7^2 + 4*7^3 + 7^4 + 5*7^5 + 7^6 + 3*7^7 + 7^8 + 3*7^9 + O(7^10))*x^2 + (6 + 3*7 + 5*7^2 + 2*7^4 + 7^5 + 7^6 + 2*7^8 + 3*7^9 + O(7^10))*x + (2 + 5*7 + 4*7^2 + 2*7^3 + 6*7^4 + 3*7^5 + 7^6 + 4*7^7 + O(7^10)))
TESTS:
Check that trac ticket #13293 is fixed:
sage: R.<T> = Qp(3)[] sage: f = 1926*T^2 + 312*T + 387 sage: f.factor() (3^2 + 2*3^3 + 2*3^4 + 3^5 + 2*3^6 + O(3^22)) * ((1 + O(3^19))*T + (2*3^-1 + 3 + 3^2 + 2*3^5 + 2*3^6 + 2*3^7 + 3^8 + 3^9 + 2*3^11 + 3^15 + 3^17 + O(3^19))) * ((1 + O(3^20))*T + (2*3 + 3^2 + 3^3 + 3^5 + 2*3^6 + 2*3^7 + 3^8 + 3^10 + 3^11 + 2*3^12 + 2*3^14 + 2*3^15 + 2*3^17 + 2*3^18 + O(3^20)))
-