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.000151558 seconds elapsed
-- 0.000205812 seconds elapsed
-- 0.000170694 seconds elapsed
-- 0.000081133 seconds elapsed
-- 0.000170615 seconds elapsed
-- 0.000189178 seconds elapsed
-- 0.000082715 seconds elapsed
-- 0.000170641 seconds elapsed
-- 0.000162886 seconds elapsed
-- 0.000091741 seconds elapsed
-- 0.000168085 seconds elapsed
-- 0.000174152 seconds elapsed
-- 0.000148997 seconds elapsed
-- 0.000356317 seconds elapsed
-- 0.000183767 seconds elapsed
-- 0.000085219 seconds elapsed
-- 0.00040594 seconds elapsed
-- 0.00018739 seconds elapsed
-- 0.000086342 seconds elapsed
-- 0.000326083 seconds elapsed
-- 0.000179909 seconds elapsed
-- 0.000081703 seconds elapsed
-- 0.000487084 seconds elapsed
-- 0.000219613 seconds elapsed
-- 0.000080342 seconds elapsed
-- 0.000313548 seconds elapsed
-- 0.000187529 seconds elapsed
-- 0.000081509 seconds elapsed
-- 0.000327753 seconds elapsed
-- 0.00018665 seconds elapsed
-- 0.000081083 seconds elapsed
-- 0.000410576 seconds elapsed
-- 0.000258147 seconds elapsed
-- 0.000081362 seconds elapsed
-- 0.000177348 seconds elapsed
-- 0.000236546 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.000152454 seconds elapsed
-- 0.000137251 seconds elapsed
-- 0.000150766 seconds elapsed
-- 0.000083716 seconds elapsed
-- 0.000152488 seconds elapsed
-- 0.000154222 seconds elapsed
-- 0.000080459 seconds elapsed
-- 0.000150364 seconds elapsed
-- 0.000174903 seconds elapsed
-- 0.000153576 seconds elapsed
-- 0.00015866 seconds elapsed
-- 0.000157342 seconds elapsed
-- 0.00010773 seconds elapsed
-- 0.000151831 seconds elapsed
-- 0.000157363 seconds elapsed
-- 0.000091041 seconds elapsed
-- 0.000176748 seconds elapsed
-- 0.000154988 seconds elapsed
-- 0.000104308 seconds elapsed
-- 0.000159038 seconds elapsed
-- 0.000209903 seconds elapsed
-- 0.000084127 seconds elapsed
-- 0.000157246 seconds elapsed
-- 0.000211685 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.