differential_geometry#

Differential geometry operations and tensor calculus utilities.

This module provides core tools for performing differential geometry calculations over structured coordinate systems, with or without the overhead of higher-level abstractions like fields or grids. These low-level utilities are designed to be flexible and composable, and are used internally by many high-level features of the library.

The functions in this module generally require explicit specification of coordinate systems, metrics, and tensor index conventions, and are intended for use in advanced workflows where full control is required.

Tensor operations are supported in both dense and sparse representation formats:

  • Dense representation expects all tensor components to be packed into a single array of shape (*field_shape, N_dim, N_dim, ...) where the trailing axes correspond to tensor indices. This layout is suitable for vector and tensor fields where full component information is available.

  • Sparse representation accepts a dictionary of the form {(i, j, ...): array}, where each key is a multi-index identifying a single component of the tensor, and the value is the corresponding array of scalar values over a set of field axes. This layout is useful when working with tensors where many components are zero.

Examples of supported operations include index raising/lowering, covariant differentiation, divergence, and the Laplacian, all of which are compatible with symbolic and numerical coordinate systems.

Modules

dense_ops

Differential geometry operations on dense arrays.

dense_utils

Utility functions for performing basic tensor manipulations including index raising and lowering.

dependence

Symbolic operational dependence manager classes.

general_ops

General operations for performing differential geometry operations.

sparse_ops

Differential geometry operations on sparse tensor field representations.

sparse_utils

Differential geometry utilities on sparse tensor field representations.

symbolic

Symbolic manipulations for differential geometry operations.