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.000179441 seconds elapsed
-- 0.000179841 seconds elapsed
-- 0.000168881 seconds elapsed
-- 0.000085481 seconds elapsed
-- 0.000172881 seconds elapsed
-- 0.000154361 seconds elapsed
-- 0.00008132 seconds elapsed
-- 0.000170801 seconds elapsed
-- 0.000152161 seconds elapsed
-- 0.00008144 seconds elapsed
-- 0.000158441 seconds elapsed
-- 0.000178681 seconds elapsed
-- 0.000160721 seconds elapsed
-- 0.000302961 seconds elapsed
-- 0.00017628 seconds elapsed
-- 0.00008084 seconds elapsed
-- 0.000343562 seconds elapsed
-- 0.000179241 seconds elapsed
-- 0.00008072 seconds elapsed
-- 0.000297922 seconds elapsed
-- 0.000167881 seconds elapsed
-- 0.00007824 seconds elapsed
-- 0.000417922 seconds elapsed
-- 0.000179241 seconds elapsed
-- 0.000076361 seconds elapsed
-- 0.000269321 seconds elapsed
-- 0.000172481 seconds elapsed
-- 0.000079281 seconds elapsed
-- 0.000279001 seconds elapsed
-- 0.000169601 seconds elapsed
-- 0.000080641 seconds elapsed
-- 0.000369722 seconds elapsed
-- 0.000233002 seconds elapsed
-- 0.000079761 seconds elapsed
-- 0.000169841 seconds elapsed
-- 0.000222721 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.000158641 seconds elapsed
-- 0.000135281 seconds elapsed
-- 0.000146441 seconds elapsed
-- 0.00008084 seconds elapsed
-- 0.000152921 seconds elapsed
-- 0.000142161 seconds elapsed
-- 0.00007988 seconds elapsed
-- 0.000158481 seconds elapsed
-- 0.000144641 seconds elapsed
-- 0.000174601 seconds elapsed
-- 0.00013428 seconds elapsed
-- 0.00015036 seconds elapsed
-- 0.000083241 seconds elapsed
-- 0.000156401 seconds elapsed
-- 0.000152041 seconds elapsed
-- 0.000078801 seconds elapsed
-- 0.000179801 seconds elapsed
-- 0.000147961 seconds elapsed
-- 0.0000868 seconds elapsed
-- 0.000160121 seconds elapsed
-- 0.000199761 seconds elapsed
-- 0.00007992 seconds elapsed
-- 0.000157921 seconds elapsed
-- 0.000202241 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.