Using xAct package in Mathematica, I am trying to obtain expansions of Ricci scalar upto second order in metric perturbations. Although I am able to obtain the perturbed expressions, Mathematica/xAct does not seem to simplify some tensor expressions. For example, there are terms like:
p2[a, -a] p2[b, -b] - (p2[a, -a])^2
p2[a,b] is a second rank tensor. I would like such expressions to be automatically simplified; in the above case, expected result is
0. However, when I use the command
//Simplification, I get the same expression. For instance, this is what I get for the above expression:
In:= p2[a, -a] * p2[b, -b] - (p2[a, -a])^2 // Simplification Out= p2[a, -a] p2[b, -b] - xAct`xTensor`Scalar[p2[a, -a]]^2
Why is xAct/Mathematica not recognizing the two terms as equal?
A prescription to simplify such expressions in general would be appreciated.