Dear Cadabra developers and users,
I would like to construct a "scalar product" of tensors of the form:
met:X x Y ->X{a}*Y{a}
but I can't find a way to implement it.
When acting on scalar quantities, it works fine as follows:
{a, b, c, d, e, f, g, h, i, j, k, l, m, n ,p, q, r,s,t,u,v,w,x,y,z#}::Indices(T, position=free, parent=double); Expmet:=met{X??}{Y??}->X??*Y??; Exp:=met{V}{W}; substitute(_, Expmet);
and the output is VW
as expected.
Now, if I want X and Y to be vectors, then the naive guess
Expmet:=met{X??}{Y??}->{X??}_{a}*{Y??}_{a};
doesn't work, the output being (VW)_{aa}.
I tried several variations but none of them worked so far.
Is there a way to implement this kind of operators for tensors?
Thank you already for any input!