amari_enumerative/
lib.rs

1//! # Amari Enumerative Geometry
2//!
3//! This crate provides enumerative geometry capabilities for the Amari mathematical library.
4//! It implements intersection theory, Schubert calculus, and tools for counting geometric
5//! configurations such as curves, surfaces, and higher-dimensional varieties.
6//!
7//! ## Features
8//!
9//! - **Intersection Theory**: Chow rings, intersection multiplicities, and Bézout's theorem
10//! - **Schubert Calculus**: Computations on Grassmannians and flag varieties
11//! - **Gromov-Witten Theory**: Curve counting and quantum cohomology
12//! - **Tropical Geometry**: Tropical curve counting and correspondence theorems
13//! - **Moduli Spaces**: Computations on moduli spaces of curves and surfaces
14//!
15//! ## Usage
16//!
17//! ```rust
18//! use amari_enumerative::{ProjectiveSpace, ChowClass, IntersectionRing};
19//!
20//! // Create projective 2-space
21//! let p2 = ProjectiveSpace::new(2);
22//!
23//! // Define two curves
24//! let cubic = ChowClass::hypersurface(3);
25//! let quartic = ChowClass::hypersurface(4);
26//!
27//! // Compute intersection number (Bézout's theorem)
28//! let intersection = p2.intersect(&cubic, &quartic);
29//! assert_eq!(intersection.multiplicity(), 12); // 3 * 4 = 12
30//! ```
31
32#[cfg(test)]
33pub mod comprehensive_tests;
34pub mod verified_contracts;
35
36pub mod geometric_algebra;
37pub mod gromov_witten;
38pub mod higher_genus;
39pub mod intersection;
40pub mod moduli_space;
41pub mod performance;
42pub mod schubert;
43pub mod tropical_curves;
44
45// Re-export core types
46pub use geometric_algebra::{
47    quantum_k_theory, signatures, GeometricProjectiveSpace, GeometricSchubertClass,
48    GeometricVariety,
49};
50pub use gromov_witten::{CurveClass as GWCurveClass, GromovWittenInvariant, QuantumCohomology};
51pub use higher_genus::{
52    AdvancedCurveCounting, DTInvariant, HigherGenusCurve, JacobianData, PTInvariant,
53};
54pub use intersection::{
55    AlgebraicVariety, ChowClass, Constraint, Grassmannian, IntersectionNumber, IntersectionPoint,
56    IntersectionRing, MockMultivector, ProjectiveSpace, QuantumProduct,
57};
58pub use moduli_space::{CurveClass, ModuliSpace, TautologicalClass};
59pub use performance::{
60    CurveBatchProcessor, FastIntersectionComputer, MemoryPool, SparseSchubertMatrix,
61    WasmPerformanceConfig,
62};
63pub use schubert::{FlagVariety, SchubertCalculus, SchubertClass};
64pub use tropical_curves::{
65    TropicalCurve, TropicalEdge, TropicalIntersection, TropicalModuliSpace, TropicalPoint,
66};
67
68use thiserror::Error;
69
70/// Error types for enumerative geometry computations
71#[derive(Error, Debug, Clone, PartialEq)]
72pub enum EnumerativeError {
73    /// Invalid dimension for the ambient space
74    #[error("Invalid dimension: {0}")]
75    InvalidDimension(String),
76
77    /// Intersection computation failed
78    #[error("Intersection error: {0}")]
79    IntersectionError(String),
80
81    /// Schubert calculus error
82    #[error("Schubert calculus error: {0}")]
83    SchubertError(String),
84
85    /// Gromov-Witten invariant computation error
86    #[error("Gromov-Witten error: {0}")]
87    GromovWittenError(String),
88
89    /// General computational error
90    #[error("Computation error: {0}")]
91    ComputationError(String),
92}
93
94/// Result type for enumerative geometry computations
95pub type EnumerativeResult<T> = Result<T, EnumerativeError>;
96
97// GPU acceleration exports