oscar-system / Oscar.jl

A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
https://www.oscar-system.org
Other
339 stars 120 forks source link

Using F4 does not seem to correctly set the gb field of an ideal #1481

Closed RafaelDavidMohr closed 2 years ago

RafaelDavidMohr commented 2 years ago

Bug Description

Using f4 on an ideal seems to not correctly set the gb field of a polynomial ideal. This causes an UndefRefError when calling, for instance, normal_form after computing a Gröbner basis for said ideal with f4.

To reproduce

using Oscar
R, (x, y) = PolynomialRing(GF(5), ["x", "y"])
I = ideal(R, [x])
gb = f4(I)
normal_form(y, I)

ERROR: UndefRefError: access to undefined reference
Stacktrace:
 [1] getproperty
   @ ./Base.jl:42 [inlined]
 [2] normal_form_internal(I::Singular.sideal{Singular.spoly{Singular.n_Zp}}, J::MPolyIdeal{gfp_mpoly})
   @ Oscar ~/.julia/packages/Oscar/FGMVN/src/Rings/groebner.jl:302
 [3] normal_form(f::gfp_mpoly, J::MPolyIdeal{gfp_mpoly})
   @ Oscar ~/.julia/packages/Oscar/FGMVN/src/Rings/groebner.jl:335
 [4] top-level scope
   @ REPL[6]:1

Expected behavior

I was expecting f4 to correctly set the gb field of the ideal I'm calling it on.

System information

OSCAR version 0.10.0
  combining:
    AbstractAlgebra.jl   v0.26.2
    GAP.jl               v0.8.1
    Hecke.jl             v0.14.10
    Nemo.jl              v0.31.1
    Polymake.jl          v0.8.0
    Singular.jl          v0.10.2
  building on:
    Antic_jll               v0.200.501+0
    Arb_jll                 v200.2200.0+0
    Calcium_jll             v0.400.102+0
    FLINT_jll               v200.800.500+0
    GAP_jll                 v400.1192.2+1
    Singular_jll            v403.1.300+0
    libpolymake_julia_jll   v0.8.0+2
    libsingular_julia_jll   v0.23.1+0
    msolve_jll              v0.2.3+1
    polymake_jll            v400.600.0+0
See `]st -m` for a full list of dependencies.

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Official https://julialang.org/ release
ederc commented 2 years ago

The problem is normal_form() not f4(): f4 correctly computes and stores the corresponding GB in I's dictionary. Sadly normal_form() is outdated code (as well as lots of other GB functionality) which does not call a singular_assure() on the GB data it wants to work with. When normal_form() was implemented we only had Singular as GB engine in Oscar. Still waiting for an idealgens implementation to further work on GB functionality.

There will also be an F4-based normal_form in the next bigger version update of AlgebraicSolving.jl

ederc commented 2 years ago

1482 fixes this issue.

RafaelDavidMohr commented 2 years ago

Thank you for the explanation and fix, closing this issue.