4
$\begingroup$

I am trying to use xAct package to calculate certain mixing terms of $\nabla_{\chi} b$ of a scalar function $b[ \tau, r, \theta, \phi]$ for a modified metric. Here is my Code:

<< xAct`xTras`
ddim = 4;
coords = {\[Tau][], r[], \[Theta][], \[Phi][]};

DefManifold[M4, 
  ddim, {\[Alpha], \[Beta], \[Gamma], \[Sigma], \[Mu], \[Nu]}];
DefMetric[-1, g[-\[Alpha], -\[Beta]], CD, PrintAs -> "g"];
DefScalarFunction[{a, \[Eta], b}];
DefChart[ch, M4, {0, 1, 2, 3}, coords, ChartColor -> Red];
DefConstantSymbol[K]

FRWr = DiagonalMatrix[{
   -\[Eta][\[Tau][]]^2,
   b[\[Tau][], r[], \[Theta][], \[Phi][]]^2/(1 - K r[]^2),
   b[\[Tau][], r[], \[Theta][], \[Phi][]]^2 r[]^2,
   b[\[Tau][], r[], \[Theta][], \[Phi][]]^2 r[]^2 Sin[\[Theta][]]^2
   }
  ]

MatrixForm@MetricInBasis[g, -ch, FRWr]
MetricCompute[g, ch, Einstein, Verbose -> True]

CD[-\[Alpha]]@CD[\[Alpha]]@b

CD[-\[Alpha]]@CD[\[Alpha]]@b[\[Tau][], r[], \[Theta][], \[Phi][]]

CD[-\[Alpha]]@b CD[\[Alpha]]@b

CD[-\[Alpha]]@b CD[\[Alpha]]@b g[-\[Mu], -\[Nu]]

(CD[-\[Alpha]]@b CD[\[Alpha]]@b) g[-\[Mu], -\[Nu]] g[\[Gamma], \[Sigma]]

The output of the last 5 lines is here:

enter image description here

How can I evaluate these abstract outputs? I have tried using //ToBasis[ch]// ToValues but didn't help either.

Any help would be greatly appreciated, thank you in advance.

$\endgroup$
1
$\begingroup$

I'd recommend to do the following. Keep this part of your code:

<< xAct`xTras`

ddim = 4;
coords = {\[Tau][], r[], \[Theta][], \[Phi][]};

DefManifold[M4, ddim, {\[Alpha], \[Beta], \[Gamma], \[Sigma], \[Mu], \[Nu]}];
DefScalarFunction[{a, \[Eta], b}];
DefChart[ch, M4, {0, 1, 2, 3}, coords, ChartColor -> Red];
DefConstantSymbol[K]

FRWr = DiagonalMatrix[{
    -\[Eta][\[Tau][]]^2, 
    b[\[Tau][], r[], \[Theta][], \[Phi][]]^2/(1 - K r[]^2), 
    b[\[Tau][], r[], \[Theta][], \[Phi][]]^2 r[]^2, 
    b[\[Tau][], r[], \[Theta][], \[Phi][]]^2 r[]^2 Sin[\[Theta][]]^2
}]

You don't need to use a symbolic metric g. We can just work with this explicit metric:

g = CTensor[FRWr, {-ch, -ch}]

Compute everything up to the Einstein tensor and set this metric as the one to be used to raise/lower indices automatically:

MetricCompute[g, ch, Einstein, Verbose -> True]
SetCMetric[g, ch, SignatureOfMetric -> {3, 1, 0}]

Get the associated Levi-Civita connection:

CD = CovDOfMetric[g];

Now you can compute the Laplacian of a scalar:

bsc = b[\[Tau][], r[], \[Theta][], \[Phi][]]

CD[-\[Alpha]]@CD[\[Alpha]]@bsc

or the square of a gradient:

CD[-\[Alpha]]@bsc CD[\[Alpha]]@bsc

This case requires some further simplification:

BasisExpand[%, ch] // Simplify

Note that you cannot compute derivatives of b, because b is a function. You first need to specify the arguments of that scalar function (that's the scalar bsc).

$\endgroup$
1
  • $\begingroup$ Great, thank you very much Jose. Defining explicit metric in your way via CTensor solved my issues. $\endgroup$ Apr 8 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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