Hi,
The Invar package requires a particular value of some of the configuration settings. If you just load Invar then note these messages:
<< xAct`Invar`
.......
** Option AllowUpperDerivatives of ContractMetric changed from False to True
** Option CurvatureRelations of DefCovD changed from True to False
** Variable $CommuteCovDsOnScalars changed from True to False
where I've removed all other uninteresting (for our purpose) messages.
But your notebook loads xTras, which undoes one of these settings:
<<xAct`xTras`
.......
** Option CurvatureRelations of DefCovD changed from False to True
and then I see your notebook is undoing another one:
In[]:= $CommuteCovDsOnScalars = True
Out[]= True
Those two things effectively break some of the cases of Invar, as you have found.
CurvatureRelations -> True is what makes contractions of Riemann become Ricci, etc. Invar wants to see only Riemann tensors.
So, either you work with only Invar, without loading xTras, or you set CurvatureRelations -> False in your call to DefMetric. And don't change the value of $CommuteCovDsOnScalars.'
Cheers,
Jose.