unitaria.ComponentwiseMul

class unitaria.ComponentwiseMul(subspace_or_first: Subspace | Node, second: Node | None = None)[source]

Bases: MultilinearNode

Node implementing the (bilinear) componentwise multiplication operator

More specifically this implements the bilinear map (x, y) -> [x_1 * y_1, ..., x_n * y_n]. Usually you will want the elementwise product of two vectors, in which case the correct result will be obtained by building the tensor product of the vectors and then multiplying it with this operation, i.e. Mul(ComponentwiseMul(a.subspace_out()), Tensor(a, b))

Parameters:

subspace – The vector space in which to perform the element-wise operation