abs#

metatensor.abs(A: TensorMap) TensorMap[source]#

Return a new TensorMap with the same metadata as A and absolute values of A.

\[A \rightarrow = \vert A \vert\]

If gradients are present in A:

\[\nabla(A) \rightarrow \nabla(\vert A \vert) = (A/\vert A \vert)*\nabla A\]
Parameters:

A (TensorMap) – the input TensorMap.

Returns:

a new TensorMap with the same metadata as A and absolute values of A.

Return type:

TensorMap