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. \begin{equation} (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} \end{equation} and \begin{equation} (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} \end{equation}
Now, let me try to explain what I was trying to do. I wrote these equations as \begin{equation} \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 \end{equation} 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.