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.00018723 seconds elapsed
-- 0.000250177 seconds elapsed
-- 0.00024036 seconds elapsed
-- 0.00010095 seconds elapsed
-- 0.000225151 seconds elapsed
-- 0.000201116 seconds elapsed
-- 0.000105056 seconds elapsed
-- 0.000252793 seconds elapsed
-- 0.000220843 seconds elapsed
-- 0.000103925 seconds elapsed
-- 0.000221224 seconds elapsed
-- 0.000219261 seconds elapsed
-- 0.000199534 seconds elapsed
-- 0.000530683 seconds elapsed
-- 0.000234068 seconds elapsed
-- 0.00010648 seconds elapsed
-- 0.000601245 seconds elapsed
-- 0.000233067 seconds elapsed
-- 0.000101861 seconds elapsed
-- 0.000487021 seconds elapsed
-- 0.000234479 seconds elapsed
-- 0.000132277 seconds elapsed
-- 0.000755864 seconds elapsed
-- 0.00024022 seconds elapsed
-- 0.00009661 seconds elapsed
-- 0.000412222 seconds elapsed
-- 0.0002242 seconds elapsed
-- 0.000105306 seconds elapsed
-- 0.000465341 seconds elapsed
-- 0.000242424 seconds elapsed
-- 0.00009613 seconds elapsed
-- 0.000648013 seconds elapsed
-- 0.000327874 seconds elapsed
-- 0.000094115 seconds elapsed
-- 0.000209612 seconds elapsed
-- 0.000306795 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.000187401 seconds elapsed
-- 0.000199002 seconds elapsed
-- 0.000196548 seconds elapsed
-- 0.000099146 seconds elapsed
-- 0.000236803 seconds elapsed
-- 0.000205705 seconds elapsed
-- 0.000103794 seconds elapsed
-- 0.000200667 seconds elapsed
-- 0.000228828 seconds elapsed
-- 0.000211646 seconds elapsed
-- 0.000196107 seconds elapsed
-- 0.000188443 seconds elapsed
-- 0.000108172 seconds elapsed
-- 0.000213369 seconds elapsed
-- 0.000200946 seconds elapsed
-- 0.000103595 seconds elapsed
-- 0.000244187 seconds elapsed
-- 0.000198221 seconds elapsed
-- 0.000108773 seconds elapsed
-- 0.000219871 seconds elapsed
-- 0.000265677 seconds elapsed
-- 0.000119312 seconds elapsed
-- 0.000218518 seconds elapsed
-- 0.000260708 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.