Numerical-relativity tensor calculus in Rust, built on
diffable's typed tensor algebra and
forward-mode automatic differentiation.
Installation
diffable is included explicitly because coordinate values use its public
Coords type.
Quick start
use ;
use Coords;
Implemented quantities
The crate currently computes:
- Christoffel symbols
- torsion tensor
- Riemann curvature tensor
- Ricci tensor
- Ricci scalar
- Kretschmann invariant
- Einstein tensor
- stress-energy-momentum tensor
Built-in metrics
MinkowskiSphericalPolarSchwarzschild
SphericalPolar is the three-dimensional Euclidean metric
dr² + r²dθ² + r²sin²(θ)dφ²
in spherical coordinates. It has nonzero coordinate connection coefficients but zero curvature.
Coordinate and scalar model
Metric implementations are generic over their scalar type. This permits
diffable Taylor jets to flow through metric, connection, and curvature
calculations.
The public API uses diffable::coords::Coords for coordinate presentation and
nested tensor views for rank-2, rank-3, and rank-4 results.
API documentation
Verification
The repository verifies:
- Minkowski flatness
- spherical-coordinate flatness
- Schwarzschild vacuum identities
- Schwarzschild Kretschmann invariant
- tensor-valued automatic differentiation
- documentation examples
- clippy and formatting cleanliness
License
MIT. See LICENSE.