add#
- metatensor.add(A: TensorMap, B: int | float | TensorMap) TensorMap [source]#
Return a new
TensorMap
with the values being the sum ofA
andB
.If
B
is aTensorMap
it has to have the same metadata asA
.If gradients are present in
A
:B
is a scalar:\[\nabla(A + B) = \nabla A\]B
is aTensorMap
with the same metadata ofA
:\[\nabla(A + B) = \nabla A + \nabla B\]