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.000119847 seconds elapsed
-- 0.000147592 seconds elapsed
-- 0.000118421 seconds elapsed
-- 0.000057606 seconds elapsed
-- 0.000127105 seconds elapsed
-- 0.000110824 seconds elapsed
-- 0.000060144 seconds elapsed
-- 0.000128425 seconds elapsed
-- 0.000115808 seconds elapsed
-- 0.000057753 seconds elapsed
-- 0.0001178 seconds elapsed
-- 0.000135577 seconds elapsed
-- 0.000114641 seconds elapsed
-- 0.000272398 seconds elapsed
-- 0.000128427 seconds elapsed
-- 0.000056543 seconds elapsed
-- 0.000292362 seconds elapsed
-- 0.000126624 seconds elapsed
-- 0.000057887 seconds elapsed
-- 0.000252962 seconds elapsed
-- 0.000126019 seconds elapsed
-- 0.000057321 seconds elapsed
-- 0.000376713 seconds elapsed
-- 0.000132181 seconds elapsed
-- 0.000057495 seconds elapsed
-- 0.000217613 seconds elapsed
-- 0.000126791 seconds elapsed
-- 0.00005683 seconds elapsed
-- 0.000243317 seconds elapsed
-- 0.000127073 seconds elapsed
-- 0.000055721 seconds elapsed
-- 0.000322939 seconds elapsed
-- 0.000171359 seconds elapsed
-- 0.000065606 seconds elapsed
-- 0.00012242 seconds elapsed
-- 0.000167469 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.000113371 seconds elapsed
-- 0.000107718 seconds elapsed
-- 0.000103864 seconds elapsed
-- 0.000057307 seconds elapsed
-- 0.000114509 seconds elapsed
-- 0.000108703 seconds elapsed
-- 0.000056734 seconds elapsed
-- 0.000114678 seconds elapsed
-- 0.000105093 seconds elapsed
-- 0.000119361 seconds elapsed
-- 0.000113852 seconds elapsed
-- 0.000106303 seconds elapsed
-- 0.000056958 seconds elapsed
-- 0.000110362 seconds elapsed
-- 0.000104198 seconds elapsed
-- 0.000058486 seconds elapsed
-- 0.000131316 seconds elapsed
-- 0.000112093 seconds elapsed
-- 0.000058373 seconds elapsed
-- 0.000118983 seconds elapsed
-- 0.000142554 seconds elapsed
-- 0.000059276 seconds elapsed
-- 0.000126165 seconds elapsed
-- 0.000152147 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.