I'm using Python's einsum for an operation over two arrays, and I was wondering how to correctly write this operation out in a paper.
Let's say I have two '3d' arrays $A_{i,j,k}$ and $B_{i,k,l}$, and I want a sum-product over index $k$, an outer product over indices $j$ and $l$, and I want to do that for every $i$, i.e. index $i$ is "matched" between $A$ and $B$. I would write that as einsum('ijk,ikl->ijl',A,B).
Is there an index-based mathematical notation that would let me write all these operations at once? I have looked up actual Einstein summation, but it seems to be defined more narrowly, e.g. for a sum-product but not outer product, and not in a way you could represent "for every $i$...". Specifically for the index $i$, it seems that once an index is repeated, it must be summed over, which I don't want.
Is there a set of rules for writing out derivatives with respect to arrays using the same index notation? E.g. of outer and inner products, repeated operations, etc?