I am trying to expand the following term (via the perturbation expansion $g_{\mu\nu} = \eta_{\mu\nu} + \kappa h_{\mu\nu}$):

$$ \frac12 \epsilon^{abcd}R^e_{fcd}R^f_{eab} $$

Where $R$ is the Riemann Tensor and $\epsilon$ the Levi-Cevita Tensor (which depends on the determinant of the metric).

I have tried using the package xAct (specifically xPert), however I can't get a result from it. I also don't know how to input the Levi-Civita Symbol $\epsilon^{abcd}$.

A minimal code is below, which typically just crashes for me. If I set GR to be simpler (say, just GR = Sqrt[-Detg[]] RicciScalarCD[]) then it seems to work OK.

<< xAct`xPert`;
$PrePrint = ScreenDollarIndices;
(* Define a manifold *)
DefManifold[M4, 4, {a, b, c, d, e, m, n, p, q, r, s, t, l}];

(* Define a metric Subscript[g, ab] *)
DefMetric[{1, 3, 0}, g[-m, -n], CD, {";", "\[Del]"}, Torsion -> False, Curvature -> True, PrintAs -> "g"];

(* Define the metric perturbation *)
DefMetricPerturbation[g, H, \[Epsilon]];

GR = 1/(2 k^2)Sqrt[-Detg[]].RiemannCD[s, -t, -a, -b].RiemannCD[t, -s, -m, -n];
Perturbation[GR] // ExpandPerturbation

1 Answer 1


For example,

<< xAct`xPert`

Define your structures:

DefManifold[M4, 4, IndexRange[a, f]]

DefMetric[{1, 3, 0}, g[-a, -b], CD]

DefMetricPerturbation[g, H, \[Epsilon]]

Construct the object to perturb, as you give it above, including the epsilon tensor of the metric g:

GR = 1/2 epsilong[a, b, c, d] RiemannCD[e, -f, -c, -d] RiemannCD[f, -e, -a, -b]

Perturb to second order and manipulate:

Perturbation[GR, 2] // ExpandPerturbation // ContractMetric // ToCanonical

Particularize to flat background and simplify:

% /. RiemannCD -> Zero // Simplification
  • $\begingroup$ Dear jose, thanks for your answer. if the background metric was not flat, how can plug it into the above code? I just want to expand Ricci tensor around a reference metric with known components. how to introduce it? I don't want a formal expansion. $\endgroup$
    – Arian
    Commented Aug 4, 2021 at 10:38

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.