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.000100948 seconds elapsed
-- 0.000129634 seconds elapsed
-- 0.000107155 seconds elapsed
-- 0.000055494 seconds elapsed
-- 0.00011995 seconds elapsed
-- 0.000106663 seconds elapsed
-- 0.00005242 seconds elapsed
-- 0.000124508 seconds elapsed
-- 0.000106693 seconds elapsed
-- 0.000056695 seconds elapsed
-- 0.000114658 seconds elapsed
-- 0.000114571 seconds elapsed
-- 0.000104396 seconds elapsed
-- 0.000255784 seconds elapsed
-- 0.000120553 seconds elapsed
-- 0.000055088 seconds elapsed
-- 0.00029088 seconds elapsed
-- 0.000119256 seconds elapsed
-- 0.000055201 seconds elapsed
-- 0.000255216 seconds elapsed
-- 0.000120982 seconds elapsed
-- 0.000055162 seconds elapsed
-- 0.000380507 seconds elapsed
-- 0.000131583 seconds elapsed
-- 0.000054629 seconds elapsed
-- 0.000204536 seconds elapsed
-- 0.000120505 seconds elapsed
-- 0.000054818 seconds elapsed
-- 0.00022933 seconds elapsed
-- 0.000120383 seconds elapsed
-- 0.000054459 seconds elapsed
-- 0.000316288 seconds elapsed
-- 0.000169576 seconds elapsed
-- 0.000053889 seconds elapsed
-- 0.000111564 seconds elapsed
-- 0.000156737 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.000099493 seconds elapsed
-- 0.000104182 seconds elapsed
-- 0.000097953 seconds elapsed
-- 0.0000523 seconds elapsed
-- 0.000105363 seconds elapsed
-- 0.000101699 seconds elapsed
-- 0.0000522 seconds elapsed
-- 0.000105114 seconds elapsed
-- 0.000100042 seconds elapsed
-- 0.000102246 seconds elapsed
-- 0.000106702 seconds elapsed
-- 0.000100209 seconds elapsed
-- 0.000054188 seconds elapsed
-- 0.000112557 seconds elapsed
-- 0.000099189 seconds elapsed
-- 0.000053372 seconds elapsed
-- 0.000112274 seconds elapsed
-- 0.000105446 seconds elapsed
-- 0.000054228 seconds elapsed
-- 0.000118181 seconds elapsed
-- 0.000141773 seconds elapsed
-- 0.000056123 seconds elapsed
-- 0.000110148 seconds elapsed
-- 0.000138492 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.