Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Mathematica
By George E. Hrabovsky
GRCalcs.nb
What is xAct?
00
00
What Do We Do Next?
00
00
Contraction
00
00
Covariant Derivatives
00
00
00
00
Perturbative GR
GRCalcs.nb
What is xAct?
This is a very complete system for doing tensor analysis in the Mathematica system.
All you need do is open the system:
<< xAct`xTensor`
-----------------------------------------------------------Package xAct`xPerm`
CopyRight (C) 2003-2014, Jose M. Martin-Garcia, under the General Public License.
Connecting to external MinGW executable...
Connection established.
-----------------------------------------------------------Package xAct`xTensor`
CopyRight (C) 2002-2014, Jose M. Martin-Garcia, under the General Public License.
-----------------------------------------------------------These packages come with ABSOLUTELY NO WARRANTY; for details type
Disclaimer[]. This is free software, and you are welcome to redistribute
it under certain conditions. See the General Public License for details.
------------------------------------------------------------
GRCalcs.nb
What Do We Do Next?
Now that we have started things up, there are some things we need to do.
1. We need to define the underlying manifold we are working in. We do this with the
DefManifold command: DefManifold[M, dim, {a, b, c,...}] defines M to be an ndimensional
differentiable manifold with dimension dim (a positive integer or a constant symbol) and
tensor abstract indices a, b, c, ... . DefManifold[M, {M1, ..., Mm}, {a, b, c,...}] defines M to be the
product manifold of previously defined manifolds M1 ... Mm. For backward compatibility dim
can be a list of positive integers, whose length is interpreted as the dimension of the defined
manifold. Here we define a fourdimensional manifold having the indices
a, b, c, d, e, f , g, h, i, j, k, l:
DefManifold[M, 4, {a, b, c, d, e, f, g, h, i, j, k, l}]
** DefManifold: Defining manifold M.
** DefVBundle: Defining vbundle TangentM.
In defining the manifold, we have also defined the vector bundle called TangentM,
: TM M. This is where our tensors will be.
GRCalcs.nb
2. We need to define the metric using the DefMetric command: DefMetric[signdet, metric[a,b],
covd, covdsymbol] defines metric[a, b] with signdet 1 or 1 and associates the covariant
derivative covd[a] to it. Note that we have the convention [a] has a as the subscript, and [a]
has it as the superscript.
DefMetric[- 1, metric[- i, - j], cd, {";", ""}, PrintAs "g"]
** DefTensor: Defining symmetric metric tensor metric[-i, -j].
** DefTensor: Defining antisymmetric tensor epsilonmetric[-a, -b, -c, -d].
** DefTensor: Defining tetrametric Tetrametric[-a, -b, -c, -d].
** DefTensor: Defining tetrametric Tetrametric[-a, -b, -c, -d].
** DefCovD: Defining covariant derivative cd[-i].
** DefTensor: Defining vanishing torsion tensor Torsioncd[a, -b, -c].
** DefTensor: Defining symmetric Christoffel tensor Christoffelcd[a, -b, -c].
** DefTensor: Defining Riemann tensor Riemanncd[-a, -b, -c, -d].
** DefTensor: Defining symmetric Ricci tensor Riccicd[-a, -b].
** DefCovD:
** DefCovD:
** DefCovD:
GRCalcs.nb
3. We can define tensors using the DefTensor command: DefTensor[T[a, b, c, ...], {M1, ...}]
defines T to be a tensor field on manifolds and parameters M1,... and the base manifolds
associated to the vector bundles of its indices. DefTensor[T[a, b, c, ...], {M1, ...}, symmetry]
defines a tensor with symmetry given by a generating set or strong generating set of the
associated permutation group. In fact we can define any order of tensor just by specifying the
indices. A scalar has no indices so we can define the scalar
DefTensor[s[], M]
** DefTensor: Defining tensor s[].
s
s
a tangent vector
DefTensor[tv[i], M]
** DefTensor: Defining tensor tv[i].
tv[i]
tv i
GRCalcs.nb
a covector
DefTensor[cv[- i], M]
** DefTensor: Defining tensor cv[-i].
cv[- i]
cv i
and so on.
GRCalcs.nb
We can define tensors by their symmetries or antisymmetries, too. Here we define the tensor
Tij that is antisymmetric:
DefTensor[T[- i, - j], M, Antisymmetric[{- i, - j}]];
** DefTensor: Defining tensor T[-i, -j].
T[- i, - j]
Tij
T[- j, - i]
Tji
To make this work, since Mathematica does not enforce our symmetry rules, we need to make
it do so by using the ToCanonical command. Lets try it again
T[- j, - i] // ToCanonical
- Tij
GRCalcs.nb
Contraction
We can do some operations. Lets say we have the Riemann tensor Rijkl and we want to
contract it using the metric gik. we use the ContractMetric command,
metric[i, k] Riemanncd[- i, - j, - k, - l] // ContractMetric
R[] j l
10
GRCalcs.nb
Covariant Derivatives
The covariant derivative of our tensor, i Tjl, is input
cd[- i][T[- j, - l]]
i T j l
If we have multiple covariant derivatives, we would enter them as follows, where @ is the
Map command:
cd[- a] @ cd[- b] @ cd[- c] @ T[- d, - e] // ToCanonical
abc T d e
GRCalcs.nb
11
This is correct, but too difficult to interpret, we add the command ScreenDollarIndices to
put it into a lnaguage we can read instead of just the computer reading it
cd[- a] @ cd[- b] @ cd[- c] @ T[- d, - e] // ToCanonical // SortCovDs // ScreenDollarIndices
- R[] c b e f a T d f - R[] c b d f a T f e - T f e b R[] c a d f f
f
f
f
T d f b R[] c a e - R[] c a e b T d f - R[] c a d b T f e - R[] b a e c T d f -
Instead of having to write all of this all of the time we make a sessionwide command
$PrePrint = ScreenDollarIndices;
cd[- a] @ cd[- b] @ cd[- c] @ T[- d, - e] // ToCanonical // SortCovDs
- R[] c b e f a T d f - R[] c b d f a T f e - T f e b R[] c a d f f
f
f
f
T d f b R[] c a e - R[] c a e b T d f - R[] c a d b T f e - R[] b a e c T d f -
12
GRCalcs.nb
We sum these,
bianchi2 = 3 term1 // ToCanonical
c R[] d e b a - d R[] c e b a + e R[] c d b a
GRCalcs.nb
13
14
GRCalcs.nb
g
cf
- [] a c g []
g
df
- c [] a d f + d [] a c f -
db
- c [] f d b + d [] f c b +
[] f c b d [] a e f - [] a e f d [] f c b +
[] a e f [] f d g []
g
cb
- [] f c g []
[] a c f d [] f e b + dc [] a e b - de [] a c b - [] f d b e [] a c f +
[] f d b [] a e g []
g
cf
- [] a c g []
g
ef
- c [] a e f + e [] a c f +
[] f c b e [] a d f - [] f c b
[] a e g []
g
df
- [] a d g []
[] a d f [] f e g []
g
ef
- d [] a e f + e [] a d f + [] a d f e [] f c b -
- [] f c g []
cb
- [] f d g []
db
eb
- c [] f e b + e [] f c b -
eb
- d [] f e b + e [] f d b - ec [] a d b +
[] a c f e [] f d b +
[] a c f [] f e g []
ed [] a c b + [] f d e [] a f g []
[] f e d [] a f g []
a
c b - [] c g
g
[] f e c - [] a f g [] d b + [] a d g
g
[] f c e [] a f g [] d b - [] a d g
g
[] f c d - [] a f g [] e b + [] a e g
g
[] f d c - [] a f g [] e b + [] a e g
cb
- [] a c g []
g
fb
- c [] a f b + f [] a c b -
a
a
f b - c [] f b + f [] c b g
[] f b + d [] a f b - f [] a d b g
[] f b - d [] a f b + f [] a d b g
[] f b + e [] a f b - f [] a e b +
[]
[]
g
fb
+ e [] a f b - f [] a e b
GRCalcs.nb
15
16
GRCalcs.nb
Perturbative GR
We begin this by opening the perturbative package:
<< xAct`xPert
Get::noopen : Cannot open xAct`xPert.
$Failed
GRCalcs.nb
17
We must first establish our metric perturbation, this is because the metric is a vacuum
metric; thus all small perturbations are gravitational waves. We define the metric perturba
tion using the DefMetricPerturbation[the existing metric, name of the perturbation, pertur
bation parameter]
DefMetricPerturbation[metric, pert, ]
** DefParameter: Defining parameter .
** DefTensor: Defining tensor pert[LI[order], -a, -b].
We can tell Mathematica to write the perturbation using the traditional notation h,
PrintAs[pert] ^= "h";
ab
ab
18
GRCalcs.nb
What? What is ? It turns out that Mathematica does not know how to perform a perturba
tion on the inverse metric. We need to use the ExpandPerturbation command,
Perturbation[metric[a, b], 1] // ExpandPerturbation
- h1ab
1
2
2 h 2 a b +
1
6
3 h 3 a b
GRCalcs.nb
19
1
2
2 2 h 1 a c h 1 c b - h 2 a b +
3 - 6 h 1 a c h 1 c d h 1 d b + 3 h 1 f b h 2 a f + 3 h 1 a e h 2 e b - h 3 a b
Jolyon Bloomfield [5] produced a method of extracting only the firstorder terms of the
expansion, since is assumed to be small, where we can write the metric as the sum of a
linearized metric and a perturbed metric, gab = g0ab + hab we adapt it for our use
firstorderonly = pert[LI[n_], __] 0 /; n > 1;
Perturbed[metric[- a, - b], 3] /. firstorderonly
gab + h1ab
Given an action we can derive an equation of motion. First we need to establish our scalar
field,
DefTensor[sf[], M, PrintAs ""]
** DefTensor: Defining tensor sf[].
20
GRCalcs.nb
-g
mp2 R[]
2
- V[] -
1
2
b b
GRCalcs.nb
mp2 R[]
]
[g
-g
2
1
2
- V[] -
mp2 [R[]] +
1
2
1
2
b b
-g
- b b - 1 ;b b - 1 V[]
We expand this
varL = L // Perturbation // ExpandPerturbation
-
1 a
g h a
gac
1
2
mp2 R[]
2
1
2
- V[] -
1
2
b b
- h 1 d d ;c ;a - h 1 d c ;d ;a + h
2
1
-g
;d
cd
;a
1
2
-g
1
2
mp2 - h 1 a c R[] a c +
h 1 d c ;a ;d + h 1 d a ;c ;d - h
- 1 ;b b - b g b e 1 ;e - h 1 b e e - 1 V[]
;d
ca
;d
21
22
GRCalcs.nb
-g
h 1 a b R[] a b + mp2
2
4
1
1
1
b
;a
mp 2 - g
h b ;a - mp2 - g
4
4
1
1
-g
h 1 b a a b + mp2 - g
2
2
1
1
1
- g b 1 ;b -g
;b
2
2
? RicciTo*
mp 2
-g
-g
h 1 a a R[] h 1 a a V[] 2
1
1 a ;b
1ba
mp 2 - g
h
h b ;a +
;b ;a +
4
1
1 a ;b
1ba
mp 2 - g
h
h a ;b ;a ;b 4
1
b - g h 1 a a b b - - g
1 V[]
4
xAct`xTensor`
RicciToEinstein
RicciToTFRicci
RicciToEinstein[expr, covd] expands expr expressing all Ricci tensors of covd in terms of the Einstein and RicciScalar tensors
of covd. If the second argument is a list of covariant derivatives the command is applied sequentially on expr. RicciToEinstein[expr] expands all Ricci tensors.
1b
-g
h 1 b a R[] b a + mp2 - g h b R[] 2
4
1
1
1
1 b ;a
1ba
1b
-g
h b V[] - mp2 - g h b ;a + mp2 - g h
;b ;a 2
2
2
1
1 ;b + 1 - g
1
-g
-g
h b a a b h 1 a a b b - - g 1 V[]
b
2
4
mp 2
GRCalcs.nb
The scalar equation of motion is then found by taking the variational derivatives of the
scalar field and set them equal to 0
0 == VarD[pertsf[LI[1]], cd][varL] / Sqrt[- Detmetric[]]
0
-g
a 1
-g
1
a
V[]
-g
a -g
a
V[]
-g
-g
We canonicalize it
0 == VarD[pertsf[LI[1]], cd][varL] / Sqrt[- Detmetric[]] /.
delta[- LI[1], LI[1]] 1 // ToCanonical
0 aa - V[]
23
24
GRCalcs.nb
-g
1
2
1
2
mp 2 1 1
R[]
-g
mp 2 1 1
ab 4
g
1
-g
1
a b V[] +
4
g
-g
a b R[] +
g
1
c
-g
1
a b c 2
g
c
d
-g
ac gbd
-g
2
1
2
1
2
mp 2
R[]
-g
mp 2
ab 4
g
-g
a b V[] +
4
g
-g
a b R[] +
g
c
-g
a b c 2
g
c
d
-g
ac gbd
GRCalcs.nb
25
We now expand by expressing all Ricci tensors of covariant derivatives in terms of Einstein
tensors and Ricci scalars
vartf =
2 (- VarD[pert[LI[1], a, b], cd][varL] / Sqrt[- Detmetric[]] /. delta[- LI[1], LI[1]] 1 //
SeparateMetric[metric] // RicciToEinstein)
1
-g
2 1
2
1
4
mp 2
g
-g
mp 2
a b R[] +
2
g
-g
a b V[] 2
-g
+ 1
-g
a
b
4
G[] a b +
1
2
g b a R[] +
g
g c d c d
-g
ab
We expand this
vartf =
2 (- VarD[pert[LI[1], a, b], cd][varL] / Sqrt[- Detmetric[]] /. delta[- LI[1], LI[1]] 1 //
SeparateMetric[metric] // RicciToEinstein) // Expand
mp2 G[] a b -
1
2
mp2 g a b R[] +
1
2
1
2
g a b g c d c d
26
GRCalcs.nb
1
2
g a b c c
1
2
g a b c c
GRCalcs.nb
then
0 eterm
0 b (- aa + V[])
27
28
GRCalcs.nb
Bibliography
[1] M. Nakahara, (2003), Geometry, Topology, and Physics, 2nd Edition, Taylor and Francis
Group.
[2] Theodore Frankel, (2012), The Geometry of Physics, 3rd Edition, Cambridge University
Press
[3] Jose M. MartinGarcia, (2009), xAct Intro
[4] B. F. Schutz, (1984), The Use of Perturbation and Approximation Methods in General
Relativity. In: Relativistic Astrophysics and Cosmology: Proceedings of the GIFT Interna
tional Seminar on Theoretical Physics, (Eds.) Fustero, Xavier; Verdaguer, Enric; Singapore:
World Scientific 3598 (1984)
[5] Jolyon Bloomfield, (2013), xAct Tutorial
xAct can be found at the website: http://www.xact.es/index.html
GRCalcs.nb
29