Just put `minpoly` here (or alternately, `minimal_polynomial`, which is a synonym). It is included in `from sympy import *`.