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.000149195 seconds elapsed
-- 0.000158251 seconds elapsed
-- 0.000125436 seconds elapsed
-- 0.00006205 seconds elapsed
-- 0.000143893 seconds elapsed
-- 0.000119486 seconds elapsed
-- 0.000061473 seconds elapsed
-- 0.000144158 seconds elapsed
-- 0.000117033 seconds elapsed
-- 0.000058018 seconds elapsed
-- 0.000130931 seconds elapsed
-- 0.000123172 seconds elapsed
-- 0.000125419 seconds elapsed
-- 0.000277818 seconds elapsed
-- 0.000131943 seconds elapsed
-- 0.000059409 seconds elapsed
-- 0.000303958 seconds elapsed
-- 0.000129428 seconds elapsed
-- 0.000063095 seconds elapsed
-- 0.000267957 seconds elapsed
-- 0.000134184 seconds elapsed
-- 0.000062376 seconds elapsed
-- 0.000394427 seconds elapsed
-- 0.000142078 seconds elapsed
-- 0.000057477 seconds elapsed
-- 0.000227864 seconds elapsed
-- 0.000128981 seconds elapsed
-- 0.000056166 seconds elapsed
-- 0.000250752 seconds elapsed
-- 0.000130094 seconds elapsed
-- 0.000063891 seconds elapsed
-- 0.000337967 seconds elapsed
-- 0.000175971 seconds elapsed
-- 0.000056287 seconds elapsed
-- 0.00013062 seconds elapsed
-- 0.000171467 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.000133 seconds elapsed
-- 0.000115005 seconds elapsed
-- 0.000115635 seconds elapsed
-- 0.000063128 seconds elapsed
-- 0.000129662 seconds elapsed
-- 0.000116228 seconds elapsed
-- 0.000058203 seconds elapsed
-- 0.000128039 seconds elapsed
-- 0.000150587 seconds elapsed
-- 0.000139246 seconds elapsed
-- 0.000123409 seconds elapsed
-- 0.000110745 seconds elapsed
-- 0.000064333 seconds elapsed
-- 0.000129332 seconds elapsed
-- 0.000113124 seconds elapsed
-- 0.00006343 seconds elapsed
-- 0.000151478 seconds elapsed
-- 0.00011661 seconds elapsed
-- 0.000063421 seconds elapsed
-- 0.000140781 seconds elapsed
-- 0.000150666 seconds elapsed
-- 0.000062534 seconds elapsed
-- 0.00013816 seconds elapsed
-- 0.000157194 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.