differential_geometry.dependence.DenseTensorDependence.element_wise_gradient#

DenseTensorDependence.element_wise_gradient(*, basis: Literal['covariant', 'contravariant'] = 'covariant', as_field: bool = False)#

Compute the component-wise gradient of the field.

Parameters:
  • basis ({"covariant", "contravariant"}, optional) – Whether to compute the gradient in the covariant or contravariant basis.

  • as_field (bool, optional) – If True, return the raw symbolic expression. If False (default), wrap the result in a dependence object.

Returns:

Symbolic gradient expression or a new dependence object.

Return type:

Expr or _DepA