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
342 stars 125 forks source link

`standard_basis` not working for SubquoModule over quotient ring #4203

Open thofma opened 1 day ago

thofma commented 1 day ago

From a user on slack, I am just the messenger.

julia> R, (x,y) = polynomial_ring(GF(2), ["x","y"]);

julia> A, _ = quo(R, ideal(R, [x^2+1, y^2+1]));

julia> F = free_module(A,2);

julia> M,_ = sub(F, [F([A(x+1),A(y+1)])]);

julia> FF = free_module(A, ngens(M)); phi = hom(FF, M, gens(M)); K, = kernel(phi); gens(K)
1-element Vector{SubquoModuleElem{MPolyQuoRingElem{FqMPolyRingElem}}}:
 (x*y + x + y + 1)*e[1]

julia> standard_basis(K)
ERROR: wrong rings
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] *(M::MonomialOrdering{FqMPolyRing}, N::ModuleOrdering{FreeMod{MPolyQuoRingElem{FqMPolyRingElem}}})
   @ Oscar.Orderings ~/.julia/packages/Oscar/38HwK/src/Rings/orderings.jl:1915
 [3] default_ordering(F::FreeMod{MPolyQuoRingElem{FqMPolyRingElem}})
   @ Oscar ~/.julia/packages/Oscar/38HwK/src/Modules/UngradedModules/Methods.jl:235
 [4] default_ordering(M::SubquoModule{MPolyQuoRingElem{FqMPolyRingElem}})
   @ Oscar ~/.julia/packages/Oscar/38HwK/src/Modules/UngradedModules/SubquoModule.jl:737
 [5] standard_basis(M::SubquoModule{MPolyQuoRingElem{FqMPolyRingElem}})
   @ Oscar ~/.julia/packages/Oscar/38HwK/src/Modules/UngradedModules/SubquoModule.jl:757
 [6] top-level scope
   @ REPL[8]:1

Maybe @wdecker @HechtiDerLachs have an idea or know the person that should have the idea?

Edit: This is with Oscar master version 534513fb17.

HechtiDerLachs commented 1 day ago

It seems that the user wants to use standard_basis over quotient rings. I am not even sure, this exists. Recently @RafaelDavidMohr carried over some resolutions over quotient rings and I made some first steps to extend the groebner basis functionality for modules over quotient rings in Oscar. However, the latter only became a stub and was not polished to an honest PR.

I think there simply is no groebner- or standard basis functionality for modules over quotient rings at the moment. The computational backend for such modules is implemented via a deflection to the polynomial case; see src/Modules/mpolyquo.jl. This is not very performant, but I just wanted to get some version running back then. And this was used to test the generic interface for the modules.

So you could either say that it is an issue (which it probably is) that we don't have this functionality. Or for the time being the issue is that we do not clearly communicate with the user. For instance, here we should throw a more informative error message explaining that a call to standard_basis is not legitimate here, rather than having something crack down the road.

iLockya commented 1 day ago

This code works on Singular.jl


julia> A,(x,y) = QuotientRing(R, std(Ideal(R, x^2+1,y^2+1)));

julia> F = FreeModule(A,2);

julia> M = Singular.Module(A, F([x+1, y+1]));

julia> K = syz(M);

julia> K
Singular module over Singular polynomial quotient ring (ZZ/2),(x,y),(dp(2),C), with generators:
xy*gen(1)+x*gen(1)+y*gen(1)+gen(1)

julia> std(K)
Singular module over Singular polynomial quotient ring (ZZ/2),(x,y),(dp(2),C), with generators:
xy*gen(1)+x*gen(1)+y*gen(1)+gen(1)

julia> x.parent
Singular polynomial quotient ring (ZZ/2),(x,y),(dp(2),C)

maybe just some simplification of modules?

HechtiDerLachs commented 1 day ago

I'm not too surprised. The functionality is just not integrated in Oscar, yet.

HechtiDerLachs commented 1 day ago

If #4204 is approved and merged, I would remove the "bug"-label here. The issue can probably stay as a request for an enhancement.

fieker commented 1 day ago

On Tue, Oct 15, 2024 at 02:17:55AM -0700, Matthias Zach wrote:

I'm not too surprised. The functionality is just not integrated in Oscar, yet. What is syz(M) supposed to do? Mathematically, I do not think a module has syzygies at all. There should be a command syzygies(Vector of Module Elems) or similar, possibly even liked to nullspace/ kernel of a matrix over polynomials, but never directly to an ideal or module

-- Reply to this email directly or view it on GitHub: https://github.com/oscar-system/Oscar.jl/issues/4203#issuecomment-2413346317 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

wdecker commented 1 day ago

What is syz(M) supposed to do? Mathematically, I do not think a module has syzygies at all. There should be a command syzygies(Vector of Module Elems) or similar, possibly even liked to nullspace/ kernel of a matrix over polynomials, but never directly to an ideal or module

@fieker Of course! But in the example, this is referring to the syz from singular.jl. In Oscar, so far, we have syzygy_generators which applies to a vector of polynomials. The analogue for modules should be implemented.

HechtiDerLachs commented 1 day ago

The analogue for modules should be implemented.

Done; see #4204.