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.000216122 seconds elapsed
-- 0.000215881 seconds elapsed
-- 0.000176801 seconds elapsed
-- 0.000119241 seconds elapsed
-- 0.000219041 seconds elapsed
-- 0.000175521 seconds elapsed
-- 0.000122561 seconds elapsed
-- 0.000194441 seconds elapsed
-- 0.000171442 seconds elapsed
-- 0.000097601 seconds elapsed
-- 0.000180162 seconds elapsed
-- 0.000182801 seconds elapsed
-- 0.000235401 seconds elapsed
-- 0.000337042 seconds elapsed
-- 0.000196041 seconds elapsed
-- 0.000102121 seconds elapsed
-- 0.000405003 seconds elapsed
-- 0.000191681 seconds elapsed
-- 0.000103441 seconds elapsed
-- 0.000346003 seconds elapsed
-- 0.000190041 seconds elapsed
-- 0.000095481 seconds elapsed
-- 0.000499884 seconds elapsed
-- 0.000201362 seconds elapsed
-- 0.00010032 seconds elapsed
-- 0.000290722 seconds elapsed
-- 0.000185322 seconds elapsed
-- 0.00009292 seconds elapsed
-- 0.000343922 seconds elapsed
-- 0.000187001 seconds elapsed
-- 0.000107761 seconds elapsed
-- 0.000419683 seconds elapsed
-- 0.000276002 seconds elapsed
-- 0.000091721 seconds elapsed
-- 0.000197362 seconds elapsed
-- 0.000263922 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.000219842 seconds elapsed
-- 0.000179802 seconds elapsed
-- 0.000183642 seconds elapsed
-- 0.000111201 seconds elapsed
-- 0.000224522 seconds elapsed
-- 0.000175362 seconds elapsed
-- 0.000110881 seconds elapsed
-- 0.000202042 seconds elapsed
-- 0.000180121 seconds elapsed
-- 0.000220201 seconds elapsed
-- 0.000182281 seconds elapsed
-- 0.000170961 seconds elapsed
-- 0.000134241 seconds elapsed
-- 0.000196402 seconds elapsed
-- 0.000172122 seconds elapsed
-- 0.000105441 seconds elapsed
-- 0.000229202 seconds elapsed
-- 0.000180442 seconds elapsed
-- 0.000114121 seconds elapsed
-- 0.000239241 seconds elapsed
-- 0.000241122 seconds elapsed
-- 0.000123241 seconds elapsed
-- 0.000200841 seconds elapsed
-- 0.000223961 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.