We describe the functions for multivariate polynomial factorization and associated computations. These are available only for a restricted range of coefficient rings.
Given a polynomial p in P=R[x_1, ..., x_n], this function returns:such that p=u.prod_i q_i^(k_i). The unit u will be chosen in an appropriate way; over a field it will be such that q=prod_i q_i^(k_i) is monic, and for R = Z it will equal the sign of the leading coefficient of p.
- A factorization sequence Q, that is, a sequence of pairs consisting of an irreducible polynomial q_i in P (the factor) and a positive integer k_i (the multiplicity);
- A unit u of R
The coefficient ring R must be one of the following: the ring of integers Z, the field of rationals Q, or a rational function field over one of those.
Returns the squarefree factorization of the multivariate polynomial p as a sequence of tuples of length 2, each consisting of a (not necessarily irreducible) factor and an integer indicating the multiplicity. The factors do not contain the square of any polynomial of degree greater than 0. The coefficient ring R must be either the ring of integers Z, the field of rationals Q, or a rational function field over one of those.
Given a multivariate polynomial p over a ring R, this function returns true if p is irreducible over R and false otherwise. The coefficient ring R must be one of the following: the ring of integers Z, the field of rationals Q, or a rational function field over one of those.
> P<x, y, z> := PolynomialRing(IntegerRing(), 3);
> f := &*[x^i+y^j+z^k: i,j,k in [1..2]];
> print #Terms(f);
461
> print TotalDegree(f);
15
> time print Factorization(f);
[
<x + y + z, 1>,
<x + y + z^2, 1>,
<x + y^2 + z, 1>,
<x + y^2 + z^2, 1>,
<x^2 + y + z, 1>,
<x^2 + y + z^2, 1>,
<x^2 + y^2 + z, 1>,
<x^2 + y^2 + z^2, 1>
]
Time: 2.000
> // Create polynomial ring over R of rank n
> PRing := function(R, n)
> P := PolynomialRing(R, n);
> AssignNames( P, ["x" cat IntegerToString(i): i in [1..n]]);
> return P;
> end function;
>
> // Create Vandermonde matrix of rank n
> Vandermonde := function(n)
> P := PRing(IntegerRing(), n);
> return MatrixRing(P, n) ! [P.i^(j - 1): i, j in [1 .. n]];
> end function;
>
> V := Vandermonde(6);
> print V;
[ 1 x1 x1^2 x1^3 x1^4 x1^5]
[ 1 x2 x2^2 x2^3 x2^4 x2^5]
[ 1 x3 x3^2 x3^3 x3^4 x3^5]
[ 1 x4 x4^2 x4^3 x4^4 x4^5]
[ 1 x5 x5^2 x5^3 x5^4 x5^5]
[ 1 x6 x6^2 x6^3 x6^4 x6^5]
> D := Determinant(V);
> print #Terms(D);
720
> print TotalDegree(D);
15
> time print Factorization(D);
[
<x5 - x6, 1>,
<x4 - x6, 1>,
<x4 - x5, 1>,
<x3 - x6, 1>,
<x3 - x5, 1>,
<x3 - x4, 1>,
<x2 - x6, 1>,
<x2 - x5, 1>,
<x2 - x4, 1>,
<x2 - x3, 1>,
<x1 - x6, 1>,
<x1 - x5, 1>,
<x1 - x4, 1>,
<x1 - x3, 1>,
<x1 - x2, 1>
]
Time: 0.920
> P<a, b, c> := PolynomialRing(RationalField(), 3);
> A2 := 1/16 * (4*a^2*b^2 - (a^2 + b^2 - c^2)^2);
> print A2;
-1/16*a^4 + 1/8*a^2*b^2 + 1/8*a^2*c^2 - 1/16*b^4 + 1/8*b^2*c^2 - 1/16*c^4
> F, u := Factorization(A2);
> print F;
[
<a - b - c, 1>,
<a - b + c, 1>,
<a + b - c, 1>,
<a + b + c, 1>
]
> print u;
-1/16
The discriminant D of p in R[x_1, ..., x_n] is returned, where p is considered as a polynomial in v=x_i. The result will be an element of P again. The coefficient ring R must be a domain. There are two ways to indicate with respect to which variable the integral is to be taken: either one specifies i, the integer 1 <= i <= n that is the number of the variable (upon creation of P, corresponding to P.i) or the variable v itself (as an element of P).
The resultant of multivariate polynomials f and g in P=R[x_1, ..., x_n] with respect to the variable v=x_i, which is by definition the determinant of the Sylvester matrix for f and g when considered as polynomials in the single variable x_i. The result will be an element of P again. The coefficient ring R must be a domain. There are two ways to indicate with respect to which variable the integral is to be taken: either one specifies i, the integer 1 <= i <= n that is the number of the variable (upon creation of P, corresponding to P.i) or the variable v itself (as an element of P).[Next] [Prev] [Right] [Left] [Up] [Index] [Root]