You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Purpose: SageMath computer algebra system rewritten in Rust
Status: ~35% complete, core modules working
Code: ~20,700 lines across 17 crates
Tests: 60+ test modules, some with compilation issues
License: GPL-2.0-or-later
The 17 Crates
Crate
Purpose
Status
Key Type
rustmath-core
Trait definitions (Ring, Field, etc.)
✅
trait Ring
rustmath-integers
Arbitrary precision integers
✅
Integer
rustmath-rationals
Rational numbers auto-simplified
✅
Rational
rustmath-reals
Real numbers (f64-based)
🚧
Real
rustmath-complex
Complex numbers
✅
Complex
rustmath-polynomials
Univariate/multivariate polynomials
🚧
UnivariatePolynomial<R>
rustmath-powerseries
Truncated power series
✅
PowerSeries<R>
rustmath-finitefields
Finite fields GF(p), GF(p^n)
✅
PrimeField, ExtensionField
rustmath-padics
p-adic numbers/integers
✅
PadicInteger, PadicRational
rustmath-matrix
Linear algebra & matrices
🚧
Matrix<R>, Vector<R>
rustmath-calculus
Symbolic differentiation
🚧
Uses Expr
rustmath-numbertheory
Primes, factorization, CRT
🚧
Functions + QuadraticForm
rustmath-combinatorics
Permutations, partitions, binomial
✅
Permutation, Partition
rustmath-graphs
Graph theory algorithms
🚧
Graph<V>
rustmath-geometry
Geometry (placeholder)
⬜
-
rustmath-crypto
RSA encryption/decryption
🚧
KeyPair
rustmath-symbolic
Expression system & simplification
🚧
Expr, Symbol
Core Design Patterns
1. Generic Algorithms Over Traits
// Works over ANY ring, not just floatsfndeterminant<R:Ring>(m:&Matrix<R>) -> R{ ...}// One implementation, infinite types:// Matrix<Integer>, Matrix<Rational>, Matrix<Polynomial>, ...
2. No Unsafe Code
Pure Rust, no raw pointers
Memory safety guaranteed by compiler
Borrow checker enforces correctness
3. Result-Based Error Handling
// Panics only in truly unrecoverable situations// Invalid math returns Err, not panicpubfninverse(&self) -> Result<Self>
Rust's type system: Enforces mathematical properties at compile time
No runtime overhead: Zero-cost abstractions
Exact arithmetic: Prevents subtle bugs
Modular: Each component can be used independently
The architecture demonstrates that Rust is an excellent language for mathematical software, offering safety and performance unavailable in Python-based systems like SageMath.