I'm new with working xAct package and got stuck defining covariant derivatives that commute with each other.

I want to simulate flat space-time. And here is my code

DefManifold[M4, 4, IndexRange[{a, f}]];
DefCovD[CD[-a], TangentM4, {"|", "\[Del]"}, Curvature -> False, CurvatureRelations -> False]
DefTensor[T[a], M4]

The following expression should be equal to zero because there is no curvature and in flat space, covariant derivatives are the normal commutative derivatives. But it does not commute

CD[c]@CD[b]@T[a] - CD[b]@CD[c]@T[a] // Simplification

What am I doing wrong?


1 Answer 1


Covariant derivatives with upper indices do not make sense before introducing a metric. So this works:

In[7]:= CD[-c]@CD[-b]@T[a] - CD[-b]@CD[-c]@T[a] // Simplification
Out[7]= 0

Instead of Simplification (or ToCanonical) you can also use SortCovDs, which will sort covariant derivatives even if they are not flat, introducing Riemann terms.

You can automate sorting of a covariant derivative with

In[8]:= SortCovDsStart[CD]

Then you have:

In[9]:= CD[-c]@CD[-b]@T[a] - CD[-b]@CD[-c]@T[a]
Out[9]= 0
  • $\begingroup$ I've defined metric like this now DefMetric[-1, g[-a, -b], CD, {"|", "\[Del]"}, FlatMetric -> True] But Covariant derivatives with upper indices still does not commute $\endgroup$ Commented Jul 27, 2019 at 5:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.