I am trying to use mathematica to generate explicitely a tensor. I know multiple thing about it. Let's call it $C_{\mu\nu\lambda\sigma}$. This guy has to be symmetric in the two first indices ${\mu,\nu}$ are well as in the two indices ${\lambda\sigma}$. To build this tensor, I have at my disposal the Kronecker symbol $\delta_{\mu\nu}$ that is symmetric as well as a vector, call it $s_{\lambda}$. It is then clear that we will have three possible structures : 2 Kronecker deltas, 1 Kronecker delta and two s, or 4 s. I worked it out explicitely on paper and manage to find the most general tensor of this type can be written as
\begin{align} C_{\mu\nu\lambda\sigma} =& C_1s^2(\delta_{\mu\nu}\delta_{\lambda\sigma}) +C_2s^2(\delta_{\mu\lambda}\delta_{\nu\sigma}+\delta_{\mu\sigma}\delta_{\nu\lambda} )+C_3\delta_{\mu\nu}s_{\lambda}s_{\sigma} + C_4\delta_{\lambda\sigma}s_{\mu}s_{\nu}\nonumber\\ & + C_5(\delta_{\lambda\nu}s_{\mu}s_{\sigma}+\delta_{\sigma\nu}s_{\mu}s_{\lambda}+\delta_{\lambda\mu}s_{\nu}s_{\sigma}+\delta_{\sigma\mu}s_{\nu}s_{\lambda})+C_6\frac{s_{\mu}s_{\nu}s_{\lambda}s_{\sigma}}{s^2}, \end{align} where the $s^2$ are just here because of dimensionality and the structure of constants in the one needed for the symmetry to be the one I described. I will have to generalize this type of construction to tensors with more indices, so I would like to be able to do it in Mathematica. My best guess at the moment in that the easiest way to do it would be to generate all the possible tensors and then erase the one that are the same due to the symmetry in place, nevertheless, I really don't know how to deal with the two different structures $s_{\lambda}$ and $\delta_{\mu\nu}$. I would really appreciate any solution.