Multivariate polynomials via FLINT

asked 2023-12-06 03:16:48 +0100

Is there a convenient way to do multivariate polynomial calculations over the rationals in Sage using FLINT? As best I can tell from the documentation, the available options are a generic algorithm and Singular, both of which are much slower than, for example, Nemo in Julia (which uses FLINT).

edit retag flag offensive close merge delete

Comments

Let us take a look at the doc string...

sage: ?PolynomialRing

After some lines, we get the block:

   * "implementation" -- string or None; selects an implementation in
     cases where Sage includes multiple choices (currently \ZZ[x] can
     be implemented with "'NTL'" or "'FLINT'"; default is "'FLINT'").
     For many base rings, the ""singular"" implementation is
     available. One can always specify "implementation="generic"" for
     a generic Sage implementation which does not use any specialized
     library.

So FLINT is the default for $\Bbb Z[x]$. However...

sage: R.<x,y> = QQ[]
sage: type(R)
<class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>

and insisting on FLINT gives an error.

dan_fulea gravatar imagedan_fulea ( 2023-12-07 02:37:33 +0100 )edit

No trick could force the present code (in my hands) to use FLINT. From https://fredrikj.net/math/lyon2023fli... is see that an implementation is very sensible w.r.t. the base ring. And the sage implementation for the case of one transcendental variable over a "simple ring" is also very base ring driven... So adapting the code to work is not an obvious task, but should be doable with work...

dan_fulea gravatar imagedan_fulea ( 2023-12-07 02:57:31 +0100 )edit