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.00010708 seconds elapsed
-- 0.000141361 seconds elapsed
-- 0.000139681 seconds elapsed
-- 0.00005262 seconds elapsed
-- 0.000117911 seconds elapsed
-- 0.00010753 seconds elapsed
-- 0.000054061 seconds elapsed
-- 0.000118301 seconds elapsed
-- 0.00011181 seconds elapsed
-- 0.00005428 seconds elapsed
-- 0.000112731 seconds elapsed
-- 0.000122201 seconds elapsed
-- 0.000104 seconds elapsed
-- 0.000281212 seconds elapsed
-- 0.000127251 seconds elapsed
-- 0.00005499 seconds elapsed
-- 0.000314002 seconds elapsed
-- 0.00012519 seconds elapsed
-- 0.000054631 seconds elapsed
-- 0.000244891 seconds elapsed
-- 0.00012323 seconds elapsed
-- 0.00005364 seconds elapsed
-- 0.000366932 seconds elapsed
-- 0.000130821 seconds elapsed
-- 0.000053431 seconds elapsed
-- 0.000203932 seconds elapsed
-- 0.00012436 seconds elapsed
-- 0.00005494 seconds elapsed
-- 0.000235411 seconds elapsed
-- 0.000127291 seconds elapsed
-- 0.000054041 seconds elapsed
-- 0.000322311 seconds elapsed
-- 0.000179501 seconds elapsed
-- 0.000055149 seconds elapsed
-- 0.0001093 seconds elapsed
-- 0.000166812 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.00010749 seconds elapsed
-- 0.000101209 seconds elapsed
-- 0.0001051 seconds elapsed
-- 0.00005421 seconds elapsed
-- 0.000104981 seconds elapsed
-- 0.00010506 seconds elapsed
-- 0.000057791 seconds elapsed
-- 0.000113921 seconds elapsed
-- 0.000107551 seconds elapsed
-- 0.00010798 seconds elapsed
-- 0.00011224 seconds elapsed
-- 0.000104961 seconds elapsed
-- 0.000056451 seconds elapsed
-- 0.000112092 seconds elapsed
-- 0.000106989 seconds elapsed
-- 0.00005308 seconds elapsed
-- 0.000130101 seconds elapsed
-- 0.000102841 seconds elapsed
-- 0.00005212 seconds elapsed
-- 0.00011205 seconds elapsed
-- 0.000152612 seconds elapsed
-- 0.00005508 seconds elapsed
-- 0.00011099 seconds elapsed
-- 0.000151061 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.