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.000158528 seconds elapsed
-- 0.000184116 seconds elapsed
-- 0.000161977 seconds elapsed
-- 0.000083948 seconds elapsed
-- 0.000177843 seconds elapsed
-- 0.000167148 seconds elapsed
-- 0.0000807 seconds elapsed
-- 0.000174782 seconds elapsed
-- 0.000158416 seconds elapsed
-- 0.000084017 seconds elapsed
-- 0.000163122 seconds elapsed
-- 0.000187168 seconds elapsed
-- 0.000158271 seconds elapsed
-- 0.000371243 seconds elapsed
-- 0.000187129 seconds elapsed
-- 0.000086875 seconds elapsed
-- 0.000412969 seconds elapsed
-- 0.000190233 seconds elapsed
-- 0.000086977 seconds elapsed
-- 0.000382783 seconds elapsed
-- 0.000186329 seconds elapsed
-- 0.000083283 seconds elapsed
-- 0.000512505 seconds elapsed
-- 0.000208062 seconds elapsed
-- 0.000079799 seconds elapsed
-- 0.00029453 seconds elapsed
-- 0.000177343 seconds elapsed
-- 0.000077783 seconds elapsed
-- 0.00033343 seconds elapsed
-- 0.000195507 seconds elapsed
-- 0.000092727 seconds elapsed
-- 0.000439182 seconds elapsed
-- 0.000264535 seconds elapsed
-- 0.000085733 seconds elapsed
-- 0.000189526 seconds elapsed
-- 0.000231976 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.000168433 seconds elapsed
-- 0.000149423 seconds elapsed
-- 0.000156729 seconds elapsed
-- 0.000091352 seconds elapsed
-- 0.000182182 seconds elapsed
-- 0.000164676 seconds elapsed
-- 0.000087065 seconds elapsed
-- 0.000160005 seconds elapsed
-- 0.00015852 seconds elapsed
-- 0.000158894 seconds elapsed
-- 0.000147525 seconds elapsed
-- 0.000180155 seconds elapsed
-- 0.000086549 seconds elapsed
-- 0.00017304 seconds elapsed
-- 0.000170831 seconds elapsed
-- 0.00008364 seconds elapsed
-- 0.000184602 seconds elapsed
-- 0.000179979 seconds elapsed
-- 0.000088417 seconds elapsed
-- 0.000169604 seconds elapsed
-- 0.000205684 seconds elapsed
-- 0.000084191 seconds elapsed
-- 0.000168479 seconds elapsed
-- 0.00022998 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.