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.000182272 seconds elapsed
-- 0.000249557 seconds elapsed
-- 0.000197259 seconds elapsed
-- 0.00010111 seconds elapsed
-- 0.000221194 seconds elapsed
-- 0.00020357 seconds elapsed
-- 0.000092993 seconds elapsed
-- 0.000221565 seconds elapsed
-- 0.000199252 seconds elapsed
-- 0.000097963 seconds elapsed
-- 0.000210824 seconds elapsed
-- 0.000207698 seconds elapsed
-- 0.000174126 seconds elapsed
-- 0.000506328 seconds elapsed
-- 0.000222276 seconds elapsed
-- 0.000097793 seconds elapsed
-- 0.000564417 seconds elapsed
-- 0.000226464 seconds elapsed
-- 0.000098044 seconds elapsed
-- 0.000485939 seconds elapsed
-- 0.000220172 seconds elapsed
-- 0.000092203 seconds elapsed
-- 0.000712052 seconds elapsed
-- 0.000235562 seconds elapsed
-- 0.000092834 seconds elapsed
-- 0.000402332 seconds elapsed
-- 0.000223849 seconds elapsed
-- 0.000092624 seconds elapsed
-- 0.000497651 seconds elapsed
-- 0.000228607 seconds elapsed
-- 0.000093074 seconds elapsed
-- 0.000621684 seconds elapsed
-- 0.000322333 seconds elapsed
-- 0.000095069 seconds elapsed
-- 0.000206757 seconds elapsed
-- 0.000301154 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.000182181 seconds elapsed
-- 0.000192831 seconds elapsed
-- 0.000190657 seconds elapsed
-- 0.000095929 seconds elapsed
-- 0.000219651 seconds elapsed
-- 0.000187201 seconds elapsed
-- 0.000102743 seconds elapsed
-- 0.000196928 seconds elapsed
-- 0.000193191 seconds elapsed
-- 0.000196819 seconds elapsed
-- 0.000207027 seconds elapsed
-- 0.000201487 seconds elapsed
-- 0.000102871 seconds elapsed
-- 0.000205015 seconds elapsed
-- 0.000189365 seconds elapsed
-- 0.000103374 seconds elapsed
-- 0.000223207 seconds elapsed
-- 0.000189253 seconds elapsed
-- 0.000100206 seconds elapsed
-- 0.000198643 seconds elapsed
-- 0.00025646 seconds elapsed
-- 0.000093764 seconds elapsed
-- 0.000205125 seconds elapsed
-- 0.000276257 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.