Speed up arithmetic in simplicial cohomology rings - #6074
Conversation
|
I am now at julia> C = Oscar.SimplicialCochainComplex(ZZ, K);
julia> # automated version which seeks out a single generator for the top cohomology
A = Oscar.DGAlgCohRing(C)
Oscar.DGAlgCohRing{ZZRingElem}(Free module of rank 16 over integer ring --> Free module of rank 120 over integer ring --> Free module of rank 560 over integer ring --> Free module of rank 720 over integer ring --> Free module of rank 288 over integer ring
, Free module of rank 1 over integer ring --> Free module of rank 0 over integer ring --> Free module of rank 22 over integer ring --> Free module of rank 0 over integer ring --> Free module of rank 1 over integer ring
, #undef, #undef, #undef, #undef, #undef)
julia> Oscar.set_volume_form!(A);
julia> g = small_generating_set(A, 2); r = 22;
julia> @time G = matrix_space(ZZ, r, r)([integral(a*b) for a in g[1:r] for b in g[1:r]])
1.735812 seconds (28.81 M allocations: 897.702 MiB, 27.27% gc time, 4.95% compilation time)There is a subtlety here: If you suppress the output when creating However, this is by design of @benlorenz wanted to have another look whether some of the caching here can be done more reasonably in conjunction with polymake's internals. |
|
Improvement looks impressive. Thanks. |
|
@HechtiDerLachs @benlorenz will discuss this for the next step |
|
I now made the simplicial complex cache the faces in a julia datatype, while we could avoid many unnecessary calls it still helps quite a bit and brings the time down to about 2 seconds now. (It took 12 seconds without the cache and using the polymake sets directly, since they still need some amount of copying to be able to do the relevant operations) |
|
Looks good. Thanks @benlorenz ! |
|
There is a weird failure in the Ring conformance tests for the This did happen twice now, but only for julia 1.13 (1.13.0-rc1.105). Once the current re-run of the failures is done I would try to restart all jobs to see if this appears anywhere else. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6074 +/- ##
==========================================
- Coverage 83.83% 83.81% -0.03%
==========================================
Files 789 789
Lines 108512 108548 +36
==========================================
+ Hits 90971 90977 +6
- Misses 17541 17571 +30
🚀 New features to boost your workflow:
|
I can reproduce this locally, but only with 1.13-rc2 (It did not happen with 1.13-rc1 which I tried before). |
A first take on #6066.
I cut out some uses of the
OFPModulefunctionality over the integers, cached the result ofis_zerochecks, and cached the output offacesonSimplicialComplexes. This brings down the timing from the example in #6066 tofor me. Ping @micjoswig , @benlorenz