| name | create-riemannian-metric |
| description | Builds RiemannianMetric objects in the local_coordinates JAX library from metric component functions, including raising and lowering indices, changing basis, and constructing the inverse metric. Use when the user defines a metric tensor, needs to convert between coordinate and orthonormal bases, or wants to verify symmetry and positive definiteness. |
Create a Riemannian metric
Use this skill when instantiating a metric tensor from a user-supplied component function g_{ij}(x).
Construction pipeline
- Define the metric components as a JAX function
metric_components(x) -> (d, d) symmetric positive-definite matrix.
- Pick a base point
p and a basis (default is get_standard_basis(p) for the coordinate basis).
- Compute the metric jet with
function_to_jet(metric_components, p) so the object carries its value, gradient, and Hessian.
- Assemble with
RiemannianMetric(basis=basis, components=metric_jet).
Index manipulation
Raise an index with the inverse metric: v^i = g^{ij} alpha_j. Lower with the metric itself: alpha_i = g_{ij} v^j. Round-trip raising and lowering recovers the original. Under a change of basis E'_i = T^j_i E_j, the components transform as g'_{ij} = T^k_i T^l_j g_{kl}.
Invariants to preserve
- Symmetry:
g_{ij} = g_{ji}.
- Positive definiteness:
g(X, X) > 0 for every nonzero X.
For full formulas, basis change derivations, and worked examples, see references/REFERENCE.md. The script at scripts/sanity_check.py checks symmetry, positive definiteness, and round-trip index manipulation.