This checks whether the generators of a subring or the sagbi generators of a computation object form a sagbi basis. After running sagbi on a subring, note that the result of the computation is stored in that subring. If new sagbi generators need to be added to S to make it a sagbi basis then isSAGBI will return false. If isSAGBI is run on a ring for which no sagbi computation has been performed, then isSAGBI will perform a test to see if the generators form a sagbi basis. This test can be skipped by setting Compute to false, and, in that case, isSAGBI will return null.
i1 : R = QQ[x,y,z];
|
i2 : S = subring {x+y+z,x*y+x*z+y*z, x*y*z, (x-y)*(x-z)*(y-z)};
|
i3 : isSAGBI S
o3 = false
|
i4 : sagbi(S, Limit => 5)
o4 = Partial SAGBIBasis Computation Object with 6 generators, Limit = 5.
o4 : SAGBIBasis
|
i5 : isSAGBI S
-- 0.000205313 seconds elapsed
-- 0.000260248 seconds elapsed
-- 0.000211957 seconds elapsed
-- 0.00010116 seconds elapsed
-- 0.000227566 seconds elapsed
-- 0.000216565 seconds elapsed
-- 0.000100399 seconds elapsed
-- 0.000230942 seconds elapsed
-- 0.000239848 seconds elapsed
-- 0.000105298 seconds elapsed
-- 0.000225371 seconds elapsed
-- 0.00022967 seconds elapsed
-- 0.000191177 seconds elapsed
-- 0.000570738 seconds elapsed
-- 0.000224971 seconds elapsed
-- 0.000104075 seconds elapsed
-- 0.000600724 seconds elapsed
-- 0.000237284 seconds elapsed
-- 0.000098994 seconds elapsed
-- 0.000540082 seconds elapsed
-- 0.000238006 seconds elapsed
-- 0.000097693 seconds elapsed
-- 0.000766715 seconds elapsed
-- 0.000240771 seconds elapsed
-- 0.000114234 seconds elapsed
-- 0.000411951 seconds elapsed
-- 0.000267109 seconds elapsed
-- 0.000099786 seconds elapsed
-- 0.00049147 seconds elapsed
-- 0.000237004 seconds elapsed
-- 0.000099336 seconds elapsed
-- 0.00063641 seconds elapsed
-- 0.00033134 seconds elapsed
-- 0.000098715 seconds elapsed
-- 0.000218158 seconds elapsed
-- 0.00032095 seconds elapsed
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
o5 = false
|
i6 : S' = subring {x+y+z,x*y+x*z+y*z, x*y*z};
|
i7 : isSAGBI S'
o7 = true
|
i8 : sagbi(S', Limit => 5)
o8 = SAGBIBasis Computation Object with 3 generators, Limit = 5.
o8 : SAGBIBasis
|
i9 : isSAGBI S'
-- 0.000185617 seconds elapsed
-- 0.000191518 seconds elapsed
-- 0.000203501 seconds elapsed
-- 0.000099997 seconds elapsed
-- 0.000205506 seconds elapsed
-- 0.000198732 seconds elapsed
-- 0.00010143 seconds elapsed
-- 0.000201927 seconds elapsed
-- 0.000199182 seconds elapsed
-- 0.000188502 seconds elapsed
-- 0.000202298 seconds elapsed
-- 0.000195836 seconds elapsed
-- 0.000100288 seconds elapsed
-- 0.000206386 seconds elapsed
-- 0.000194213 seconds elapsed
-- 0.000110055 seconds elapsed
-- 0.000249407 seconds elapsed
-- 0.000196839 seconds elapsed
-- 0.000100829 seconds elapsed
-- 0.00020873 seconds elapsed
-- 0.000292708 seconds elapsed
-- 0.000094267 seconds elapsed
-- 0.000213981 seconds elapsed
-- 0.000284292 seconds elapsed
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
timing raw subduction
o9 = true
|
If isSAGBI is supplied a SAGBIBasis then the generators of the subring can be checked for being a sagbi basis by setting UseSubringGens to true.
A note of caution. Excessive use of isSAGBI may impact performance. The inputs and outputs of isSAGBI are stored and never deleted. Since the inputs and outputs include pointers objects such as SAGBIBasis computation objects, these objects will not be garbage collected.