Expand description
Multivariate polynomial GCD computation using evaluation-interpolation
Implements the heuristic GCD algorithm (heugcd) from SymPy’s euclidtools.py. This approach avoids the infinite recursion issues of content-primitive factorization by using integer evaluation and polynomial interpolation.
§Algorithm Overview (from [Liao95])
For multivariate polynomials f, g in Z[x₁, …, xₙ]:
- Extract ground GCD (numeric content only - NON-RECURSIVE)
- Evaluate both polynomials at integer point x₀ for main variable
- Recursively compute GCD of resulting (n-1)-variate polynomials
- Interpolate back to n-variate polynomial
- Verify result by polynomial division
- If verification fails, try new evaluation point (up to 6 attempts)
§Mathematical Background
The key insight is that GCD computation can be reduced dimension by dimension:
- gcd(f(x,y), g(x,y)) at y=y₀ gives gcd(f(x,y₀), g(x,y₀))
- The GCD is then reconstructed via polynomial interpolation
- Verification ensures correctness (heuristic may fail, triggering retry)
§References
[Liao95]Liao, Q. “Factoring multivariate polynomials over algebraic number fields”- SymPy polys/euclidtools.py:
dmp_zz_heu_gcd,dup_zz_heu_gcd
Structs§
- HeuristicGCD
Failed - Error type for heuristic GCD failures
Functions§
- multivariate_
gcd - Compute GCD of multivariate polynomials using evaluation-interpolation
- polynomial_
evaluate_ at - Evaluate polynomial at integer value for main variable
- polynomial_
interpolate - Interpolate polynomial from integer using symmetric representation