-
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
Changes from all commits
67c6a7a
b3f4622
756b664
ae9eb05
bf08e43
ea7bcd4
068c4a8
6c6f172
2d379c8
8f85388
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1278,6 +1278,38 @@ function hilbert_series(I::sideal{spoly{T}}, w::Vector{<:Integer}) where T <: Ne | |
return z | ||
end | ||
|
||
@doc raw""" | ||
hilbert_series(I::sideal{spoly{T}}, Qt::PolyRing) where T <: Nemo.FieldElem | ||
|
||
Return the polynomial $Q(t)$ as element of Qt where `Q(t)/(1-t)^nvars(base_ring(I))` | ||
is the Hilbert-Poincare series of $I$ for weights $(1, \dots, 1)$. | ||
The generators of $I$ must be given as a Groebner basis. | ||
""" | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. If it is the caller's responsibility to ensure that GB for |
||
R = base_ring(I) | ||
GC.@preserve I R Qt new_ptr = libSingular.scHilbPoly(I.ptr, R.ptr, Qt.ptr) | ||
return Qt(new_ptr) | ||
end | ||
|
||
@doc raw""" | ||
hilbert_series(I::sideal{spoly{T}}, w::Vector{<:Integer}) where T <: Nemo.FieldElem | ||
|
||
Return the polynomial $Q(t)$ of Qt where $\frac{Q(t)}{\prod_i (1-t^{w_i})}$ | ||
is the Hilbert-Poincare series of $I$ for weights $\{w_i\}$. Each weight must be | ||
positive $w_i > 0$. | ||
The generators of $I$ must be given as a Groebner basis. | ||
""" | ||
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 commentThe 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? |
||
all(x -> x > 0, w) || error("weights must be positive") | ||
w = convert(Vector{Int32}, w) | ||
GC.@preserve I R Qt new_ptr = libSingular.scHilbPolyWeighted(I.ptr, R.ptr, w, Qt.ptr) | ||
return Qt(new_ptr) | ||
end | ||
|
||
@doc raw""" | ||
std_hilbert(I::sideal{spoly{T}}, hs::Vector{Int32}; complete_reduction::Bool=false) where T <: Nemo.FieldElem | ||
|
||
|
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