I am working on a iterative solver for non linear Coupled Cluster equations that would require a computation of lot of tensor elements via tensor contractions. For now, I am using the TensorOperations.jl for this purpose. I am trying to initialize a tensor g
where the values of g[I,J,K,L]
are given for only certain [I,J,K,L]
. And the rest are supposed to be deduced from permutational symmetries. For now, I am using this make-shift code to achieve the above, where the values g[I,J,K,L]
had been read from some data file and only the non redundant elements were provided.
for (I,J,K,L) in non_redundant_indices
g[K,L,I,J]=g[I,J,K,L]
g[J,I,L,K]=g[I,J,K,L]
g[L,K,J,I]=g[I,J,K,L]
g[J,I,K,L]=g[I,J,K,L]
g[L,K,I,J]=g[I,J,K,L]
g[I,J,L,K]=g[I,J,K,L]
g[K,L,J,I]=g[I,J,K,L]
end
Does anyone have an about how may I do the same but maybe a bit more conveniently or elegantly perhaps? I looked a bit into TensorKit.jl and they seem to deal with Tensors as a new data type called TensorMap
which does support some symmetry features, but I cannot figure out how to implement this permutational symmetry in those tensors and how to exploit them during tensor operations like contractions.