DenseTensorDependence#

class differential_geometry.dependence.DenseTensorDependence(coordinate_system: _CoordinateSystemBase, rank: int, /, *, dependent_axes: str | Sequence[str] | None = None)[source]#

Dense symbolic tensor dependence with attached tensor-aware operators.

This subclass uses the tensor rank to define the shape and supports symbolic tensor operations (e.g., raising/lowering indices, divergence), in addition to element-wise operations.

Parameters:
  • coordinate_system (_CoordinateSystemBase) – The coordinate system in which the tensor is defined.

  • rank (int) – The rank (number of tensor indices) for the tensor. Shape will be (ndim,)*rank.

  • dependent_axes (str or Sequence[str], optional) – The coordinate axes on which the tensor depends.

Methods

__init__(coordinate_system, rank, /, *[, ...])

Initialize a dense tensor dependence object with a given rank and coordinate dependence.

adjust_tensor_signature(variance_in, ...[, ...])

Adjust the tensor variance (covariant/contravariant) of each index.

depends_on(axis)

Check whether this object symbolically depends on a given coordinate axis.

divergence(*[, basis, as_field])

Compute the divergence of a rank-1 tensor field.

element_wise_gradient(*[, basis, as_field])

Compute the component-wise gradient of the field.

element_wise_laplacian(*[, as_field])

Compute the component-wise Laplacian of the field.

from_symbolic_proxy(coordinate_system, ...)

Rebuild a DenseTensorDependence from a symbolic proxy.

gradient(*[, basis, as_field])

Compute the elementwise gradient of the tensor field.

laplacian(*[, as_field])

Compute the Laplacian of the tensor field (component-wise).

lower_index(axis, /, *[, as_field])

Lower a tensor index along the specified axis using the metric tensor.

raise_index(axis, /, *[, as_field])

Raise a tensor index along the specified axis using the inverse metric tensor.

to_symbolic_proxy()

Construct a symbolic proxy representing this tensor or scalar field.

Attributes

axes_symbols

The symbolic representations of the dependent coordinate axes.

coordinate_system

The coordinate system associated with this dependence object.

coordinates_ndim

Number of coordinate dimensions in the associated coordinate system.

dependent_axes

The list of coordinate axis names this field depends on.

is_scalar

Whether this object represents a scalar field (i.e., rank 0).

rank

The tensor rank [number of indices] of this field.

shape

The tensor shape of this symbolic field.

symbolic_proxy

A symbolic proxy field or tensor that represents coordinate dependence.