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.000104441 seconds elapsed
-- 0.000132872 seconds elapsed
-- 0.000109371 seconds elapsed
-- 0.00005316 seconds elapsed
-- 0.000114042 seconds elapsed
-- 0.000102861 seconds elapsed
-- 0.00005355 seconds elapsed
-- 0.000120631 seconds elapsed
-- 0.000105231 seconds elapsed
-- 0.0000542 seconds elapsed
-- 0.000103602 seconds elapsed
-- 0.000109891 seconds elapsed
-- 0.000095241 seconds elapsed
-- 0.000261783 seconds elapsed
-- 0.000118561 seconds elapsed
-- 0.00005429 seconds elapsed
-- 0.000290874 seconds elapsed
-- 0.000121961 seconds elapsed
-- 0.00004905 seconds elapsed
-- 0.000237153 seconds elapsed
-- 0.000138242 seconds elapsed
-- 0.000050581 seconds elapsed
-- 0.000380624 seconds elapsed
-- 0.000127811 seconds elapsed
-- 0.000052331 seconds elapsed
-- 0.000202942 seconds elapsed
-- 0.000118241 seconds elapsed
-- 0.00004888 seconds elapsed
-- 0.000226023 seconds elapsed
-- 0.000118362 seconds elapsed
-- 0.000069541 seconds elapsed
-- 0.000437795 seconds elapsed
-- 0.000244832 seconds elapsed
-- 0.000070011 seconds elapsed
-- 0.000144581 seconds elapsed
-- 0.000238732 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.000096512 seconds elapsed
-- 0.000095841 seconds elapsed
-- 0.000097131 seconds elapsed
-- 0.000051771 seconds elapsed
-- 0.000098811 seconds elapsed
-- 0.000097701 seconds elapsed
-- 0.0000517 seconds elapsed
-- 0.000098731 seconds elapsed
-- 0.000097891 seconds elapsed
-- 0.000099961 seconds elapsed
-- 0.000098461 seconds elapsed
-- 0.000099752 seconds elapsed
-- 0.00005128 seconds elapsed
-- 0.000099601 seconds elapsed
-- 0.000097871 seconds elapsed
-- 0.0000527 seconds elapsed
-- 0.000129442 seconds elapsed
-- 0.000100581 seconds elapsed
-- 0.000051211 seconds elapsed
-- 0.000105041 seconds elapsed
-- 0.000136381 seconds elapsed
-- 0.000053721 seconds elapsed
-- 0.000105781 seconds elapsed
-- 0.000143872 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.