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.000154992 seconds elapsed
-- 0.000144822 seconds elapsed
-- 0.000112191 seconds elapsed
-- 0.000056572 seconds elapsed
-- 0.000153282 seconds elapsed
-- 0.000113421 seconds elapsed
-- 0.000074661 seconds elapsed
-- 0.000126881 seconds elapsed
-- 0.000331803 seconds elapsed
-- 0.000060521 seconds elapsed
-- 0.000121252 seconds elapsed
-- 0.000121022 seconds elapsed
-- 0.000124952 seconds elapsed
-- 0.000282353 seconds elapsed
-- 0.000126221 seconds elapsed
-- 0.000056161 seconds elapsed
-- 0.000301252 seconds elapsed
-- 0.000126101 seconds elapsed
-- 0.000054021 seconds elapsed
-- 0.000253563 seconds elapsed
-- 0.000121661 seconds elapsed
-- 0.000055449 seconds elapsed
-- 0.000381414 seconds elapsed
-- 0.000129901 seconds elapsed
-- 0.00005289 seconds elapsed
-- 0.000206334 seconds elapsed
-- 0.00012019 seconds elapsed
-- 0.000067081 seconds elapsed
-- 0.000260003 seconds elapsed
-- 0.000127842 seconds elapsed
-- 0.000059292 seconds elapsed
-- 0.000342764 seconds elapsed
-- 0.000176342 seconds elapsed
-- 0.000054372 seconds elapsed
-- 0.000114692 seconds elapsed
-- 0.000178981 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.000127201 seconds elapsed
-- 0.000108392 seconds elapsed
-- 0.000107991 seconds elapsed
-- 0.00006321 seconds elapsed
-- 0.000118551 seconds elapsed
-- 0.000104871 seconds elapsed
-- 0.000056661 seconds elapsed
-- 0.000112591 seconds elapsed
-- 0.000103451 seconds elapsed
-- 0.000128261 seconds elapsed
-- 0.000110651 seconds elapsed
-- 0.000127421 seconds elapsed
-- 0.000066531 seconds elapsed
-- 0.000146762 seconds elapsed
-- 0.000112521 seconds elapsed
-- 0.000061241 seconds elapsed
-- 0.000200862 seconds elapsed
-- 0.000128291 seconds elapsed
-- 0.00005696 seconds elapsed
-- 0.000114962 seconds elapsed
-- 0.000142801 seconds elapsed
-- 0.000056711 seconds elapsed
-- 0.000118581 seconds elapsed
-- 0.000152322 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.