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.000218825 seconds elapsed
-- 0.000307805 seconds elapsed
-- 0.000265598 seconds elapsed
-- 0.000114963 seconds elapsed
-- 0.000270229 seconds elapsed
-- 0.000257629 seconds elapsed
-- 0.000113669 seconds elapsed
-- 0.000269845 seconds elapsed
-- 0.000266589 seconds elapsed
-- 0.000116212 seconds elapsed
-- 0.000254994 seconds elapsed
-- 0.000291135 seconds elapsed
-- 0.00021593 seconds elapsed
-- 0.000646737 seconds elapsed
-- 0.000296366 seconds elapsed
-- 0.000114124 seconds elapsed
-- 0.000702446 seconds elapsed
-- 0.000313951 seconds elapsed
-- 0.00011855 seconds elapsed
-- 0.000579137 seconds elapsed
-- 0.000295033 seconds elapsed
-- 0.000110691 seconds elapsed
-- 0.000869145 seconds elapsed
-- 0.000303273 seconds elapsed
-- 0.000107762 seconds elapsed
-- 0.000478359 seconds elapsed
-- 0.000285708 seconds elapsed
-- 0.000111906 seconds elapsed
-- 0.000532899 seconds elapsed
-- 0.000290551 seconds elapsed
-- 0.000107595 seconds elapsed
-- 0.00074204 seconds elapsed
-- 0.000458114 seconds elapsed
-- 0.0001089 seconds elapsed
-- 0.000238862 seconds elapsed
-- 0.000407422 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.000197551 seconds elapsed
-- 0.00021315 seconds elapsed
-- 0.000226138 seconds elapsed
-- 0.000102767 seconds elapsed
-- 0.000215105 seconds elapsed
-- 0.000223349 seconds elapsed
-- 0.000102674 seconds elapsed
-- 0.000224625 seconds elapsed
-- 0.000222666 seconds elapsed
-- 0.000200239 seconds elapsed
-- 0.000215105 seconds elapsed
-- 0.000221724 seconds elapsed
-- 0.000101357 seconds elapsed
-- 0.000215834 seconds elapsed
-- 0.000223175 seconds elapsed
-- 0.000106103 seconds elapsed
-- 0.000226603 seconds elapsed
-- 0.000233458 seconds elapsed
-- 0.000108933 seconds elapsed
-- 0.000239578 seconds elapsed
-- 0.00035277 seconds elapsed
-- 0.000111625 seconds elapsed
-- 0.00023846 seconds elapsed
-- 0.000354852 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.