Evaluating Tensors With XCoba

1. Setup

Initiating XCoba:

<<xAct`xCoba`

Defining the manifold and Chart (Coordinate system on the manifold):

DefManifold[M4,4,{μ,ν,α,β,σ,λ,b,c,d,e,f}]
DefChart[cart,M4,{0,1,2,3},{t[],r[],θ[],ϕ[]},FormatBasis->{"Partials","Differentials"}]

The following free cells are used to define metric. Firstly, the “MatrixMetric “matrix is defined, containing components of the metric tensor with respect to the coordinates defined before.  Then, the corresponding “met” tensor is defined and set to be the metric tensor with the “SetCMetric” command:

MatrixForm[MatrixMetric=DiagonalMatrix[{-(1-1/r[]),(1-1/r[])^-1,r[]^2,r[]^2Cos[θ[]]^2}]]

met=CTensor[MatrixMetric,{-cart,-cart}]
SetCMetric[met,cart,SignatureOfMetric->{-1,3,0}]
met[-μ,-ν]

Setting the covariant derivative to be the one defined by Levi-Civita connection of the given metric, as well as computing all of the Pre-defined XCoba tensors for the metric.

CD=LC[met];

MetricCompute[met,cart,All]

2.Calculating User-Defined Tensors.

RicciPDcart[-b,-c]RicciPDcart[b,c]