Approximate Polynomial Algebra - Maple Help

Home : Support : Online Help : What's New and Release Notes : Approximate Polynomial Algebra

Approximate Polynomial Algebra Package in Maple 2021

New PolynomialTools Subpackage

 • New in Maple 2021 is the PolynomialTools:-Approximate subpackage. It includes three main commands for computing approximate operations on polynomials in many variables: Factor, GCD, and Divide, as well as commands for computing the matrices used for these operations.
 • These new commands are useful for cases where no exact answer is possible, and a solution is instead found for a nearby problem which does have a solution. Typically, this assumes that some amount of error or noise was introduced into the coefficients of the input polynomial(s) that destroyed algebraic structure, and which these commands attempt to recover.
 • The SNAP package has provided the gcd and division with remainder operations for univariate polynomials but those commands typically require the user to provide a numerical tolerance.  These new commands do not take a tolerance as input, but instead always return an approximate solution, even if it has very large backward error following the model in the papers of Gao et al. and Kaltofen et al in the references below.
 • This new package supports univariate computations of quotients and gcd under that model (univariate inputs to Factor are just sent to the top-level command factor).
 > factor( x^4-3.0*x^2-4.0 );
 $\left({x}{+}{2.00000000000000}\right){}\left({x}{-}{2.00000000000000}\right){}\left({{x}}^{{2}}{+}{0.999999999999996}\right)$ (1)
 > factor( x^4-3.0*x^2-4.0*I );
 $\left({x}{+}{1.85321006568802}{+}{0.291797565955056}{}{I}\right){}\left({x}{+}{0.627404403732890}{-}{0.861903714978381}{}{I}\right){}\left({x}{-}{0.627404403732890}{+}{0.861903714978381}{}{I}\right){}\left({x}{-}{1.85321006568802}{-}{0.291797565955056}{}{I}\right)$ (2)
 > SNAP:-QRGCD( x^4-3.0*x^2-4.0, x^2-4.0, x, 10e-10);
 ${0}{,}{0.2425356250}{,}{-}{0.970142500145332}{+}{0.242535625036333}{}{{x}}^{{2}}$ (3)
 > SNAP:-Quotient( x^4-3.0*x^2-4.0, x^2-4.0, x );
 ${1.00000000000000}{}{{x}}^{{2}}{+}{1.00000000000000}$ (4)
 • New functionality is described below.
 > with(PolynomialTools):
 > with(Approximate);
 $\left[{\mathrm{ConvolutionMatrix}}{,}{\mathrm{Divide}}{,}{\mathrm{Factor}}{,}{\mathrm{GCD}}{,}{\mathrm{RuppertMatrix}}{,}{\mathrm{SylvesterMatrix}}\right]$ (5)

CoefficentVector and FromCoefficientVector

 • The commands CoefficientVector and FromCoefficientVector in the main PolynomialTools package were both enhanced to work with multivariate polynomials.
 > v := CoefficientVector(y^3-y^2*x+(y-2)*x^2+x^3, [x,y]);
 ${v}{≔}\left[\begin{array}{c}{0}\\ {0}\\ {0}\\ {-2}\\ {0}\\ {0}\\ {1}\\ {1}\\ {-1}\\ {1}\end{array}\right]$ (6)
 > FromCoefficientVector( v, [a, b]);
 ${{a}}^{{3}}{+}{{a}}^{{2}}{}{b}{-}{a}{}{{b}}^{{2}}{+}{{b}}^{{3}}{-}{2}{}{{a}}^{{2}}$ (7)

Divide and ConvolutionMatrix

 • Approximate division using a LeastSquares computation on the matrix representing polynomial division.
 > f := x^2+y^2-1;
 ${f}{≔}{{x}}^{{2}}{+}{{y}}^{{2}}{-}{1}$ (8)
 > ConvolutionMatrix(f, [x,y], 2);
  (9)
 > infolevel[PolynomialTools] := 1;
 ${{\mathrm{infolevel}}}_{{\mathrm{PolynomialTools}}}{≔}{1}$ (10)
 > d := sqrt(2.0)*(x^2+y^2-1);
 ${d}{≔}{1.414213562}{}{{x}}^{{2}}{+}{1.414213562}{}{{y}}^{{2}}{-}{1.414213562}$ (11)
 > G := sort( (x^2-y^3+1), [x,y]); F := sort( expand( d*G ), [x,y]);
 ${G}{≔}{-}{{y}}^{{3}}{+}{{x}}^{{2}}{+}{1}$
 ${F}{≔}{-}{1.414213562}{}{{x}}^{{2}}{}{{y}}^{{3}}{-}{1.414213562}{}{{y}}^{{5}}{+}{1.414213562}{}{{x}}^{{4}}{+}{1.414213562}{}{{x}}^{{2}}{}{{y}}^{{2}}{+}{1.414213562}{}{{y}}^{{3}}{+}{1.414213562}{}{{y}}^{{2}}{-}{1.414213562}$ (12)
 > ad_8 := Divide( expand( F + 10^(-8)*x*y ), expand(G+10^(-8)*x^2*y), [x,y] );
 Divide:   computed approximate quotient has backward error 2.291288e-08 Divide:   computed approximate quotient has backward error 2.291288e-08
 ${\mathrm{ad_8}}{≔}{-}{1.41421356376777}{-}{1.18686577420138}{×}{{10}}^{{-16}}{}{x}{+}{4.71404426419272}{×}{{10}}^{{-9}}{}{y}{+}{1.41421356730330}{}{{x}}^{{2}}{+}{3.33333326578262}{×}{{10}}^{{-9}}{}{x}{}{y}{+}{1.41421356200000}{}{{y}}^{{2}}$ (13)
 ${\mathrm{ad_8}}{≔}{1.414213565}{}{{x}}^{{2}}{+}{1.414213560}{}{{y}}^{{2}}{-}{1.414213562}$ (14)
 ${-9}$ (15)

GCD and SylvesterMatrix

 • Approximate GCD computation using a low-rank approximation of a generalized Sylvester matrix.
 > d := sqrt(2.0)*(x^2+y^2-1);
 ${d}{≔}{1.414213562}{}{{x}}^{{2}}{+}{1.414213562}{}{{y}}^{{2}}{-}{1.414213562}$ (16)
 > F := sort( expand( d*(x^3-y^3+1) ), [x,y]);
 ${F}{≔}{1.414213562}{}{{x}}^{{5}}{+}{1.414213562}{}{{x}}^{{3}}{}{{y}}^{{2}}{-}{1.414213562}{}{{x}}^{{2}}{}{{y}}^{{3}}{-}{1.414213562}{}{{y}}^{{5}}{-}{1.414213562}{}{{x}}^{{3}}{+}{1.414213562}{}{{y}}^{{3}}{+}{1.414213562}{}{{x}}^{{2}}{+}{1.414213562}{}{{y}}^{{2}}{-}{1.414213562}$ (17)
 > G := sort( expand( d*(x^2-y^3+1) ), [x,y]);
 ${G}{≔}{-}{1.414213562}{}{{x}}^{{2}}{}{{y}}^{{3}}{-}{1.414213562}{}{{y}}^{{5}}{+}{1.414213562}{}{{x}}^{{4}}{+}{1.414213562}{}{{x}}^{{2}}{}{{y}}^{{2}}{+}{1.414213562}{}{{y}}^{{3}}{+}{1.414213562}{}{{y}}^{{2}}{-}{1.414213562}$ (18)
 > S1 := SylvesterMatrix(F, G, [x,y], 3);
  (19)
 • Maximal rank, means degree( gcd(F,G) ) < 3
 > min(upperbound(S1)) - LinearAlgebra:-Rank(S1);
 ${0}$ (20)
 > ad_8 := GCD( expand( F + 10^(-8)*x*y ), expand(G+10^(-8)*x^2*y), [x,y] );
 GCD:   approximate GCD inputs of total degrees 5 and 5 in [x, y] GCD:   approximate GCD determined with an error of 7.484964e-10
 ${\mathrm{ad_8}}{≔}{0.569494797046587}{+}{3.40007756198411}{×}{{10}}^{{-10}}{}{x}{-}{1.02787952298720}{×}{{10}}^{{-9}}{}{y}{-}{0.569494797402477}{}{{x}}^{{2}}{-}{1.49456595411036}{×}{{10}}^{{-10}}{}{x}{}{y}{-}{0.569494797883116}{}{{y}}^{{2}}$ (21)
 ${\mathrm{ad_8}}{≔}{1.414213563}{}{{x}}^{{2}}{+}{1.414213563}{}{{y}}^{{2}}{-}{1.414213562}$ (22)
 ${-10}$ (23)

Factor and RuppertMatrix

 • Approximate factorization computation using a low-rank approximation of a Ruppert matrix.
 > F := sort( expand( (x^2+y^2-1)*(x^3-y^3+1) ), [x,y]);
 ${F}{≔}{{x}}^{{5}}{+}{{x}}^{{3}}{}{{y}}^{{2}}{-}{{x}}^{{2}}{}{{y}}^{{3}}{-}{{y}}^{{5}}{-}{{x}}^{{3}}{+}{{y}}^{{3}}{+}{{x}}^{{2}}{+}{{y}}^{{2}}{-}{1}$ (24)
 > R1 := RuppertMatrix( F, [x,y]);
  (25)
 • The rank deficiency of the Ruppert matrix is equal to the number of factors.
 > min(upperbound(R1)) - LinearAlgebra:-Rank(R1);
 ${2}$ (26)
 > aF_8 := Factor( expand( F + 10^(-8)*x*y ), [x,y] );
 Factor:   approximate factorization input of degree [5, 5] in [x, y] Factor:   factorization square-free input of degree [5, 5] in [x, y] Factor:   polynomial has 2 approximate factors at numerical tolerance 10e-9
 ${\mathrm{aF_8}}{≔}{-}{3.51077852290418}{}\left({-}{0.553434072552870}{+}{1.77801449939224}{×}{{10}}^{{-9}}{}{x}{+}{7.90819893953528}{×}{{10}}^{{-10}}{}{y}{+}{0.553434076446519}{}{{x}}^{{2}}{+}{3.77682390338017}{×}{{10}}^{{-9}}{}{x}{}{y}{+}{0.553434072366221}{}{{y}}^{{2}}\right){}\left({-}{0.514672154045167}{-}{2.34835330244616}{×}{{10}}^{{-9}}{}{x}{-}{5.64898033341907}{×}{{10}}^{{-9}}{}{y}{-}{1.17024430331672}{×}{{10}}^{{-9}}{}{{x}}^{{2}}{-}{1.49078205314256}{×}{{10}}^{{-9}}{}{x}{}{y}{+}{2.96989965820472}{×}{{10}}^{{-9}}{}{{y}}^{{2}}{-}{0.514672156472411}{}{{x}}^{{3}}{-}{5.26728849881315}{×}{{10}}^{{-10}}{}{{x}}^{{2}}{}{y}{-}{2.25599615014506}{×}{{10}}^{{-9}}{}{x}{}{{y}}^{{2}}{+}{0.514672152925071}{}{{y}}^{{3}}\right)$ (27)
 > sort( fnormal( expand(aF_8) ), [x,y] );
 ${1.000000007}{}{{x}}^{{5}}{+}{1.000000004}{}{{x}}^{{3}}{}{{y}}^{{2}}{-}{0.9999999990}{}{{x}}^{{2}}{}{{y}}^{{3}}{-}{0.9999999926}{}{{y}}^{{5}}{-}{0.9999999953}{}{{x}}^{{3}}{+}{1.000000004}{}{{y}}^{{3}}{+}{0.9999999999}{}{{x}}^{{2}}{+}{1.000000001}{}{{y}}^{{2}}{-}{0.9999999951}$ (28)
 > ilog10( norm(expand(F-aF_8),2) / norm(F,2) );
 ${-9}$ (29)

References

 Gao, S.; Kaltofen, E.; May, J.; Yang, Z.; and Zhi, L. "Approximate factorization of multivariate polynomials via differential equations." Proceedings of the 2004 International Symposium on Symbolic and Algebraic Computation (ISSAC 2004),  pp. 167-174. Ed. J. Gutierrez. ACM Press, 2004.
 Kaltofen, E.; May, J.; Yang, Z.; and Zhi, L. "Approximate factorization of multivariate polynomials using singular value decomposition." Journal of Symbolic Computation Vol. 43(5), (2008): 359-376.