Hello.
I am trying to implement the transverse-traceless gauge on metric perturbations and I can get it to work sometimes only if I have a specific order of operations.
If I first perturb the equations of motion, and then implement an automatic rule
AutomaticRules[metpert,
MakeRule[{CD[-a]@metpert[LI[1], a, b], 0}, MetricOn -> All,
PatternIndices -> All]]
but also at the end of the expression flip covariant derivatives via
/. {CD[a_][CD[b_][expr_]] :> CD[b][CD[a][expr]]}
I get the right answer but I think it is only by luck since a more careful way, I would assume, would be to use the SortCovDs[] command, but I am unsure how to implement this. I attached an example notebook of showing how this works. (Since I want to work with more complicated systems of course).
Any help is appreciated, thanks.
Alex.