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.0043707 seconds elapsed
-- 0.006088 seconds elapsed
-- 0.0057057 seconds elapsed
-- 0.0018974 seconds elapsed
-- 0.0054829 seconds elapsed
-- 0.0052284 seconds elapsed
-- 0.0018672 seconds elapsed
-- 0.0054548 seconds elapsed
-- 0.0046424 seconds elapsed
-- 0.0019229 seconds elapsed
-- 0.0057137 seconds elapsed
-- 0.0051939 seconds elapsed
-- 0.0042152 seconds elapsed
-- 0.0104766 seconds elapsed
-- 0.0056716 seconds elapsed
-- 0.0019206 seconds elapsed
-- 0.0098448 seconds elapsed
-- 0.0052687 seconds elapsed
-- 0.0037159 seconds elapsed
-- 0.0168299 seconds elapsed
-- 0.0060382 seconds elapsed
-- 0.0032671 seconds elapsed
-- 0.0212443 seconds elapsed
-- 0.010138 seconds elapsed
-- 0.0031007 seconds elapsed
-- 0.0116326 seconds elapsed
-- 0.0096345 seconds elapsed
-- 0.0036311 seconds elapsed
-- 0.0161858 seconds elapsed
-- 0.0107993 seconds elapsed
-- 0.0037301 seconds elapsed
-- 0.0191897 seconds elapsed
-- 0.0136489 seconds elapsed
-- 0.002682 seconds elapsed
-- 0.0058815 seconds elapsed
-- 0.0070802 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.0038678 seconds elapsed
-- 0.0057782 seconds elapsed
-- 0.0054829 seconds elapsed
-- 0.0041037 seconds elapsed
-- 0.0083396 seconds elapsed
-- 0.0086845 seconds elapsed
-- 0.0039755 seconds elapsed
-- 0.0091532 seconds elapsed
-- 0.0063913 seconds elapsed
-- 0.0068195 seconds elapsed
-- 0.005364 seconds elapsed
-- 0.0069527 seconds elapsed
-- 0.0018892 seconds elapsed
-- 0.0080911 seconds elapsed
-- 0.0058589 seconds elapsed
-- 0.0020596 seconds elapsed
-- 0.0095334 seconds elapsed
-- 0.0053585 seconds elapsed
-- 0.0022492 seconds elapsed
-- 0.0058096 seconds elapsed
-- 0.006326 seconds elapsed
-- 0.0021293 seconds elapsed
-- 0.0058566 seconds elapsed
-- 0.0062551 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.