Maybe https://github.com/Jutho/TensorOperations.jl can be helpful here? I've never used it myself, but just by the name and the description ("Julia package for tensor contractions and related operations") it sounds like exactly what you're looking for...
// T On Thursday, August 28, 2014 12:11:43 PM UTC+2, Steven G. Johnson wrote: > > It should be straightforward to write a macro that simplifies the > Kronecker sums to give you an efficient Julia expression. >
