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.000109902 seconds elapsed
-- 0.000116322 seconds elapsed
-- 0.000102067 seconds elapsed
-- 0.000067797 seconds elapsed
-- 0.000102036 seconds elapsed
-- 0.000087398 seconds elapsed
-- 0.000054759 seconds elapsed
-- 0.000099765 seconds elapsed
-- 0.0000895 seconds elapsed
-- 0.000054224 seconds elapsed
-- 0.00009647 seconds elapsed
-- 0.000094725 seconds elapsed
-- 0.000103431 seconds elapsed
-- 0.000235709 seconds elapsed
-- 0.000113864 seconds elapsed
-- 0.000054441 seconds elapsed
-- 0.000234523 seconds elapsed
-- 0.000100347 seconds elapsed
-- 0.000056828 seconds elapsed
-- 0.000203777 seconds elapsed
-- 0.000104901 seconds elapsed
-- 0.000050317 seconds elapsed
-- 0.000291553 seconds elapsed
-- 0.000107672 seconds elapsed
-- 0.000055903 seconds elapsed
-- 0.000178359 seconds elapsed
-- 0.000101334 seconds elapsed
-- 0.00005794 seconds elapsed
-- 0.000204356 seconds elapsed
-- 0.000101874 seconds elapsed
-- 0.000067722 seconds elapsed
-- 0.00029737 seconds elapsed
-- 0.000160626 seconds elapsed
-- 0.000046107 seconds elapsed
-- 0.000096756 seconds elapsed
-- 0.000151678 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.00009767 seconds elapsed
-- 0.000079953 seconds elapsed
-- 0.000083838 seconds elapsed
-- 0.000052855 seconds elapsed
-- 0.000092758 seconds elapsed
-- 0.000097337 seconds elapsed
-- 0.000058258 seconds elapsed
-- 0.000088319 seconds elapsed
-- 0.000078975 seconds elapsed
-- 0.000100462 seconds elapsed
-- 0.000080812 seconds elapsed
-- 0.000082591 seconds elapsed
-- 0.00005142 seconds elapsed
-- 0.000100493 seconds elapsed
-- 0.000079625 seconds elapsed
-- 0.000051444 seconds elapsed
-- 0.000098905 seconds elapsed
-- 0.000078542 seconds elapsed
-- 0.000055387 seconds elapsed
-- 0.000097816 seconds elapsed
-- 0.000113096 seconds elapsed
-- 0.000043315 seconds elapsed
-- 0.000095095 seconds elapsed
-- 0.000119665 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.