xTensor types: continuation

We start a new xTensor session:

Exit

<<xAct`xTensor`

$DefInfoQ=False;

$PrePrint=ScreenDollarIndices;

Define manifold, metric & covariant derivatives:

DefConstantSymbol[dim,PrintAs->"d"]

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

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

$DefInfoQ=True;

Type constant symbol

A constant symbol is a symbol (in the WL sense) which is zero when acted upon any covariant derivative or ordinary derivative:

DefConstantSymbol[GNewton,PrintAs->"(Subscript[G, N])"]

PD[-a][GNewton]

CD[-a][GNewton]

D[GNewton,x]

Type Parameter

A parameter is a variable which is independent from any manifold or tensor:

DefParameter[time,PrintAs->"t"]

$Parameters

Now tensors can also depend upon that parameter:

DefTensor[U[a],{M,time}]

DependenciesOf returns both manifold and parameter dependencies:

DependenciesOf[3U[a]U[b]]

It is now possible to compute the parametric derivative of any tensorial expression with respect to the introduced parameter:

ParamD[time][3U[a]U[b]]

We can add the dependency on the parameter to already defined tensors:

DependenciesOfTensor@metric^={M,time};DependenciesOfTensor@RicciCD^={M,time};

Use the added parameter dependency to write down the famous Ricci flow equation:

RicciFlow=ParamD[time]@metric[-a,-b]==-2 RicciCD[-a,-b]

Type InertHead

An InertHead wraps around a tensor or a tensorial expression and it is almost transparent to index manipulations. It may carry additional information. For example, we define an InertHead to represent the trace free part of any tensor expression:

DefInertHead[TFPart]

List of InertHeads:

$InertHeads

Index contraction of the trace-free part in any pair of indices vanishes:

TFPart/:TFPart[expr_]delta[-a_,b_]:=0/;IsIndexOf[expr,a]&&IsIndexOf[expr,-b];

DefTensor[T[a,-b],M]

T[a,-b]delta[-a,b]

TFPart[T[a,-b]U[c]U[d]]delta[-c,b]

Are these two equivalent ? clearly not.

{TFPart[T[a,-b]]delta[-a,b],TFPart[T[a,-a]]}

There are two special inert heads built into xAct: Error and Scalar. Error is used when Validate detects a tensor expression with unknown symbols:

U[-a,-B]

%//Validate

Scalar is used as a wrapper for tensor expressions without free indices:  consider:

(U[a]U[-a])^2

T[b,-b]^2/.IndexRule[T[c_,-c_],U[a]U[-a]]

The proper way of working with these expressions is through the use of the inert head Scalar:

Scalar[U[a]U[-a]]^2

Scalar[T[b,-b]]^2/.IndexRule[T[c_,-c_],U[a]U[-a]]

The Scalar inert head can be removed:

NoScalar[%]

and put back again:

PutScalar[%]

Type ScalarFunction

A scalar function is a function having an arbitrary number of scalar (tensors of zero rank) arguments:

DefScalarFunction[SF]

List of scalar functions:

$ScalarFunctions

ScalarFunctionQ@SF

?SF

Arguments of a scalar function can be also scalar tensorial expressions:

SF[Scalar[U[a]U[-a]]]

CD[-a][%]

%//Validate

Some relevant operations

The Lie Bracket

DefTensor[W[a],M]

This is the Lie bracket of two vector fields

Bracket[U[c],W[c]][a]

The bracket vanishes when both vector fields coincide as expected:

Bracket[U[b],U[b]][a]

Expansion of the Lie bracket in terms of a covariant derivative

Bracket[U[c],W[c]][a]

BracketToCovD[%,CD]

We check the Jacobi identity:

DefTensor[v[a],M]

Bracket[Bracket[U[d],W[d]][c],v[b]][a]+Bracket[Bracket[W[d],v[d]][c],U[b]][a]+Bracket[Bracket[v[d],U[d]][c],W[b]][a]

BracketToCovD[%,PD]

BracketToCovD[%,PD]

ToCanonical[%,UseMetricOnVBundle->None]

The Lie derivative

General notation:

LieD[ U[a] ][ T[-a,-b] ]

Any vector field is valid but indices within vectors inside the Lie derivative cannot collide with indices outside the Lie derivative:

expr=LieD[ 3T[d,f]U[-f]+U[f] ][ T[-a,-b] ]

expr//ToCanonical

expr U[a]U[b]//ToCanonical

Lie derivatives to CovD derivatives

We can transform the Lie derivative of any tensor expression into an expression written in terms of covariant derivatives using the standard formula:

expr

LieDToCovD[expr,PD]

LieDToCovD[expr,CD]

%//ToCanonical

Vector contraction on tensor slots

Two notations for vector contraction on tensor slots: the standard one:

expr1=U[a]T[-a,-b]

and the directional one:

expr2=T[Dir[U[a]],-b]

We can switch between them:

SeparateDir[expr2]

ContractDir[%,U]

Again, Dir can contain any vector field (note the special formatting for larger expressions):

T[a,Dir[ 3U[b]+W[b]+T[b,c]U[-c]+T[b,c]W[-c]]]

SeparateDir@%