Serialize cohomology classes#4266
Conversation
|
|
||
| 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.
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.
I think @HechtiDerLachs added support for this? Maybe it hasn't been merged?
There was a problem hiding this comment.
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 foundI am out of ideas how to fix this. Any ideas @antonydellavecchia? Help appreciated.
Here is a MWE, based on this PR: