-
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
[ToricVarieties] Serialize cohomology classes #4266
[ToricVarieties] Serialize cohomology classes #4266
Conversation
src/Serialization/ToricGeometry.jl
Outdated
|
||
function save_object(s::SerializerState, cc::CohomologyClass) | ||
save_data_dict(s) do | ||
save_typed_object(s, polynomial(cc).f, :polynomial) |
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.
Aside, I tried save_typed_object(s, polynomial(cc), :polynomial)
first. Unless I am mistaken, serialization for MPolyQuoRingElem
is not yet supported, correct?
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 think @HechtiDerLachs added support for this? Maybe it hasn't been merged?
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.
Ok. But do we really need this here?
The current version of the code tries to serialize a polynomial in the base ring (rather than the quotient ring). In theory, this is sufficient to serialize a (toric) cohomology class. But the loading of said polynomial does not work (yet) - reasons unclear/unknown to me.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4266 +/- ##
==========================================
+ Coverage 84.47% 84.49% +0.02%
==========================================
Files 641 641
Lines 85394 85459 +65
==========================================
+ Hits 72133 72210 +77
+ Misses 13261 13249 -12
|
This PR aims to serialize cohomology classes on toric varieties. This boils down to saving a polynomial, and ensuring that it resides in the cohomology ring of the toric variety (= a quotient ring)/the base ring of this quotient ring. Sadly I cannot get the code to work. The line:
poly = load_object(s, MPolyDecRingElem, base_ring(cohomology_ring(tv)), :polynomial)
raises the error:
ERROR: KeyError: key Symbol("1") not found
I am out of ideas how to fix this. Any ideas @antonydellavecchia? Help appreciated.
Here is a MWE, based on this PR: