Spherical Symmetry

xCoba examples

November 2009

MetricCompute

Load the system :

<<xAct`xCoba`

Setup. Deactivate info messages, both in xTensor and xCoba:

$Info=False;
$CVVerbose=False;

Hide away ugly dummies :

$PrePrint=ScreenDollarIndices;

Report timings over 0.1 seconds:

<<xAct`ShowTime1`

$ShowTimeThreshold=0.1

In xCoba, as in all of xAct, we need to start by declaring a geometric environment.

Declare 4-manifold :

DefManifold[M,4,IndexRange[a,q]]

Declare abstract metric :

DefMetric[-1,metric[-a,-b],CD,PrintAs->"g"]

Declare spherical coordinates :

DefChart[B,M,{0,1,2,3},{t[],r[],θ[],ϕ[]}]

Now we specify components of the metric in that chart. First, declare scalar functions

DefScalarFunction[g00]
DefScalarFunction[g01]
DefScalarFunction[g11]
DefScalarFunction[R]

Input the metric. Note that coordinates are fields, and hence need a pair of brackets.

MatrixForm[metricarray={
{g00[t[],r[]],g01[t[],r[]],0,0},
{g01[t[],r[]],g11[t[],r[]],0,0},
{0,0,R[t[],r[]]^2,0},
{0,0,0,R[t[],r[]]^2 Sin[θ[]]^2}
}]

We use the function MetricInBasis to input the components of the metric in a given basis. It is a rather flexible function :

?MetricInBasis

We simply pass the components matrix as third argument. Note the minus sign in front of B. This indicates that we are supplying the covariant components of the metric.

MetricInBasis[metric,-B,metricarray]

TensorValues[metric]

Now we compute a particular object. We can choose, with the option CVSimplify, the function which is used on all (independent) components after each step of the computation. The algorithm reports timings and sizes in memory.
To see the possible values for the third argument simply write the symbol All there. Note the structure string[1,-1,...] , where -1 means covariant and 1 means contravariant.

?MetricCompute

MetricCompute[metric,B,"Riemann"[-1,-1,-1,-1],CVSimplify->Simplify]

Most of the time is spent in the simplification of the tensor components.

Now we have the independent components :

Last@TensorValues[RiemannCD]//Column

We can compute other objects. The previously computed objects are repeated, but much faster because Mathematica has cached the results.

MetricCompute[metric,B,"Kretschmann"[],CVSimplify->Simplify]

This is the Ricci scalar :

MetricCompute[metric,B,"RicciScalar"[],CVSimplify->Simplify]

RicciScalarCD[]//ToValues

We can restrict to special cases. For example, let us use Schwarzschild - like coordinates :

%/.{R->Function[{t,r},r],g01->Function[{t,r},0]}//Simplify

Let us impose a relation between the components :

%/.{g11->Function[{t,r},1/g00[t,r]]}//Simplify

Impose staticity :

%/.{g00->Function[{t,r},S[r]]}//Simplify

If the Ricci scalar is zero then (note that DSolve cannot use a bracketed independent variable):

DSolve[(%/.r[]->r)==0,S,r]

Note that we have not declared S as a scalar function, and therefore we can do Mathematica computations, but not xAct computations with it.

In double null coordinates  (t, r):

RicciScalarCD[]//ToValues

%/.{g00->Function[{t,r},0],g11->Function[{t,r},0],R->Function[{t,r},t-r]}//Simplify

%/.g01->Function[{t,r},S[t-r]]/.t[]->r[]+u//Simplify

Horribly enough, Mathematica thinks this equation has no solutions, though obviously S=-2 (Minkowski) is a solution :

DSolve[%==0,S,u]

DSolve[((S[u]^2)/(u^2))+2((S[u])/(u^2))-((S'[u]^2)/(S[u]))+S''[u]==0,S,u]

It should return the full equation, if nothing is found. Note that this happens if we remove the 2, after a long time :

DSolve[((S[u]^2)/(u^2))+((S[u])/(u^2))-((S'[u]^2)/(S[u]))+S''[u]==0,S,u]

We can also compute "everything" :

MetricCompute[metric,B,All,CVSimplify->Simplify]

Check of the contracted Bianchi identity :

CD[-c][EinsteinCD[-a,-b]]//ToBasis[B]//ToBasis[B]

%metric[{c,B},{b,B}]//Expand

array=%//TraceBasisDummy//ComponentArray//Expand

Length/@%

array//ToValues//Simplify