-
Notifications
You must be signed in to change notification settings - Fork 120
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
Fix vector_space(K, polynomials) #3717
Fix vector_space(K, polynomials) #3717
Conversation
The `preimage` function this provided was buggy; it failed when the number of monomials involved exceeded the number of polynomials. The new tests catch this. Also add a rudimentary doc string, and refactor the code to use exponent vectors instead of "monomials".
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3717 +/- ##
==========================================
- Coverage 81.34% 80.93% -0.41%
==========================================
Files 577 577
Lines 78611 78580 -31
==========================================
- Hits 63945 63598 -347
- Misses 14666 14982 +316
|
Co-authored-by: Johannes Schmitt <jschmitt@posteo.eu>
Note that all polynomials must have the same parent `R`, and `K` must be equal | ||
to `base_ring(R)`. The optional keyword argument `target` can be used to |
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.
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.
This goes for some other vector_space
methods as well:
vector_space(K::Field, e::Vector{T}; target) where T<:MPolyRingElem @ Oscar ~/.julia/dev/Oscar/src/Rings/mpoly-graded.jl:1349
vector_space(K::Field, Q::MPolyQuoRing) @ Oscar ~/.julia/dev/Oscar/src/Rings/MPolyQuo.jl:1272
vector_space(kk::Field, W::Oscar.MPolyQuoLocRing{<:Field, <:FieldElem, <:MPolyRing, <:MPolyRingElem, <:Oscar.MPolyComplementOfKPointIdeal}; ordering) @ Oscar ~/.julia/dev/Oscar/src/Rings/mpolyquo-localizations.jl:2203
vector_space(kk::Field, W::Oscar.MPolyQuoLocRing; ordering) @ Oscar ~/.julia/dev/Oscar/src/Rings/mpolyquo-localizations.jl:2184
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.
It construct a vector space and a map to the polynomial ring. If there are no polynomials, the polynomial ring (target of the map) must be supplied.
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.
indeed, and that's why we have the target
KW argument. But even in that scenario we don't need K
-- after all we have this in the code: @assert base_ring(R) == K
(where R
is either target
or else parent(polys[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.
Ah oops, I misunderstood, you are 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.
The remaining question could also be resolved separately.
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.
The code makes sense to me. Not sure if this accounts for much, since I never touched this method :). But if @joschmitt is happy, I am happy.
I added a backport label because this constitutes a bugfix. If this gets backported, then #3727 should also be backported. |
* Fix vector_space(K, polynomials) The `preimage` function this provided was buggy; it failed when the number of monomials involved exceeded the number of polynomials. The new tests catch this. Also add a rudimentary doc string, and refactor the code to use exponent vectors instead of "monomials". * Apply suggestions from code review Co-authored-by: Johannes Schmitt <jschmitt@posteo.eu> --------- Co-authored-by: Johannes Schmitt <jschmitt@posteo.eu> (cherry picked from commit 93a0292)
The
preimage
function this provided was buggy; it failed when the number of monomials involved exceeded the number of polynomials. The new tests catch this.Also add a rudimentary doc string, and refactor the code to use exponent vectors instead of "monomials".
@Lax202 that should fix the case you had trouble with