Christoffel symbols in xTensor symbolically

101 views
Skip to first unread message

Hermann

unread,
Mar 28, 2025, 11:33:26 AM3/28/25
to xAct Tensor Computer Algebra

I have a (maybe) naive question. I would like to calculate the Christoffel symbols of a given metric of the type in xTensor (so I don't want to specify any chart) Therefore, the Christoffel symbols are only derivatives of . Is it possible in xTensor? I tried this:

IndexSet[g[-a, -b], delta[-a, -b] + p[-a] p[-b]]

But it doesn't work like this. Or one needs xCoba? And how?

Thanks!

Jose

unread,
Mar 29, 2025, 4:01:10 PM3/29/25
to xAct Tensor Computer Algebra
Hi Hermann,

Before we discuss how to implement it, we need to discuss what it is that you want to do. If one works with xTensor only, without xCoba, then everything must have a coordinate-independent meaning. The metric g[-a, -b] does have such a meaning, but delta[-a, -b] (with both indices down) does not. In fact, xTensor assumes that delta[-a, -b] means g[-a, -c] delta[c, -b], which is g[-a, -b], and automatically performs the conversion:

<< xAct`xTensor`

DefManifold[M, 4, {a, b, c, d, e, f}]
DefMetric[-1, g[-a, -b], cd]

In[4]:= delta[-a, -b]
Out[4]= g[-a, -b] 

So we need to be more precise. I think we can either use xPert for this, or we can do everything ourselves in xTensor. Given that this is a simple case, let's do the latter. Start with a fresh session and declare two metrics: the background metric bg[-a, -b] and the full metric g[-a, -b], both curved metrics:

<< xAct`xTensor`
$PrePrint = ScreenDollarIndices;

DefManifold[M, 4, {a, b, c, d, e, f}]
DefMetric[-1, bg[-a, -b], cd]
DefMetric[-1, g[-a, -b], CD]

Now define the vector field p[-a] and a small parameter eps that will help us control perturbation orders:

DefTensor[p[-a], M]
DefConstantSymbol[eps]

Now we can do the sort of thing you want. First note we have to give separate definitions for g and its inverse Invg. What I write here is correct to first order in eps, or always correct if p[a] is null in the background bg metric (i.e. Kerr-Schild perturbations):

rules = {
   g[-a_, -b_] :> bg[-a, -b] + eps p[-a] p[-b],
   Invg[a_, b_] :> bg[a, b] - eps p[a] p[b]
};

Then you can do this, which will give you three terms: the zeroth-order Christoffel of the background metric, its first-order perturbation and some second-order terms:

Collect[ChristoffelToGradMetric[ChristoffelCD[a, -b, -c]] /. rules, eps]

If you want the background metric to be flat and have zero derivatives in the "fiducial chart" of the "fiducial derivative" PD then replace the definition above of bg with this other one:

DefMetric[-1, bg[-a, -b], PD, FlatMetric -> True]

(The red messages emitted are warnings and can be ignored.) Then PD-derivatives of bg will disappear, in particular the zeroth-order Christoffel. It will then be convenient to use ContractMetric as third argument of Collect too.

Cheers,
Jose.
Reply all
Reply to author
Forward
0 new messages