I am struggling with creating the rank-4 matrix T in Mathematica. The matric is defined as
$T_{i,j,k,l}= n_i n_j n_k n_l-(\delta_{i,j} n_k n_l +\delta_{i,k} n_j n_l+\delta_{i,l} n_k n_j+\delta_{j,l} n_i n_k+\delta_{j,k} n_i n_l+\delta_{k,l} n_i n_j)/6$,
Where $n$ is a vector with two components: $n=(a,b)$.
I used TensorProduct to create the matrix, but I am not sure if that is correct, and also I do not know how to add the second part with delta functions. Could someone please help me?
Here is what I did:
n = {a, b};
mat = TensorProduct[n, n, n, n]
mat // MatrixForm