multiply#
- metatensor.multiply(A: TensorMap, B: float | int | TensorMap) TensorMap [source]#
Return a new
TensorMap
with the values being the element-wise multiplication ofA
andB
.If
B
is aTensorMap
it has to have the same metadata asA
.If gradients are present in
A
:B
is a scalar then:\[\nabla(A * B) = B * \nabla A\]B
is aTensorMap
with the same metadata ofA
.The multiplication is performed with the rule of the derivatives:
\[\nabla(A * B) = B * \nabla A + A * \nabla B\]
- Parameters:
- Returns:
New
TensorMap
with the same metadata asA
.- Return type: