differential_geometry.dense_utils#

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

Functions

dense_adjust_tensor_signature(tensor_field, ...)

Adjust multiple indices of a tensor field by raising or lowering them using the metric or inverse metric.

dense_compute_tensor_trace(tensor_field, ...)

Compute the trace over a pair of tensor indices, adjusting their variances if needed.

dense_compute_volume_element(metric_field, ...)

Compute the volume element (√|det(g)|) from a metric tensor field.

dense_contract_with_metric(tensor_field, ...)

Contract a tensor index with the provided metric tensor.

dense_lower_index(tensor_field, index, rank, ...)

Lowers a specified index of a tensor field using the metric tensor.

dense_permute_tensor_indices(tensor_field, ...)

Permutes the order of the tensor indices in the last rank dimensions of the tensor field.

dense_raise_index(tensor_field, index, rank, ...)

Raise a specified index of a tensor field using the inverse metric tensor.

dense_tensor_product(tensor_a, type_a, ...)

Compute the tensor product of two tensor fields with specified (p, q) types, ensuring that the result has contravariant indices first and covariant indices last.

dense_transform_tensor_field(tensor_field, ...)

Apply a coordinate transformation to a tensor field based on its signature and selected indices.

infer_metric_type(metric_field, field_shape)

Infer whether the given metric (or inverse metric) tensor is diagonal or full.