amari-enumerative
Enumerative geometry for counting geometric configurations.
Overview
amari-enumerative provides tools for enumerative geometry, the mathematical discipline concerned with counting geometric objects satisfying given conditions. The crate implements intersection theory, Schubert calculus, Gromov-Witten invariants, and tropical curve counting.
Features
- Intersection Theory: Chow rings, intersection multiplicities, Bézout's theorem
- Schubert Calculus: Computations on Grassmannians and flag varieties
- Gromov-Witten Theory: Curve counting and quantum cohomology
- Tropical Geometry: Tropical curve counting via correspondence theorems
- Moduli Spaces: Computations on moduli spaces of curves
- GPU Acceleration: Optional GPU support for large computations
Installation
Add to your Cargo.toml:
[]
= "0.12"
Feature Flags
[]
# Default features
= "0.12"
# With serialization
= { = "0.12", = ["serde"] }
# With GPU acceleration
= { = "0.12", = ["gpu"] }
# With parallel computation
= { = "0.12", = ["parallel"] }
# For WASM targets
= { = "0.12", = ["wasm"] }
Quick Start
use ;
// Create projective 2-space (P²)
let p2 = new;
// Define two curves by degree
let cubic = hypersurface; // Degree 3 curve
let quartic = hypersurface; // Degree 4 curve
// Compute intersection number using Bézout's theorem
let intersection = p2.intersect;
assert_eq!; // 3 × 4 = 12 points
Key Concepts
Bézout's Theorem
Two plane curves of degrees d and e intersect in d·e points (counting multiplicity):
use ;
let p2 = new;
let line = hypersurface;
let conic = hypersurface;
// Line meets conic in 1 × 2 = 2 points
let points = p2.intersect.multiplicity;
assert_eq!;
Schubert Calculus
Count linear subspaces satisfying incidence conditions:
use ;
// Grassmannian Gr(2,4): lines in P³
let gr = new;
// How many lines meet 4 general lines in P³?
let sigma_1 = sigma; // Lines meeting a line
let count = gr.intersect;
assert_eq!; // Answer: 2 lines
Gromov-Witten Invariants
Count curves in algebraic varieties:
use ;
// Count rational curves of degree d in P²
let gw = new;
let count = gw.compute_with_insertions?;
Tropical Curves
Use tropical geometry for curve counting:
use TropicalCurve;
let curve = new;
let count = curve.tropical_count?;
Modules
| Module | Description |
|---|---|
intersection |
Chow rings, intersection products, Bézout |
schubert |
Schubert calculus on Grassmannians |
gromov_witten |
Curve counting, quantum cohomology |
tropical_curves |
Tropical geometry methods |
moduli_space |
Moduli spaces of curves |
higher_genus |
Higher genus curve counting, DT/PT invariants |
geometric_algebra |
Integration with geometric algebra |
performance |
Optimized computation utilities |
Mathematical Background
Chow Rings
The Chow ring A*(X) captures the intersection theory of a variety X:
A*(P^n) = Z[H] / (H^(n+1))
where H is the hyperplane class.
Schubert Cells
The Grassmannian Gr(k,n) has a cell decomposition by Schubert cells:
Gr(k,n) = ⊔ Ω_λ
indexed by partitions λ ⊂ (n-k)^k.
Gromov-Witten Theory
GW invariants count curves via:
⟨τ_a1(γ1),...,τ_an(γn)⟩_{g,β} = ∫_{[M̄_{g,n}(X,β)]^{vir}} ψ_1^{a1} ev_1*(γ1) ∧ ...
Classic Enumerative Problems
| Problem | Answer |
|---|---|
| Lines through 2 points | 1 |
| Conics through 5 points | 1 |
| Lines meeting 4 general lines in P³ | 2 |
| Rational cubics through 8 points in P² | 12 |
| Lines on a smooth cubic surface | 27 |
Performance
- Parallel Computation: Rayon-based parallelization
- GPU Acceleration: WebGPU for large intersection computations
- Sparse Matrices: Efficient representation of Schubert classes
- Batch Processing: Process multiple curves simultaneously
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Part of Amari
This crate is part of the Amari mathematical computing library.