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.000195083 seconds elapsed
-- 0.000266767 seconds elapsed
-- 0.000216925 seconds elapsed
-- 0.000100477 seconds elapsed
-- 0.000225721 seconds elapsed
-- 0.000209521 seconds elapsed
-- 0.000103193 seconds elapsed
-- 0.000233816 seconds elapsed
-- 0.000219941 seconds elapsed
-- 0.000099986 seconds elapsed
-- 0.000210803 seconds elapsed
-- 0.00023106 seconds elapsed
-- 0.000186207 seconds elapsed
-- 0.000514559 seconds elapsed
-- 0.000239136 seconds elapsed
-- 0.00010156 seconds elapsed
-- 0.000575673 seconds elapsed
-- 0.000233496 seconds elapsed
-- 0.000098293 seconds elapsed
-- 0.000456612 seconds elapsed
-- 0.000230579 seconds elapsed
-- 0.000103031 seconds elapsed
-- 0.000742814 seconds elapsed
-- 0.000240939 seconds elapsed
-- 0.000094877 seconds elapsed
-- 0.00039218 seconds elapsed
-- 0.000227995 seconds elapsed
-- 0.000101249 seconds elapsed
-- 0.000459767 seconds elapsed
-- 0.000290932 seconds elapsed
-- 0.000098082 seconds elapsed
-- 0.000611901 seconds elapsed
-- 0.000341837 seconds elapsed
-- 0.000097963 seconds elapsed
-- 0.000208599 seconds elapsed
-- 0.000314707 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.000189824 seconds elapsed
-- 0.000194082 seconds elapsed
-- 0.000194032 seconds elapsed
-- 0.000102141 seconds elapsed
-- 0.000203269 seconds elapsed
-- 0.000199482 seconds elapsed
-- 0.000095417 seconds elapsed
-- 0.000197548 seconds elapsed
-- 0.000192709 seconds elapsed
-- 0.000205874 seconds elapsed
-- 0.000197088 seconds elapsed
-- 0.000196295 seconds elapsed
-- 0.000100978 seconds elapsed
-- 0.00020385 seconds elapsed
-- 0.000249355 seconds elapsed
-- 0.000099195 seconds elapsed
-- 0.000226131 seconds elapsed
-- 0.000191697 seconds elapsed
-- 0.000104535 seconds elapsed
-- 0.000207817 seconds elapsed
-- 0.000270444 seconds elapsed
-- 0.000093975 seconds elapsed
-- 0.00020943 seconds elapsed
-- 0.000275994 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.