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