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