Repository navigation
Compute all-degree Betti numbers for zero loci - #43
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
betti_numbers(X)[k]now gives b_k(X) in every cohomological degree, with indices0:2*dimension(X). Partial flag varieties include their vanishing odd entries, and smooth zero loci obtain their Betti numbers by summing Hodge anti-diagonals. Unresolved affine parameters are retained.For example, a cubic threefold has Betti vector
[1, 0, 1, 10, 1, 0, 1], sobetti_numbers(X)[3] == 10.Update the Hodge computation and other callers to read the even Betti numbers at
b[2*p], and document the convention and the zero-locus method. Construct the homogeneous Hodge matrix with zero-based axes before filling it. The fourfold example keeps its computed and reference Hodge matrices zero-based and reuseshodge_numbersfor the ambient calculation. Use the dimensional aliasesOffsetMatrixandOffsetVectorexplicitly. Include the zero-locus Betti method in the precompile workload.This brings the work from #42 to
main. #42 was merged into its former stacked base branch after #41 had already merged, leaving the changes absent frommain. It also includes the subsequent simplification of reference-data iteration to ordinaryenumerateloops.Validation on Julia 1.13:
Warm-cache performance checks with BenchmarkTools 1.8.0 on Julia 1.13, using identical dependency manifests and two sequential alternating runs per branch, found no material slowdown in eight representative workloads. Median-of-run-medians timings (microseconds):
The timing differences are within the observed run-to-run variation; these are not claimed speedups. Direct Betti calls return longer vectors. The zero-locus Betti method has the same allocations as computing Hodge anti-diagonal sums directly on #41.
Cold checks use Julia 1.13 with
--startup-file=no --threads=1 --gcthreads=1, identical dependency manifests, and three fresh processes per workload. Call times below exclude loading and constructing the variety. Since #41 has no zero-locus Betti method, its baseline computes the same Hodge anti-diagonal sums directly.Forced precompilation was measured twice per branch in alternating order, verifying that dependency caches did not change during the measured runs. Package-load times aggregate the six fresh processes used for the two zero-locus workloads. Full fresh-process time for the (b8) Betti calculation, including Julia startup, loading, construction, and the call, was 2.02 s versus 1.95 s. These figures do not indicate a material cold-start regression. Precompiling the new method reduces its first-call compilation cost.