In fact, I like xAct so much, I wrote an additional package for. It's aptly called xTras, and its available over on www.xact.es/xtras. It brings some functionality that I found missing in xAct, like computing equations of motion for the metric, perturbations around AdS spaces, and Young projectors (yes, this also includes Bianchi identities).
I'll demonstrate some of the new functionality by computing the linearization of the Einstein tensor around AdS spaces. Here goes!
First, open up Mathematica, and enter the following line:
In: <<xAct`xTras`This loads the xTras package (assuming you're managed to download and install it). Next we'll define a manifold and a metric:
In: DefConstantSymbol[dimension,PrintAs->"D"]We'll be doing stuff on AdS spaces, which has a constant curvature. Hence we need to define a constant symbol to indicate that curvature:
In: DefManifold[M,dimension,IndexRange[a,f]]
In: DefMetric[-1,g[-a,-b],CD]
In: DefConstantSymbol[L]Now we're ready to define the standard Lagrangian for gravity with a cosmological constant:
In: lagrangian = RicciScalarCD[] -(dimension-2)(dimension-1)LWe'd like to compute the equations of motion that follow from this Lagrangian. To do so, we first write the command
In: DefMetricVariation[g,h,eps]This command makes it possible to do covariant metric variations. It also registers the command VarL, which varies Lagrangians:
In: eom = VarL[g[a,b]][lagrangian] //TensorCollectThe equations of motion should allow for AdS spaces. To check this, we first generate a list of replacement rules for curvature tensors of the covariant derivative CD on symmetric spaces:
Out: \( \frac{1}{2} (2 - 3 D + D^2) L g_{ab} + R_{ab} - \frac{1}{2} g_{ab} R\)
In: AdSrules = SymmetricSpaceRules[CD,L]And indeed, the equations of motion are zero for this background:
In: eom /. AdSrules // ToCanonicalThis means we can perturb around this solution. So without any further ado, here's the linear perturbation of the Einstein tensor:
Out: \( 0 \)
In: ExpandBackground[eom, BackgroundSolution -> AdSrules] // TensorCollectAnd that's it! Granted, we could also have done this by hand. But the power of xAct is that it can do much more complicated calculations without breaking a sweat. If we would like to know the second order pertubation of the Einstein tensor, we can simply replace the above input by ExpandBackground[eom,2,BackgroundSolution->AdSrules]. Pretty cool, right?
Out: \( (l - D l) h^{1}{}_{ab} + \frac{1}{2} (-1 + D) l g_{ab} h^{1c}{}_{c} - \frac{1}{2} \triangledown_{a}\triangledown_{b}h^{1c}{}_{c} + \frac{1}{2} \triangledown_{c}\triangledown_{a}h^{1}{}_{b}{}^{c} + \frac{1}{2} \triangledown_{c}\triangledown_{b}h^{1}{}_{a}{}^{c} \)
\(- \frac{1}{2} \triangledown_{c}\triangledown^{c}h^{1}{}_{ab} - \frac{1}{2} g_{ab} \triangledown_{d}\triangledown_{c}h^{1cd} + \frac{1}{2} g_{ab} \triangledown_{d}\triangledown^{d}h^{1c}{}_{c} \)