differential_geometry.dependence.DenseTensorDependence.adjust_tensor_signature#
- DenseTensorDependence.adjust_tensor_signature(variance_in: Sequence[int], variance_out: Sequence[int], /, *, as_field: bool = False)#
Adjust the tensor variance (covariant/contravariant) of each index.
- Parameters:
variance_in (
Sequence[int]
) – The current variance of each index (0 = covariant, 1 = contravariant).variance_out (
Sequence[int]
) – The target variance signature to convert to.as_field (
bool
, optional) – If True, return the symbolic expression. If False, return a new dependence object.
- Returns:
Symbolic tensor with adjusted signature or a new dependence object.
- Return type:
_GenericFieldType
or_DepT
- Raises:
ValueError – If the variance vector lengths do not match the tensor rank.