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.000211082 seconds elapsed
-- 0.000182681 seconds elapsed
-- 0.000172641 seconds elapsed
-- 0.000102361 seconds elapsed
-- 0.000219762 seconds elapsed
-- 0.000160002 seconds elapsed
-- 0.000107201 seconds elapsed
-- 0.000217081 seconds elapsed
-- 0.000163921 seconds elapsed
-- 0.000116681 seconds elapsed
-- 0.000195802 seconds elapsed
-- 0.000179682 seconds elapsed
-- 0.000240082 seconds elapsed
-- 0.000301602 seconds elapsed
-- 0.000181841 seconds elapsed
-- 0.000116561 seconds elapsed
-- 0.000385163 seconds elapsed
-- 0.000203922 seconds elapsed
-- 0.000136761 seconds elapsed
-- 0.000342883 seconds elapsed
-- 0.000187721 seconds elapsed
-- 0.000108041 seconds elapsed
-- 0.000486884 seconds elapsed
-- 0.000198842 seconds elapsed
-- 0.000134321 seconds elapsed
-- 0.000289763 seconds elapsed
-- 0.000180682 seconds elapsed
-- 0.000113081 seconds elapsed
-- 0.000321962 seconds elapsed
-- 0.000215682 seconds elapsed
-- 0.000131041 seconds elapsed
-- 0.000436043 seconds elapsed
-- 0.000247402 seconds elapsed
-- 0.000117921 seconds elapsed
-- 0.000196281 seconds elapsed
-- 0.000224922 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.000218802 seconds elapsed
-- 0.000164241 seconds elapsed
-- 0.000156881 seconds elapsed
-- 0.000108281 seconds elapsed
-- 0.000189802 seconds elapsed
-- 0.000166561 seconds elapsed
-- 0.000108001 seconds elapsed
-- 0.000210441 seconds elapsed
-- 0.000167841 seconds elapsed
-- 0.000241522 seconds elapsed
-- 0.000145241 seconds elapsed
-- 0.000167601 seconds elapsed
-- 0.000109641 seconds elapsed
-- 0.000211121 seconds elapsed
-- 0.000161281 seconds elapsed
-- 0.000103641 seconds elapsed
-- 0.000233202 seconds elapsed
-- 0.000160361 seconds elapsed
-- 0.000122761 seconds elapsed
-- 0.000201642 seconds elapsed
-- 0.000221602 seconds elapsed
-- 0.00008896 seconds elapsed
-- 0.000195241 seconds elapsed
-- 0.000203521 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.