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.000110689 seconds elapsed
-- 0.000147589 seconds elapsed
-- 0.000122902 seconds elapsed
-- 0.000055684 seconds elapsed
-- 0.000123283 seconds elapsed
-- 0.000112322 seconds elapsed
-- 0.000054643 seconds elapsed
-- 0.000144513 seconds elapsed
-- 0.000110668 seconds elapsed
-- 0.000066025 seconds elapsed
-- 0.000113013 seconds elapsed
-- 0.000132109 seconds elapsed
-- 0.000108785 seconds elapsed
-- 0.000283294 seconds elapsed
-- 0.00013751 seconds elapsed
-- 0.000059692 seconds elapsed
-- 0.000323981 seconds elapsed
-- 0.000126048 seconds elapsed
-- 0.000054963 seconds elapsed
-- 0.000268807 seconds elapsed
-- 0.000157025 seconds elapsed
-- 0.000056938 seconds elapsed
-- 0.000426134 seconds elapsed
-- 0.000133562 seconds elapsed
-- 0.000057017 seconds elapsed
-- 0.000214726 seconds elapsed
-- 0.000122701 seconds elapsed
-- 0.000055295 seconds elapsed
-- 0.00024921 seconds elapsed
-- 0.000126158 seconds elapsed
-- 0.000054052 seconds elapsed
-- 0.000353357 seconds elapsed
-- 0.000179969 seconds elapsed
-- 0.000061206 seconds elapsed
-- 0.000111701 seconds elapsed
-- 0.000342647 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.000118914 seconds elapsed
-- 0.000104048 seconds elapsed
-- 0.000103836 seconds elapsed
-- 0.000056357 seconds elapsed
-- 0.000112371 seconds elapsed
-- 0.0001164 seconds elapsed
-- 0.000057058 seconds elapsed
-- 0.000107001 seconds elapsed
-- 0.000104487 seconds elapsed
-- 0.00010525 seconds elapsed
-- 0.000107563 seconds elapsed
-- 0.000103495 seconds elapsed
-- 0.000057549 seconds elapsed
-- 0.000109997 seconds elapsed
-- 0.000119596 seconds elapsed
-- 0.000056045 seconds elapsed
-- 0.000124725 seconds elapsed
-- 0.000102233 seconds elapsed
-- 0.000061126 seconds elapsed
-- 0.000119706 seconds elapsed
-- 0.000145193 seconds elapsed
-- 0.000056878 seconds elapsed
-- 0.000120437 seconds elapsed
-- 0.00016417 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.