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.000120022 seconds elapsed
-- 0.000155183 seconds elapsed
-- 0.000129972 seconds elapsed
-- 0.000068818 seconds elapsed
-- 0.000140634 seconds elapsed
-- 0.000130054 seconds elapsed
-- 0.000065351 seconds elapsed
-- 0.000142577 seconds elapsed
-- 0.000133032 seconds elapsed
-- 0.000063547 seconds elapsed
-- 0.000136679 seconds elapsed
-- 0.000140627 seconds elapsed
-- 0.000113652 seconds elapsed
-- 0.000291834 seconds elapsed
-- 0.000141571 seconds elapsed
-- 0.000063324 seconds elapsed
-- 0.000331222 seconds elapsed
-- 0.000144342 seconds elapsed
-- 0.000065954 seconds elapsed
-- 0.000270964 seconds elapsed
-- 0.000147442 seconds elapsed
-- 0.000066272 seconds elapsed
-- 0.000426993 seconds elapsed
-- 0.000157507 seconds elapsed
-- 0.00006447 seconds elapsed
-- 0.000232479 seconds elapsed
-- 0.000145344 seconds elapsed
-- 0.000065104 seconds elapsed
-- 0.00026605 seconds elapsed
-- 0.000148775 seconds elapsed
-- 0.000064266 seconds elapsed
-- 0.000342168 seconds elapsed
-- 0.000207621 seconds elapsed
-- 0.000063464 seconds elapsed
-- 0.000124266 seconds elapsed
-- 0.000192307 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.000116699 seconds elapsed
-- 0.000120897 seconds elapsed
-- 0.000122075 seconds elapsed
-- 0.00006378 seconds elapsed
-- 0.000122631 seconds elapsed
-- 0.000118979 seconds elapsed
-- 0.000064829 seconds elapsed
-- 0.00012544 seconds elapsed
-- 0.000121008 seconds elapsed
-- 0.000117572 seconds elapsed
-- 0.000123661 seconds elapsed
-- 0.000119778 seconds elapsed
-- 0.00006477 seconds elapsed
-- 0.000131197 seconds elapsed
-- 0.000124239 seconds elapsed
-- 0.000065608 seconds elapsed
-- 0.000132527 seconds elapsed
-- 0.000124325 seconds elapsed
-- 0.000068243 seconds elapsed
-- 0.000133447 seconds elapsed
-- 0.000181367 seconds elapsed
-- 0.000068105 seconds elapsed
-- 0.000133727 seconds elapsed
-- 0.000175897 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.