List<Expression> expressionsList = new ArrayList<>();
IndexGenerator generator = new IndexGenerator();
//creating T_a*T_b = 1/2N g_ab + I/2*f_abc*T^c + 1/2*d_abc*T^c
int upper, lower, contracted, firstMetric, secondMetric, thirdMetric;
SimpleIndices indicesOfA = IndicesFactory.createSimple(null,
firstMetric = generator.generate(metricType),
upper = (0x80000000 | generator.generate(matrixType)),
contracted = generator.generate(matrixType));
SimpleIndices indicesOfB = IndicesFactory.createSimple(null,
secondMetric = generator.generate(metricType),
(0x80000000 | contracted),
lower = generator.generate(matrixType));
SimpleIndices indicesOfC = IndicesFactory.createSimple(null,
(0x80000000 | (thirdMetric = generator.generate(metricType))),
upper, lower);
Tensor lhs = multiply(simpleTensor(sunName, indicesOfA),
simpleTensor(sunName, indicesOfB));
//(1/(2*N))*g_ab
Tensor gTerm = multiply(Complex.ONE_HALF, reciprocal(N),
createMetric(firstMetric, secondMetric), createKronecker(upper, lower));
SimpleIndices fIndices = IndicesFactory.createSimple(null, firstMetric, secondMetric, thirdMetric);
Tensor C = simpleTensor(sunName, indicesOfC);
//(I/2)*f_abc*T^c
Tensor fTerm = multiply(Complex.ONE_HALF, Complex.IMAGE_ONE,
simpleTensor(fName, fIndices), C);
//(1/2)*d_abc*T^c