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.0048118 seconds elapsed
-- 0.0058248 seconds elapsed
-- 0.0056613 seconds elapsed
-- 0.0021908 seconds elapsed
-- 0.0056944 seconds elapsed
-- 0.0051221 seconds elapsed
-- 0.0019593 seconds elapsed
-- 0.0056107 seconds elapsed
-- 0.0052637 seconds elapsed
-- 0.001652 seconds elapsed
-- 0.0043563 seconds elapsed
-- 0.0047075 seconds elapsed
-- 0.0034777 seconds elapsed
-- 0.0084211 seconds elapsed
-- 0.0045817 seconds elapsed
-- 0.0016667 seconds elapsed
-- 0.0088517 seconds elapsed
-- 0.0048304 seconds elapsed
-- 0.0016666 seconds elapsed
-- 0.0070695 seconds elapsed
-- 0.0049728 seconds elapsed
-- 0.0016515 seconds elapsed
-- 0.0105004 seconds elapsed
-- 0.0046338 seconds elapsed
-- 0.0017172 seconds elapsed
-- 0.0068746 seconds elapsed
-- 0.0044639 seconds elapsed
-- 0.0017238 seconds elapsed
-- 0.00776 seconds elapsed
-- 0.0057819 seconds elapsed
-- 0.0017286 seconds elapsed
-- 0.0098548 seconds elapsed
-- 0.0064914 seconds elapsed
-- 0.0018376 seconds elapsed
-- 0.0043327 seconds elapsed
-- 0.0061176 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.0032794 seconds elapsed
-- 0.0051287 seconds elapsed
-- 0.0044445 seconds elapsed
-- 0.0017166 seconds elapsed
-- 0.0045692 seconds elapsed
-- 0.0060416 seconds elapsed
-- 0.0016786 seconds elapsed
-- 0.0046214 seconds elapsed
-- 0.0039925 seconds elapsed
-- 0.0033147 seconds elapsed
-- 0.0046124 seconds elapsed
-- 0.0042551 seconds elapsed
-- 0.0019537 seconds elapsed
-- 0.0047384 seconds elapsed
-- 0.0039558 seconds elapsed
-- 0.0017081 seconds elapsed
-- 0.0050851 seconds elapsed
-- 0.0038888 seconds elapsed
-- 0.0017062 seconds elapsed
-- 0.0050082 seconds elapsed
-- 0.0049478 seconds elapsed
-- 0.0016241 seconds elapsed
-- 0.0041127 seconds elapsed
-- 0.0052851 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.