oscar-system / Singular.jl

Julia package for the Singular library
Other
31 stars 33 forks source link

Turning off the reduce tails option #808

Closed Sequenzer closed 3 months ago

Sequenzer commented 4 months ago

Hey im having an issue using options in Singular.jl specifically the redTail option. I want to turn it off when calculating a Gröbner basis. But no matter what I do. It stays on. Any suggestions on how to turn it off?? In Singular, this is done directly with the noredTail option, but it does not seem to be an option in Singular.jl.

My Code

using Singular #Or Oscar.Singular
R, (u11,u12,u13,u14, 
u21,u22,u23,u24, 
u31,u32,u33,u34, 
u41,u42,u43,u44) = FreeAlgebra(QQ, ["u11", "u12", "u13", "u14", 
"u21", "u22", "u23", "u24", 
"u31", "u32", "u33", "u34", 
"u41", "u42", "u43", "u44"], 7) 
#rs1 = u11 + u12 + u13 + u14 - 1
rs2 = u21 + u22 + u23 + u24 - 1 
rs3 = u31 + u32 + u33 + u34 - 1 
rs4 = u41 + u42 + u43 + u44 - 1 
cs1 = u11 + u21 + u31 + u41 - 1 
cs2 = u12 + u22 + u32 + u42 - 1 
cs3 = u13 + u23 + u33 + u43 - 1 
cs4 = u14 + u24 + u34 + u44 - 1 

#alternative: Singular.useOption("noredTail")
#alternative: Singular.libSingular.set_option("OPT_REDTAIL",false)
#alternative: Singular.call_interpreter("option(noredTail);")

with_redTail(false) do
    J1 = Ideal(R,[rs2,rs3,rs4,cs1,cs2,cs3,cs4])   
    gens(std(J1))
end

This returns

7-element Vector{slpalg{n_Q}}:
 u41 + u42 + u43 + u44 - 1
 u31 + u32 + u33 + u34 - 1
 u21 + u22 + u23 + u24 - 1
 u14 + u24 + u34 + u44 - 1
 u13 + u23 + u33 + u43 - 1
 u12 + u22 + u32 + u42 - 1
 u11 - u22 - u23 - u24 - u32 - u33 - u34 - u42 - u43 - u44 + 2

Using Singular directly to get the "correct" Result:

LIB "freegb.lib";
ring r = 0,(u11,u12,u13,u14,
u21,u22,u23,u24,
u31,u32,u33,u34,
u41,u42,u43,u44),Dp;
def R = freeAlgebra(r,14);
setring R;
option(noredTail);

//poly rs1 = u11 + u12 + u13 + u14 - 1;
poly rs2 = u21 + u22 + u23 + u24 - 1;
poly rs3 = u31 + u32 + u33 + u34 - 1;
poly rs4 = u41 + u42 + u43 + u44 - 1;
poly cs1 = u11 + u21 + u31 + u41 - 1;
poly cs2 = u12 + u22 + u32 + u42 - 1;
poly cs3 = u13 + u23 + u33 + u43 - 1;
poly cs4 = u14 + u24 + u34 + u44 - 1;
ideal F2 = rs2,rs3,rs4,cs1,cs2,cs3,cs4;
std(F2);

Output:

_[1]=u41+u42+u43+u44-1
_[2]=u31+u32+u33+u34-1
_[3]=u21+u22+u23+u24-1
_[4]=u14+u24+u34+u44-1
_[5]=u13+u23+u33+u43-1
_[6]=u12+u22+u32+u42-1
_[7]=u11+u21+u31+u41-1

I asked this question in the OSCAR slack and was asked to open an issue.

thofma commented 4 months ago

@hannes14 any idea what could be going wrong?

hannes14 commented 4 months ago

setting the option works correctly as Singular.libSingular.call_interpreter("option();"); shows. std calls also the right function within Singular - I need to look deeper into that.