The main difference between this sort of approach and the approach in an EinSum esque package is that these packages actually encode the name of the dimensions in the type signature of the array whereas an Einsum-esque approach, the names are just temporary labels for the purposes of the macro call.
Also towards adding something like, making einsum work where you just specify the left-hand side of the einsum and then it uses the encoded names. (Rather than the temporay labels)
PRs to add that feature are welcome
It should also be noted that the original use of Einstein notation had all the indices refer to the same thing (it refers to some basis of the underlying vector space). I'v seen some ML papers where this was very much not the case. Obviously in those situations you should be very clear about which index means what.
Pandas is somewhere halfway that and raw matrix/numpy math, automatically aligning dataframes by row and column names first before doing computations. Even though performance is usually closer to numpy than SQL, the extra overhead is sometimes large enough for people to drop down to plain numpy.
It's not optimal, but it's the best I know and named-indices would have their drawbacks too.
It seems like named columns like in SQL might be better?