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.0001437 seconds elapsed
-- 0.000187883 seconds elapsed
-- 0.000156603 seconds elapsed
-- 0.000072833 seconds elapsed
-- 0.000166771 seconds elapsed
-- 0.000155418 seconds elapsed
-- 0.000075619 seconds elapsed
-- 0.000168872 seconds elapsed
-- 0.000152654 seconds elapsed
-- 0.000077818 seconds elapsed
-- 0.000159734 seconds elapsed
-- 0.000174534 seconds elapsed
-- 0.000152818 seconds elapsed
-- 0.000402444 seconds elapsed
-- 0.000178838 seconds elapsed
-- 0.000076301 seconds elapsed
-- 0.000432252 seconds elapsed
-- 0.000177366 seconds elapsed
-- 0.000076439 seconds elapsed
-- 0.0003655 seconds elapsed
-- 0.000172073 seconds elapsed
-- 0.000073574 seconds elapsed
-- 0.000538275 seconds elapsed
-- 0.000182135 seconds elapsed
-- 0.000075113 seconds elapsed
-- 0.000300106 seconds elapsed
-- 0.000173521 seconds elapsed
-- 0.000076205 seconds elapsed
-- 0.000346736 seconds elapsed
-- 0.000174952 seconds elapsed
-- 0.000072009 seconds elapsed
-- 0.000470449 seconds elapsed
-- 0.00024997 seconds elapsed
-- 0.000073913 seconds elapsed
-- 0.000156081 seconds elapsed
-- 0.000233976 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.00027869 seconds elapsed
-- 0.000252288 seconds elapsed
-- 0.000244884 seconds elapsed
-- 0.00012102 seconds elapsed
-- 0.000252524 seconds elapsed
-- 0.000245497 seconds elapsed
-- 0.000131686 seconds elapsed
-- 0.000242269 seconds elapsed
-- 0.000237415 seconds elapsed
-- 0.000179571 seconds elapsed
-- 0.00018659 seconds elapsed
-- 0.000174413 seconds elapsed
-- 0.000078941 seconds elapsed
-- 0.000165851 seconds elapsed
-- 0.000162136 seconds elapsed
-- 0.00007299 seconds elapsed
-- 0.00015716 seconds elapsed
-- 0.00014819 seconds elapsed
-- 0.000075064 seconds elapsed
-- 0.000157302 seconds elapsed
-- 0.000209039 seconds elapsed
-- 0.000090665 seconds elapsed
-- 0.000159769 seconds elapsed
-- 0.000206135 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.