Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalization returns a corrupted ring #3488

Closed
simonbrandhorst opened this issue Mar 4, 2024 · 2 comments · Fixed by #3536
Closed

Normalization returns a corrupted ring #3488

simonbrandhorst opened this issue Mar 4, 2024 · 2 comments · Fixed by #3536
Labels
bug Something isn't working

Comments

@simonbrandhorst
Copy link
Collaborator

simonbrandhorst commented Mar 4, 2024

Describe the bug
Using the output of normalisation results in bugs.
It looks to me like something is going wrong with wrapping the singular output.
@wdecker @jankoboehm
Edit: The pecularity of this example is that the input is already normal.
For a non-normal example it seem to work. Thus this is a corner case that is not caught somehow.

To Reproduce

using Oscar
julia> P,(a,b) = polynomial_ring(QQ,[:a,:b])
(Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[a, b])

julia> I = ideal(P,a^2-b);

julia> Q = normalization(quo(P,I)[1])[1][1];

julia> R = base_ring(Q);

julia> J = ideal(R, R[1])
Ideal generated by
  x

julia> base_ring(J) === base_ring(modulus(Q))
true

julia> saturation(modulus(Q),J)
ERROR: Incompatible ideals
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] check_parent
   @ ~/.julia/packages/Singular/N0xXX/src/ideal/ideal.jl:261 [inlined]
 [3] saturation(I::Singular.sideal{Singular.spoly{Singular.n_Q}}, J::Singular.sideal{Singular.spoly{Singular.n_Q}})
   @ Singular ~/.julia/packages/Singular/N0xXX/src/ideal/ideal.jl:602
 [4] saturation(I::MPolyIdeal{QQMPolyRingElem}, J::MPolyIdeal{QQMPolyRingElem})
   @ Oscar ~/.julia/dev/Oscar/src/Rings/mpoly-ideals.jl:343
 [5] top-level scope
   @ REPL[314]:1

julia> saturation(ideal(base_ring(Q),gens(modulus(Q))),J) # curiously this works
Ideal generated by
  x^2 - y


Expected behavior
This should work.

System (please complete the following information):
Please paste the output of Oscar.versioninfo(full=true) below. If this does
not work, please paste the output of Julia's versioninfo() and your Oscar
version.

julia> Oscar.versioninfo(full=true)
ulia> Oscar.versioninfo(full=true)

OSCAR version 1.1.0-DEV - #sb/EnriquesAut, 328c741432 -- 2024-03-01 14:08:32 +0100
  combining:
    AbstractAlgebra.jl   v0.40.1
    GAP.jl               v0.10.3
    Hecke.jl             v0.30.0 - #master, 6599c41e23 -- 2024-02-29 19:02:54 +0100
    Nemo.jl              v0.43.1
    Polymake.jl          v0.11.14
    Singular.jl          v0.22.4
  building on:
    Antic_jll               v0.201.500+0
    Arb_jll                 v200.2300.0+0
    Calcium_jll             v0.401.100+0
    FLINT_jll               v200.900.9+0
    GAP_jll                 v400.1200.200+9
    Singular_jll            v403.214.1400+0
    libpolymake_julia_jll   v0.11.4+0
    libsingular_julia_jll   v0.43.0+0
    polymake_jll            v400.1100.1+0
See `]st -m` for a full list of dependencies.

Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores
Official https://julialang.org/ release
...
@simonbrandhorst simonbrandhorst added the bug Something isn't working label Mar 4, 2024
@fingolfin
Copy link
Member

@afkafkafk13 will have a look at it for now (thanks!)

@afkafkafk13
Copy link
Collaborator

It is a (slightly inconsistent) special case in normal.lib, where the Singular output has a particular format.
This needs to be caught in _conv_normalize_data in src/Rings/mpoly-affine-algebras.jl.

@joschmitt joschmitt linked a pull request Mar 20, 2024 that will close this issue
afkafkafk13 added a commit that referenced this issue Mar 21, 2024
* avoid corruption of internal ideal data (persisting information on a Singular ring), when normalization had been called for a normal ring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants