differential_geometry.dependence.TensorDependenceMixin.gradient#
- TensorDependenceMixin.gradient(*, basis: Literal['covariant', 'contravariant'] = 'covariant', as_field: bool = False)[source]#
Compute the elementwise gradient of the tensor field.
This delegates to element_wise_gradient() from OperatorsMixin, treating each tensor component as an independent scalar function.
- Parameters:
basis (
{"covariant", "contravariant"}
, optional) – Whether to return the result in the covariant or contravariant basis.as_field (
bool
, optional) – Whether to return the raw symbolic result or wrap it as a dependence object.
- Returns:
The gradient expression or new dependence object.
- Return type:
_GenericFieldType
or_DepT