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.000127977 seconds elapsed
-- 0.000158649 seconds elapsed
-- 0.000132645 seconds elapsed
-- 0.000068988 seconds elapsed
-- 0.000148952 seconds elapsed
-- 0.000136289 seconds elapsed
-- 0.000069901 seconds elapsed
-- 0.000151765 seconds elapsed
-- 0.000137057 seconds elapsed
-- 0.000069183 seconds elapsed
-- 0.000174288 seconds elapsed
-- 0.000198326 seconds elapsed
-- 0.00013551 seconds elapsed
-- 0.00034709 seconds elapsed
-- 0.000209926 seconds elapsed
-- 0.000068367 seconds elapsed
-- 0.000358967 seconds elapsed
-- 0.000155779 seconds elapsed
-- 0.000069724 seconds elapsed
-- 0.000297228 seconds elapsed
-- 0.000151876 seconds elapsed
-- 0.00006945 seconds elapsed
-- 0.000449379 seconds elapsed
-- 0.000158306 seconds elapsed
-- 0.000073213 seconds elapsed
-- 0.000257819 seconds elapsed
-- 0.000149366 seconds elapsed
-- 0.000069733 seconds elapsed
-- 0.000288322 seconds elapsed
-- 0.000157134 seconds elapsed
-- 0.000067834 seconds elapsed
-- 0.000383268 seconds elapsed
-- 0.000209874 seconds elapsed
-- 0.000066697 seconds elapsed
-- 0.00013653 seconds elapsed
-- 0.000191136 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.000131032 seconds elapsed
-- 0.000163534 seconds elapsed
-- 0.000182082 seconds elapsed
-- 0.000070893 seconds elapsed
-- 0.00013608 seconds elapsed
-- 0.000130041 seconds elapsed
-- 0.000068186 seconds elapsed
-- 0.000134038 seconds elapsed
-- 0.000129268 seconds elapsed
-- 0.000127272 seconds elapsed
-- 0.000131175 seconds elapsed
-- 0.000126807 seconds elapsed
-- 0.000068901 seconds elapsed
-- 0.000137547 seconds elapsed
-- 0.000131159 seconds elapsed
-- 0.000068399 seconds elapsed
-- 0.000137156 seconds elapsed
-- 0.000129886 seconds elapsed
-- 0.000069245 seconds elapsed
-- 0.000141297 seconds elapsed
-- 0.000173648 seconds elapsed
-- 0.000068279 seconds elapsed
-- 0.000137275 seconds elapsed
-- 0.000171431 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.