I'd like to express an abstract tensor I derived using xPert in components of a metric using xCoba. My result seems not to agree with the result I obtain using xPand, so I assume I am not using the correct approach in xCoba.
Here is what I do:
I start with a Lagrangian L and take its second order perturbation:
varL2 = ToCanonical[
ContractMetric[ExpandPerturbation[Perturbation[L, 2]]]]
I extract the abstract tensorial equation of motion:
vartf2 = 2 (-VarD[pert[LI[1], a, b], cd][varL2]/
Sqrt[-Detbackground[]] /. {delta[-LI[1], LI[1]] -> 1,
delta[-LI[2], LI[1]] -> 0, delta[-LI[1], LI[2]] -> 0} //
SeparateMetric[background]) // Expand //
ContractMetric // ToCanonical
eomt1[b_] =
Simplify[Simplify[
IndexCollect[cd[a]@vartf2 // ToCanonical, cd[-b][sf[]]] //
Simplification, eom0 == 0], eoms1 == 0]
where background is the metric
DefMetric[-1, background[-a, -b], cd, PrintAs -> "g"] and eom0 and eom1 are the scalar equations of motion, which I use to simplify the tensorial part, if such a combination of terms should appear again.
Then, I switch to xCoba and the component part, where I define my actual metric and a chart ch.
To express the Ricci scalar, Jose was so kind to help provide me with the following rules to transition the abstract result into the component-depending result:
rules = {
background[inds__Symbol] :> Inv[backgroundMetric][inds],
cd -> bgcd,
Riccicd[inds__] :> Ricci[bgcd][inds],
RicciScalarcd[] :> RicciScalar[bgcd][],
pert[LI[1], inds__] :> perturbation[inds]
};
With these rules I can express the abstract scalar equations of motion in components of the metric:
ceom0 = Collect[
ToCanonical[
eom0 // ExpandPerturbation // SeparateMetric[background],
UseMetricOnVBundle -> None] /. rules, \[Epsilon], Simplify]
These agree with my results from xPand.
Now, I'd like to also express the tensorial equations of motion in a similar manner. But the result seems not to agree with what I get with xPand. xPand gives me a zero/time component and a spatial component (1,2,3 which are "identical" besides the index). Therefore, I tried to extract the time and space component:
tmpeq = Collect[
ToCanonical[
eomt1[{0, ch}] // ExpandPerturbation //
SeparateMetric[background], UseMetricOnVBundle -> None] /.
rules, \[Epsilon], Simplify] // ContractBasis // FullSimplify
Collect[ToCanonical[
eomt1[{1, ch}] // ExpandPerturbation //
SeparateMetric[background], UseMetricOnVBundle -> None] /.
rules, \[Epsilon], Simplify] //
ContractBasis // FullSimplify
The first expression seems to disagree with what I get with xPand and the second expression runs for hours (I haven't seen a result yet).
Is there something wrong with this last step? Or is there just a better way to re-express an abstract tensor in a given basis?
Thank you very much in advance.