Speed up vector_space_basis for SubquoModule#5915
Speed up vector_space_basis for SubquoModule#5915Syz-MS wants to merge 8 commits intooscar-system:masterfrom
vector_space_basis for SubquoModule#5915Conversation
HechtiDerLachs
left a comment
There was a problem hiding this comment.
Thanks! Looks good on a first glance. I will read it more carefully later.
| o = negdegrevlex(base_ring(M_shift))*lex(ambient_free_module(M_shift)) | ||
| return _has_monomials_on_all_axes(leading_module(M_shift.quo, o)) | ||
| ord = negdegrevlex(base_ring(M_shift))*lex(ambient_free_module(M_shift)) | ||
| return _has_monomials_on_all_axes(standard_basis(M_shift.quo, ordering = ord)) |
There was a problem hiding this comment.
I'm afraid, this might be doing something wrong here. @afkafkafk13 : There was a reason why the leading_module was used in the local case, wasn't it? Or was this resolved?
There was a problem hiding this comment.
I replaced the code of _has_monomials_on_all_axes() above to accept the ModuleGens of a standard basis GB as an input and compute for the corresponding leading module whether it has monomials on all axes.
So maybe the function should be renamed to _has_leading_monomials_on_all_axes(GB) ??
Edit: I also forgot to change the signature in the docstring
| singular_gens = singular_generators(F) | ||
| return ModuleGens(oscar_free_module(F), Singular.lead(singular_gens)) | ||
| mg = ModuleGens(oscar_free_module(F), Singular.lead(singular_gens)) | ||
| mg.S.isGB = true # TODO: should be set in lead in Singular |
There was a problem hiding this comment.
Should we open a PR on Singular.jl for this?
There was a problem hiding this comment.
I can open a PR later.
|
This should fix the failing doctest due to #5914 |
Tunes
vector_space_basisfor aSubquoModuleover aMPolyAnyRingby reducing the number of monomials that need to be checked individually to be in the leading module of interest.This is achieved by computing (and caching):
Using this data the number of monomials which need to be check individually in each coordinate of the ambient free module is reduced.
Examples like this motivated these optimizations:
Even in (smaller) examples, which profit less from these optimizations, there is a slight speed up:
Edit: Also overwrites the generic function
_vector_space_dim(kk::Field, M::SubquoModule; check::Bool=true)for presentedSubquoModules over aMPolyAnyRingover aField(Localized rings only at a point) with wrappers to Singular'svdim.