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.000247342 seconds elapsed
-- 0.000348662 seconds elapsed
-- 0.000278985 seconds elapsed
-- 0.000136795 seconds elapsed
-- 0.000325795 seconds elapsed
-- 0.00027528 seconds elapsed
-- 0.00013757 seconds elapsed
-- 0.000333241 seconds elapsed
-- 0.000268439 seconds elapsed
-- 0.000180004 seconds elapsed
-- 0.000286386 seconds elapsed
-- 0.000296577 seconds elapsed
-- 0.000241691 seconds elapsed
-- 0.000635148 seconds elapsed
-- 0.000290336 seconds elapsed
-- 0.00013954 seconds elapsed
-- 0.000691449 seconds elapsed
-- 0.000314178 seconds elapsed
-- 0.000135545 seconds elapsed
-- 0.000606885 seconds elapsed
-- 0.000309988 seconds elapsed
-- 0.000128984 seconds elapsed
-- 0.00088129 seconds elapsed
-- 0.000311734 seconds elapsed
-- 0.000126313 seconds elapsed
-- 0.00051008 seconds elapsed
-- 0.000311528 seconds elapsed
-- 0.000176304 seconds elapsed
-- 0.000566441 seconds elapsed
-- 0.000317024 seconds elapsed
-- 0.000131804 seconds elapsed
-- 0.000753796 seconds elapsed
-- 0.000430017 seconds elapsed
-- 0.000124793 seconds elapsed
-- 0.00027458 seconds elapsed
-- 0.000407324 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.00023493 seconds elapsed
-- 0.000272244 seconds elapsed
-- 0.000263459 seconds elapsed
-- 0.000133384 seconds elapsed
-- 0.0002789 seconds elapsed
-- 0.000273234 seconds elapsed
-- 0.000128024 seconds elapsed
-- 0.00027879 seconds elapsed
-- 0.000279575 seconds elapsed
-- 0.000250852 seconds elapsed
-- 0.000262548 seconds elapsed
-- 0.000248147 seconds elapsed
-- 0.0001409 seconds elapsed
-- 0.00028111 seconds elapsed
-- 0.000268083 seconds elapsed
-- 0.0001373 seconds elapsed
-- 0.000307013 seconds elapsed
-- 0.000261638 seconds elapsed
-- 0.000136865 seconds elapsed
-- 0.000304953 seconds elapsed
-- 0.000350978 seconds elapsed
-- 0.0001319 seconds elapsed
-- 0.000298567 seconds elapsed
-- 0.000352958 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.