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.000236825 seconds elapsed
-- 0.000314676 seconds elapsed
-- 0.000275714 seconds elapsed
-- 0.000117587 seconds elapsed
-- 0.00027192 seconds elapsed
-- 0.000273519 seconds elapsed
-- 0.000116265 seconds elapsed
-- 0.000272601 seconds elapsed
-- 0.000270433 seconds elapsed
-- 0.000118244 seconds elapsed
-- 0.000257918 seconds elapsed
-- 0.000297681 seconds elapsed
-- 0.000229327 seconds elapsed
-- 0.000667614 seconds elapsed
-- 0.000307704 seconds elapsed
-- 0.000114949 seconds elapsed
-- 0.000720778 seconds elapsed
-- 0.000314332 seconds elapsed
-- 0.000115882 seconds elapsed
-- 0.000607253 seconds elapsed
-- 0.000307512 seconds elapsed
-- 0.000115896 seconds elapsed
-- 0.000927844 seconds elapsed
-- 0.000316754 seconds elapsed
-- 0.000118979 seconds elapsed
-- 0.000506829 seconds elapsed
-- 0.000305899 seconds elapsed
-- 0.000118197 seconds elapsed
-- 0.000568751 seconds elapsed
-- 0.000315119 seconds elapsed
-- 0.000114017 seconds elapsed
-- 0.0008014 seconds elapsed
-- 0.000478803 seconds elapsed
-- 0.000116426 seconds elapsed
-- 0.000252094 seconds elapsed
-- 0.000440524 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.000229573 seconds elapsed
-- 0.0002425 seconds elapsed
-- 0.000250316 seconds elapsed
-- 0.000115105 seconds elapsed
-- 0.00023405 seconds elapsed
-- 0.000266192 seconds elapsed
-- 0.000119923 seconds elapsed
-- 0.000237327 seconds elapsed
-- 0.000255354 seconds elapsed
-- 0.000227371 seconds elapsed
-- 0.000241745 seconds elapsed
-- 0.000262209 seconds elapsed
-- 0.000119701 seconds elapsed
-- 0.000246244 seconds elapsed
-- 0.000259604 seconds elapsed
-- 0.000119946 seconds elapsed
-- 0.000247376 seconds elapsed
-- 0.000255553 seconds elapsed
-- 0.000119095 seconds elapsed
-- 0.000255117 seconds elapsed
-- 0.000380208 seconds elapsed
-- 0.000119904 seconds elapsed
-- 0.000256286 seconds elapsed
-- 0.000398985 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.