xTensor
 A: Basic concepts

José M. Martín-García
	LUTH & IAP, France

LUTH & IAP, 21-29 April 2009

1a. Installation of xAct

Install xAct in one of the directories of the $Path (Applications directories recommended):

$Path//Column

1b. Load one of the xAct packages

Two different notations to load a package (use only one of them!)

<<xAct/xTensor.m

<<xAct`xTensor`

Check that all packages have been read in the correct order:

$ContextPath

1c. Documentation

Help browser and Doc files.

Usage messages:

?xAct`xTensor`*

?xAct`xPerm`*

2a. The mathematical structure

Hierarchy of objects:

Manifold

				  Vector Bundle (VBundle)

					 	Tensor

			        	Connection (CovD)

					  	Metric

Only local properties stored.

2b. Abstract indices

Notes taken from Ashtekar et al, GRG 14 (1982) 414:

Two traditional approaches to tensor calculus:
	- 1) Transformation properties of components. Emphasis: computations.
	- 2) Cross-sections of bundles. Connection 1-forms. Emphasis: geometry.
Third viewpoint: abstract indices (Penrose 1969):
	- 3) "These are to be thought of as labels indicating the valence of tensor fields and do not take on numerical values. Thus, one can regard a tensor field with abstract indices as an intrinsic object in its own right."    "... at least as simple as 1) and at least as elegant as 2)."
	
"One might therefore feel that nothing new has been achieved... The fact that abstract indices appear to have the algebraic properties of components is not a drawback; this is precisely what is aimed at."

2c. General idea of type in xTensor

Types in xTensor are defined through inquiring functions. For a given Type there are four associated objects:

DefType[object, properties]

UndefType[object]

TypeQ[object]^=True;

$Types

Current types:
Manifold, VectorBundle, AbstractIndex, Tensor, CovD, Metric,
Parameter, ConstantSymbol, InertHead, ScalarFunction, Basis, Chart.

3a. Type Manifold

Define a 4d manifold:

(* comment *)

DefManifold[M4,4,{a,b,c,d,e,f,g,h}]

?M4

$Manifolds

3b. Type VBundle

?TangentM4

3c. Type AbstractIndex

?a

There are DefAbstractIndex / UndefAbstractIndex, but they are not to be used  by the user.

$AbstractIndices

4a. Type Tensor

Define a contravariant vector field:

DefTensor[v[a],M4]

?v

4b. Symmetries of tensors

There is a general notation for any monoterm symmetry of a tensor. Special cases:

Symmetric[{1,2,3}]

Antisymmetric[{1,2,3}]

RiemannSymmetric[{1,2,3,4}]

DefTensor[F[-a,-b],M4,Antisymmetric[{-a,-b}]]

?F

4c. Exercise: antisymmetric tensors

1. Define an antisymmetric tensor
2. Construct "strings" of tensors (a metric is needed!)
3. Contract first and last indices
4. Show that the result is 0 for an odd number of tensors
5. (Harder) Construct a function which does this for arbitrary n.

DefMetric[-1,metric[-a,-b],CD]

Hide away dollar - indices :

$PrePrint=ScreenDollarIndices;

Expressions :

F[a,b]F[-b,-a]//ToCanonical

F[a,b]F[-b,-c]F[c,-a]//ToCanonical

indices=GetIndicesOfVBundle[TangentM4,11]

IndicesOfVBundle[TangentM4]

{indices,-indices}

Transpose[%]

Flatten[%]

RotateLeft[%]

Partition[%,2]

Apply[F,%,{1}]

Apply[Times,%]

ToCanonical[%]//Timing

Riemanns :

RiemannCD[-a,-b,-c,-d]

indices=GetIndicesOfVBundle[TangentM4,20]

{indices,-indices}

indices2=Flatten[%]

indices2[[RandomSample[Range[40]]]]

Partition[%,4]

Apply[RiemannCD,%,{1}]

Apply[Times,%]

ToCanonical[%]//Timing

5a. General connections

A covd ▽ is an operator obeying (Wald, chapter 2):
	1) ▽[ x + y ]  =  ▽[ x ] + ▽[ y ]
	2) ▽[ x y ] = ▽[ x ] y + x ▽[ y ]
	3) ▽[ f ] = df	for any scalar field f
	4) Commutativity with index contraction

An arbitrary connection :

DefCovD[covd[-a],Torsion->True,SymbolOfCovD->{"|","𝔇"}]

Commutation now gives torsion tensors as well as Riemann tensors :

$TorsionSign

covd[-a][ covd[-b][ RicciCD[-c,-d] ] ]

%//SortCovDs

$CovDFormat="Postfix";

%%

$CovDFormat="Prefix";

%%

5b. The "fiducial" derivative

There is a predefined derivative called PD, with zero torsion and curvature ("ordinary" in Wald's terminology) :

$Tensors

PD[-a][ F[b,-c] ]

PD[-a][ PD[-b][ F[c,-d] ] ]

SortCovDs[%]

A theorem says that an ordinary derivative is always the partial derivative associated to a coordinate system, and viceversa. That motivates its name PD.

Christoffel tensors in xTensor are always the "difference" between a given arbitrary connection and PD.

ChristoffelCD[a,-b,-c]

ChangeCovD[CD[-a][v[b]],CD,covd]

5c. Exercise: General Bianchi identities

First Bianchi identity :

Riemanncovd[-a,-b,-c,d]+covd[-a][ Torsioncovd[d,-b,-c] ]-Torsioncovd[e,-a,-b]Torsioncovd[d,-c,-e]

6Antisymmetrize[%,{-a,-b,-c}]

That is zero for any covariant derivative. Let us show it.

%//CovDToChristoffel

%//RiemannToChristoffel

%//TorsionToChristoffel

%//ToCanonical

Second Bianchi identity :

covd[-a][ Riemanncovd[-b,-c,-d,e] ]-Torsioncovd[f,-a,-b]Riemanncovd[-c,-f,-d,e]

6Antisymmetrize[%,{-a,-b,-c}]

%//CovDToChristoffel

%//RiemannToChristoffel

%//TorsionToChristoffel

%//ToCanonical

5d. General Christoffels

Following Wald, a Christoffel is a **tensor** relating any two covariant derivatives :

DefTensor[X[a,-b],M4]

expr= covd[-a][ X[b,-c] ]

ChangeCovD[expr,covd,CD]

ChangeCovD[%,CD,covd]

ChangeCovD[%%,CD,PD]

%//BreakChristoffel

%//ToCanonical

ChangeCovD[expr,covd,PD]

%%-%//ToCanonical

CovDToChristoffel uses ChangeCovD to transform every connection into PD.

RiemannCD[-a,-b,-c,d]

ChangeCurvature[%,CD,covd]

ChangeCurvature[%,covd,CD]

ChangeCovD[%,covd,CD]

ChangeTorsion[%,covd,CD]

%//ToCanonical

RiemannToChristoffel generalizes to ChangeCurvature and TorsionToChristoffel generalizes to ChangeTorsion.