# Find invariant tensors under two matrix

I have two $$9\times 9$$ matrices $$g_1, g_2$$ where

g1 = {{-1, -(1/2), 0, 0, -(1/2), -(1/2), 0, 1/2, -(1/2)}, {0, 0, 0, 1, 0, 0, 0, 0, 0}, {-1, -(1/2), 3/2, 1, -(1/2), -1, -(3/2), 1, -(1/2)}, {1, 0, -(3/2), -1, 0, 1/2, 3/2, 1/2, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1}, {1/2, 0, 1/4, 1/2, -(1/2), -(1/4), -(3/4), 1/4, -(1/2)}, {0, 0, 0, 0, 0, 0, 0, 1, 0}, {-(1/2), 1/2, 3/4, 3/2, 0, -(5/4), -(5/4), 1/4, 0}, {0, 1/2, 0, -1, -(1/2), -(1/2), 1, -(1/2), 1/2}}

g2 = {{1/2, 1/2, 1/4, -(1/2), 0, 1/4, 1/4, -(1/4), 1}, {1/2, -(1/2), -(5/4), -(1/2), 1, 3/4, 3/4, 1/4, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0}, {0, 1/2, 1/2, 0, 1/2, 0, -(1/2), 0, -(1/2)}, {0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, -1, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1, 0}, {1/2, 0, 1/4, 1/2, -(1/2), -(1/4), -(3/4), 1/4, -(1/2)}}

I want to find four index invariants under the action of these two matrices, i.e. $$$$(g_1)_a^{\,a_1}(g_1)_b^{\,b_1}(g_1)_c^{\,c_1}(g_1)_d^{\,d_1}T_{a_1 b_1 c_1 d_1}=T_{abcd}$$$$ and $$$$(g_2)_a^{\,a_1}(g_2)_b^{\,b_1}(g_2)_c^{\,c_1}(g_2)_d^{\,d_1}T_{a_1 b_1 c_1 d_1}=T_{abcd}$$$$

Now, let me try to explain what I was trying to do. I wrote these equations as $$$$\big[(g_1)_a^{\,a_1}(g_1)_b^{\,b_1}(g_1)_c^{\,c_1}(g_1)_d^{\,d_1}-\delta_a^{\,a_1}\delta_b^{\,b_1}\delta_c^{\,c_1}\delta_d^{\,d_1}\big]T_{a_1b_1c_1d_1}=0$$$$ Then use Kronecker Product to make this problem as a problem of finding the null space of a matrix. i.e.

(KroneckerProduct[g1, g1, g1, g1]) - IdentityMatrix[9^4] //NullSpace

Then I move to see whether the linear combinations of these null vectors can be the null vectors of

(KroneckerProduct[g2, g2, g2, g2]) - IdentityMatrix[9^4] //NullSpace

If I can find one solution, then the problem is solved. All I need to do then is to translate the $$9^4$$ vector to a 4 rank tensor.

I tried this algorithm in the case of $$g_1,g_2$$ are two $$5\times5$$ matrices and it worked well. However, it seems it takes forever to run the first command line in $$9\times 9$$ case. Any suggestions for me to solve this problem?

For my use, I only need to solve the problem for the case where $$T_{abcd}$$ is totally symmetric. Perhaps I could write down a general ansatz for the totally symmetric four rank tensor and solve it. I will try to do it.

For curiosity, I'd like to understand the general case.

• Can you show all your code, including definitions of g1 and g2, rather than just snippets? What does each $(g_1)^{a_1}_{a}$ mean? What is $T_{abcd}$? Jan 19 at 16:34
• @MarcoB: The OP is using abstract index notation. Jan 19 at 16:36
• It seems plausible to me that if $W \subseteq V$ is the subspace of $V$ invariant under the actions of $g_1$ and $g_2$, then the subspace of $V \otimes V \otimes V \otimes V$ that is invariant under $g_1$ and $g_2$ will simply be $W \otimes W \otimes W \otimes W$. If that's true, it simplifies your problem greatly, since you only have to run your code on an $n$-dimensional space instead of an $n^4$-dimensional space. Proving that would be off-topic here, though. You might consider posting this conjecture as a question to Mathematics instead (if you can't readily disprove it.) Jan 19 at 16:53
• I got Mathematica to complete your code in about 15 minutes of calculation time, using $g_1$ as the rotation matrix that takes $\hat{e}_1 \to \hat{e}_9$ and $g_2$ as the rotation matrix that takes $\hat{e}_1 \to \hat{e}_2$. The resulting nullspaces are 2997-dimensional, which suggests that my conjecture above is incorrect. Jan 19 at 17:01
• @user3257842 Thanks. I have updated the question Jan 19 at 23:43