-
Notifications
You must be signed in to change notification settings - Fork 126
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
Sets poly ring caching to false for modules #3872
Conversation
I think this should fix the tests. But we should discuss whether or not we really want this behavior. Maybe it's reasonable to cache the ring for the Hilbert series of all modules in the @wdecker , @jankoboehm . |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3872 +/- ##
==========================================
+ Coverage 84.05% 84.07% +0.02%
==========================================
Files 592 592
Lines 81746 81757 +11
==========================================
+ Hits 68708 68738 +30
+ Misses 13038 13019 -19
|
Thanks for fixing. |
The last commit is a suggestion for how we can regain usability after briefly consulting with @wdecker . Let me know, everyone, in case there is further need for discussion. CC: @JohnAAbbott |
On Mon, Jul 01, 2024 at 04:28:34AM -0700, Matthias Zach wrote:
I think this should fix the tests.
But we should consider whether or not we really want this behavior. Maybe it's reasonable to cache the ring for the Hilbert series of all modules in the `base_ring` so that we do not get different parents for different modules over the same ring?
There is also Hecke.Globals.Qx and Hecke.Globals.Zx that can potentially
be used...
… @wdecker , @jankoboehm .
--
Reply to this email directly or view it on GitHub:
#3872 (comment)
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
src/Modules/hilbert.jl
Outdated
function hilbert_series_parent(S::MPolyDecRing) | ||
if !isdefined(S, :hilbert_series_parent) | ||
if is_z_graded(S) | ||
S.hilbert_series_parent = laurent_polynomial_ring(ZZ, :t; cached=false)[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.
How about always using a multivariate polynomial ring?
S.hilbert_series_parent = laurent_polynomial_ring(ZZ, :t; cached=false)[1] | |
S.hilbert_series_parent = laurent_polynomial_ring(ZZ, [:t]; cached=false)[1] |
That would make the return value of this function potentially type stable (well, with some further changes). As @jankoboehm says "this might also help with some other issues". But of course it might also cause issues... So this is really an open question.
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.
Unless people come up with qualified opinions on this, I will leave it as is since these were the rings used in the source code up to this point for the different cases.
Type stability did not seem to matter before. If it matters now, I need clear advice which ring to use.
Doctests fail? |
Evaluated output:
│
│ (-t^2 + 1)^1*(-t^4 + 1)^1*(-t^3 + 1)^1
│
│ Expected output:
│
│ (-t^4 + 1)^1*(-t^3 + 1)^1*(-t^2 + 1)^1 to my eyes, these look identical |
Yes, but I do not completely understand why the order of the terms change when not caching the rings when computing the hilbert series. |
Maybe the order of the terms/factors was never deterministic, and just by chance we see it now? It may be coincidence that it arises after changing the caching? |
Somebody put effort in it that the denominator is printed in this factorized form. I agree that it is mathematically equivalent, but whoever made this printing might have an opinion on the order of exponents as well. |
On Thu, Jul 04, 2024 at 06:35:15AM -0700, JohnAAbbott wrote:
Maybe the order of the terms/factors was never deterministic, and just by chance we see it now? It may be coincidence that it arises after changing the caching?
This is a dict internally, the order of keys in a dict is
non-deterministic (from a users point of view)
… --
Reply to this email directly or view it on GitHub:
#3872 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
It appears that the doc test fails because previously |
I pushed a commit so that different parents are used for |
@joschmitt Thanks, looks good to me. |
This also looks like a reasonable solution to me. Thanks @joschmitt . Maybe @JohnAAbbott can have a look and confirm that everything is alright with his part of the code on Hilbert series? |
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 changes look good to me -- but is the type specification on line 126 of src/Modules/hilbert.jl correct? Can it not be simply parent::Ring = ...
?
Thank you, you are right! I corrected it. |
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 by @JohnAAbbott (and also the triage meeting last week).
See #2455.
Again, some tests are failing due to different parent rings, thus I would like @jankoboehm and @HechtiDerLachs to have a look.