| name | compute-curvature |
| description | Computes the Levi-Civita connection, Christoffel symbols, Riemann curvature tensor, Ricci tensor, and scalar curvature from a Riemannian metric using the local_coordinates JAX library. Use when the user works with curvature quantities, parallel transport, Koszul formula, Bianchi identities, or needs to verify that a metric is flat or that curvature tensor symmetries hold. |
Compute curvature
Use this skill when computing curvature objects from a Riemannian metric. The primary pipeline is
- Build a
RiemannianMetric (see create-riemannian-metric for that step).
- Call
get_levi_civita_connection(metric) to obtain Christoffel symbols.
- Call
get_riemann_curvature_tensor(connection) for the Riemann tensor.
- Call
get_ricci_tensor(connection, R=riemann) for the Ricci tensor, and contract with the inverse metric for scalar curvature.
Key mathematical facts
Christoffel symbols in a general frame come from the Koszul formula. In a coordinate basis they reduce to
Gamma^k_{ij} = (1/2) g^{kl} (d_i g_{jl} + d_j g_{il} - d_l g_{ij}). Riemann tensor symmetries with all indices lowered: skew in the first pair, skew in the second pair, interchange symmetric across pairs, and the first Bianchi identity. The Levi-Civita connection is the unique torsion-free metric-compatible connection.
For derivations, component formulas, and property checklists, read references/REFERENCE.md.
Sanity checks
The script at scripts/sanity_check.py verifies the Riemann tensor definition, its symmetries, and that flat metrics produce zero curvature. Run with uv run python scripts/sanity_check.py from inside the target project's environment.