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.000107121 seconds elapsed
-- 0.000151585 seconds elapsed
-- 0.000114495 seconds elapsed
-- 0.000059672 seconds elapsed
-- 0.000119245 seconds elapsed
-- 0.000110467 seconds elapsed
-- 0.000054161 seconds elapsed
-- 0.000121678 seconds elapsed
-- 0.000108975 seconds elapsed
-- 0.000055304 seconds elapsed
-- 0.000114094 seconds elapsed
-- 0.000117471 seconds elapsed
-- 0.000115917 seconds elapsed
-- 0.000299382 seconds elapsed
-- 0.000126658 seconds elapsed
-- 0.000056997 seconds elapsed
-- 0.000331343 seconds elapsed
-- 0.000126377 seconds elapsed
-- 0.000061556 seconds elapsed
-- 0.000337424 seconds elapsed
-- 0.000128741 seconds elapsed
-- 0.000053069 seconds elapsed
-- 0.000415681 seconds elapsed
-- 0.000132329 seconds elapsed
-- 0.000058981 seconds elapsed
-- 0.000254097 seconds elapsed
-- 0.000124213 seconds elapsed
-- 0.000056306 seconds elapsed
-- 0.000257384 seconds elapsed
-- 0.000126828 seconds elapsed
-- 0.000073668 seconds elapsed
-- 0.000345018 seconds elapsed
-- 0.000178696 seconds elapsed
-- 0.000055144 seconds elapsed
-- 0.000117651 seconds elapsed
-- 0.000183185 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.000106951 seconds elapsed
-- 0.000103664 seconds elapsed
-- 0.000103033 seconds elapsed
-- 0.000055524 seconds elapsed
-- 0.000108403 seconds elapsed
-- 0.0001219 seconds elapsed
-- 0.00005316 seconds elapsed
-- 0.000107643 seconds elapsed
-- 0.000107632 seconds elapsed
-- 0.000106519 seconds elapsed
-- 0.000118403 seconds elapsed
-- 0.000107562 seconds elapsed
-- 0.000054232 seconds elapsed
-- 0.000104255 seconds elapsed
-- 0.000100088 seconds elapsed
-- 0.000057368 seconds elapsed
-- 0.000127861 seconds elapsed
-- 0.000120666 seconds elapsed
-- 0.000053751 seconds elapsed
-- 0.000118924 seconds elapsed
-- 0.000136896 seconds elapsed
-- 0.000059232 seconds elapsed
-- 0.000115406 seconds elapsed
-- 0.000164189 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.