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.000133885 seconds elapsed
-- 0.000156539 seconds elapsed
-- 0.000134368 seconds elapsed
-- 0.00007029 seconds elapsed
-- 0.000150036 seconds elapsed
-- 0.000132868 seconds elapsed
-- 0.000071513 seconds elapsed
-- 0.000146867 seconds elapsed
-- 0.000134598 seconds elapsed
-- 0.000073443 seconds elapsed
-- 0.000141518 seconds elapsed
-- 0.000143004 seconds elapsed
-- 0.00013199 seconds elapsed
-- 0.000321585 seconds elapsed
-- 0.000151592 seconds elapsed
-- 0.000069849 seconds elapsed
-- 0.000360275 seconds elapsed
-- 0.000160074 seconds elapsed
-- 0.000071613 seconds elapsed
-- 0.000307168 seconds elapsed
-- 0.000150488 seconds elapsed
-- 0.000070249 seconds elapsed
-- 0.000461534 seconds elapsed
-- 0.000158648 seconds elapsed
-- 0.000072024 seconds elapsed
-- 0.000258367 seconds elapsed
-- 0.000149482 seconds elapsed
-- 0.000084604 seconds elapsed
-- 0.000293543 seconds elapsed
-- 0.00015485 seconds elapsed
-- 0.000067922 seconds elapsed
-- 0.000399065 seconds elapsed
-- 0.000207216 seconds elapsed
-- 0.000062177 seconds elapsed
-- 0.000133371 seconds elapsed
-- 0.000186098 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.000129644 seconds elapsed
-- 0.000121557 seconds elapsed
-- 0.000122814 seconds elapsed
-- 0.000070444 seconds elapsed
-- 0.000131403 seconds elapsed
-- 0.000126041 seconds elapsed
-- 0.000071799 seconds elapsed
-- 0.000134455 seconds elapsed
-- 0.000126033 seconds elapsed
-- 0.000132249 seconds elapsed
-- 0.000126229 seconds elapsed
-- 0.000124513 seconds elapsed
-- 0.000075943 seconds elapsed
-- 0.000132584 seconds elapsed
-- 0.00013268 seconds elapsed
-- 0.000072246 seconds elapsed
-- 0.000146158 seconds elapsed
-- 0.000127631 seconds elapsed
-- 0.000073757 seconds elapsed
-- 0.000138585 seconds elapsed
-- 0.000167039 seconds elapsed
-- 0.000062077 seconds elapsed
-- 0.000135876 seconds elapsed
-- 0.000166921 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.