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.000105082 seconds elapsed
-- 0.000133291 seconds elapsed
-- 0.000109621 seconds elapsed
-- 0.00005183 seconds elapsed
-- 0.000115582 seconds elapsed
-- 0.000102341 seconds elapsed
-- 0.00005532 seconds elapsed
-- 0.000126672 seconds elapsed
-- 0.000110661 seconds elapsed
-- 0.00005393 seconds elapsed
-- 0.000128342 seconds elapsed
-- 0.000112949 seconds elapsed
-- 0.000102241 seconds elapsed
-- 0.000273213 seconds elapsed
-- 0.000128361 seconds elapsed
-- 0.00005415 seconds elapsed
-- 0.000289602 seconds elapsed
-- 0.000119541 seconds elapsed
-- 0.000050111 seconds elapsed
-- 0.000247502 seconds elapsed
-- 0.000123541 seconds elapsed
-- 0.00004958 seconds elapsed
-- 0.000364493 seconds elapsed
-- 0.000141892 seconds elapsed
-- 0.00005271 seconds elapsed
-- 0.000213412 seconds elapsed
-- 0.00011995 seconds elapsed
-- 0.00006409 seconds elapsed
-- 0.000229653 seconds elapsed
-- 0.000120621 seconds elapsed
-- 0.00005176 seconds elapsed
-- 0.000322743 seconds elapsed
-- 0.000174771 seconds elapsed
-- 0.000055741 seconds elapsed
-- 0.000109531 seconds elapsed
-- 0.000172641 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.000101181 seconds elapsed
-- 0.000099921 seconds elapsed
-- 0.000104371 seconds elapsed
-- 0.000052771 seconds elapsed
-- 0.00010373 seconds elapsed
-- 0.00010563 seconds elapsed
-- 0.000054371 seconds elapsed
-- 0.000106441 seconds elapsed
-- 0.0001012 seconds elapsed
-- 0.000101192 seconds elapsed
-- 0.000114411 seconds elapsed
-- 0.000103121 seconds elapsed
-- 0.000052181 seconds elapsed
-- 0.000103601 seconds elapsed
-- 0.000101681 seconds elapsed
-- 0.00005425 seconds elapsed
-- 0.000110631 seconds elapsed
-- 0.000099561 seconds elapsed
-- 0.000053561 seconds elapsed
-- 0.000105581 seconds elapsed
-- 0.000140601 seconds elapsed
-- 0.000051 seconds elapsed
-- 0.000108881 seconds elapsed
-- 0.000149932 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.