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

missing Singular kernel functions #59

Open
ThomasBreuer opened this issue Oct 19, 2018 · 16 comments
Open

missing Singular kernel functions #59

ThomasBreuer opened this issue Oct 19, 2018 · 16 comments

Comments

@ThomasBreuer
Copy link
Member

I have tried to reimplement some of the functionality of Singular's finvar.lib,
using GAP and its package GAPJulia for calling Singular.jl,
but some of the Singular kernel features seem to be missing.

  • Maps are used for the substitutions of indeterminates by linear combinations thereof
    (e.g., in the function evaluate_reynolds in finvar.lib).
  • In order to compute a basis of a vector space spanned by polynomials of a fixed degree,
    finvar.lib sets the global variable degBound and then calls minbase.
  • The Singular function dim is used to compute the Krull dimension of an ideal
    (e.g., in the function primary_char0 in finvar.lib).

Did I overlook something, or are these functions not available via Singular.jl?
Of course I can implement these functions in GAP (or Julia),
and then use Singular itself essentially for Groebner basis computations;
is this a recommended way to proceed?

@wbhart
Copy link
Contributor

wbhart commented Oct 19, 2018

Singular.jl is currently being rewritten (see the cxx_wrap branch).

After we have it working again, we will switch over the code to run on Julia-1.0.

After that, we will start to fill out the kernel interface. We have a HiWi doing the above, so it could be some months before we get there.

@sebasguts
Copy link
Contributor

@wbhart Can you give a more precise (i.e., calendar week number) estimate on which date we will be able to use Singular.jl again? The new GAP interface only works with a Julia that contains @rbehrends patch, so it is unusable with Singular.jl, potentially until some time next year?

@wbhart
Copy link
Contributor

wbhart commented Oct 20, 2018

We will have someone work on it for ostensibly 3 months starting this coming Thursday. I will possibly find some time to put into it, but I can't guarantee that.

@wbhart
Copy link
Contributor

wbhart commented Oct 25, 2018

Sorry for the delay in updating everyone. This was quite difficult to sort out since it implied finding someone (else) to work on it.

We have agreed to get n_Q, spoly and sideal working with CxxWrap and Julia-1.0, up to an including std, by the time of our meeting in November. Barring any unforeseen obstacles, this should be possible given the manpower we currently have.

Sachin Mohan will be working on this, together with Andreas Steenpas. Our first meeting to discuss how to do the job is tomorrow at 4pm.

In the mean time, I will work on reestablishing support for Nemo coefficients as Singular coefficient rings, using the new CxxWrap interface we've been writing over the past few months (though not immediately, as I have other commitments right at this moment).

The work has been progressing very slowly as we only had a HiWi working on it 8 hours per week (you have to multiply every time estimate by 5 when comparing with a full time worker, and then make an adjustment for the level of experience).

Our HiWi will be cutting back to 4 hours per week over the next month, due to exams, hence the addition of Andreas Steenpas to the effort.

@wbhart
Copy link
Contributor

wbhart commented Oct 26, 2018

We've opened issue #60 for the update to Julia-1.0, which is a prerequisite to resolve this issue. Our meeting today went well, and I this is all underway now. Updates will continue at issue #60, until we are ready to get back to this issue.

@fingolfin
Copy link
Member

@ThomasBreuer do you know what the status of this issue is?

@ThomasBreuer
Copy link
Member Author

There is dimension for computing the Krull dimension of the quotient of a polynomial ring by an ideal, and substitutions can be computed with evaluate; at the moment I do not see how to get the minbase functionality.

@fieker
Copy link
Contributor

fieker commented Nov 25, 2020

What is the goal? In Oscar we have
function vector_space(K::AbstractAlgebra.Field, e::Array{T, 1}; target = nothing) where {T <: MPolyElem}

which will give the VS generated by the polynomials.
In Oscar/examples is
function Oscar.monomials(R::MPolyRing, d::Int)

is the goal to re-write the .lib in Singular.jl or in Oscar? minbase looks difficult as it seems to be also affected by global variables...

@hannes14
Copy link
Member

degBound affects all Groebner base computaions in Singular, not only minbase:
if your ideal is homogeneous, a partial GB (up toi degree degBound) is returned.
This can save you time IF you know that the result has at most degree degBound.
Not setting7using degBound willl also return the correct result, but needs mor time.

@fingolfin
Copy link
Member

@ThomasBreuer what's the status of this issue? is there still something concrete you are missing? By now, calling Singular library functions should be possible (and we do so in Oscar)

@ThomasBreuer
Copy link
Member Author

@fingolfin As far as I understand, minbase is a Singular kernel function, not a library function.
At the time when I opened this issue (three years ago), the idea was to use the GAP interface to Julia for using Singular functionality from GAP, and this worked via the machinery from GAP's Homalg package(s) but not via Singular.jl. (see the files GAP.jl/pkg/JuliaExperimental/gap/finvar.g*).
Independent of this old GAP code, the question would be what is the recommended way to get the minbase results in Oscar.

@fingolfin
Copy link
Member

minbase is implemented by the Singular kernel function idMinBase which is wrapped in libsingular-julia, and then called in Singular.jl by two methods for minimal_generating_set() (once for ideals and once for modules).

However, you (well, finvar.lib need it with degBound set. OK, so it took some time to trace this, but I believe this is the "sysvar" with id VMAXDEG and corresponds to the global variable Kstd1_deg in the Singular kernel. Since it is a global variable, using it is dangerous, as one must not forget to restore it else unexpected things can happen in code elsewhere. It is set by the interpreter C function jjMAXDEG which also enables/disables the global option OPT_DEGBOUND depending on whether the bound is zero or not.

As far as I could tell, there is no corresponding function in libsingular-julia right now (but maybe @hannes14 or @tthsqe12 know more).


For dim on an ideal, I think you can use dimension().


For "substitutions of indeterminates by linear combinations thereof" I think AlgebraHomomorphism can do it.

@tthsqe12
Copy link
Contributor

So the goal here is be able to repoduce the following singular code?

  int DEGB = degBound;
  degBound=d;
...
      B=minbase(B);
      degBound=DEGB;
      return(B);

Indeed, degBound is one of those global system variables, and is named VMAXDEG. The julia version could look like the following?

DEGB = Singular.set_deg_bound(d) # return the old value, also sets/clears OPT_DEGBOUND as in jjMAXDEG
... minimal_generating_set(...)
Singular.set_deg_bound(DEGB)

I actually don't like giving the user access to these global variables because now everyone has to also keep track of the state of them, which is just a headache. If there aren't too many functions that one would want to use with the non-default value of this global variable, could we just add the degree bound in as a second argument to minimal_generating_set?

@tthsqe12
Copy link
Contributor

What do we want here? I can see three possibilities:

  1. give the user unrestricted access to singular's global variables :(
  2. provide a minimal_generating_set(I::sideal, deg_bound::Int) which sets and resets the global variable internally
  3. provide a general with_deg_bound(d) do f in a do-block syntax for setting and resetting the global variable automatically in an arbitrary block of code.

@hannes14
Copy link
Member

I prefer 2, as deg_boud needs really "to know what you do".

@tthsqe12
Copy link
Contributor

I am doing the third option in #527, which can be used to easily implement stuff like the second option without making changes to libsingular-julia.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants