# Using Tensorial.jl to deal with Tensors with high symmetries

I am writing code that deals with contractions of large tensors which possess high symmetry.

As an example, I have a tensor `g` whose certain entries are read from a data file. The remaining entries are entered using the permutational symmetries

``````        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]
``````

I know that Tensorial.jl has support for `SymmetricFourthOrderTensors` , but I cannot figure out how exactly to exploit the symmetry in question. As a direct example of where it might be helpful :

I am dealing with contractions like

``````@tensor Trm2[a_1,a_2,i_1,i_2] := - g_voov[a_1,i_3,i_1,a_3] * T2[a_2,a_3,i_3,i_2]
``````

Where each tensor can be of rank `60x60x10x10` , which is quite large. However, the tensors on the RHS `g_voov` and `T2` posses many permutational symmetries which are not being exploited in TensorOperation.jl 's `@tensor` macro inheretly. Tensoril.jl 's Benchmarks indicate we can get massive speedups when using tensors of appropriate symmetry class. It would be really helpful if someone could give me a direction in which I can move in to start exploiting these symmetries using the Tensorial.jl package. Whenever I am dealing with these contractions, the tensors like `g_voov` are going to be read from the disk. Is there any way to auto-detect the symmetries during reading the binaries ? Or if I am aware beforehand of the symmetries : How can I initialize the tensor in memory such that the program is aware of the symmetries.

While I am not familiar with the details of Tensorial.jl, it seems to have an `@einsum` macro, which would behave similar to TensorOperations.jl `@tensor` and would probably address your question.