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.000191246 seconds elapsed
-- 0.00027328 seconds elapsed
-- 0.000212656 seconds elapsed
-- 0.000101199 seconds elapsed
-- 0.00023126 seconds elapsed
-- 0.000206525 seconds elapsed
-- 0.0001019 seconds elapsed
-- 0.000232213 seconds elapsed
-- 0.000206535 seconds elapsed
-- 0.000099405 seconds elapsed
-- 0.000251489 seconds elapsed
-- 0.000224538 seconds elapsed
-- 0.00019276 seconds elapsed
-- 0.000537161 seconds elapsed
-- 0.000232994 seconds elapsed
-- 0.000103383 seconds elapsed
-- 0.00058515 seconds elapsed
-- 0.00023054 seconds elapsed
-- 0.000097131 seconds elapsed
-- 0.000491135 seconds elapsed
-- 0.000229989 seconds elapsed
-- 0.000100017 seconds elapsed
-- 0.000753274 seconds elapsed
-- 0.0002467 seconds elapsed
-- 0.000099877 seconds elapsed
-- 0.000401097 seconds elapsed
-- 0.000229357 seconds elapsed
-- 0.000099665 seconds elapsed
-- 0.000510852 seconds elapsed
-- 0.000234897 seconds elapsed
-- 0.000097332 seconds elapsed
-- 0.000634172 seconds elapsed
-- 0.000345123 seconds elapsed
-- 0.00009675 seconds elapsed
-- 0.00020923 seconds elapsed
-- 0.00031048 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.000189482 seconds elapsed
-- 0.000190305 seconds elapsed
-- 0.000197348 seconds elapsed
-- 0.000105886 seconds elapsed
-- 0.000202748 seconds elapsed
-- 0.000197498 seconds elapsed
-- 0.000099044 seconds elapsed
-- 0.00020385 seconds elapsed
-- 0.000198761 seconds elapsed
-- 0.000196486 seconds elapsed
-- 0.000198089 seconds elapsed
-- 0.00018811 seconds elapsed
-- 0.000101119 seconds elapsed
-- 0.000201425 seconds elapsed
-- 0.000190756 seconds elapsed
-- 0.000126596 seconds elapsed
-- 0.000236972 seconds elapsed
-- 0.000197078 seconds elapsed
-- 0.000103984 seconds elapsed
-- 0.000215401 seconds elapsed
-- 0.00026808 seconds elapsed
-- 0.000137758 seconds elapsed
-- 0.000222223 seconds elapsed
-- 0.000287505 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.