I am trying to implement an efficient elimination and substitution procedure for calculating the solution set of a zero-dimensional ideal $I \subseteq \mathbb{Q}[x_1, \ldots, x_n]$ over $\bar{\mathbb{Q}}$. (I know there is ideal.variety(QQbar)
but would also like to compute directly the smallest number field over which each solution point is defined - number_field_elements_from_algebraics(..., minimal=True)
can be very slow.)
The algorithm finds the irreducible factors $f_i$ of a generator of $I \cap \mathbb{Q}[x_n]$. These determine algebraic solutions for $x_n$ which can be plugged in to the remaining polynomials to inductively extend them to solutions of $I$.
The base field is thus extended from $\mathbb{Q}$ to the number field $\mathbb{Q}[x]/(f_i(x))$ (and iteratively to further extensions.)
When running the code, I observed that the construction of the field extensions is actually one of the main performance bottlenecks, in particular _pari_integral_basis
. I assume the number field structure and the ring of integers are not necessary for Singular's Groebner algorithms and therefore wonder if these calculations can be turned off?
Working over Sage's quotient rings
QQ['x'].quotient(f)
does not seem to work together with Singular:
TypeError: Cannot call Singular function 'eliminate' with ring parameter of type '<class 'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain_with_category'>'