Curvature
Curvature measures how much a manifold deviates from flat Euclidean space.
cartan exposes three scalar/tensor quantities: sectional, Ricci, and scalar.
Riemann Curvature Tensor
The Riemann curvature tensor $R$ is the $(1,3)$-tensor:
It measures the failure of covariant differentiation to commute. On a flat manifold $R \equiv 0$.
Sectional Curvature
For a 2-plane , the sectional curvature is:
This is the Gaussian curvature of the geodesic surface swept out by $\sigma$.
For any 2-plane at any point, $K \equiv 1$ on the unit sphere. This matches the Gaussian curvature formula $K = 1/R^2$ for a sphere of radius $R = 1$.
use cartan::prelude::*;
use cartan::manifolds::Sphere;
let s2 = Sphere::<3>;
let mut rng = rand::rng();
let p = s2.random_point(&mut rng);
let u = s2.random_tangent(&p, &mut rng);
let v = s2.random_tangent(&p, &mut rng);
let k = s2.sectional(&p, &u, &v);
assert!((k; 1.0).abs() < 1e-10); // K ≡ 1 everywhere on S²Known Values
| Manifold | Sectional $K$ | Ricci | Scalar $s$ |
|---|---|---|---|
| $\equiv 1$ | $(N-2)\langle u,v\rangle$ | $(N-1)(N-2)$ | |
| $\equiv 0$ | $0$ | $0$ | |
| $SO(N)$ | |||
| $K \leq 0$ (NPC) | - | - | |
| $K \in [0, 2]$ | - | - |
The Curvature Trait
pub trait Curvature: Connection {
/// Sectional curvature of the 2-plane spanned by u, v at p.
fn sectional(
&self,
p: &Self::Point,
u: &Self::Tangent,
v: &Self::Tangent,
) -> f64;
/// Ricci tensor: Ric(u, v) = tr(w ↦ R(w, u)v).
fn ricci_tensor(
&self,
p: &Self::Point,
u: &Self::Tangent,
v: &Self::Tangent,
) -> f64;
/// Scalar curvature: s = tr(Ric) = sum of Ricci eigenvalues.
fn scalar_curvature(&self, p: &Self::Point) -> f64;
}Sphere<N>, Euclidean<N>, SO<N>Algebraic Bianchi Identity
The Riemann tensor satisfies:
Sphere Riemann Tensor
On , the Riemann tensor takes the especially clean form:
This is the tensor of a space form with constant sectional curvature $K = 1$. The same formula holds for any sphere of radius $r$ with $K = 1/r^2$.
Geometric Interpretation
Positive sectional curvature ($K > 0$): geodesics initially parallel converge (like lines of longitude on a sphere). Negative sectional curvature ($K < 0$): geodesics diverge exponentially (hyperbolic space). Zero ($K = 0$): Euclidean behavior, geodesics stay parallel.
This directly affects optimization: on positively curved manifolds the Riemannian gradient descent step is more conservative near the cut locus; on negatively curved (NPC/CAT(0)) manifolds like SPD, the Fréchet mean is unique and gradient descent converges globally.