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.000263622 seconds elapsed
-- 0.000177601 seconds elapsed
-- 0.000133981 seconds elapsed
-- 0.000099631 seconds elapsed
-- 0.000217471 seconds elapsed
-- 0.000172711 seconds elapsed
-- 0.00012358 seconds elapsed
-- 0.000221821 seconds elapsed
-- 0.000178042 seconds elapsed
-- 0.000125511 seconds elapsed
-- 0.000208571 seconds elapsed
-- 0.000191542 seconds elapsed
-- 0.000169951 seconds elapsed
-- 0.000393023 seconds elapsed
-- 0.000194501 seconds elapsed
-- 0.000113581 seconds elapsed
-- 0.000585225 seconds elapsed
-- 0.000204552 seconds elapsed
-- 0.000103171 seconds elapsed
-- 0.000379082 seconds elapsed
-- 0.000188501 seconds elapsed
-- 0.00011297 seconds elapsed
-- 0.000584784 seconds elapsed
-- 0.000159221 seconds elapsed
-- 0.000087821 seconds elapsed
-- 0.000261772 seconds elapsed
-- 0.000143061 seconds elapsed
-- 0.000090392 seconds elapsed
-- 0.000306112 seconds elapsed
-- 0.000144451 seconds elapsed
-- 0.000101701 seconds elapsed
-- 0.000405474 seconds elapsed
-- 0.000240502 seconds elapsed
-- 0.000078571 seconds elapsed
-- 0.000166081 seconds elapsed
-- 0.000192061 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.000204171 seconds elapsed
-- 0.000145791 seconds elapsed
-- 0.000151571 seconds elapsed
-- 0.00008135 seconds elapsed
-- 0.000146551 seconds elapsed
-- 0.00011346 seconds elapsed
-- 0.000082751 seconds elapsed
-- 0.000148192 seconds elapsed
-- 0.00013313 seconds elapsed
-- 0.000164601 seconds elapsed
-- 0.000117511 seconds elapsed
-- 0.00011244 seconds elapsed
-- 0.00006943 seconds elapsed
-- 0.000137151 seconds elapsed
-- 0.000117691 seconds elapsed
-- 0.000078161 seconds elapsed
-- 0.000174662 seconds elapsed
-- 0.000120081 seconds elapsed
-- 0.00009769 seconds elapsed
-- 0.000161231 seconds elapsed
-- 0.000164841 seconds elapsed
-- 0.000067481 seconds elapsed
-- 0.000160502 seconds elapsed
-- 0.000172741 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.