-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add hilbert_series
#694
Add hilbert_series
#694
Conversation
return h; | ||
}); | ||
Singular.method("scHilbPolyWeighted", [](ideal I, ring r, jlcxx::ArrayRef<int> weights, ring Qt) { | ||
intvec *w = to_intvec(weights); |
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.
Assumes that weights
has the correct size, and that all its entries are positive (and maybe not too big?)
This is apparently checked in line 1304 below
function hilbert_series(I::sideal{spoly{T}}, w::Vector{<:Integer}, Qt::PolyRing) where T <: Nemo.FieldElem | ||
I.isGB || error("Not a Groebner basis") | ||
R = base_ring(I) | ||
length(w) == nvars(R) || error("wrong number of weights") |
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.
Is it useful in the error mesg to say how many weights were received, and how many were expected?
is the Hilbert-Poincare series of $I$ for weights $(1, \dots, 1)$. | ||
""" | ||
function hilbert_series(I::sideal{spoly{T}}, Qt::PolyRing) where T <: Nemo.FieldElem | ||
I.isGB || error("Not a Groebner basis") |
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.
If it is the caller's responsibility to ensure that GB for I
is available then this should be in the doc!
Maybe consider an optional/kw arg which the user can use to permit hilbert_series
to compute a GB if necessary?
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.
I have put some comments/suggestions in the code deltas
addressed suggestions with 068c4a8 |
test/ideal/sideal-test.jl
Outdated
@@ -686,6 +686,11 @@ end | |||
|
|||
@test ngens(std_hilbert(j, h, w, complete_reduction = true)) == | |||
ngens(std(j, complete_reduction = true)) | |||
Qt,(t)= polynomial_ring(QQ, ["t"]) | |||
t=gen(Qt,1) |
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.
Is the assignment t = gen(Qt,1)
superfluous? I think line 698 already assigns the correct value to t
, right?
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.
Not sure how I can actually try running this code; anyway, reading the code makes me believe that it is correct (under wholly reasonably assumptions about how Oscar-Singular interface works). I believe line 690 in sideal-test.jl
is superfluous (but harmless), and for me in an interactive Oscar session the syntax in line 691 produces an error (but works when Ideal
is replaced by ideal
(all lowercase)).
Inconsistencies between Singular.jl and Oscar: Singular.jl has 7 variants of Ideal(..), but no ideal(..). |
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.
Approved: Hans has explained the parts which were unclear to me
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.
Thanks: neat workaround for one of julia's "foibles"
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.
Approved
test/ideal/sideal-test.jl
Outdated
Qt,_= polynomial_ring(QQ, ["t"]) | ||
t=gen(Qt,1) |
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.
Qt,_= polynomial_ring(QQ, ["t"]) | |
t=gen(Qt,1) | |
Qt,t= polynomial_ring(QQ, ["t"]) |
hilbert_series(I, Qt::PolyRing) wih the new Hilbert function algorithm for sideal and smodule