-
Notifications
You must be signed in to change notification settings - Fork 257
Git issues 3937 1935 #3942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Git issues 3937 1935 #3942
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -529,6 +529,7 @@ export { | |
"cache", | ||
"cacheValue", | ||
"cancelTask", | ||
"canUseHilbertHint", | ||
"capture", | ||
"catch", | ||
"ceiling", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
doc /// | ||
Key | ||
canUseHilbertHint | ||
(canUseHilbertHint, Ring) | ||
(canUseHilbertHint, Ideal) | ||
(canUseHilbertHint, Module) | ||
(canUseHilbertHint, Matrix) | ||
Headline | ||
whether certain Groebner computations can make use of the Hilbert function | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect nobody will actually find this node. How about this: add the example of passing the |
||
Usage | ||
canUseHilbertHint m | ||
Inputs | ||
m:{Ring,Ideal,Module,Matrix} | ||
Outputs | ||
:Boolean | ||
Description | ||
Text | ||
Certain Groebner basis computations, when given homogeneous input, can run faster if | ||
the Hilbert function is know: the algorithm can use this information to bypass | ||
computing zero reductions in many cases. | ||
|
||
In order to be able to use a Hilbert function hint, currently the object must be | ||
in a singly graded polynomial ring (or quotient of such), over a field, | ||
with all generators of positive degree, and it must be either commutative, or skew-commutative. | ||
|
||
Given a ring, this function returns whether this holds for the ring. For | ||
a module, matrix or ideal, this function additionally checks whether the input is | ||
homogeneous. | ||
Example | ||
R1 = ZZ/101[x,y,z, Degrees => {1,2,3}]; | ||
assert canUseHilbertHint R1 | ||
R2 = ZZ[x,y,z]; | ||
assert not canUseHilbertHint R2 | ||
R3 = (GF 8)[x,y,z] | ||
assert canUseHilbertHint R3 | ||
use R1 | ||
R4 = R1[u,v, Join => false]/(x*u+y*v) | ||
R5 = first flattenRing R4 | ||
canUseHilbertHint R4 | ||
canUseHilbertHint R5 | ||
Text | ||
Here is one way to use Hilbert hints. If one knows the Hilbert function, one can use it. | ||
If one computes a Hilbert function (via poincare), one can use that in a ring | ||
which is identical, except the monomial order is more computationally intensive (e.g. Lex). | ||
Example | ||
R = ZZ/101[x,y,z,w] | ||
I = ideal random(R^1, R^{-5,-5,-5}) | ||
hf = poincare I | ||
codim I == 3 -- a complete intersection | ||
Rlex = newRing(R, MonomialOrder => Lex) | ||
Ilex = sub(I, Rlex) | ||
elapsedTime g1 = gens gb Ilex; | ||
Ilex = ideal(Ilex_*) -- clear out the previous Groebner basis | ||
elapsedTime g2 = gens gb(Ilex, Hilbert => hf); | ||
g1 == g2 | ||
Caveat | ||
One cannot currently use Hilbert hints for multigraded input | ||
SeeAlso | ||
poincare | ||
newRing | ||
/// |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,7 @@ document { | |
TO gbRemove, | ||
TO "gbTrace", | ||
TO LongPolynomial, | ||
TO canUseHilbertHint | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- test of canUseHilbertHint, Hilbert hint code with M2. | ||
restart | ||
R1 = ZZ/101[x,y,z, Degrees => {1,2,3}]; | ||
assert canUseHilbertHint R1 | ||
R2 = ZZ[x,y,z]; | ||
assert not canUseHilbertHint R2 | ||
R3 = (GF 8)[x,y,z] | ||
assert canUseHilbertHint R3 | ||
use R1 | ||
R4 = R1[u,v, Join => false]/(x*u+y*v) | ||
R5 = first flattenRing R4 | ||
assert not canUseHilbertHint R4 -- we might want to change this behavior | ||
assert canUseHilbertHint R5 | ||
|
||
-- test in presence of multi-degrees | ||
R = ZZ/101[a,b,c,d, Degrees => {2:{1,0}, 2:{0,1}}] | ||
I = ideal for i from 1 to 3 list random({2,3}, R) | ||
hf = poincare I | ||
assert not canUseHilbertHint R | ||
assert not canUseHilbertHint I | ||
|
||
Rlex = ZZ/101[a,b,c,d, Degrees => {2:{1,0}, 2:{0,1}}, MonomialOrder => Lex] | ||
Ilex = sub(I, Rlex) | ||
gblex = gens gb(Ilex, Hilbert => hf) -- gives warning, but no error | ||
assert(numgens ideal gblex == 37) -- happens with given random seed, at least.... | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason behind this change? If this is correct in this case I wonder about tons of other
exponents_t
initializations which usenewarray_atomic
(only three exceptions, and this makes it four). The comment beforenewarray_atomic
innewdelete.hpp
says: