I've been using Carl Woll's einsum function, but it's missing the ability to handle repeated indices.
For instance np.einsum('i,i->i',w, w)
will perform a Hadamard product, so it makes sense for Mathematica's einsum to do the same for einsum[{{1}, {1}} -> {1}, a, a]
.
Another example, the following einsum in Python produces outer product of diagonal of A with $a\odot b$
np.einsum('ii,j,j->ij', A, b, c)
In Mathematica syntax this could look like this:
einsum[{{1,1}, {2}, {2} -> {1,2}, A, b, c]
Jacob Biamonte visualizes this kind of structure using "COPY-tensor", but it's really just an edge with more than 2 endpoints - a hyper-edge, so it would be useful to have it supported