Full factorization of polynomials over complexes with SymPy
问题 I want to fully factorize a polynom, thus factorize it over complexes. SymPy provide factor to do it, but I’m very surprised that factorization is done only over integer roots, e.g. : >>> from sympy import * >>> z = symbols('z') >>> factor(z**2 - 1, z) (z - 1)*(z + 1) >>> factor(z**2 + 1, z) z**2 + 1 or >>> factor(2*z - 1, z) 2*z - 1 >>> factor(2*z - 1, z, extension=[Integer(1)/2]) 2*(z - 1/2) An answered question already exists : Factor to complex roots using sympy, and the solution given by