0% found this document useful (0 votes)
20 views324 pages

TensoriaCalc: Mathematica Package for Tensor Calculus

The document presents a master's thesis by Wei-Hao Chen titled 'TensoriaCalc, an user-oriented Mathematica package to tackle semi-Riemannian tensor calculus problems.' It describes the development and functionalities of TensoriaCalc, which allows users to perform various tensor calculus operations efficiently. The thesis includes an explanation of the package's structure, new features, and applications in solving classic problems in General Relativity and Differential Geometry.

Uploaded by

foue tang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views324 pages

TensoriaCalc: Mathematica Package for Tensor Calculus

The document presents a master's thesis by Wei-Hao Chen titled 'TensoriaCalc, an user-oriented Mathematica package to tackle semi-Riemannian tensor calculus problems.' It describes the development and functionalities of TensoriaCalc, which allows users to perform various tensor calculus operations efficiently. The thesis includes an explanation of the package's structure, new features, and applications in solving classic problems in General Relativity and Differential Geometry.

Uploaded by

foue tang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 324

國 立 中 央 大 學

物 理 學 系
碩 士 論 文

TensoriaCalc, an user-oriented Mathematica


package to tackle semi-Riemannian
tensor calculus problems

研 究 生 : 陳 威 澔
指 導 教 授 : 瞿 怡 仁 教 授

中 華 民 國 一 百 一 十 二 年 六 月
n
National Central University

Advisor’s Recommendation for Postgraduate Students

This thesis titled “TensoriaCalc, an user-oriented Mathematica


package to tackle semi-Riemannian tensor calculus problems” is
written by Wei-Hao Chen (陳威澔) from the graduate program in
Phsics under my supervision. I hereby recommend it for
examination.

Advisor __Yi-Zen Chu__________

_____July 5, 2023_________(Month, Date, Year)

1090326
TensoriaCalc, an user-oriented Mathematica package to
tackle semi-Riemannian tensor calculus problems
by

Wei-Hao Chen
Submitted to the Department of Physics
in partial fulfillment of the requirements for the degree of

Master of Physics
at the

NATIONAL CENTRAL UNIVERSITY


June 2023

© National Central University 2023. All rights reserved.

Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Wei-Hao Chen
Department of Physics
August 15, 2023

Certified by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Yi-Zen Chu
Professor
Thesis Advisor

Accepted by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Yi-Zen Chu, Chiang-Mei Chen and Kuo-Chuan Pan


Professor
Chairman, Thesis Committee
TensoriaCalc – 處理偽黎曼張量分析問題的

使用者導向 Mathematica 套件

摘要

TensoriaCalc 是一個使用者導向的 Mathematica 套件,首先是由我的導師

瞿怡仁所建構的,並且由我顯著地擴展套件。經由使用者提供度量張量以及坐

標系,可以快速算出重要的幾何張量如克里斯多福符號、愛因斯坦張量等,微

分幾何及張量分析中的常見運算如: 張量收縮、座標轉換、投影、偏導數、協

變導數、外微分、李導數亦是可使用的功能。在本文中,我將解釋

TensoriaCalc 的基本運作及使用方式,並展示新添加的功能與建構的思路。最

後,我將呈現如何使用 TensoriaCalc 來計算數個廣義相對論及微分幾何中經典

的問題。

ii
TensoriaCalc, an user-oriented Mathematica package to
tackle semi-Riemannian tensor calculus problems
by

Wei-Hao Chen
Submitted to the Department of Physics
on August 15, 2023, in partial fulfillment of the
requirements for the degree of
Master of Physics

Abstract
TensoriaCalc is an user-oriented Mathematica package developed to tackle tensor cal-
culus problems. By giving a metric tensor and the coordinate set, the users can rapidly
obtain tensor components of geometric objects such as Christoffel symbols, Einstein
tensors, etc. Operations in tensor calculus and differential geometry, such as contrac-
tion, coordinate transformation, projection, partial derivative, covariant derivative, ex-
terior derivative, Lie derivative, etc., are also available. In this paper, I will explain the
basic structure of this package, firstly constructed by Yi-Zen Chu and significantly ex-
panded by me. Also, the track of thought of my newly added functionality or structure
will be presented. Eventually, I will show how to use TensoriaCalc to calculate several
classic problems in General Relativity and Differential Geometry.

Thesis Advisor: Yi-Zen Chu


Title: Professor

iii
Acknowledgements
I especially thank to my advisor, Yi-Zen Chu, who has guided me in the field of the-
oretical physics for five years. He is an advisor who genuinely cares about his stu-
dents. His open and approachable nature has made it easy for me to discuss not only
physics-related questions but also has provided me robust suggestions for challenges
I have faced in both my personal life and career. Additionally, he has offered valuable
guidance on expanding TensoriaCalc.
I would like to extend my appreciation to Vaidehi Verma for her valuable sugges-
tions in improving the code.
Furthermore, I would like to express my gratitude to my father, Zheng-Cheng
Chen, for his hard work and dedication to family.
Last but not least, I thank my friends, Yu-Hao Yao, Wei-Ming Chen, and Kai-Chieh
Ma, who provide me with mental support throughout my master career.

v
Writing Tool

I used LaTeX to write this paper, modifying the NCU Thesis LaTeX Template. Addi-
tionally, I utilized ChatGPT to assist in polishing the text. However, this does not imply
that I overly relied on it. All the knowledge, paper writing, and underlying work are
my own, with guidance from my advisor.

vi
Contents

1 Introduction 1
1.1 Development History and Advantage . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Development History . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.2 Advantage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Basic Structure and Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.1 Tensor Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.2 Geometrical Objects . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Metric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Christoffel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Riemann . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Ricci, and the first glimpse of TensorComponents . . . . . . . . . 12
RicciScalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Einstein, and the first glimpse of TensorIsZero . . . . . . . . . . 13
Story: Vacuum Solutions of Einstein field equations . . . . . . . . 14
Weyl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.3.3 NonMetricTensor . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.3.4 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
PartialD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
CovariantD and the first glimpse of CovariantHodgeDual . . . . 22

vii
1.3.5 Tensor Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Einstein summation . . . . . . . . . . . . . . . . . . . . . . . . . . 26
TensorsProduct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Evaluating abstract indices at specific coordinates/values . . . . 32
MoveIndices, RaiseAllIndices and LowerAllIndices . . . . . . . 33
SwapIndices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Function Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
UniqueIndices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.3.6 Geodesic related object . . . . . . . . . . . . . . . . . . . . . . . . . 41
GeodesicSystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
GeodesicLagrangians . . . . . . . . . . . . . . . . . . . . . . . . . 43
GeodesicHamiltonianDynamics . . . . . . . . . . . . . . . . . . . 44

2 Advanced Functionality 47
2.0.1 Declare Inverse Metric with Quadratic form . . . . . . . . . . . . 47
Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.0.2 OrthonormalFrameField and transformation into orthonormal
basis through MoveIndices . . . . . . . . . . . . . . . . . . . . . . 48
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
orthonormal basis . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.0.3 Second strategy of calculating OrthonormalFrameField and
EigenSystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.0.4 Series expansion on OrthonormalFrameField . . . . . . . . . . . 66
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

viii
2.0.5 TooltipStyle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
2.0.6 TooltipDisplay→TensorComponents . . . . . . . . . . . . . . . . 68
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
2.0.7 Extract Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
The first benefit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
The second benefit . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
The third benefit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
2.0.8 Endow Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
2.0.9 PartialD now become more flexible . . . . . . . . . . . . . . . . . 80
Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
2.0.10 Partial Derivative with specific coordinate or variable (PD) . . . . 82
2.0.11 ∇g = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
2.0.12 CovariantBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
2.0.13 Auxiliary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Declare NonMetricTensor in ExpressionForm with Wedge . . . 85
Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
WedgeProductExpand . . . . . . . . . . . . . . . . . . . . . . . . . 87
ToTensorComponents . . . . . . . . . . . . . . . . . . . . . . . . . 87
Declare NonMetricTensor in ExpressionForm with ⊗ or sym-
metric objects . . . . . . . . . . . . . . . . . . . . . . . . . 88
ToExpressionForm . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

ix
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
2.0.14 CoordinateTransformation . . . . . . . . . . . . . . . . . . . . . . 90
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
CoordinateTransformation into a new coordinateset, but share
with same symbol and meaning . . . . . . . . . . . . . . 93
CoordinateTransformation into a new coordinate, but share with
symbols and meanings, to deal with ExpressionForm . 103
CoordinateTransformation into a new coordinate set, with dif-
ferent symbols and meanings . . . . . . . . . . . . . . . 104
CoordinateTransformation into a new coordinate, with different
symbols and meanings, to deal with ExpressionForm . 107
CoordinateTransformation for Christoffel . . . . . . . . . . . . . 108
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
code and usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Projection into (hyper)surface: Induced Tensor other than Christof-
fel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Indices in orthonormal basis won’t be transformed . . . . . . . . 115
Development History . . . . . . . . . . . . . . . . . . . . . . . . . 116
2.0.15 TensorEquations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
2.0.16 LieDerivative and LieBracket . . . . . . . . . . . . . . . . . . . . 118
Killing tensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Development History . . . . . . . . . . . . . . . . . . . . . . . . . 123

x
2.0.17 TensorSymmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
2.0.18 SymmetrizeIndices and AntiSymmetrizeIndices . . . . . . . . . 126
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
2.0.19 ExteriorD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
2.0.20 PotentialForm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
2.0.21 LeviCivita . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Development History . . . . . . . . . . . . . . . . . . . . . . . . . 139
2.0.22 CovariantHodgeDual . . . . . . . . . . . . . . . . . . . . . . . . . 140
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Development History . . . . . . . . . . . . . . . . . . . . . . . . . 143
Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
2.0.23 TensorWedge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
2.0.24 SymmetrizedArray . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
2.0.25 Declare NonMetricTensor with SymmetrizedArray or
SparseArray TensorComponents . . . . . . . . . . . . . . . . . . 145
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
2.0.26 Normal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
2.0.27 InteriorProduct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

xi
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
2.0.28 MetricOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
2.0.29 TensorAssumption . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
2.0.30 TensorOperator and TensorIsZeroOperator . . . . . . . . . . . . 155
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
2.0.31 TensorDivision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
2.0.32 SphericalHarmonicYTensor . . . . . . . . . . . . . . . . . . . . . 159
2.0.33 VectorSphericalHarmonic . . . . . . . . . . . . . . . . . . . . . . 160
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
2.0.34 OperatorDistributeOverPlus and OperatorProductRule . . . . . 163
Development History . . . . . . . . . . . . . . . . . . . . . . . . . 165
2.0.35 TensorsProduct, TensorComponents and Operators’ Rules . . . 169
2.0.36 Declare scalar as Tensor after operation . . . . . . . . . . . . . . . 180
2.0.37 Conjugate for Tensor . . . . . . . . . . . . . . . . . . . . . . . . . 182
2.0.38 TensorComponentsManipulation . . . . . . . . . . . . . . . . . . . 183
2.0.39 error Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
2.0.40 ElectromagneticStressEnergyTensor . . . . . . . . . . . . . . . . 186
Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

3 Stories in Physics 189


3.1 Story: Symmetry in S2 -SO(3) symmetry . . . . . . . . . . . . . . . . . . . 189
3.2 Story: Vector calculus in spherical coordinates in orthonormal basis . . . 198

xii
3.3 Story: Maxwell’s equations: From 3D vector calculus to 4D tensor cal-
culus in the differential form language . . . . . . . . . . . . . . . . . . . . 202
3.4 Story: Kerr-Newman black hole . . . . . . . . . . . . . . . . . . . . . . . . 208
3.4.1 Kerr–Newman metric is an solution of Einstein-Maxwell equations208
3.4.2 Constants of Motion of a free-falling particle around
Kerr–Newman black hole . . . . . . . . . . . . . . . . . . . . . . . 213
3.5 Story: Linearized gravity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
3.5.1 Newtonian gravity . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
3.5.2 Gravitoelectromagnetism . . . . . . . . . . . . . . . . . . . . . . . 232
3.6 Story: de Sitter spacetime . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
3.6.1 FLRW metric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
3.6.2 de Sitter metric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Einstein field equations . . . . . . . . . . . . . . . . . . . . . . . . 244
de Sitter spacetime is conformally flat . . . . . . . . . . . . . . . . 245
de Sitter spacetime is maximally symmetric . . . . . . . . . . . . . 248
3.7 Story: Scalar and Vector Basis and more on S2 . . . . . . . . . . . . . . . . 251
3.7.1 scalar basis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
3.7.2 vector basis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
3.7.3 coordinate systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
3.7.4 Ladder operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
3.7.5 EigenSystem of Spherical Harmonic . . . . . . . . . . . . . . . . . 257
3.7.6 EigenSystem of Vector Spherical Harmonic . . . . . . . . . . . . . 258
3.7.7 Plot of Vector Spherical Harmonic . . . . . . . . . . . . . . . . . . 260
3.8 Story: Conformal Invariance
Maxwell’s Equations in 4D . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
3.9 Story: More example on CoordinateTransformation . . . . . . . . . . . . 269
3.9.1 Monopole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
3.9.2 Coordinate Systems of Kerr black hole . . . . . . . . . . . . . . . . 272
3.9.3 r + SD−1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

xiii
3.10 Story: 3D Weyl Tensor is Zero . . . . . . . . . . . . . . . . . . . . . . . . . 277

4 Exercises in Schutz 281


4.0.1 Exercise 2.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
4.0.2 Frobenius’ theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
4.0.3 Exercise 3.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
4.0.4 Local exactness of closed form . . . . . . . . . . . . . . . . . . . . 284
4.0.5 ExteriorD and LieDerivative commute . . . . . . . . . . . . . . . 286
4.0.6 Exercise 4.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
4.0.7 Exercise 4.22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
4.0.8 Exercise 4.34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
4.0.9 Exercise 5.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290

5 Appendix 293
5.0.1 Appendix A: FullForm of a 2-Sphere Metric . . . . . . . . . . . . 293
5.0.2 Appendix B: FullForm of a Faraday Tensor declared by Non-
MetricTensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
5.0.3 Appendix C: Solve Hamilton-Jacobi equation of particles around
the Kerr–Newman black hole . . . . . . . . . . . . . . . . . . . . . 294
5.0.4 Appendix D: orthogonality of SphericalHarmonicY . . . . . . . . 296
5.0.5 List of available Functions in TensoriaCalc . . . . . . . . . . . . . . 296
5.0.6 List of Tensor properties . . . . . . . . . . . . . . . . . . . . . . . . 297
5.0.7 List of TensorTypes . . . . . . . . . . . . . . . . . . . . . . . . . . 298
5.0.8 List of OptionValues of Functions and their default values . . . . 298

Bibliography 301

xiv
Notations

Notation and definitions used in this work follow the Math book by Yi-Zen Chu [1]. I
have cited several equations and examples from this textbook as references throughout
this thesis.

In this paper, Latin letters (i, j, k, ...) represent spatial coordinates (1 ∼ D), while
Greek letters (α, β, γ, ...) represent spacetime coordinates (0 ∼ D). Capital Latin letter
(A, B, C, ...) represent indices in (hyper)surface. Normally d is the number of spacetime
dimension, and D = d − 1. We follow natural units, where speed of light c is set to 1.
examples are given with a specific metric tensor in the mostly minus convention. σg
represents metric signature. σg = 1 for mostly plus, σg = −1 for mostly minus. The
D+1 dimension spacetime represent D-dimensional space plus 1-dimensional time. â
indicates a is a index in orthonormal basis.

g normally stands for metric. Γ for Christoffel Symbols, R for Riemann tensor, Ricci
tensor or Ricci scalar. G for Einstein tensor, C for Weyl tensor, | · | for determinant,
ε for orthonormal frame field, ϵ for Levi-Civita symbols or infinitesimal quantity in
perturbation theory, J for Jacobian, T for stress–energy tensor, and F for Faraday tensor.
∇ for covariant derivative. d for infinitesimal quantities or exterior derivative. £ for
Lie derivative. L for Lagrangian. L for Lagrangian density

GN is Newton constant.

≡ represents definition, =
˙ means "be presented as"

Curly bracket in indices indicates symmetrization. Here is an example: T{ij} = Tij +Tji .
Square bracket in indices indicates anti-symmetrization. Here is an example: T[ij] =
Tij − Tji . It is important to note that there is no factorial normalization involved for
both symmetrization and anti-symmetrization, which may differ from some textbooks.

Bold text indicates the corresponding word is a built-in function or object in Mathe-
matica or TensoriaCalc.

xv
In this thesis, some equations and definitions related to tensors and operations may be
presented with Latin alphabet. This is for convenience because we will use a purely
spatial example to demonstrate soon after introducing the equation. For example, in
eq.(1.2), since I use 2-Sphere (pure space) as the first example, before that, I also intro-
duce the metric compatibility with Latin alphabet.

∇k gij = 0 (1)

However, when readers want to obtain the metric compatibility in a spacetime,


they may simply replace all the Latin alphabet into Greek alphabet. The expressions
of the equations remain the same in both spatial and spacetime contexts. In the metric
compatibility example, for instant, one can perform this replacement.

∇α gµν = 0 (2)

xvi
Chapter 1

Introduction

TensoriaCalc [2] is an user-oriented package, based on the Mathematica language[3]. It


serves as a powerful tool for analytical tensor calculus in the field of differential geom-
etry. Physicists and applied mathematicians can make effective use of it, particularly
in areas such as General Relativity, Cosmology, and Field Theory. Furthermore, the
package is designed to be readily modified to suit the users’ specific needs, allowing
them to extend the code or define new tensor types to facilitate calculations in their
respective Modified Gravity Theory or gravitational models.
In this chapter, I will provide an overview of the background knowledge, including an
introduction to TensoriaCalc, instructions for its installation, and guidance on how to
utilize its basic functionalities.

1.1 Development History and Advantage

1.1.1 Development History

TensoriaCalc was initially developed by Yi-Zen Chu sometime during 2011-2012. Dur-
ing that time, it included functions for calculating geometrical tensors and
partial/covariant derivatives. In 2016, an additional code section was added by Yi-
Zen Chu to assist in finding solutions to (astrophysical) ideal Magnetohydrodynamics
model under curved spacetimes[4]. Concurrently, the version zero of TensoriaCalc was
released.

1
In 2019, Vaidehi Verma joined the team to help write the electronic manual for Ten-
soriaCalc. In 2020, I joined the team to initiate the expansion of its functionality.
We plan to release version 1 of TensoriaCalc hopefully towards the end of Fall 2023.

1.1.2 Advantage

When we built TensoriaCalc, we adhered a few basic principles. We aim to make it as


user-friendly as possible. To this end, firstly, we therefore strive to maintain a smooth
consistency with the Wolfram Language. This allows users with experience in Math-
ematica to get started with TensoriaCalc quickly and easily. The functions and their
names are streamlined, reducing the need for users to memorize additional Tensoria-
Calc terminology. Developers can easily grasp the overall structure of TensoriaCalc and
efficiently expand the code in a consistent manner.
Secondly, we ensure that the number of required arguments of functions are kept
to be minimum, while additional specifications are provided via optional arguments
Thirdly, like all programmers, we prioritize efficiency in calculations by improving
algorithms and eliminating redundant computations. Whenever possible, we utilize
Mathematica’s built-in functions.

1.2 Installation

Here, I will provide an example to demonstrate how to include and run the Tensori-
aCalc package. For more detailed information and requirements, please refer to the
official TensoriaCalc manual.
Firstly download TensoriaCalc.nb from the official TensoriaCalc website or any other
reliable internet resource. Open the file and save it again (Ctrl+S). By doing so, Math-
ematica will automatically generate TensoriaCalc.m in the same folder. If done cor-
rectly, you should now have the following two files in your folder.

2
F IGURE 1.1: TensoriaCalc.m should be generated

Then, use the Get(<<) command and specify the location of TensoriaCalc.m. Exe-
cute the command.

Type Tensor in your notebook. If the text color is black instead of blue, it means
you have successfully accessed the functions in TensoriaCalc.

Haven’t accessed to TensoriaCalc’s function:

Accessed to TensoriaCalc’s function:

This color distinction is also a method for verifying if you have correctly input any
built-in function of TensoriaCalc.

1.3 Basic Structure and Usage

In this section, I will introduce the most basic structure of TensoriaCalc, created by Yi-
Zen Chu. Readers will also know a few of the most basic functions that will be used
often and have an initial big picture to TensoriaCalc.

3
1.3.1 Tensor Objects

The central concept revolves around a built-in type of object in TensoriaCalc, called
Tensor1 .
You can think of a Tensor as a new type that is built into TensoriaCalc, similar to how
object-oriented programming languages introduce new types. In the terminology of
Mathematica, a Tensor is the the key Head in TensoriaCalc. All information in a tensor
will be stored as a Sequence of Rules2 inside the Tensor, as shown in the following
example.

F IGURE 1.2: A 2-Sphere metric Tensor by input it manually.

When you hover your mouse to the output gij , it shows its Tooltip, including the
display of TensorComponents and CoordinateSystem. The text
g2s =Metric[...TooltipStyle→"Large"] is the input part of code. gij and the tooltip box
are output. The SubMinus3 on i− indicates it is a lower Indices. A SuperMinus4 , for
example, i− will represent it is a upper Indices.
Another example: a vector Tensor:
1
In this paper, I will use Bold text to indicate the corresponding word is a built-in function or object
in Mathematica or TensoriaCalc.
2
In Mathematica, a Rule has the form (left-hand side→right-hand side)
3
In Mathematica, to type i− , after you type the letter i, and then press Crtl+_. An sub-script block
will appear on i, and you can fill it with the minus sign -. This is equivalent to SubMinus [i]
4
In Mathematica, to type i− , after you type the letter i, and then press Crtl+ˆ. An super-script block
will appear on i, and you can fill it with the minus sign -. This is equivalent to SuperMinus [i]

4
Properties

There are several essential properties in TensoriaCalc with specific built-in meanings.
Indices, TensorComponents, CoordinateSystem, and StartIndex 5 are the most critical
properties for a tensor. The absence of any of these properties may hinder proper
calculations. Additionally, there are optional properties in TensoriaCalc with built-in
meanings. Readers can refer to all OptionValues and their default value in Sec.(5.0.8).

Format

TensoriaCalc only displays the most important information in output’s appearance,


even although it may contain more information. Typically, the output will only show
TensorName and its sub/superscript Indices, just like our hand writing to a tensor!
There is an OptionValue called TooltipDisplay. While user didn’t specified it, by de-
fault, it will show MatrixForm6 of TensorComponents and CoordinateSystem when
the user hovers the mouse over them (as Fig.(1.2)). The default Tooltip will only be
displayed for rank-≤ 2 tensors (scalar, vector or matrix). The TensorComponents’ Ma-
trixForm of a rank-≥ 3 tensor is usually too large and complex to be easily read, so we
choose not to display it in order to streamline the layout. Users can provide their own
TooltipDisplay if desired. An example could be referred in code.(2.16).
An example for a scalar Tensor (rank-0). There is Tooltip when you hover your
mouse on f .
5
StartIndex indicates the number of the first coordinate. In this paper, and typically, the number
assigned to the first index of spacetime is 0, while the number assigned to the first index of space is 1.
6
MatrixForm is a built-in function in Mathematica that transforms a List of List into a more compre-
hensible form. In this paper, List of List refers to the TensorComponents of all rank-≥ 2 tensors.

5
An example for a vector Tensor (rank-1). There is Tooltip when you hover your
mouse on V i .

An example for a rank-2 Tensor. There is Tooltip when you hover your mouse on
V i.

However, whenever there is a rank-≥ 3 Tensor, when user hover the mouse on it,
there is no Tooltip. Here is a more complex rank-4 Tensor.

6
This section demonstrates how information of Tensor objects is stored. However,
it does not imply that users need to declare Tensors by inputting all the information
manually. We have built functions that allow users to quickly declare a Tensor and
calculate relevant properties by providing only the essential arguments. The starting
point for users is to use the Metric (See here: 1.3.2) and NonMetricTensor Functions
(See here: 1.3.3).

1.3.2 Geometrical Objects

Metric

In Einstein General Relativity, the metric tensor/orthonormal frame field contains all
the information about the geometry of spacetime. By having one of them, you can
calculate other important tensors with geometrical meanings. For example, Christoffel
Symbols, Riemann tensor, Ricci tensor, Ricci scalar, Einstein tensor, Wyel tensor, and so
on. In most modern modified gravity theories, based on differential geometry, there is
at least one metric involved.
The definition of all geometrical objects in TensoriaCalc is followed by classical Einstein
General Relativity. Metric has a geometric interpretation related to the length element,
which describes how distances are measured in the spacetime.

dl2 = gij dxi dxj (1.1)

Here, dl2 represents what we call ExpressionForm of Metric gij 7 . xi represents the
CoordinateSystem. The Metric also satisfies an important condition that determine
other geometrical objects or operators, known as metric compatibility.

∇k gij = 0 (1.2)

7
Although I use Latin letters in the introduction, it does not mean that TensoriaCalc can only handle
Riemann tensor problems. Users can still input metrics with temporal coordinates. As promised in the
title, TensoriaCalc can handle semi-Riemannian tensor calculus problems.

7
Now, let’s declare a 2-Sphere metric.

 
 1 0 
gij = 


 (1.3)
2
0 sin [θ]

In, TensoriaCalc you have 2 ways to declare an Metric Tensor. Here is the first way.

F IGURE 1.3: g2s: A 2-Sphere metric. it will be used as example frequently in this thesis.

The first 2 arguments are Indices. The third argument is TensorComponents. Ten-
sorComponents could be in the form of MatrixForm or List of Lists. The rest are as
shown in the left-hand side of the Rules.
In TensoriaCalc, the first few arguments of any Function are mandatory. The remaining
input, in the form of Sequence of Rules, represents OptionValues of that Function.
All the Rules in Functions and Tensors are Orderless, which means users can input
them in any desired order. However, this flexibility does not apply to the mandatory
arguments.
Here is the second way to declare a Metric.

(1.4)

That is, user can choose to input TensorComponents in ExpressionForm. That is,
the line element of 2-Sphere.

8
dl2 = dθ2 + sin2 [θ] dϕ2 (1.5)

Notice that the output of these 2 approaches is exactly the same (probably up to a
Simplify8 ).
A technique that user can employ is to apply FullForm to a Tensor when they want
to view all its information. However, it is generally not recommended to do so, as the
output layout may become cluttered.
Here, in Appendix 5.0.1, I provide the FullForm of a 2-Sphere Metric as an example
offering readers have a big picture about what Metric does.
From this example, you can observe that TensoriaCalc have already calculated most of
the important geometrical objects’s TensorComponents’ quantities and stored them
into a newly declared Tensor. To extract them, I’m going to introduce the remaining
geometrical objects’ Functions.

Christoffel

In gravitational theories, connection like Christoffel Symbols determine the the defi-
nition of covariant derivative and geodesic equations. The definition of TensoriaCalc’s
Christoffel is,

1
Γijk ≡ g il (∂j gkl + ∂k gjl − ∂l gjk ) (1.6)
2

Which satisfies eq.(1.2) (metric compatibility) and the following symmetric prop-
erty.

Γijk = Γikj (1.7)

The Christoffel Symbols here is the unique connection in General Relativity (Torsion-
less) given the metric, also known as the Levi-Civita connection in Einstein-Cartan
8
Simplify is a Mathematica built-in Function that searches for all ExpressionForm objects in the
input and returns the output with more compact ExpressionForm.

9
theory. Physicists who incorporate spin into their gravitational theories can construct
their own custom connections.
To declare a Christoffel Symbols or read its TensorComponents, we can call the
Function Christoffel and provide indices and metric. This will generate a Christoffel
Symbolswith the Head Tensor with the TensorType "ChristoffelSymbols". It is impor-
tant to note that although the Head is Tensor, Christoffel Symbols does not follow the
transformation rule of tensors (a rank-3 array, not tensor).

The default value of TooltipDisplay for Christoffel is TensorComponents (See


here: 2.0.6). This setting makes the Tooltip will display only the non-zero Tensor-
Components.

Riemann

In General Relativity, The Riemann tensor directly plays a role in the analysis of tidal
forces.
The Riemann tensor implies a non-zero change of a vector V i or a general tensor
T k1 ...kN l1 ...lM after an infinitesimally small closed loop parallel transport. That is, the
commutator of covariant derivative is not zero. covariant derivative serves as the gen-
erator of parallel transport.

[∇i , ∇j ] T k1 ...kN l1 ...lM

= Rk1 aij T ak2 ...kN l1 ...lM + Rk2 aij T k1 ak3 ...kN l1 ...lM + . . . + RkN aij T k1 ...kN −1 a l1 ...lM (1.8)

− Ra l1 ij T k1 ...kN al2 ...lM − Ra l2 ij T k1 ...kN l1 al3 ...lM − . . . − Ra lM ij T k1 ...kN l1 ...lM −1 a

10
The definition of Riemann is,

Ri jkl = ∂[k Γil]j + Γis[k Γsl]j (1.9)

In the language of differential forms, the Riemann tensor is generated by the exte-
rior covariant derivative of Christoffel Symbols.

R i j = DΓ Γ i j (1.10)

where,

DΓ ≡ d · +Γ ∧ · (1.11)

d is the exterior derivative and ∧ is the wedge product.

Now, We call Riemann to declare a Riemann Tensor.

The geometrical objects extract Functions in TensoriaCalc not only allow users ex-
tract geometrical objects Tensors with all lower Indices but also helps calculate if users
want to have any upper index.

11
Ricci, and the first glimpse of TensorComponents

The Ricci tensor Rij is defined as the trace of the Riemann tensor.

l (1.12)
Rij = Rilj

Here is a demonstration of how to use the Ricci Function.

The TensorComponents on a Tensor will extract its TensorComponents. In this


case, is a List of Lists. The extract Functions are discussed in Sec.(2.0.7).

RicciScalar

The Ricci scalar R is defined as the trace of the Ricci tensor.

R = Rii (1.13)

Here is a demonstration of how to use the RicciScalar Function.

12
Einstein, and the first glimpse of TensorIsZero

Einstein tensor definition is

1
Gµν ≡ Rµν − gµν R (1.14)
2

It’s an essential component that always appears on left-hand side of Einstein field
equations. Here is an Einstein field equations without the cosmological constant Λ.

Gµν = 8πGN Tµν (1.15)

Which is generated by Einstein-Hilbert action. LM is the Lagrangian density of the


matter field.

 
p R
LGR = |g| σg + LM (1.16)
16πGN

Here is the example

(1.17)

There is a quick way to test/judge whether a Tensor is a zero tensor or not. We can
use the TensorIsZero Function9 .
9
TensorIsZero returns True if input is a zero Tensor. Return False if input is not a zero Tensor.

13
Story: Vacuum Solutions of Einstein field equations

Vacuum solutions are the most simplest or purest solutions people can find for Einstein
field equations. By setting Tµν = 0, Einstein field equations (eq.(1.15)) become the
vacuum ones.

Gµν = 0 (1.18)

In code.(1.17), we can see that the 2-Sphere S2 is vacuum, even though its Ricci
Tensor is not a zero tensor. In fact, all 2-dimensional spacetimes are locally conformally
flat. This fact implies that the 2D gravitational theorem cannot be described by the
Einstein field equations. The geometric part (left-hand side) is always 0, while we can
have a non-vacuum field in the right-hand side.
Example 1: No General Relativity in 2D spacetime.
Here, we can use TensoriaCalc to show any arbitrary 2D spacetime is vacuum, by
brute force. Declare a general 2D Metric.

(1.19)

Example 2: Curvilinear coordinates are flat.

14
Let’s move on to higher dimension, firstly 3D. The most trivial case is a 3D Eu-
clidean space or 2+1 Minkowski spacetime. Here I provide slightly more non-triavial
example, 3D spherical coordinate, a classic example of curvilinear coordinate.
By observing the Einstein field equations, we can discover that if the Ricci tensor is
zero, then the Einstein tensor must also be zero. Conversely, the opposite is not neces-
sarily true. In other words, a spacetime with zero Ricci tensor must be vacuum.

Rij = 0 ⇒ Gij = 0 (1.20)

Now, let’s proceed with the direct calculation of the Ricci Tensor.

Example 3: The simplest black hole is (almost) vacuum everywhere!


Now, let’s explore some solutions in 3+1 dimensional spacetime. Afterall, this is
the spacetime we live in!
Apart from the most trivial (3+1)D Minkowski spacetime, there are 4 additional solu-
tions has benn found until 1960s, corresponding to 4 types of ideal static black holes.
All 4 black hole solutions are solutions of Einstein field equations or Einstein-Maxwell
field equations(the difference up to a electromagnetic stress–energy tensor) except for
the central singularity. Let’s begin with the simplest one, the Schwarzschild black hole
in Schwarzschild coordinate.

 rs   rs −1
dτ 2 = 1 − (dt)2 − 1 − (dr)2 − r2 (dΩS2 )2 (1.21)
r r

15
(dΩS2 )2 = dθ2 + sin2 [θ] dϕ2 (1.22)

The code:

(1.23)

The rs in the code, or normally denoted as rs , represents the Schwarzschild radius.


It determines the length scale and event horizon of the black hole. M represents the
mass of black hole.

rs = 2GN M (1.24)

The second output of code.(1.23) shows that it is a vacuum solution.


The Schwarzschild black hole corresponds to the simplest/purest black hole solution,
which does not rotate and is uncharged, with mass M .

Example 4: A rotating black hole is (almost) vacuum everywhere.


The next one is more interesting, the Kerr black holein Boyer–Lindquist coordi-
nates. Unlike the Schwarzschild black hole it rotates with angular momentum J, while
remaining uncharged.

16
 rs r  Σ
2
dτ = 1 − (dt)2 − (dr)2 − Σ (dθ)2 +
Σ ∆
(1.25)
2
2rs ra sin2 [θ]

rs ra
r 2 + a2 + sin2 [θ] sin2 [θ] (dϕ)2 + (dt) (dϕ)
Σ Σ

Σ = r2 + a2 cos2 [θ] (1.26)

∆ = r2 − rs r + a2 (1.27)

rs r

a, Σ and ∆ are length scales. Σ = 0 and 1 − ∆
= 0 determine the locations of the
two event horizons and two ergospheres, respectively. The ergospheres are significant
boundaries when discussing the frame-dragging effect on free-falling particles, while
the event horizons contribute to the coordinate singularity surfaces of the spacetime.
The Kerr parameter a is determined by the angular momentum angular momentum.
The code:

J
a= (1.28)
M

17
This shows that Kerr black hole is a vacuum solution.
I will not discuss the charged (either non-rotating or rotating) black hole at this point,
but will do so later once I have introduced sufficient functionality (in Sec.(3.4.1))

Weyl

The Weyl’s definition for d ≥ 4 is:

1  gµ[α gβ]ν
Cµναβ ≡ Rµναβ − Rα[µ gν]β − Rβ[µ gν]α + R (1.29)
d−2 (d − 2) (d − 1)

While

Cµναβ = 0 (1.30)

implies the spacetime is conformally flat.


If you insert a 3D Metric into this definition. You will find the Weyl is always zero. The
proof is in Sec.(3.10). However, unlike in 2D, in 3D spacetime, we can have coordinates
that are not conformally flat10 . The role of characterizing the conformally flat geometry
is taken care of by the Cotton tensor in 3D spacetime.
Example 5: de Sitter spacetime is conformally flat.
Here we consider a de Sitter spacetimein observer time coordinate,

(dτ )2 = (dt)2 − e2Ht d⃗x · d⃗x (1.31)

H is the Hubble constant in de Sitter spacetime.


10
Due to this fact, TensoriaCalc is programmed to immediately return a zero Tensor for Metrics with
d ≤ 3, without requiring any CPU calculation time.

18
Λ
H2 = (1.32)
3

Although it might not looks conformally flat, we can still calculate its Weyl to judge
if it can be transformed into a conformally flat form.

The code:

de Sitter spacetime is conformally flat.

Determinant

The Function Determinant extract the determinant of a Metric. It is important to note


that it is specifically used for extracting the determinant of Metric Tensors and not for
calculating the determinant of any square rank-2 tensor11 .

The Determinant of a Metric is most relevant to volume element of spacetime.

p
dV = |g|dx1 dx2 · · · dxd (1.33)

Let’s do it with spherical coordinate.


11
a Mathematica Function Det can deal with it.

19
where volume element in spherical coordinate is:

dV = r2 sin [θ] drdθdϕ (1.34)

1.3.3 NonMetricTensor

The NonMetricTensor Function helps users declare desired tensors quickly and easily.
Similarly to Metric, user should still provide mandatory arguments Indices, Tensor-
Components, TensorName, CoordinateSystem.

The FullForm of declared Tensor can be referred to in Appendix 5.0.2.

20
1.3.4 Operators

PartialD

PartialD act a partial derivative ∂ on a Tensor.


Here is the examples.

For a upper index PartialD ∂ k , we need to provide the metric.

21
The first argument is index of partial derivative ∂. The second is the Tensor on
which you want to act. The third is Metric Tensor.

CovariantD and the first glimpse of CovariantHodgeDual

A CovariantD ∇k is applied to a general rank-(N +M ) Tensor T i1 i2 ...iN j1 j2 ...jM . resulting


in a rank-(N + M + 1) Tensor with the following definition.

∇k T i1 i2 ...iN j1 j2 ...jM

= ∂k T i1 i2 ...iN j1 j2 ...jM
(1.35)
+ Γikl1 T li2 ...iN j1 j2 ...jM + Γikl2 T i1 l...iN j1 j2 ...jM + ... + ΓiklN T i1 i2 ...iN −1 l j1 j2 ...jM

− Γlkj1 T i1 i2 ...iN lj2 ...jM − Γlkj2 T i1 i2 ...iN j1 l...jM − . . . − ΓlkjM T i1 i2 ...iN lj2 ...jM −1 l

This definition satisfies metric compatibility eq.(1.2), which makes

∇k T i j = ∇k g il Tlj

(1.36)
il
= g ∇k (Tlj )

That is, the action of raising or lowering indices commutes with CovariantD.
Additionally, it defines a Tensor that obeys the transformation rule (which PartialD
does not obey) after this derivative.

 
∇k T i1 i2 ...iN j1 j2 ...jM ξ⃗
(1.37)
iN bM
= (∇c T a1 a2 ...aN
b1 b2 ...bM (⃗x)) J ck J i1a1 J i2a2 ...J b1 b2
aN J j1 J j2 ...J jM

⃗ The Js are Jacobian.


with a transformation from a coordinate set ⃗x to another ξ.
The coordinate transformation will be discussed in Sec.(2.0.14).
Example 6: Gradient in curved spacetime
The gradient of a scalar in curved spacetime is defined to be

(gradf )i ≡ ∇i f = ∂ i f = g ij ∂j f (1.38)

22
In S2

g ij ∂j f [θ, ϕ] = ∂θ f [θ, ϕ] + csc2 [θ] f [θ, ϕ] (1.39)

Here is the code

The first argument is index of covariant derivative ∇. The second is the Tensor on
which you want to act. The third is Metric Tensor.
Users can choose to input it in ExpressionForm or in Tensor form if they want to act
on a scalar.
In form language, the gradient (in 1-form but not 1-vector) is also denoted as:

gradf = d̃f (1.40)

Another field must be orthonormal to it is

d̄f = ⋆d̃f (1.41)

23
Where the star ⋆ represents Hodge Dual (See here: 2.0.22). d here represents exterior
derivative (not to be confused with infinitesimal change) (See here: 2.0.19).
The indices notation is

(d̄f )i = ϵij ∇j f (1.42)

Here is the code:

In this piece of code, I also show the orthogonality of d̃f and d̄f . i.e.,

ϵ̃ij ∇i f ∇j f = 0 (1.43)

The ϵ̃ij is Levi-Civita (psuedo-)tensor12 (See here: 2.0.21). The TensorsProduct is


used to contract 2 Tensors. In this case, it is equivalent to inner product of a 1-vector
and a 1-form. The orthogonal property cause 2 set of vector basis on S2 , called vector
spherical harmonics, discussed in Sec.(2.0.33).
Actually, applying CovariantD on a scalar (gradient) is not too interesting. The
only benefit is to see the covariant property of gradient.
Let’s move on to apply it on a non-scalar Tensor.
Example 7: Divergence in curved spacetime
12 i1 i2 ...id
ϵ̃ = √1 ϵi1 i2 ...id
|g|

24
The divergence in curved spacetime is defined:

∇i V i (1.44)

Here is the code to calculate divergence in spherical coordinate:

This code calculates the same thing using only PartialD.

This show the equivalece of 2 ways to calculate divergence. One involves PartialD,
while the other involves CovariantD.

1 p 
∇i V i = p ∂i |g|V i (1.45)
|g|

Example 8: Curl in curved spacetime


The curl in curved spacetimeis defined:

25
ϵ̃ijk ∇j Vk (1.46)

The example in 2-Sphere: eq.(3.11)


Example 9: Metric Compatibility ∇g = 0
(See here: 2.0.11)

1.3.5 Tensor Manipulation

Einstein summation

In TensoriaCalc, Einstein summation is not implemented as a single function, but rather


as an internal pattern check within the Tensor object itself. Say you declare a Tensor
with its Indices List contains at least one pair of repeated indices (one up and one
down), automatic contraction will be performed.
When TensoriaCalc detects a Tensor with a repeated indices pattern, it will perform
the corresponding contraction to its TensorComponents. After, it will add an Under-
Bar to the indices pair. In TensoriaCalc, the UnderBar indicates that the corresponding
index is concrete or has been contracted. That is, it is not an abstract index anymore.

F IGURE 1.4: When the result of contraction is a scalar, the output will be in Expres-
sionForm rather than a Tensor form.

26
F IGURE 1.5: After doing contraction on the first 2 indices, the rank-3 tensor becomes a
rank-1 tensor. The only remaining abstract index is k− . The indices is will be marked
with an UnderBar to indicate that they have been contracted.

I will utilized the Metric declared here (code.(1.19)) to have some examples in this
section.
Example 10: The trace of any metric equals its dimension.

g ii = δ ii = tr(Id×d ) = d (1.47)

Let’s show it13 :

Example 11: Trace of Ricci Tensor is RicciScalar.

Rii = R (1.48)

13
Caution: CoordinateDimension might be an internal Function that we haven’t decided to make it
public.

27
Let’s show it (g2D is declared here code.(1.19)):
1.

Here are additionally three equivalent ways to do the same thing.


2. This show a way to change indices to a declared Tensor.

3 . This show a way to change indices to a declared Tensor, regardless of the Indices
that the Tensor originally contains.

4. We can call the Indices endow Function. The endow Functions are introduced
in Sec.(2.0.8).

Example 12: contraction of Christoffel


A relationship between the Determinant of Metric and a contracted Christoffel:

h 1i
∂i ln |g| 2 = Γsis (1.49)

28
Let’s show it:

Example 13: Energy/momentum Conservation


The divergence of stress–energy tensor

∇µ Tµν = 0 (1.50)

implies energy/momentum conservation.


Let’s consider Einstein field equations with the cosmological constant Λ.

29
Gµν − Λgµν = 8πGN Tµν (1.51)

Which is generated by:

 
p R − 2Λ
LGR = |g| + LM (1.52)
16πGN

Apply CovariantD on left-hand side of eq.(1.51) and recall the metric compatibility
(eq.(1.2)).

∇µ Gµν − Λ
∇µ  µ 
 = 8πG ∇
gµν N Tµν = 0
 (1.53)

The divergence of Einstein also implies energy/momentum conservation.


Remember that in code.(1.19), I showed that Einstein is identically zero in 2D. We need
to consider higher dimensions, preferably at least 3D.

However, this is not a calculation can be done easily14 . So I only show an arbitrary
diagonalized 3D Metric’s energy/momentum conservation.
14
Caution: This calculation is time-consuming.

30
You might want to ask: Inner contraction within a single Tensor? How about con-
traction between multiple Tensors. This is taken care by TensorsProduct.

TensorsProduct

TensorsProduct15 performs tensor product operation on multiple input Tensors, com-


bining them into a single Tensor as the output.
code example:

Users have the option to input either Times of Tensors or List of Tensors. However,
when using the first strategy, it’s important to note that the order of tensors may be re-
arranged due to the Orderless property of Mathematica Times Function. The solution
is discussed in Sec.(2.0.35).
15
Regarding the TensorsProduct Function, please note that there is an extra "s" in comparison to
Mathematica’s TensorProduct function. Please be careful not to confuse the two.

31
When there is at least one pair of repeated indices, after combining into a single Ten-
sor using TensorsProduct, it will automatically trigger Einstein summation Sec.(1.3.5)
Example 14: g −1 g = I
Here I will perform this contraction of metrics.

g ij gjk = δ ik (1.54)

code:

Evaluating abstract indices at specific coordinates/values

In TensoriaCalc, there are 2 ways to evaluate abstract indices at specific coordinates.


The first is using Replace (shortcut: /.)

Specified it while using a Function required Indices.

32
After evaluating, it adds an UnderBar to the specified coordinate to indicate that it
is a concrete index. If all the coordinates are specified, the output will become a single
component represented in ExpressionForm.

The second coordinate, denoted as 2, is equivalent to ϕ. The numbering of coordi-


nates starts from a specified StartIndex of Tensor. This alternative method provides a
way to specify coordinates.

MoveIndices, RaiseAllIndices and LowerAllIndices

MoveIndices allows users to freely raise or lower indices. The first argument is the
original Tensor on which the operation is performed. The second argument specifies
the target Indices and the third argument is the Metric used for raising or lowering
the Indices.
For example, let’s consider a Faraday tensor F µν in flat spacetime:

33
To use MoveIndices, we need to declare the Metric in this case, the flat spacetime
Metric ηµν (Minkowski spacetime).

Now, if we want to obtain Fµ ν using MoveIndices, the target Indices should be


{µ− , ν − }.

This performs

34
Fµ ν = ηµα η νβ F αβ (1.55)

More example:

(1.56)

An equivalent achieve the same result as the code.(1.56) is by using


RaiseAllIndices and LowerAllIndices. In these 2 Functions, you do not need to pro-
vide target Indices.

35
More example:

Note that if you want to move the indices of a Metric. the Metric itself provides
the information to move itself. Therefor, you do not need to use MoveIndices,
RaiseAllIndices or LowerAllIndices. Metric itself has a built-in functionality to move
its indices.

36
SwapIndices

SwapIndices swap Indices in input Tensor to target order.


Here, Swap Indices of a rank-2 anti-symmetric Tensor Fµν .

The first argument is the Tensor to be swapped, and the second argument is the
target Indices order.
After swapping this rank-2 anti-symmetric tensor, we can observe the TensorCom-
ponents become opposite.

Fµν = −Fνµ (1.57)

Here is an example for higher rank Tensor.

37
Function Operator

In TensoriaCalc, approximately half of the Functions support the use of OptionValue.


Reader could refer to Sec.(5.0.8) to see all the OptionPattern and default value.
Some Functions in TensoriaCalc offer the option of OptionValue with Simplify as
the default value. If users do not specify a value for this option, TensoriaCalc will auto-
matically apply Simplify. For example, in Metric, there are options such as Christof-
felOperator, RiemannOperator. Setting RiemannOperator→Simplify will simplify
the result of Riemann.

On the other hand, if users provide RiemannOperator option, the CPU Timing16
16
The Timing is a Mathematica Function returns both the CPU calculation time and the original out-
put. The output List is returned in the form {CPU time, original output} .

38
will be significantly reduced when calculating the Metric. However, the output will
remain unchanged, without undergoing the Simplify.

This will be a significant issue in the calculation of perturbation theory of General


Relativity, linearized gravity in Sec.(3.5).

Series

Series do Taylor Series expansion on input Tensor.


consider a 2D rotation matrix.

Apply Series on it. Expand at θ = 0, up to O (θ3 ).

39
This is equivalent to the first three term of

     l

h i   0 −1  X 1   0 −1 
ˆ
exp −iθJ = exp θ 
    = θ   (1.58)

l=0
l!   
1 0 1 0

code:

Where J is generator of 2D rotational matrix.


Series is an important Function in the perturbation theory of General Relativity.

Dimensions

This show a Riemann Tensor of Kerr black hole is rank-4, 4 dimension.

40
UniqueIndices

Unique is a Mathematica Function used to generate a unique symbol.

UniqueIndices is a Function that converts every index in the input Tensor into a
unique one.

1.3.6 Geodesic related object

I have covered a lot about describing the geometry of curved spacetime. At this point,
let me quote one of the most famous sentences in General Relativity by J.A. Wheeler

Spacetime tells matter how to move; matter tells spacetime how to curve.

The Einstein equations are the part that describe how "matter tells spacetime how
to curve". On the other hand, the dynamics or path of particles in General Relativity
follows straight lines in curved spacetime, known as geodesics. This dynamics can be
determined by solving the geodesic equations.
A straight line in curved spacetime corresponds to minimizing the length of path
taken by particles. The length, denoted as l, is given by the integral:

r
λ2
dz α (λ) dz β (λ)
Z
l= dλ gαβ (z (λ)) (1.59)
λ1 dλ dλ

41
where gαβ (x(λ)) is the metric tensor, z α (λ) are the position of the path, and the
fictitious time λ parametrizes the path between the starting point x1 and the end point
x2 .

z µ (λ1 ) = x1
(1.60)
µ
z (λ2 ) = x2

The non-affinely parametrized Lagrangian associated with this length is given by:

r
dz α (λ) dz β (λ) (1.61)
L′g = gαβ (z (λ))
dλ dλ
The equations of motion for this Lagrangian are the non-affinely parametrized
geodesic equations.

d
q
µ
z̈ + Γµαβ ż α ż β µ
= ż ln gαβ ż α ż β (1.62)

At this point, you can see "Spacetime tells matter how to move". We can always
find an affine parameter λ′ such that

q
gαβ ż α ż β = constant along geodesic (1.63)

The affinely parametrized Lagrangian is defined with square of it.

1
Lg = gαβ ż α ż β (1.64)
2

Affinely parametrized geodesic equations:

z̈ µ + Γµαβ ż α ż β = 0 (1.65)

Also, an affinely parametrized geodesic vector field v follows

v σ ∇σ v µ = 0 (1.66)

42
GeodesicSystem

A example with S2 .
GeodesicSystem returns a List output containing four Parts: the first Part is the
affine parameter (eq.(1.64)). The second Part is the non-affinely parametrized La-
grangian (eq.(1.61)). The third Part is the affinely parametrized geodesic equations
(eq.(1.65)). The fourth Part is the non-affinely parametrized geodesic equations
(eq.(1.62)).

GeodesicLagrangians

If you only want to calculate the Lagrangian, you can use GeodesicLagrangians.
example:

43
In GeodesicSystem and GeodesicLagrangians, users can input the OptionValue
AffineParameter and NonAffineParameter to specify the symbols for the affine and
non-affine parameters, respectively.

GeodesicHamiltonianDynamics

Hamiltonian mechanics provides another way to describe the geodesic of particles. In


this framework, The conjugate momenta ps are defined by:

∂Lg
pµ ≡ = gµν ż ν (1.67)
∂ ż µ

Hamiltonian H is defined by:

1
H (z, p) ≡ pµ ż µ (z, p) − L (z, p) = g αβ (z (λ)) pα (λ) pβ (λ) (1.68)
2

The Hamilton’s equations are:

∂H
ż µ (λ) = = g µν pν (1.69)
∂pµ
 
∂H 1 ∂ αβ
ṗµ (λ) = − µ = − g pα pβ (1.70)
∂z 2 ∂µ

code:
Users should provide the Metric Tensor, the conjugate momenta in the form of
Rules with the corresponding coordinates, and the affine parameter.

44
The output is a List. The first Part is the Hamiltonian. The second Part consists of
four sub-Part s, each corresponding to one of Hamilton’s equations of particles’ motion
in S2 . (2d equations for d-dimensional spacetime) The last Hamilton’s equation implies
a constant of motion in S2 since ϕ is absent in 2-Sphere metric (caused by eq.(1.70)).

 
1 ∂  αβ

ṗϕ (λ) = − gS2 pα pβ = 0 (1.71)
2 ∂ϕ

45
Chapter 2

Advanced Functionality

We have covered the basic usage and examined a few examples. In this chapter, I
will introduce the advanced functionality that has been expanded by me, including
the thought process behind the development of these functions. Additionally, I will
include a code section to explain the expansion of the respective Function if the process
is not straightforward. If there is overlap between my contributions and Yi-Zen’s, I will
include a Development History section as well.

2.0.1 Declare Inverse Metric with Quadratic form

Motivation

In code.(1.4), we can declare a lower indices Metric in quadratic form. However, in


version 0 of TensoriaCalc, we can not declare a inverse metric in the same way. A S2
inverse metric in ExpressionForm:

(∂θ)2 + sin−2 [θ] (∂ϕ)2 (2.1)

Unfortunately, since a ∂ is an operator with Mathematica built-in meanings. The


flexibility of its syntax is quite restricted by Mathematica. We can’t use it representing
the vector basis.

47
Solution

We decide to use ∇ to replace ∂ in TensoriaCalc. ∇ is an operator without Mathematica


built-in meaning. Here is an example:

Note that although d also has Mathematica built-in meaning for Integrate and total
derivative, there is no strict restriction on its usage, unlike ∂.

2.0.2 OrthonormalFrameField and transformation into orthonormal

basis through MoveIndices

Definition

The orthonormal frame field εα̂β transforms a tensor from the coordinate basis to the
orthonormal basis, or its inverse transformation. For example, transform a rank-2 ten-
sor from the coordinate basis to the orthonormal basis

T α̂β̂ = εα̂γ εβ̂ λ T γλ (2.2)

48
The definition of orthonormal frame field is

gµν = εα̂µ ηαβ εβ̂ ν (2.3)

ηµν = εµ̂α gαβ εν̂ β (2.4)

It transforms a metric tensor into a (Minkowski-/Cartesian-like) flat metric tensor,


as well as its inverse transformation. The OverHat on index â indicates a is a index in
orthonormal basis.

Usage

There are 2 strategies to obtain OrthonormalFrameField. In this second, I will intro-


duce the first strategy, and in the next section, Sec.(2.0.3), I will introduce the second
strategy. Briefly speaking, users are strongly recommended not to use the first strategy
to deal with a non-diagonal metric. On the other hand, the first strategy is easier than
the second one and can obtain a correct result for a diagonal metric.
When declaring a Metric, if users provide a FlatMetric1 ’s diagonal terms in List,
the calculation of the orthonormal frame field will be triggered. The time coordinate
can be more than one (For example, F-theory has 2 time) and the position of time is not
necessary the first one. (some people put it on the last one.)

(2.5)

Example 15: orthonormal frame field of spherical coordinates


1
The FlatMetric ηαβ is the argument that users should provide to specify the information about which
coordinates represent time and which represent space. For example, in a mostly plus d-dimensional
space corresponds to a length d FlatMetric {+1, +1, . . . , +1} to represent ηαβ = Diag [+1, +1, . . . , +1].
The mostly minus 4D Kerr black hole (eq.(1.25)) corresponds to {+1, −1, −1, −1}.

49
The output is a List. The first Part is the orthonormal frame field Tensor.

The second Part is the inverse orthonormal frame field Tensor.

The reason why I call it the inverse orthonormal frame field is because it’s the in-
verse of orthonormal frame field, with respect to the first and third indices, and the
second and fourth indices.

εâc εâb = δ cb (2.6)

εĉb εâb = δ ac (2.7)

50
The third Part of code.(2.5) is a Metric Tensor that contains the calculation results
of the OrthonormalFrameField and InverseOrthonormalFrameField.

Users can use OrthonormalFrameField to extract OrthonormalFrameField and In-


verseOrthonormalFrameField in the form of a List of Lists.

You can raise or lower Indices with OrthonormalFrameField.

51
Comparing to code.(2.5), if users do not specify the OptionValue Orthonormal-
FrameFieldOperator, the square root operation may not be canceled with square in-
side it in this example. Additionally, if user do not specify the OrthonormalFrame-
FieldIndices, TensoriaCalc will automatically generate 2 Unique Indices, which may
result in a slightly messy output.

If users initially declare a Metric Tensor without specifying the FlatMetric. They
can use OrthonormalFrameField to recalculate it.

52
User can provide either the OrthonormalFrameField or the InverseOrthonormal-
FrameField. If the OrthonormalFrameField is provided, we will calculate Inverse-
OrthonormalFrameField using the following relationship:

ˆ
εâb = ηad εdc g cb (2.8)

code:

On the other hand, if InverseOrthonormalFrameField is provided, we calculate


OrthonormalFrameField using:

ˆ
εdc = η da εâb gbc (2.9)

53
If users are unsure whether they have correctly input the OrthonormalFrameField
or InverseOrthonormalFrameField, they can include the OptionValue CheckOrthonor-
malFrameField→True when declaring the Metric. This will perform a check to ensure
the consistency of the provided frame field.

The output List would have two additional outputs, making a total of five outputs.
The fourth is the check of eq.(2.3). The fifth is the check of eq.(2.4).
Example 16: counter example for CheckOrthonormalFrameField.
Users are encouraged to endow an OrthonormalFrameField to Metric Tensor with
the first strategy if they already know the correct OrthonormalFrameField, and then
TensoriaCalc will help calculate the InverseOrthonormalFrameField. However, if users
are not sure whether they have provided a correct OrthonormalFrameField. CheckO-
rthonormalFrameField to initially check its validity. For a diagonal metric, in current
version, we do not allow users to input an OrthonormalFrameField. Here, I will use
a non-diagonal metric as an example. Although I mentioned that users are not sug-
gested to use the first strategy to deal with a non-diagonal metric, I will firstly obtain
the correct OrthonormalFrameField with the first strategy. The following result is still
correct since two coordinates are symmetric and have the same dimension. The reason
why these two properties are important in this example will be discussed in the second
strategy part.

54
Here is a non-diagonal example that will be further discussed in eq.(3.119).

 2
2 2
(dl) = dzdz̄ (2.10)
1 + z z̄

Now, I will re-declare a Metric Tensor by manually inputting an incorrect Or-


thonormalFrameField, adding an additional term to the correct one. After that, I will
perform CheckOrthonormalFrameField, and now the results are not True.

55
Code

In eq.(2.3), it implies how to calculate orthonormal frame field, by given Metric and
FlatMetric.
First, we utilize Mathematica Function EigenSystem which returns the eigenval-
ues λ(M M A) a and eigenvectors of the Metric Tensor. Second, we normalize the eigen-
vectors and combine them to obtain a normalized rotational matrix Oab .
The obtain the square root of eigenvalues. Note that Mathematica assumes every-
thing in flat space. That’s why users should provide th FlatMetric to multiply back to
Mathematica’s eigenvalues.

1
λa 2 = square root of every components in ηab λ(M M A) b (2.11)

Then we can get orthonormal frame field:

1
εâb = λa 2 Oab (For specified a, no sum on the right-hand side.) (2.12)

orthonormal basis

To transform a Tensor from the coordinate basis to the orthonormal basis, like eq.(2.2),
we can use MoveIndices. MoveIndices can not only raise or lower Indices, but also
add OverHat on Indices.
example:

56
The first argument is the Tensor we want to transform. The Tensor is allowed to
be in mixed indices of OverHated2 or Un-OverHated. The second argument is target
Indices List, which can also have mixed indices of OverHated or Un-OverHated. The
third argument is the Metric with the OrthonormalFrameField.
By input OrthonormalBasis or CoordinateBasis as the second argument, users can
use this shortcut where they do not need to specify target Indices List.
2
In Mathematica, to type î, you can select the letter i you typed, and then press Crtl+&. An Over
block will appear on the selected i, and you can fill it with the caret symbol ˆ. This is equivalent to
OverHat [i]

57
Example 17: Tensor in orthonormal basis of spherical coordinate
(See here: 3.2)
Example 18: Tidal force around a Schwarzschild black hole
Before calculating the Riemann Tensor, we should first obtain the Metric with cal-
culated OrthonormalFrameField.

58
OrthonormalFrameField:

InverseOrthonormalFrameField:

The tidal force is described by the Riemann Tensor. For example, a particle (or ob-
ject, or point) deviates from the center of mass of a free-falling particle with a geodesic
field U µ . By choosing the Fermi Normal Coordinate (FNC) system at the center of mass,
the tidal force (imaginary force) acting on the deviated particle at ξ µ compared to the
center of mass is described by the geodesic deviation equation in the FNC system:

d2 ξ µ (2.13)
U α U β ∇α ∇β ξ µ = = −Rµ 0ν0 ξ ν
dτ 2

The τ is the observer’s time at the center of mass.


Now, we can calculate the Riemann Tensor. However, to compare the compo-
nents between different coordinates, we want to transform the Riemann Tensor into
orthonormal basis.

59
Consider a radial direction deviation ξ µ̂ = δ µ̂r̂ .

rs
Rr̂ 0̂r̂0̂ = − (2.14)
r3

The minus sign in − rrs3 implies that the tidal force is a repulsive force between the
deviated point and the center of mass.

d2 ξ µ̂ rs (2.15)
2
= −Rµ̂ 0̂r̂0̂ ξ r̂ = 3 r̂
dτ r
rs
where r3
> 0.
Consider angular directions deviation ξ µ̂ = δ µ̂θ̂ and ξ µ̂ = δ µ̂ϕ̂ .

60
There is no minus sign. In angular direction, the tidal force is an attractive force.
Consider the three directions of the tidal force, and this is the reason for Spaghetti-
fication when a large enough object gets close to the event horizon of a Schwarzschild
black hole. The shape of the object will be distorted and become lengthy in the radial
direction but squeezed in the angular direction. The shape will become more and more
like Spaghetti, a line, when it gets close to the coordinate singularity of a black hole (For
Schwarzschild black hole, both coordinate singularity and tidal force singularity are at
r = 0).
rs
Notice that, the tidal force is proportional to r3
, while the Newtonian gravitational
rs
attractive force is proportional to r2
. While the total mass of source rs is not large
enough (For example the mass of Moon as the source), for a small size of object like
the human body at the Earth surface, it is not easy to discover the tidal force on human
body. Notice that the Schwarzschild radius of the Earth is about the size of a coin,
and the moon’s rs is even smaller. It is much smaller than the Earth-Moon distance r.
However, when the object is large enough, the deviation ξ µ is significant, and the tidal
force can be discovered. The ocean on the Earth’s surface is widely distributed, which
is why it is easy to observe the tidal force effect on the shape of the ocean. It distorts the
ocean’s shape from a spherical surface to ellipsoid surface, aligned on the Earth-Moon
direction.
However, when the rs is large enough, for example, around a black hole, even a
human body can easily feel the effects of the tidal force. A free-falling human in the
high sky of the Earth may die at the moment they arrive at the floor. For a free-falling

61
human around a black hole, they could even die before reaching the event horizon
because their body gets distorted due to the tidal force.

2.0.3 Second strategy of calculating OrthonormalFrameField and

EigenSystem

In the previous section, we dicussed the first strategy to calculate the Orthonormal-
FrameField. However, it seems that in many scenarios, the result OrthonormalFrame-
Field’s rows are swapped.
Let’s take the orthonormal frame field of Schwarzschild black hole in ingoing
Eddington-Finkelstein coordinates as an example.

In this example, you can observe that ϵ1̂3 = ir is swapped from the third row and
accidentally multiplied by i since the FlatMetric is multiplied by the wrong term. This
problem cannot be discovered if we only see the result of CheckOrthonormalFrame-
Field. However, it will become apparent when users try to transform a tensor into
orthonormal basis, as the physicla dimensions will not be correct.

62
The reason for this problem is the random sorting property of the EigenSystem
output.
Now, EigenSystem can not only accept List of Lists as input but also accept Tenso-
riaCalc’s Tensor objects. I use this Function as an intermediate step if users provide an
non-diagonal metric.
Here is the output of EigenSystem on a Schwarzschild Metric in ingoing Eddington-
Finkelstein coordinates.

The first output is the List of eigenvalues of Metric’s TensorComponents.

The second output is the List of eigenvectors of Metric’s TensorComponents.

The order is swapped. However, there is be a correct order to need to be figure out
by the user. Otherwise even the physical dimensions of the eigensystem may not be
correct. Fortunately, the eigenvalues always correspond to correct eigenvectors.
Now, let’s try to do the analysis. Because the 2-Sphere is the subspace of this metric,
the first eigenvalue −r2 must correspond to the θ-th (3rd) orthonormal frame field ϵθ̂β .

63
The forth eigenvalue −r2 sin2 [θ] must correspond to the ϕ-th (4th) orthonormal frame
field ϵϕ̂β . Both have physical dimensions of [L]2 . This can be even easier to judge from
the eigenvectors since their eigenvectors are not even mixed with other coordinates.
The v and r’s eigenvectors are mixed with each other in coordinates. From FlatMet-
ric {1,-1,-1,-1}, we can know that one eigenvalue that corresponds to the 1st orthonor-
mal frame field ϵ1̂β should be positive. The other one that corresponds the the 2nd
orthonormal frame field ϵ2̂β should be negative. Both of their eigenvalues are dimen-

sionless. Fortunately, this is easy to analyze in this case. 5r2 − 2rrs + rs 2 is positive
since 5r2 − 2rrs + rs 2 ∝ 4 + (1 − rs /r)2 > 0. It is obvious that the second eigenvalue
is negative and the third eigenvalue is positive, since we can directly compare their
quantities.
In this case, we know the correct order should be {3,2,1,4}. The 3 at the first place
here means the first orthonormal frame field should correspond to the 3rd output of
EigenSystem es.
However, doing this analysis for any arbitrary Metric automatically by computer,
without human brain, could be very challenging. The Metric could be even higher
dimension with multiple times. One can imagine that it is hard to build a general steps
to find the correct order.
As a result, we have no choice but ask users to follow a 2-step process to obtain
the orthonormal frame field. The first step is what we have done above. Obtain the
output of EigenSystem[Metric] and save it (es). Users should perform some analysis
to obtain the order.
The second step is utilizing OrthonormalFrameField Function. The first argument
is the Metric. The second argument is the es saved in the first step. The third argument
is the correct order provided by users. The fourth argument is the FlatMetric. Users
can also provide OrthonormalFrameField’s OptionValue.

64
OrthonormalFrameField:

InverseOrthonormalFrameField:

Now, we obtain the correct orthonormal frame field.


The first strategy with the potential sorting problem has been solved for the di-
agonal Metric case. Since we don’t need to use EigenSystem, we can directly obtain
the orthonormal frame field by squaring the diagonal components. Users can use the
first strategy directly if they have a diagonal Metric. There won’t be a chance to get
swapped orthonormal frame field.

65
2.0.4 Series expansion on OrthonormalFrameField

Since I have included OrthonormalFrameField as an additional geometrical objects of


the Metric, when performing a Series expansion on the Metric, OrthonormalFrame-
Fieldis also considered.

Usage

Let’s declare a Metric with an OrthonormalFrameFieldand apply Series on it.

By extracting OrthonormalFrameField from the resulting Metric, you can observe


that the OrthonormalFrameField is indeed expanded.

2.0.5 TooltipStyle

You may have noticed that I have set property TooltipStyle→{”Large”}3 multiple
times. This is done to adjust the size of Tooltip box to match the typesetting of this
thesis. TooltipStyle is an OptionValue of the Mathematica Function Tooltip.
3
TooltipStyle→{”Large”} is equivalent to TooltipStyle→{Large}

66
Usage

When a Tensor is not provided with a specific TooltipStyle, the default value is Tooltip-
Style→{}. In Mathematica, this is equivalent to TooltipStyle→{Small}.

Now, insert TooltipStyle→{Medium}.

Or TooltipStyle→{Large}.

Users can input any font size number they want.

67
Or change the font color and make it Bold.

2.0.6 TooltipDisplay→TensorComponents

Usage

example:
Consider a rank-4 Tensor.

68
When you hover your mouse over it, there is no Tooltip, since a rank-≥ 3 Tensor
won’t display it by default.
However, by assigning TooltipDisplay→TensorComponents to Tensor, it will dis-
play all the non-zero TensorComponents of the Tensor as a Listwhen hovering over
it.

Another equivalent way is to use endow Function (See here: 2.0.8).

Motivation

This piece of code was inspired by Yi-Zen’s "Tooltip for Christoffel" code. Normally,
reading the TensorComponents of a rank-≥ 3 Tensor can be difficult, so we choose to

69
hind them. Despite this, Yi-Zen create a code to display all non-zero TensorCompo-
nents of Christoffel. However, there was a problem. When we applied a PartialD to
the Christoffel. The Tooltip didn’t updated to a new one in the output. Even though
the TensorComponents is calculated already for ∂Γ (rank-4), the Tooltip still showed
the non-zero TensorComponents of Γ (rank-3).
I found a way to extend the method for finding all the non-zero TensorCompo-
nents of any rank Tensor. I created the Format to handle this. Right now, TooltipDis-
play→TensorComponents is set as the default value for Christoffel. The result is as
shown in code.(2.19).

Here are a few ways we can utilize TooltipDisplay with Christoffel in spherical
coordinate.
The default one:

70
Say users want to display TensorComponents in MatrixForm.

Or simply want to add a remark to it.

(2.16)

71
2.0.7 Extract Functions

In version 0 of TensoriaCalc, when we want to extract TensorComponents, Coordi-


nateSystem, or Indices, We can use the TensorComponents, Coordinatesand Indices
Function. We have named these extract Functions with the same names as their corre-
sponding properties for consistency.

Motivation

However, others properties of Tensors have not been taken into consideration. Now
we also have extract Function: StartIndex, TensorName, TensorType, TooltipDisplay,
TooltipStyle, TensorAssumption and TensorOperator. The last 2 properties will be
introduced later. TensorAssumption is introduced in Sec.(2.0.29). TensorOperator is
introduced in Sec.(2.0.30).
There are three benefits to creating extract Functions for all properties.

72
The first benefit

The first benefit is that it improves code clarity and speed. For example, when we
want to test if a Tensor is a Metric Tensor, we extract its TensorType, and this is the
way how we originally did.

(2.17)

Now we can write in a more concise manner.

For programmers, I have implemented an internal Function called TestMetricTen-


sor, which allows for more efficient testing of Metric Tensors.

The second benefit

The second benefit is that it helps programmers establish a unified way of generating
output for scalar ExpressionForms. In operation such as PartialD, CovariantD, and
others that I have not yet introduced, like LieDerivative (See here: 2.0.16), ExteriorD
(See here: 2.0.19) and OutputBecomesOneTensor (See here: 2.0.35), there are cases
where we need to extract scalars’ properties. However, scalars in ExpressionForm are
not a Tensor object, there is no relevant information we can extract. Therefore, we need
to generate a default output in such a situation. Here is an example to demonstrate
how we generate default answers to a scalar ExpressionForm:

73
We recommend that programmers avoid extracting StartIndex and CoordinateSys-
tem from a scalar ExpressionForm. In the case of StartIndex, the default value 0 may
lead to inconsistency if user’s StartIndex is a different number. As for CoordinateSys-
tem, there is no way an ExpressionForm to store such information. Therefore, we have
no choice but to print an error message as output.
Here is an example that we can see how the default value of TensorName works.
Consider a divergence of Faraday Tensor in curved spacetime, say conformally flat
(3+1)D spacetime.

1 p 
∇i F ij = p ∂i |g|F ij (2.18)
|g|

74
This resulting output may appear somewhat messy. We recommend that users de-
clare a scalar ExpressionForm as a scalar Tensor if it is not a simple expression. Here
is the demonstration:

75
This may be the first time reader is encountering a combination of scalars and Ten-
sors, with the Head Times or Plus. This is the approach used to calculate TensorCom-
ponents of a collection of objects.

This shows that 2 methods are equivalent.

The third benefit

The third benefit is that we can easily and consistently change the level of Cases or
make other adjustments in a single sentence. In Comparison to the code.(2.17), all the
Cases in the extract function are set to level 1. This is done with future development
in mind. Although TensoriaCalc currently does not generate, and we do not recom-
mend declaring Nested Tensors, if in the future we allow it, this will be an important
consideration.

76
2.0.8 Endow Functions

Usage

In comparison to extract Functions, Endow Functions have an additional second ar-


gument v, in addition to the first argument Tensor t. Endow Functions assign the
property value v corresponding to the property (the name of the Endow Function) as
a Rule to the target Tensor t. If t already has an existing value for that property, it will
be replaced with the new value. If there is no corresponding property Rule, a new one
will be Appended. This ensure that there are no duplicated Rules for same property
but with different values.
example: Re-name a Tensor.

Consider a Tensor that hasn’t declared its TensorType. When we try to extract its
TensorType, you can see the output is part one of a Null List, indicating that there is
no TensorType assigned to it. By using endow Function TensorType, we can append
a TensorType to the Tensor. This time, when we extract the TensorType, we can see
the newly assigned value.

77
This is useful when one wants to change TooltipStyle or TooltipDisplay.

78
Motivation

As a TensoriaCalc developer, we often find ourselves needing to borrow the structure of


one Tensor and modify it to create another Tensor. This code example demonstrates
how we can change Tensor F into a scalar Tensor Gaussain.

You can see the benefits of borrowing a structure. The new Tensor inherits other
properties from the old Tensor, such as TooltipStyle→{"Large"} in this case. However,
commend need to be made can be quite lengthy.
Now we can use endow Functions to achieve the same result rapidly and intu-
itively.

79
Please note that TensorComponents does not have its own endow Function, but
4
only the extract one.

2.0.9 PartialD now become more flexible

Motivation

As I mentioned in Sec.(1.3.4), there are 3 arguments: new index, Tensor t to be differ-


entiated and the Metric Tensor m in PartialD. However, in some cases, we don’t need
to provide all three arguments.
For a lower index PartialD ∂k , we don’t need to provide the Metric. Only need first
two arguments.

4
For programmer: The reason for this is because it will mis-trigger OperatorDistributeOverPlus (See
here: 2.0.34) and cause a bug.

80
Since a lower index PartialD doesn’t involve the inverse Metric, all we need is the
CoordinateSystem, which can already be extracted from Tensor t without the need for
the Metric Tensor m. Users can choose to provide an additional CoordinateSystem or
Metric. If they do so, TensoriaCalc will use the coordinate information provided by the
users.
For a lower index PartialD ∂k acting on a scalar ExpressionForm, we must provide
either CoordinateSystem or Metric. However, if users declare it as a scalar Tensor
first, TensoriaCalc can extract CoordinateSystem from it automatically.

Again, since a lower index PartialD doesn’t involve the inverse Metric, the fol-
lowing shortcut contains all the necessary information we need. However, it is only
available for lower index PartialD and not for upper index PartialD.

81
2.0.10 Partial Derivative with specific coordinate or variable (PD)

PD will act as a derivative on a Tensor t (the first argument) with respect to a variable
v (the second argument). The output will remain the same rank without extra index.
example:

This is equivalent to these 2 ways that utilize PartialD and then project to θ coordi-
nate. The later one requires more calculations.

More example:

82
You can do it multiple times.

(2.19)

This example shows we can apply PD to a scalar Tensor, and the variable can be a
non-coordinate variable.

2.0.11 ∇g = 0

TensoriaCalc is programmed to immediately return a zero Tensor without requiring


any CPU calculation time, while calculating the CovariantD acts on corresponding
Metric Tensor. The result is provided immediately, regardless of the complexity of the

83
Metric Tensor. Of course, if you use Christoffel to construct its definition and calculate
it, you can prove it is really zero.

2.0.12 CovariantBox

Definition

The CovariantBox applies the box operator on a Tensor in curved spacetime and is
defined as follows:

□T i1 i2 ...iN j1 j2 ...jM = ∇k ∇k T i1 i2 ...iN j1 j2 ...jM (2.20)

The box operator is also known as d’Alembert operator and wave operator.

Usage

Operate on scalar ExpressionForm:

The first argument represents the object on which you want to apply the box oper-
ator. The second argument represents the Metric Tensor.
Apply on a Tensor:

84
An application of wave operator on a higher rank tensor can be found in Sec.(3.8).

2.0.13 Auxiliary Functions

Declare NonMetricTensor in ExpressionForm with Wedge

Motivation

This part is inspired by Yi-Zen’s "declaring Metric in quadratic form" code


in code.(1.4). Since a Metric can be declared this way, we are wondering if we can
do the same thing on any rank tensor. This would enable users to declare a Riemann
Tensor directly if they can provide its ExpressionForm. Say:

R = (dt ∧ dx) ⊗ (dy ∧ dz) + (dy ∧ dz) ⊗ (dt ∧ dx) (2.21)

which is the simplest example that satisfies symmetry properties of Riemann tensor.

Usage

The syntax for this is similar to what we do in the case of a Metric.

85
2 more example:

86
WedgeProductExpand

WedgeProductExpand is the initial step performed by TensoriaCalc when declaring a


tensor in ExpressionForm with Wedge into a Tensor. This Function is also publicly
available.
The purpose of WedgeProductExpandis to expand a wedge product into a sum of
objects using the tensor product ⊗ by considering all possible permutations. Here is a
simple example:

There are 6 terms since there are 6 permutation.


Let’s apply it on R:

ToTensorComponents

ToTensorComponents is the second step. This requires Indices to read the position of
indices and the coordinates List.
Let’s apply it on Rotimes:

Then we can use NonMetricTensor to declare a Tensor.

87
Declare NonMetricTensor in ExpressionForm with ⊗ or symmetric objects

Let’s declare an asymmetric tensor in ExpressionFormusing the tensor product ⊗.

This is the easiest example for symmetric object in ExpressionForm.

Let’s declare 2 NonMetricTensors with the TensorComponents of 2-Sphere Metric.

88
ToExpressionForm

I have demonstrated numerous examples of converting ExpressionForm into Tensor.


Now, ToExpressionForm serves to convert a Tensor into back into ExpressionForm.

Usage

Here is an example of an asymmetric tensor:

And here is an example of an anti-symmetric tensor:

Lastly, here is an example of a symmetric tensor with non-diagonalized terms:

89
2.0.14 CoordinateTransformation

Definition

In differential geometry, coordinate transformation plays an important role in defining


what a "tensor" is. A rank-n array with multiple components may not be a tensor. It
needs to obey coordinate transformation rule.
In differential geometry, a tensor is a tensor field in the spacetime. Since it describes
the field at an infinitesimal point, it needs to be multiplied by its infinitesimal coordi-
nates basis to describe the entire thing. The basis is composed by a dual basis set,
which describes displacement with physical dimension length [L] or flow with physi-
cal dimension [L−1 ].
An upper index corresponds to an infinitesimal tangent basis.
This is a vector field (1-vector), or a flow field.

V = V i ∂i (2.22)

90
An upper index corresponds to an infinitesimal displacement basis.
This is a 1-form.

W = Wi dxi (2.23)

This is a general rank-(N + M ) tensor field T multiplies by its basis.

T = T a1 a2 ...aN b1 b2 ...bM [⃗x] ∂a1 ⊗ ∂a2 ⊗ . . . ⊗ ∂aN ⊗ dxb1 ⊗ dxb2 ⊗ ⊗ . . . ⊗ dxbM (2.24)


Here is where the coordinate transformation comes into play a role. When we
change from one d-dimensional coordinates ⃗x into another d-dimensional coordinates
⃗ the basis is transformed by:
ξ,

∂ξ i
 
i
∂a = a
∂ξi ≡ J −1 a ∂ξi
∂x
 b (2.25)
∂x
dxb = j
dξ j ≡ J bj dξ j
∂ξ

The J and J −1 are known as Jacobian and inverse Jacobian. They are inverses of
each other.
Substitute the basis transformation rule eq.(2.25) into eq.(2.24).

J J −1 = I (2.26)


91
h h ii
T ⃗x ξ⃗

= T a1 a2 ...aN b1 b2 ...bM [⃗x] ∂a1 ⊗ ∂a2 ⊗ . . . ⊗ ∂aN ⊗ db1 ⊗ db2 ⊗ . . . ⊗ dbM


h h ii  i   i 
= T a1 a2 ...aN b b ...b ⃗x ξ⃗
1 2 M
J −1 1 ∂ξi1 ⊗ J −1 2 ∂ξi2
a1 a2
   
−1 iN bM
J b1j1 dξ j1
J b2j2 dξ j2 jM
  
⊗ ... ⊗ J ∂i ⊗
aN ξ N
⊗ ⊗ . . . ⊗ J jM dξ
   h i (2.27)
−1 i1 −1 i2 −1 iN
a1 a2 ...aN b1 b2 bM
ξ⃗
  
= T b1 b2 ...bM J a1
J a2
⊗ J a
J j1 J j2 ⊗ J jM
N

∂ξi1 ⊗ ∂ξi2 ⊗ . . . ⊗ ∂ξiN ⊗ dξ j1 ⊗ dξ j2 ⊗ . . . ⊗ dξ jM



h i
i1 i2 ...iN ⃗ ∂ξi1 ⊗ ∂ξi2 ⊗ . . . ⊗ ∂ξiN ⊗ dξ j1 ⊗ dξ j2 ⊗ . . . ⊗ dξ jM

≡T j1 j2 ...jM ξ
h i
= T ξ⃗

From the fourth equality, we can see how the tensors transform under coordinate
transformations.

h i
T i1 i2 ...iN j1 j2 ...jM ξ⃗
h h ii (2.28)
i i i
=T a1 a2 ...aN
b1 b2 ...bM ⃗x ξ⃗ J −1 1 a1 J −1 2 a2 . . . J −1 N a J b1j1 J b2j2 . . . J bNjN
N

⃗ not only replace


During the transformation from coordinates ⃗x into coordinates ξ,
⃗ but also to contract them the corre-
the expressions of Tensor elements from ⃗x to ξ,
sponding Jacobian J or inverse Jacobian J −1 . Each upper index should contract with
one inverse Jacobian, while each lower index should contract with one Jacobian.
All the geometrical objects (Metric, Riemann, etc.) in TensoriaCalc except Christof-
fel are tensors. A CovariantD on a tensor is another tensor.
On the other hand, Christoffel and a PartialD on a tensor are not tensors. Although
their Head named Tensor, they are actually arrays field.
There are 4 types of CoordinateTransformation. In TensoriaCalc, each requiring a
different number of required arguments.
The first type of transformation involves a change in coordinates while sharing

92
the same coordinate set. This type of transformation corresponds to continuous or
incontinuous symmetries and allows for the transformation of tensors into another ob-
server’s perspective. For example, in Minkowski spacetime, there are 10 transforma-
tions with SO(3,1) symmetry, including 4 spacetime translations, 3 spatial rotations and
3 boosts. The CoordinateSystem involved in this transformation are from {t, x, y, z} to
{t′ , x′ , y ′ , z ′ }
The second type of transformation involves a change to a completely different co-
ordinate set while describing the same physical phenomena from the same observer’s
perspective. For example, transforming from 3D Cartesian coordinates to 3D spherical
coordinates. The CoordinateSystem involved in this transformation are from {x, y, z}
to {r, θ, ϕ}
The third type is to coordinate transform Christoffel.
The forth type is to calculate induced tensors.
These four types of CoordinateTransformation serve different purposes and re-
quire different input arguments in TensoriaCalc.

CoordinateTransformation into a new coordinateset, but share with same symbol


and meaning

Let’s do some example for the first type first.


Example 19: Re-scale
Consider a re-scaling on spherical coordinate so that three coordinates are physi-
cally dimensionless.


r′ r




 = R


θ′ =θ (2.29)




ϕ′

 =ϕ

R is a constant with physical dimension length [L].


A metric in spherical coordinate:

93
For the first type of CoordinateTransformation, you only need to provide the Ten-
sor t that you want to transform as the first argument, and the transformation Rules
ct as a List. t is T a1 a2 ...aN b1 b2 ...bM in eq.(2.28). TensoriaCalc will calculate Jacobian and in-
verse Jacobian with ct that users input through derivative. The output will be eq.(2.28).

When t is a Metric, not only the TensorComponents of Metric will be transformed,


but also all the geometrical objects in the new coordinates will be calculated.
Here we compare the Christoffel before and after the CoordinateTransformation.

94
Let’s recall the definition of Christoffel (eq.(1.6)). Christoffel symbols are com-
posed of terns involving g −1 ∂g. This implies that the factor 1
R2
will be canceled out.
In this case, the re-scaling of r causes the constant re-scaling on metric, which can be
viewed as a constant Weyl transformation. Geometrical objects except the metric, in-
verse metric, Weyl tensor, orthonormal frame field, and determinant of the metric, are
invariant under the constant Weyl transformation.
The Weyl transformation is to re-scale the metric with a spacetime-dependent factor
Ω [x]2

gµν [x] ≡ Ω [x]2 ḡµν [x] (2.30)

ḡµν describes the original spacetime, and gµν describes the new spacetime after the
Weyl transformation.
The relationship between Christoffel symbols after and before the Weyl transfor-
mation is:

Γµαβ [g] = Γ̄µαβ [ḡ] + ∂{α ln Ω δ µβ} − ḡαβ (∂ µ ln Ω) (2.31)




The Γµαβ [g] represents Christoffel symbols after the Weyl transformation, and Γ̄µαβ [ḡ]
represents Christoffel symbols before the Weyl transformation.
1
In this case, it is a constant Weyl transformation Ω2 = R2
, where R is a constant. All
derivative of Ω vanish.

95
Γµαβ [g] = Γ̄µαβ [ḡ] + ∂ lnΩ δ µβ} − ḡαβ µ  (2.32)


(∂ ln Ω)
 
{α

That’s why Christoffel Symbolsare invariant under the constant Weyl transforma-
tion, i.e., Γµαβ [g] = Γ̄µαβ [ḡ].
Similarly, if you observe the Riemann tensor Rµ ναβ , Ricci tensor Rµν , Ricci scalar R,
Einstein tensor Gµν (with correct indices position) under the Weyl transformation, all
the changes are contributed by the derivatives of Ω, which vanishes under a constant
Ω.
Here is an example that we can see the difference in geometrical objects, a confor-
mally flat coordinates of 2-Sphere (χ, ϕ). More discussion about this coordinates could
be found in eq.(3.118) in Sec.(3.7.3).

Re-scale the χ:

If you extract the Ricci Tensor, you can see the difference.

96
Example 20: Faraday Tensor in Minkowski spacetime under a Lorentz boost
Consider a Faraday Tensor in Minkowski spacetime.

Lorentz boost it on t-x plane with speed β.


t′




 = γ (t − βx)



x ′

 = γ (x − βt)
(2.33)
y′




 =y



z ′

 =z

97
(2.34)

where γ = √ 1
1−β 2

If we define γ = cosh [ξ] and βγ = sinh [ξ]

98
where ξ is rapidity.

For Fty′ , this implies Ey′ = cosh [ξ] Ey + sinh [ξ] By and Fxz implies By′ = cosh [ξ] By −
sinh [ξ] Ez .
Example 21: Faraday Tensor in Minkowski spacetime under a rotation
Consider a rotation matrix that rotates θ on x-y plane. Let’s transform the Faraday
Tensor.

Example 22: Faraday Tensor in Minkowski spacetime remains invariant under


spacetime translation
Let’s translate the Faraday Tensor with x′ µ = xµ + x0 µ

99
F ′ remains invariant.
Example 23: Minkowski Metric remains invariant under translation, rotation and
boost.
The definition of a member Λ of Lorentz group is:

ΛT ηΛ = η (2.35)

Minkowski Metric η remains invariant under transformation.


In (3+1)D, there are 10 continuous transformation satisfied this definition.5
Declare (3+1)D Minkowski Metric:

boost on x direction (y and z are similar, totally 3):


5 d(d+1)
Maximum number: 2 , in this case, which is maximally symmetric

100
rotation on x direction (y and z are similar, totally 3):

spacetime translation (totally 4):

Example 24: light speed is constant in different frame of flat spacetime


The problem of the speed of light was the first question that Einstein tackled. The
answer to this question led to the development of Special Relativity, which is built
upon the mathematical framework of Lorentz symmetry. Here, we will demonstrate
that the speed of light remains invariant under Lorentz transformation.
Let’s consider a four momentum of photon that propagate on x-direction.

101
 
 E 
 
 
 E 
µ
 
P =
 
 (2.36)
 0 
 
 
 
0

First declare as a Tensor:

The following condition implies that the photon propagates on the light cone, i.e.,
with speed of light.

p2 = E 2 − p2x − p2y − p2z = 0 (2.37)

Let’s boost to obtain p′

102
This shows p′2 = 0 in another frame.

CoordinateTransformation into a new coordinate, but share with symbols and mean-
ings, to deal with ExpressionForm

If we only provide the transformation Rules as the sole argument, the output will
include not only the transformation Rules for coordinates, but also the transformation
Rules for basis.
That is, append these as Rules to input List:

∂xb
 
b
dx = j
dξ j (2.38)
∂ξ
 i
∂ξ
∂ xa = ∂ξ i (2.39)
∂xa

Here is an example:

Apply it on a tensor ExpressionForm with Replace.

103
This again shows the Lorentz invariance.
Use this way to Lorentz transform a Faraday tensor ExpressionForm.

Declare as a Tensor. The result is same as code.(2.34).

CoordinateTransformation into a new coordinate set, with different symbols and


meanings

In contrast to the first type of CoordinateTransformation, which is based on a contin-


uous symmetry and preserves the same coordinate set. For example, Lorentz transfor-
mation transforms a Minkowski spacetime into another

104
Minkowski spacetime : {t, x, y, z} → {t′ , x′ , y ′ , z ′ }. The second type transformation
involves a change to a completely different coordinate set. For example, transforming
from 3D Cartesian coordinatetransforms into spherical coordinate: {x, y, z} → {r, θ, ϕ}.






 x = r sin [θ] cos [ϕ]


y = r sin [θ] sin [ϕ] (2.40)





z
 = r cos [θ]

In comparison to the first type transformation, the second type require an addi-
tional argument: the symbols’ name of the new coordinate set as a List.

To simplify the process, you can declare the transformation as a new variable, al-
lowing you to quickly and easily apply the transformation multiple times.

105
Once again, if you coordinate transform a Metric Tensor, all geometrical objects
will be updated accordingly.

We can transform from spherical coordinates back to the Cartesian.

Example 25: CoordinateTransformation of Schwarzschild black holes


Declare a Schwarzschild black hole Metric in ingoing Eddington–Finkelstein coor-
dinates.

Let’s transform from ingoing Eddington–Finkelstein coordinates to


Schwarzschild coordinates.
Due to the coordinate singularity at r = rs , the calculation will be divided into 2
parts.

106
r > rs :

r < rs :

CoordinateTransformation into a new coordinate, with different symbols and mean-


ings, to deal with ExpressionForm

Similar to the first type, if users only provide transformation Rules ct and the new
coordinate List coo, the output will be a Rule List. User can then use this with Replace
to transform an ExpressionForm.

107
Use Replace:

CoordinateTransformation for Christoffel

Definition

The CoordinateTransformation of Christoffel from ⃗x to ξ⃗ is described by:

h i h h ii l  l ∂ 2 xk
Γlij ξ⃗ = Γkmn ⃗x ξ⃗ J −1 k (J)mi (J)nj + J −1 k j i (2.41)
∂ξ ∂ξ

The first term ΓJ −1 JJ transform like a tensor. The second term which involved
with a Hessian ∂ξ2 x is the term makes Christoffel Symbolsnot a tensor.

code and usage

Since the first term transforms like a tensor, we will use the CoordinateTransformation
for a normal Tensor to calculate it. The second term is the additional term that needs
to be calculated. With the provided ct, we can obtain both (inverse) Jacobian and the
Hessian. There are no more additional arguments required compared to the second
type of CoordinateTransformation. Therefore, the syntax is identical to the second

108
type. The input consists of the Christoffel chr, a List of transformation Rules ct and a
new coordinate set coo.
The TensorType of chr "ChristoffelSymbols" would prevent TensoriaCalc from trig-
gering CoordinateTransformation for a normal Tensor. To calculate the first term, a
temporary Tensor chr′ is declared, inheriting all the information from input Christof-
fel chr except its TensorType. chr′ is then fed into CoordinateTransformation to obtain
the first term. The second terms is the Hessian contracted with the inverse Jacobian.
The Hessian can be obtained by taking an additional partial derivative to Jacobian.
Let’s transform a Christoffel from 3D Cartesian to spherical coordinates.

Perform an inverse transformation:

109
Transform a Christoffel from 3D Cartesian to cylindrical coordinates.

The process does not involve the Metric. The result is equivalent to substituting a
Metric in the new coordinates into Christoffel.

Projection into (hyper)surface: Induced Tensor other than Christoffel

Definition

In differential topology, there is the theorem called the Whitney embedding theorem. It
states that any arbitrary smooth spacetime/space (whether it is flat, has extrinsic cur-
vature or intrinsic curvature), can be smoothly embedded into a higher-dimensional
flat spacetime/space, with the dimension that is at most twice the dimension of origi-
nal manifold. It is useful to transform a tensor from a higher-dimensional spacetime to
a lower-dimensional one. It provides a new approach to understanding the properties
and symmetries of (hyper)surfaces.
For example, a (3+1)D de Sitter spacetime can be embedded in a (4+1)D Minkowski
spacetime. A (3+1)D Schwarzschild black hole can be embedded in a (5+1)D Minkowski
spacetime.

110
To transform to a lower dimension, a constraint function is required, which can in-
volve multiple coordinates of the ambient space. The constraint can even be nonlinear
with respect to the coordinate variables. However, if one can find a good coordinate
system to describes the relationship between the ambient space and its (hyper)surface
using a constraint that involve only one coordinate. one can easily project a tensor onto
a (hyper)surface.
For example, by specified the constraint r = R in spherical coordinates {r, θ, ϕ}
with a constant R, we can obtain a 2-Sphere with radius R. In other words, the 2-
Sphere {θ, ϕ} is embedded in 3D Cartesian/spherical space.
This is the definition of this type of transformation to a rank-(N+M) Tensor from

ambient space coordinates ⃗x to (hyper)surface new coordinates ξ:

h i h h ii
T A1 A2 ...AN B1 B2 ...BM ξ⃗ = T a1 a2 ...aN b1 b2 ...bM ⃗x ξ⃗ E A1a1 E A2a2 . . . E AN aN
(2.42)
bN
E b1B1 E b2B2 ...E BN

The indices a1 a2 . . . aN , b1 b2 . . . bM runs from 1 ∼ d and A1 A2 . . . AN , B1 B2 . . . BM


runs from 1 ∼ D, where D < d. The E here is a d × D matrix, defined by

∂ξ A
∂a = ∂ A ≡ E Aa ∂ξA
∂xa ξ
(2.43)
∂xb
dxb = B dξ B ≡ E bB dξ B
∂ξ

Usage

In comparison to the second type of CoordinateTransformation, when transforming a


NonMetricTensor, users need to provide the ambient space Metric m as the fourth ar-
gument. However, if you are transforming the ambient space Metric itself, the fourth

111
argument is not necessary. The requirement for the ambient space Metric will be ex-
plained in detail in the code section ((See here: 2.0.14)). Additionally, the third argu-
ment coo will have a shorter Length. The Length of the second argument ct corre-
sponds to the dimension of ambient space, i.e., Length[ct] = d. On the other hand, the
Length of coo corresponds to the dimension of (hyper)surface. i.e., Length[coo] = D.
Here we project a identity matrix from 3D Cartesian to 2-Spherewith radius R.

Or project a constant diagonalized matrix from 3D Cartesian to 2-Sphere.

112
The induced metric can be obtained from projecting an ambient metric.

h h ii h i
gij ⃗x ξ E I E J = HIJ ξ⃗
⃗ i j
(2.44)

As advertised, projecting a Metric to obtain induced Metric H itself does not re-
quired the fourth argument. Here, project 3D Cartesian Metric to obtain a 2-Sphere
Metric with radius R.

(2.45)

Note that for Induced Christoffel. Users can directly plug the induced Metric into
Christoffel. There is no benefit to build another CoordinateTransformation code for
Induced Christoffel. Since it still requires an induced Metric.

Code

For a CoordinateTransformation from a d-dimensional coordinates ⃗x to another d-


dimensional coordinates ξ, ⃗ TensoriaCalc can obtain the Jacobian J b from the provided
j
h i
transformation ct ⃗x ξ⃗ . Then TensoriaCalc apply Mathematica Function Inverse to J bj

113
i
to obtain the inverse Jacobian (J −1 ) a , since J bj is a square d × d matrix, which is invert-
ible. TensoriaCalc then use TensorsProduct to contract them with Tensor.
For a projection from d-dimensional ambient space coordinates ⃗x to D-dimensional
⃗ where d < D, obtaining the E A directly from a single set
(hyper-)surface coordinates ξ, a
h i
of ct provided by users is not straightforward. With ct ⃗x ξ⃗ , E bB can still be calculated
easily. However, since E bB is a non-square d×D matrix, it is not invertible. This implies
that users may need to provide the inverse transformation Rules ξ⃗ [⃗x] to calculate E Aa ,
which can be a challenging task. In the definition eq.(2.42), both E bB and E Aa are
required.
The solution to this issue is to avoid using E Aa . Instead, we can perform the Low-
erAllIndices on the input Tensor
T a1 a2 ...aN b1 b2 ...bM first. This operation requires the ambient space Metric gij , but this is a
much simpler task compared to providing ξ⃗ [⃗x].
The first step:

LowerAllIndices [T a1 a2 ...aN b1 b2 ...bM , Ambient Metric gij ] → Ta1 a2 ...aN b1 b2 ...bM (2.46)

The left-hand side of the arrow represents the input, and the right-hand side of the
arrow represents the output. This step requires the ambient Metric gij .
With ct, we can obtain d × D matrix E bB . Now we can proceed with the projection.
The second step:

Ta1 a2 ...aN b1 b2 ...bM E a1A1 E a2A2 . . . E aN AN E b1B1 E b2B2 . . . E bN BN


(2.47)
= TA1 A2 ...AN B1 B2 ...BM

Then move the Indices back to the original position, with induced Metric.

114
MoveIndices TA1 A2 ...AN B1 B2 ...BM , A1 − , . . . , BM − , Induced Metric Hij
  
(2.48)
→ T A1 A2 ...AN B1 B2 ...BM

The Induced Metric Hij can be obtained using the method as demonstrated in
code.(2.45). This method also requires the ambient Metric as an input, which is also
required in the first step. This is the reason that users need to provide it as the fourth
argument.

Indices in orthonormal basis won’t be transformed

Since indices in orthonormal basis is in locally flat coordinatesystem, they won’t be


transformed during CoordinateTransformation.
Transform a identity matrix in coordinate basis of 2D Cartesian to 2D polar coordi-
nates.

Transform a identity matrix from 2D Cartesian to 2D polar coordinates. The first


index is in coordinate basis but the second one is in orthonormal basis.

115
Transform a identity matrix in orthonormal basis of 2D Cartesian to 2D polar coor-
dinates. It’s won’t be transformed.

Development History

In the version zero of TensoriaCalc, there were already functionalities for Coordinate-
Transformation of Metric and the generation of Rules. The functionality for the in-
duced Metric was also available. Later, I expanded these capabilities to include Co-
ordinateTransformation for higher rank Tensors, induced Tensor (projections), Co-
ordinateTransformation for OverHated objects and CoordinateTransformation for
Christoffel.

116
2.0.15 TensorEquations

Definition

TensorEquations takes a left-hand side Tensor TLHS as the first argument and a right-
hand side Tensor TRHS as the second argument, and outputs the Equal List component-
by-component.

TLHS i1 i2 ...iN j1 j2 ...jM = TRHS i1 i2 ...iN j1 j2 ...jM (2.49)

TensorEquations [TLHS , TRHS ]


(2.50)
→ TLHS 1...1 1...1 == TRHS 1...1 1...1 , . . . , TLHS d...d d...d == TRHS d...d d...d


Usage

Here is an example to demonstrate a rank-2, 4D TensorEquations.

Aµν = Bµν + Cµν (2.51)

117
If one side is a zero Tensor, you can directly input 0 on the right-hand side.

A practical example is in Sec.(3.3).

2.0.16 LieDerivative and LieBracket

Killing tensor

Before introducing the definition of LieDerivative, I should explain the concept of a


Killing tensor Kµ1 ...µN .
If one can find a rank-N fully-symmetric Killing tensor Kµ1 ...µN , which is defined
by Killing tensor equation:,

∇{µ Kµ1 ...µN } = 0 (2.52)

then it corresponds to a constant of motion

Kµ1 ...µN v µ1 . . . v µN (2.53)

That won’t change under parallel transportation along an affinely parametrized


geodesic vector field v µ .

118
v σ ∇σ (Kµ1 ...µN v µ1 . . . v µN ) = 0 (2.54)

This observation is a consequence of the symmetry of the geometry and is known


as Noether’s theorem.
The rank-1 Killing tensor equation, which is also known as Killing vector equation:

∇{µ ξν} = 0 (2.55)

The conserved quantity:

ξµ v µ (2.56)

One should note that finding a Killing vector is normally much easier than finding
a higher rank Killing tensor in a specific spacetime. In the next section, I will introduce
a method to initially find some conserved quantities in a spacetime.

Definition

Lie derivative is the first of order change of a Tensor T while translation along an
infinitesimal vector ξ.
Consider a infinitesimal translation x = x′ + ξ. The first order of change on a rank-
(N + M ) tensor is:

(2.57)

119
The first term is contributed by the change of T along original ξ. The remaining
terms show that not only the change of T contributes, but also the change of ξ itself
contributes.
The higher-order change of T involves higher-order Lie derivatives.
Also, the Lie derivative itself can help analyzing the symmetry.
The Lie derivative of the metric tensor is equal to the left-hand side of the Killing
vector equation.

(£ξ g)µν = ∇{µ ξν} (2.58)

The simplest way to initially find some Killing vectors is that if there is a coordinate
z that does not appear in any of the tensor components of the metric, then the Lie
derivative along z direction (ξµ = ẑµ = δ zµ ) is equal to 0. This corresponds to a constant
of motion:

pz = δ zµ v µ = v z (2.59)

Usage

Declare J (x) , J (y) and J (z) first, which I will show are all Killing vectors of 2-Sphere.

Now we can apply LieDerivative to obtain Lie derivative of a Tensor t along a


1-vector V , where V is the first argument and t is the second argument.

120
Testing the three vectors, we can see that all of them satisfy Killing equation on
2-Sphere.

You can also obtain Lie derivative on a 1-vector along another 1-vector.

The definition of a LieBracket is as follows, which is equivalent to LieDerivative


on a 1-vector.

[V, W ]i ≡ V j ∇j W i − W j ∇j V i

= V j ∂j W i − W j ∂j V i (2.60)

= £V W i = −£W V i

121
This is a demonstration to show that the LieBracket of 2 Killing vectors (V and W )
is still a Killing vector.

(2.61)

£[V,W ] g µν
=0

You can also apply LieDerivative to a scalar ExpressionForm. The output will still
be scalar ExpressionForm.

In the case of f being a function, note that the definition of £V f is:

£V f = V i ∂i f (2.62)

The previous code is equivalent to the following.

For a more complete story of LieDerivative in 2-Sphere (See here: 3.1).

122
A shortcut is available, by using £ (\[Sterling])

Development History

In the version zero of TensoriaCalc. It included the LieDerivative for Metric. Later, I
extended it to higher rank Tensors and implemented the LieBracket and their shortcut.

2.0.17 TensorSymmetry

Motivation

The ability to extract the symmetric property of tensors allows for the potential to per-
form abstract calculations, which are expected to consume less CPU Timing compared
to concrete calculations. While this functionality has not been developed in Tensoria-
Calc, TensorSymmetry may serve as a first step towards its further development.
The output of TensorSymmetry is a 2-component List. It extracts the TensorCom-
ponents and applies the Mathematica TensorSymmetry operator to them, resulting in
the first output. The second output is the Tensor endowed with the TensorSymmetry
property.
Let’s obtain the TensorSymmetry of a Metric.

gµν = gνµ (2.63)

123
You can use Cases to extract TensorSymmetry, but there is no extraction Function
available for it.

Obtain TensorSymmetry of a Faraday Tensor.

Fµν = −Fνµ (2.64)

ZeroTensor is a Function used to generate a zero Tensor.

However, ZeroTensor may not be a publicly available Function in the future pub-
lished version of TensoriaCalc. Here I provide a method to call an internal Function of
a package.

124
This syntax can be used if ZeroTensor is a private Function.
TensorSymmetry of a Riemann Tensor.

Rµναβ = Rαβµν

Rµναβ = −Rνµαβ (2.65)

Rµναβ = −Rµνβα

Whenever there are multiple symmetry relationships, Cycles is used. The second
number beside each cycle represents the factor difference when swapping indices.
Let’s consider a complex symmetry:

125
2.0.18 SymmetrizeIndices and AntiSymmetrizeIndices

Definition

Fully SymmetrizeIndices:

T{α1 ...αN } = Tα1 ...αN + Tα2 α1 ...αN + All permutation (N! terms) (2.66)

1
Notice that in TensoriaCalc, there is no normalization factor of N!
.
For example:

T{αβ} = Tαβ + Tβα (2.67)

T{αβγ} = Tαβγ + Tγαβ + Tβγα + Tβαγ + Tγβα + Tαγβ (2.68)

There is also partially SymmetrizeIndices.

T{α|β|γ} = Tαβγ + Tγβα (2.69)

Fully AntiSymmetrizeIndices:

T[α1 ...αN ] = Tα1 ...αN − Tα2 α1 ...αN

+ All permutation (N! terms) with factor (−1)l (2.70)

, l is the number of time to swap the indices

1
Again, in TensoriaCalc, there is no normalization factor of N!
.

T[αβ] = Tαβ − Tβα (2.71)

T[αβγ] = Tαβγ + Tγαβ + Tβγα − Tβαγ − Tγβα − Tαγβ (2.72)

There is also partially AntiSymmetrizeIndices.

126
T[α|β|γ] = Tαβγ − Tγβα (2.73)

Usage

Let’s declare a general rank-4, 4 dimensional Tensor first.

For Fully SymmetrizeIndices, only the Tensor to be symmetrized needs to be pro-


vided.

After applying the Function, you can see that the symmetric property has been
fully symmetrized.

You can also convert the TensorComponents from a List of Lists into a
SymmetrizedArray.

127
For partially SymmetrizeIndices, users should provide the target indices List as
the first argument.

Again, we can use TensorSymmetry to see the result is symmetrized on the first
and the third indices.

Convert the TensorComponents from a List of Lists into a SymmetrizedArray.

For fully AntiSymmetrizeIndices:

128
A 4-dimensional rank-4 fully anti-symmetric Tensor has only one independent com-
ponent.

For partially AntiSymmetrizeIndices:

Example 26: Bianchi Identities


Let’s test it with a general 2D Tensor.

129
Let’s declare the Riemann Tensor and check that it is not a zero Tensor.

Then let’s declare the left-hand side of the following Bianchi Identity:

Ri[jkl] = 0 (2.74)

It is a zero Tensor.

Let’s declare the left-hand side of the following Bianchi Identity:

∇[i Rjk lm] = 0 (2.75)

130
It is a zero Tensor.

2.0.19 ExteriorD

Definition

An exterior derivative on a p-form F in differential form is denoted as:

dF (2.76)

The output becomes a (p + 1)-form


In index notation:

1
∂[µ Fα1 ,α2 ,...,αp ] (2.77)
p!

Usage

Declare a 3D spatial vector potential Aj

Operate d (esc+d+d+esc) acting on Aj with a new index.

131
F = dA (2.78)

This generates the spatial Faraday Tensor, which corresponds to the magnetic field
B only.

If users do not specify the new index, TensoriaCalc will automatically generate a
Unique index. This is for convenience if users only need the TensorComponents and
do not require further contraction with other tensors.

These 2 shortcut are equivalent to:

There is a p-vector ExteriorD code (no shortcut):

132
Example 27: Infinitesimally Thin Solenoid
Consider a vector potential in 3D Cartesian:

xdy − ydx
Ai dxi = (2.79)
x2 + y 2

This show that B field is zero almost everywhere.


p
However, it is important to note that there is a singularity at ρ = x2 + y 2 = 0. This
singularity indicates that further analysis is needed to determine the existence of the B
field in space. To investigate this, we can recall the Stokes’ theorem, which relates the
integral of a differential form over a manifold to the boundary of the manifold.

Z Z
n⃗
p ijk
d ξ |g (ξ) |ni ϵ̃ ∂j Ak = dn−1 xAi (2.80)
D ∂D

133
Where the left-hand side is a finite n-dimensional (hyper-)volume D with coordi-
nates ξ⃗ in spacetime, and the right-hand side is (hyper-)surface with coordinates ⃗x. The
outgoing field on the boundary of D is described by ni .
First, let’s convert the 3D Cartesian vector potential Ai to 3D cylindrical coordinates.

Now, eq.(2.80) becomes:

Z Z
ijk 1
dxdydzni ϵ̃ Fjk = dϕ (2.81)
D 2 ∂D

If the chosen volume covers the singularity:

Z Z
ijk 1
dxdydzni ϵ Fjk = dϕ = 2π (2.82)
D 2 ∂D

If the chosen volume does not cover the singularity:

Z Z
ijk 1
dxdydzni ϵ Fjk = dϕ = 0 (2.83)
D 2 ∂D

We can conclude that:

Fij = 2πϵijz δ (x) δ (y) (2.84)

The B field only exists at ρ = 0. The vector potential Ai describes an infinitesimally


thin solenoid.
There is also a 2D infinitesimally thin solenoid. First project Ai onto 2D polar coor-
dinates.

134
The vector potential of the 2D infinitesimally thin solenoid can be generated by dϕ

Faraday Tensor is zero almost everywhere.

2.0.20 PotentialForm

The PotentialForm is defined by the equation (4.61) of Schutz:

Z 1
1 n
dt tp−1 αij...k tx1 , tx2 , . . . , txn xi
 
βj...k x , . . . , x = (2.85)
0

by given a p-form αij...k as input and returns a (p − 1)-form βj...k . A proof of this
equation is demonstrated in Sec.(4.0.4).

135
Usage

Consider a 2-form α, obtain a 1-form potential:

The second argument t in eq.(2.85) is the name of the integrating variable. If the
integral can be finished, there is no difference whether you provide it or not.

Example 28: Infinitesimally Thin Solenoid


Consider infinitesimally thin solenoid again:

136
By given Ai = di θ, we can obtain θ again.

If you provide a Tensor as the argument, it will generate a scalar potential rep-
resented as a Tensor object. If the argument is not a Tensor, it will be treated as an
expression and represented in ExpressionForm.

2.0.21 LeviCivita

Definition
p
A LeviCivita Tensor ϵ̃ is defined as the Determinant of the Metric |g| multiplied by
the Levi-Civita symbols ϵ.

p
ϵ̃µ1 ,µ2 ,...,µd = |g|ϵµ1 ,µ2 ,...,µd (2.86)

The LeviCivita Tensor is a pseudo-tensor, which means you can raise or lower in-
dices by the Metric Tensor itself. It also obeys the coordinate transformation rule.

137
However, the word "pseudo-" implies that under a spacetime parity flips transforma-
tion, it is invariant, which means it does not behave like a normal tensor, but rather
differs by up to a minus sign.

Usage

Consider a conformally flat metric:

To declare ϵ̃µναβ , users should provide Indices and the Metric. By default, ϵ0123 ≡ 1.
In addition to all lower indices as example shown here, users can also choose to input
all upper or mixed Indices. TensoriaCalc will handle the MoveIndices operation for
users.

Declare ϵ̃µναβ

138
If users want to define ϵ0123 ≡ −1, they can add a Minus as an additional argument.

Development History

In version 0 of TensoriaCalc, this Function was already available. I have made modifica-
tions to use Mathematica’s built-in Function LeviCivitaTensor6 . Additionally, I have
made the definition of ϵ012...D ≡ −1 available.
6
Although it is called LeviCivita"Tensor", the output is actually a flat Levi-Civita symbol.

139
2.0.22 CovariantHodgeDual

Definition

An N -form can be transformed into a d − N -form or a d − N -vector using the following


definition of CovariantHodgeDual.

1 µ1 ...µd−N ν1 ...νN
T̃ µ1 ...µd−N ≡ ϵ̃ Tν1 ...νN (2.87)
N!

Usage

Consider a conformally flat metric:

Declare a 0-form (Tensor and ExpressionForm), 2-form, 4-form.

You can obtain ⋆F from a 2-form by applying the CovariantHodgeDual, resulting


in a 2-form. You can also raise or Lower Indices during the operation. Furthermore,
you can input a Tensor without all upper or lower indices.

140
Obtain ⋆F from a 0-form (Tensor) by applying the CovariantHodgeDual operation,
resulting in a 4-form.

Obtain ⋆F from a 0-form (ExpressionForm) by applying the CovariantHodgeDual


operation, resulting in a 4-form.

Obtain ⋆F from a 4-form (ExpressionForm) by applying the CovariantHodgeDual


operation, resulting in a scalar.

141
Declare as a Tensor with Tensor as an additional argument.

If you do not specify the Indices, TensoriaCalc will automatically generate a set of
Unique Indicesfor the CovariantHodgeDual operation.

142
Development History

In version 0 of TensoriaCalc, this Function was already available. I have modified it to


use Mathematica’s HodgeDual7 Function. I have ensured that it can handle both scalar
Tensors and ExpressionForms. Additionally, I have included code for automatically
generating Indices code when they are not specified.

Code

First, apply RaiseAllIndices to the tensor, then use the HodgeDual function, and fi-
nally apply MoveIndices.

2.0.23 TensorWedge

The wedge product between a p-form Tensor α and a q-form Tensor β is defined as
follows:

α ∧ β = (−1)pq β ∧ α (2.88)

Usage

Using ∧ (esc+t+ˆ +esc) as the shortcut.


3 Tensor Sequence:
7
Flat Hodge dual, need to include an extra Metric and up to a power of minus sign difference due to
the contraction definition is different.

143
2.0.24 SymmetrizedArray

This Function allows users to transform TensorComponents from a List of Lists to a


SymmetrizedArray.

Usage

Let’s declare a Tensor with certain symmetry, and its TensorComponents are given as
a List of Lists.

Using SymmetrizedArray:

144
The TensorComponents are now in the form of a SymmetrizedArray, and the Ten-
sorSymmetry of the Tensor is updated accordingly.

2.0.25 Declare NonMetricTensor with SymmetrizedArray or

SparseArray TensorComponents

Now, we can use not only List of Lists or ExpressionForm as a TensorComponents to


declare a NonMetricTensor, but also SymmetrizedArray and SparseArray.

Usage

Declare a NonMetricTensor with SparseArray as its TensorComponents.

145
The methods of storing information differ.

Declare with SymmetrizedArray.

2.0.26 Normal

Normal is a Mathematica Function that has multiple functionalities. One of its appli-
cation is to convert a SymmetrizedArray or a SparseArray into a List of Lists.

146
You can directly apply it to a Tensor to convert its TensorComponents.

2.0.27 InteriorProduct

Definition

A q-vector X α and a p-form ωβ1 β2 ...βp . The operation to obtain their InteriorProduct
(ιX ω) returns a (p − 1)-form (p > q):

1 β1 ...βq
(ιX ω)βq+1 ...βp = X ωβ1 β2 ...βq βq+1 ...βp (2.89)
q!

In most scenarios, X would be 1-vector.

Usage

Consider a 1-vector X and a 2-form ω.

147
The order of X and ω can be swapped.
There is a shortcut using ι (iota).

If q = p, the output is a scalar ExpressionForm

By adding a third argument Tensor, you can declare the output as a Tensor.

Example 29: Demonstration of important formula of InteriorProduct in 3D

148
Declare two 1-vectors, X and Y , and a 2-form ω.

Show these anti-symmetric properties:

ιY ιX ω = −ιX ιY ω
(2.90)
ιX ιX ω = 0

The Cartan magic formula:

£X ω = d (ιX ω) + ιX (dω) (2.91)

Commutator of 2 vectors satisfies:

ι[X,Y ] = [£X , ιY ] (2.92)

149
2.0.28 MetricOperator

The MetricOperator is a new OptionValue for the Metric Function. It allows users to
specify the operator they want to apply to the metric TensorComponents itself. This
operator will be active when a Metric is declared with ExpressionForm TensorCom-
ponents or when calculating the Inverse Metric.

Usage

The default value of MetricOperator is Simplify.

150
Users have the option to provide additional conditions for Simplify or choose not
to perform any Simplify by providing this OptionValue.

Inverse Metric:

Specified MetricOperator when Inverse the Metric:

151
2.0.29 TensorAssumption

The TensorAssumption is a new property of a Tensor. When Simplify or FullSimplify


is applied to a Tensor, TensoriaCalc will search for the TensorAssumption property and
append it as an Assumption List to the Simplify or FullSimplify operation.

Usage

Declare a Tensor g that cannot be fully simplified without providing further assump-
tions.

After applying Simplify to it, there is no difference in the result.


Now, let’s declare a Tensor gT A with the TensorAssumption to make sin [θ] ≥ 0.

152
You can also use endow Function.

After extracting the Christoffel from g and applying Simplify, you can observe
that there are still Abs [sin [θ]] terms remaining in the result.

In comparison to this, after extracting the Christoffel from gT A and applying Sim-
plify, you can observe that there are no Abs terms anymore. This example demon-
strates that the TensorAssumption is inherited for all geometrical objects Tensors from
Metric.

153
TensorAssumption could be an important issue while calculating Orthonormal-
FrameField, as it involves the Sqrt.

If you provide TensorAssumption and then apply Simplify, the Sqrt will be ex-
panded.

154
2.0.30 TensorOperator and TensorIsZeroOperator

Similarly to TensorAssumption, TensorOperator is the property that can be specified


to have Assumption in Simplify or other types of operations. In version 1 of Tensori-
aCalc, it is only active in TensorIsZero. The default values of TensorIsZeroOperator
and TensorOperator in most Tensors are Simplify.

Usage

Let’s declare a 2-Sphere’s LeviCivita.

Let’s declare another Tensor, but remove Abs from TensorComponents.

Since they are not exactly the same, TensorIsZero’s output is False if we subtract
them.

If we provide the TensorIsZeroOperator with Simplify and include the Assump-


tion, it helps TensoriaCalc to recognize that they are the same in this region.

155
If the TensorIsZeroOperator is not provided, TensoriaCalc will search for the Ten-
sorOperator stored in the Tensors you plug into this Function. However, it is better
to ensure that every Tensor stores the same TensorOperator if you want to use this
strategy effectively.
Here is an example to endow both Tensors with TensorOperator, and we apply
TensorIsZero.

2.0.31 TensorDivision

Definition

In tensor calculus, there is no concept of division between tensors. However, there are
situations where we may want to determine whether two tensors are proportional to
each other and find the factor of proportionality κ.

Ak1 ...kN l1 ...lM = κB k1 ...kN l1 ...lM (2.93)

For example, in the Einstein field equations, the factor kappa may differ for different
types of stress–energy tensor.

Gµν = κTµν (2.94)

TensorDivision allows us to easily solve for the factor κ .

156
Usage

TensorDivision solves for the factor between the components of the left-hand side
Tensor and the right-hand side Tensor evaluating each component separately. If the
components are proportional to each other, and the factors are the same value for every
component, the output will be the value of the factor κ in ExpressionForm.
The TensorComponents of the left-hand side Tensor appear in the numerator, while
the TensorComponents of the right-hand side Tensor appear in the denominator.

If the factors of all component divisions can not be recognized as a single Expres-
sionForm, even after simplification, the output will be a Tensor that contains all factors
in their corresponding positions.

157
If a component in numerator is zero while the corresponding component in the
denominator is non-zero, the factor will be 0. This is because we multiply κ on the
right-hand side and any division involving zero will result in zero.

If a component in the denominator is zero while the corresponding component in


the numerator is non-zero, the factor will be Null (indicating no solution for κ). This is
because we multiply κ on the right-hand side and dividing by zero is undefined.

Example 30: Conformally flat Ricci tensor


In eq.(3.109), one can observe that the Ricci tensor is proportional to the metric
tensor in conformally flat spacetime.

158
Take 2-Sphere as an example. The metric is equal to the Ricci tensor multiplied by
the radius squared, r2 .

If users swap Tensor on the left-hand side and the right-hand side, the output will
be the reciprocal of the original result.
More example of TensorDivision can be found in Sec.(3.7.4) and Sec.(3.7.5).
Providing the TensorDivisionOperator helps TensoriaCalc to determine if the com-
mon factor is the same. If no TensorDivisionOperator is provided, TensoriaCalc will
search for a TensorOperator in the left-hand side Tensor and right-hand side Tensor.

Code

Extract the TensorDivisionOperator from the OptionValue, left-hand side Tensor or


right-hand side Tensor. Use MapThread to add Equal and κ on the right-hand side.
Use Map to solve for κ at a certain level (rank number). Then use Union to compare
each non-zero term.

2.0.32 SphericalHarmonicYTensor

SphericalHarmonicYTensor is a Function to declare a spherical harmonic Ylm as a


Tensor.

159
The definition and syntax are the same as Mathematica’s built-in Function, Spher-
icalHarmonicY.
One can also assign the eigenvalue parameters of SphericalHarmonicY l and m.

However, this Function may not be publicly available.

2.0.33 VectorSphericalHarmonic

Definition

The vector orthonormal basis on the 2-Sphere consists of 2 sets: Ail,m , Bl,m
i
. These ba-
sis vectors are known as vector spherical harmonics. VectorSphericalHarmonic helps
to declare a vector spherical harmonic as a Tensor.
The normalized vector spherical harmonics are defined as follows.


∇Y i m
Ai ≡√ l


l,m l(l+1)
(2.95)
ϵ̃ij ∂ Y m
i
≡√ i l

Bl,m

l(l+1)

The √ 1
is the normalization factor. Users can choose to declare a VectorSpheri-
l(l+1)

calHarmonic with or without this factor. The Ail,m set is what we call "Gradient" vector
i
spherical harmonic. The Bl,m set is what we call "Curl" vector spherical harmonic.

160
For saving calculation Timing, I have firstly calculated it and Simplify it to a com-
pact form (as follows) to avoid duplicated time-consuming Simplify calculation on
users’ side.

 
p
1  m cot [θ] Ylm [θ, ϕ] + e−iϕ
(l − m) (l + m + 1)Ylm+1 [θ, ϕ] 
Ail,m [θ, ϕ] = p  
l (l + 1)  2 m

im csc [θ] Yl [θ, ϕ]
(2.96)

 
1 im csc [θ] Ylm [θ, ϕ]
i
Bl,m [θ, ϕ] = p  
l (l + 1)
 
m+1
m −iϕ
p
− csc [θ] m cot [θ] Yl [θ, ϕ] + e (l − m) (l + m + 1)Yl [θ, ϕ]
(2.97)

Usage

Users need to provide one index as the first argument, either an upper or lower index.
Provide the value of l and m should be provided as the second and third arguments.
The fourth argument should specify the type of VectorSphericalHarmonic, which can
be either "Gradient" or "Curl". Additionally, users can provide the value of Normalize,
which can be either True or False. The default value of Normalize is True.
This is a demonstration to declare an abstract gradient VectorSphericalHarmonic
Tensor.

One can also set Normalize to be False.

161
Users can also declare a concrete VectorSphericalHarmonic.

The abstract curl one:

The concrete curl one:

162
The index can also be a lower index:

2.0.34 OperatorDistributeOverPlus and OperatorProductRule

In version 0 of TensoriaCalc, some Functions can handle a combination of scalar Expres-


sionForm a, scalar Tensor at, and TensorTensor Tij . We refer to this combination as
CombinedObjects. The term TensorTensor here refers to any Tensor object with rank-
> 0, for example, aAij + atBij . When an operator OP encounters CombinedObjects,
especially a differential operator, product rule should be triggered:

OP [arg1 _ _ _, f [x]T i1 i2 ...iN j1 j2 ...jM [x], arg2 _ _ _]

→ OP [arg1 _ _ _, f [x], arg2 _ _ _]T i1 i2 ...iN j1 j2 ...jM [x] (2.98)

+ f [x]OP [arg1 _ _ _, T i1 i2 ...iN j1 j2 ...jM [x], arg2 _ _ _]

Partial derivative as an example:

∂k f [x]T i1 i2 ...iN j1 j2 ...jM [x] =



(2.99)
i1 i2 ...iN i1 i2 ...iN

∂k (f [x]) T j1 j2 ...jM [x] + f [x]∂k T j1 j2 ...jM [x]

Or in TensoriaCalc language, PartialD.

PartialD[k− , f [x]T i1 i2 ...iN j1 j2 ...jM [x], g]

→ PartialD[k− , f [x], g]T i1 i2 ...iN j1 j2 ...jM [x] (2.100)

+ f [x]PartialD[k− , T i1 i2 ...iN j1 j2 ...jM [x], g]

This will be triggered when the Head is Times.

163
OP [arg1 _ _ _, CombinedObjects_Times, arg2 _ _ _] (2.101)

Here is an example that CombinedObjects’ Head is Times.

On the other hand, when CombinedObjects is the Times of Tensors, TensoriaCalc


will apply TensorsProduct to combine them into a single Tensor. Take atAij Bkl as an
example.

OP [arg1 _ _ _, Aij Bkl , arg2 _ _ _]


(2.102)
→ OP [arg1 _ _ _, TensorsProduct[atAij Bkl , Tensor], arg2 _ _ _]

The OutputBecomesOneTensor code will combine them into a single Tensor(See


here: 2.0.35).

→ OP [arg1 _ _ _, (at A ⊗ B)ijkl , arg2 _ _ _] (2.103)

Note that there is still a potential automatic sorting problem mentioned in Sec.(1.3.5).
The result may become (atB ⊗ A)klij . Users are suggested to combine them first in the
following way:

TensorsProduct[{at, Aij , Bkl } , Tensor]


(2.104)
→ (at A ⊗ B)ijkl

The combination of eq.(2.98) and eq.(2.102) is taken care by OperatorProductRule.


The Linearity Property is also included. Take ∂k (a (Aij + Bij )) as an example.

164
∂k (a (Aij + Bij )) = ∂k (aAij + aBij )
(2.105)
= ∂k (aAij ) + ∂k (aBij )

In TensoriaCalc, the processing order is a slightly different, but the results are the
same. The first equality is taken care by OperatorProductRule, as the Head is Times.

∂k (a (Aij + Bij )) = 
∂k(a)

(Aij + Bij ) + a∂k (Aij + Bij ) (2.106)

Now, the Head becomes Plus, and it will trigger OperatorDistributeOverPlus.

a∂k (Aij + Bij ) = a∂k (Aij ) + a∂k (Bij ) (2.107)

Here is the result:

Development History

In version 0 of TensoriaCalc, Yi-Zen built the code to handle eq.(2.100), not only for Par-
tialD, but also CovariantD, and other operators. Then, we realized that they shared

165
similar codes for product rule and linearity. However, whenever a new operator Func-
tion was implemented, we needed to add a new section of code for that specific Func-
tion to include the product rule and linearity. We were wondering if there was a more
efficient and compact way to declare the product rule and linearity for particular Func-
tions. So, I created the following command to make it possible. Now, with these short
pieces of code, we can declare them efficiently.

Because OperatorDistributeOverPlus’s code is short, I attach here. This code is a


Function that requires the name of the Function as its argument. It will declare another
Function that serves as the operator rule for the specified Function itself.
The idea behind this code is inspired by the object-oriented concept in languages
like JAVA. While developing Mathematica packages in an object-oriented environment
can be complex, here I have opted for a simpler approach without creating a full object-
oriented environment. In object-oriented languages, you can quickly inherit rules by
declaring the "type" of objects. I have tried to achieve a similar result by generalizing

166
OperatorProductRule and OperatorDistributeOverPlus into a standard forms that
can fit any operator, similar to eq.(2.98), so that other Functions can easily be assigned
to these operator rules.
Additionally, I have made OperatorProductRule and OperatorDistributeOverPlus
public, so users can use them to declare rules for custom Functions denoted as op.

OperatorProductRule:

In second term, you can observe how we handle a zero Tensor. In this scenario, we
will let it become 0 ExpressionForm. Then Mathematica will automatically discard it.
Here is an example to demonstrate that LieDerivative has OperatorProductRule
and OperatorDistributeOverPlus:

167
Let’s do it step-by-step:

£J + Ylm ≡ £J (x) +iJ (y) Ylm (2.108)

In TensoriaCalc,

LieDerivative[J (x) + iJ (y) , Ylm ] (2.109)

Since the Head is Plus, OperatorDistributeOverPlus will be triggered.

LieDerivative[J (x) , Ylm ] + LieDerivative[iJ (y) , Ylm ] (2.110)

The Head becomes Times.

Now OperatorProductRule will be triggered.

LieDerivative[J (x) , Ylm ] + iLieDerivative[J (y) , Ylm ]


(2.111)
((
((((Y m ]J (y)
+ LieDerivative[i,
(( ( (( l

168
The third term vanishes because we set that if the first argument is a scalar Expres-
sionForm, in this case, i, the output is 0.

2.0.35 TensorsProduct, TensorComponents and Operators’ Rules

In this section, I will explain the underlying techniques used in my work for program-
mer readers.
In the previous section (Sec.(2.0.34)), I introduce the concept of Operators’ Rules.
In this section, I will introduce more Operators’ Rules that extend the functionality of
TensorsProduct and TensorComponents. These rules allow them to handle even more
complex CombinedObjects.
First, I commented out the operator rules of TensorsProduct and TensorCompo-
nentsin TensoriaCalc. I will how TensorsProduct and TensorComponents are built
step-by-step.
Let’s start by declaring some Tensors as elements.

Use these Tensors to construct complicated CombinedObjects, involving scalar Ex-


pressionForm, scalar Tensor, TensorTensor, Plus of Tensors, Times of Plus, Times of
scalar and TensorTensor, Function of scalar Tensor and Function of contraction.

169
The first one is with Head Times. The second is with Head List. Here, the List
means Times, but a order preserved version. We mentioned before that when user
want to preserve the order of Tensors while TensorsProduct, they are suggested to use
List, to avoid Mathematica’s Orderless property of Times. In this example, you can
see the first output’s order has been swapped by Mathematica.
So how to deal with this complicated object? Let’s do it step-by-step.
For demonstration, I clear the operator rules of TensorsProduct. Now it does noth-
ing.

The first rule to be included is OperatorExpansion.

170
If Head is Times, and there is at least one Plus of TensorTensor inside it, it will ex-
pand the Times of Plus. The List one should work with OperatorDistributeOverPlus,
or there will be an infinite loop.
Next, let’s include the OperatorDistributeOverPlus.

171
Now one term is well expanded into 4 terms.
Include OperatorFactorOutScalar.

172
This is an important step. This separates different types of objects so that we can
deal with them case-by-case.
Although the output is a bit lengthy, if you focus on the TensorTensor part, you
can observe that TensoriaCalc also performs TensorsProduct to combine scalar Times
TensorTensor into a single Tensor in List version. This will be finished once we declare
OutputBecomesOneTensor.
Let’s separately deal with each part.
Include OperatorExpressionFormReturnItself.

173
This rule will do nothing and return itself if the input is an ExpressionForm.
Include OperatorThreadThroughFunction.

This rule will thread through the Function cover around a scalar Tensor. The

174
Function can be any except Plus, Times, List, Tensor, and Function’s name itself
(TensorsProduct).
Include OperatorTensorReturnItself.

When the input is a single Tensor, it returns itself.


Include OperatorContractThroughFunction.

This will thread through Function and operate TensorsProduct when there are Ten-
sors to be contracted.

175
Include OperatorTensorsProduct.

This operates Mathematica’s TensorProduct when there are Times of TensorTen-


sors.
At this point, let’s take a look at TensorsProduct[CombinedObjects].

This is well done.


How about List version?

176
We still need to declare OutputBecomesOneTensor.

This will combine any CombinedObjects in to a single Tensor, following this pat-
tern.

TensorsProduct[CombinedObjects, Tensor] (2.112)

Now we can see the List version output.


This is well done, with the correct order.
I also modified a code for TensorName to extract TensorName
from CombinedObjects. If you feed CombinedObjects all at once, it will look like:

177
For TensorsProduct, there is no code for itself. Everything about TensorsProduct is
defined through operator rules.
In contrast, TensorComponents has its own code. It tells TensoriaCalc how to extract
the TensorComponentswhen the Head is Tensor.

Now, since I have cleared the operator rules of TensorComponents, at this point, it
cannot deal with CombinedObjects.

Now, let’s declare the following operator rules.

178
Now we can see TensorComponents[CombinedObjects] is well done. (I won’t show
the entire output since it is lengthy.)

The way to declare the operator rules is easy and requires no additional effort!
There are still two rules haven’t been declared. OperatorRemoveSingleCompo-
nentList is to discard the List if there is only one Tensor inside it.

179
OperatorNullList is used to return 1 if there is only a Null List.

2.0.36 Declare scalar as Tensor after operation

Some operators require TensorTensor, and the rank of the output may change. By de-
fault, TensoriaCalc will discard all information about this output except its TensorCom-
ponents and directly print its TensorComponents when it changes into rank-0 (scalar).
When user want to declare the output as a Tensor, they should use this pattern.

OP [input__, Tensor] (2.113)

example for TensorsProduct.

180
Add Tensor as the second argument.

example for InteriorProduct:

example for RicciScalar:

example for Determinant:

181
example for CovariantHodgeDual:

2.0.37 Conjugate for Tensor

Conjugate is a Mathematica built-in Function. It applies complex conjugate to both


scalar ExpressionForm and List of Lists. Now it can directly be applied on Tensor.
Let’s declare a complex Tensor and apply Conjugate.

182
Utilize the TensorAssumption.

Conjugate has 2 operator rules: OperatorDistributeOverPlus and


OperatorThreadThroughTimes, which help it deal with Head Plus
and Times CombinedObjects. OperatorThreadThroughTimes is a rule
that allows Conjugate to thread through every object in Times.

2.0.38 TensorComponentsManipulation

I have implemented Mathematica Functions that manipulate ExpressionForm or List


of Lists. The following functions are now implemented: Expand, ExpToTrig, TrigTo-
Exp, TrigReduce, ComplexExpand, FunctionExpand and PowerExpand. These Func-
tions can be applied to the TensorComponents of a Tensor.

183
The TensorComponentsManipulation Function is an operator’s rule. The declara-
tions of rules are:

I will do 2 demonstrations here.


Expand:
Declare a Tensor with binomial Power.

Expand it.

ExpToTrig:
Declare a Tensor with exponential.

184
Apply ExpToTrig:

2.0.39 error Message

While TensoriaCalc detects user’s input may in a wrong form, an error Message will
pop up. This helps users to find out the problem to be fixed more easily. Now, there
are 4 internal Functions that will return Message, TestDifferentialForm, TestDiffer-
entialVector, TestQuadratic, TestMetricTensor,TestOneVector.
If users do not input the ExpressionForm in quadratic form when declaring Metric,
an error Message will pop up.

Normally, TestDifferentialForm and TestDifferentialVector would not stop the


operation even though the message pop up.

185
In this example, TestDifferentialForm is triggered during the operation of Exteri-
orD. Since the TensorComponents of βνγ are incomplete integral, Mathematica cannot
determine if this is an anti-symmetric tensor. That is the reason the error message pops
up. TensoriaCalc still proceeds to calculate its ExteriorD.

2.0.40 ElectromagneticStressEnergyTensor

Definition

ElectromagneticStressEnergyTensor is a Function used to calculate the electromag-


netic stress–energy tensor. This Function may not be public.

 
αβ αµ β 1 αβ µν
T = σg F F µ − g Fµν F (2.114)
4

Usage

Users should provide a Faraday Tensor with TensorType→"Faraday" as the first argu-
mentand the Metric Tensor as the second argument. They can also provide the Op-
tionValue of MetricSignature if needed, where the value can be either "Mostly minus"
or "Mostly plus". The default value is "Mostly minus".
Let’s declare the Faraday Tensor and the Metric Tensor.

186
MetricSignature→"Mostly minus":

MetricSignature→"Mostly plus":

187
Chapter 3

Stories in Physics

I have covered all the important functionalities of TensoriaCalc. Although due to the
limitation of the thesis length, I couldn’t cover all the details. However, these Func-
tions are sufficient to handle many applications in Physics. In this chapter, I will
demonstrate how to use TensoriaCalc to tell some classic "stories" in Physics. Through-
out the process, a single story may involves multiple Functions in TensoriaCalc.

3.1 Story: Symmetry in S2-SO(3) symmetry

SO(3) symmetry is a fundamental symmetry that arises in various physical systems.


Whenever a system exhibits spherical symmetric, it exists an underlying SO(3) sym-
metry.
For example, the wave function of an electron in a Hydrogen-like atom is spheri-
cally symmetric. This symmetry allows us to perform a separation of variables to ob-
tain the radial and angular wave functions independently. The symmetry also causes
a degeneracy in electron’s energy level. The breaking of symmetry in the sub-leading
order term of the interaction in a Hydrogen-like atom leads to the existence of the fine
structure. This fine structure arises due to relativistic effects and spin-orbit coupling,
which introduce corrections to the leading order spherically symmetric Coulomb inter-
action. These corrections give rise to energy splittings and additional spectral features
in the atom’s spectrum, providing a more detailed understanding of its behavior.
In quantum mechanics, the angular momenta in 3D Cartesian are given by:

189
J (i) = ϵijk X j Pk = −iϵijk xj ∂k (3.1)

where each term is defined as:

J (x) = −i (y∂z − z∂y )

J (y) = −i (z∂x − x∂z ) (3.2)

J (z) = −i (x∂y − y∂x )

These 3 angular momenta correspond to the 3 rotation symmetries in 3D Cartesian.


In total, there are 6 symmetries in 3D Cartesian, including 3 rotation symmetries and 3
translation symmetries.
The 3 translation symmetries also correspond to 3 conserved quantities, momenta
P in 3 directions.

Pk = −∂k (3.3)

where each term is:

Px = −i∂x

Py = −i∂y (3.4)

Pz = −i∂z

In this story, I will show that these 3 rotation symmetries are shared within the
2-Sphere which is embedded in 3D flat space.
Let’s declare the 3 angular momenta in 3D Cartesian:

190
Next, project the angular momenta onto S2 .

The angular momenta are purely in angular direction so there is no radial com-
ponent of the vector loss during the projection. How do we know? Try to do a Co-
ordinateTransformation to spherical coordinates. You can observe that there is no
r-direction component.
The projection can also start from the angular momentum in (3+1)D Minkowski
spacetime, which corresponds to rotational symmetries in SO[3,1] symmetry group.

191
The rotation symmetries here are contained in SO[3,1] symmetries. The continuous
SO[3,1] symmetries, which include the rotation and boost symmetries, combined with
translation symmetries, form the Poincaré group. This group describes all the sym-
metries in local (3+1)D spacetime we live in, or it describes symmetries in the global
(3+1)D Minkowski spacetime.
The conserved quantities, angular momenta in 3 directions, are also shared in de
Sitter spacetime due to its isometric property. The symmetries in de Sitter spacetime
are discussed in Sec.(3.6.2).
Again, let’s proceed to project the angular momenta from (3+1)D Minkowski space-
time to 2-Sphere.

192
Then, declare the 2-Sphere Metric through induced Metric CoordinateTransforma-
tion.

Calculate the LieDerivative of Metric along the 3 angular momenta vectors.

By verifying that the LieDerivatives of the 2-Sphere Metric along these vectors are
zero, we can conclude that the 3 vectors are Killing vectors.

193
Hence, the 3 angular momenta vectors are Killing vectors on S2 .
Let’s test one of the Lie algebra relations of SO(3):

 (x) (y) 
J ,J = iJ (z) (3.5)

To generalize, we can test all the Lie algebra relations of SO(3):

 (i) (j) 
J ,J = iϵijk J (k) (3.6)

Next, let’s see how the angular momentum operator acts on a wave function: f .

194
The story of SO(3) in quantum mechanics has reached a temporary conclusion.
Now, let’s multiply i back to the vectors.

I will now demonstrate the existence of 3 conserved quantities in 2-Sphere from the
perspectives of classical physics and differential geometry’s point of view. The first
step is to calculate the affinely parametrized Lagrangian in 2-Sphere.

195
∂Lg
∂ ż a
(where z = (θ, ϕ)):

Due to Noether’s theorem, a Killing vector ξ corresponds to a conserved quantity


along the geodesic z:

∂Lg
ξ a (z) (3.7)
∂ ż a

These 3 conserved quantities are angular momenta in 3 directions.

196
We can calculate L2 ≡ Lx 2 + Ly 2 + Lz 2

If we establish the conjugate momenta in Hamiltonian dynamics:

The results are the angular momenta in classical mechanics. By replacing the mo-
menta with the corresponding quantum momentum operators, we can recover the pre-
viously obtained results.

197
3.2 Story: Vector calculus in spherical coordinates in or-

thonormal basis

In many introductory physics textbooks for physics students or engineer, vector cal-
culus operators such as speed, gradient, divergence, and curl are often presented in
orthonormal basis. This approach has its advantages and disadvantages. One benefit
is that it allows for easy comparison of components in different directions. However,
a drawback is that it loses its covariance property, making it challenging to perform
coordinate transformations to other coordinate systems without involving the basis
vectors. For beginners, it is not straightforward to derive these vectors in different co-
ordinate systems, and understanding how to calculate the divergence of a vector in an
orthonormal basis system can be difficult.
To illustrate this, let’s start by declaring a spherical coordinate system Metric.

The change of coordinates in orthonormal basisare speed.

The gradient in a covariant form.

198
(gradf )i = ∇i f (3.8)

The gradient in orthonormal basis.

A vector in orthonormal basis.

The divergence in coordinate basis:

(divA) = ∇i Ai (3.9)

199
The curl of vector in coordinate basis:

(curlA)i = ϵijk ∂j Ak = (⋆dA)i (3.10)

(3.11)

in orthonormal basis:

⃗ 22 f = □S2 f = ∇i ∇i f
∇ (3.12)
S

200
However, in textbook, the vector A are in orthonormal basis. Let’s compare the
operations involved with A.
Declare the Rules to transform the component of A from orthonormal basis into
coordinate basis.

Transform divergence in orthonormal basis found in textbooks into coordinate ba-


sis:

Compare our result with textbooks’.

Transform curl in orthonormal basis found in textbooks into coordinate basis:

201
Compare our result with textbooks’.

3.3 Story: Maxwell’s equations: From 3D vector calcu-

lus to 4D tensor calculus in the differential form lan-

guage

In this section, we will utilize TensorEquations, ExteriorD and CovariantHodgeDual


to derive all Maxwell’s equations. This demonstrates the power of TensorEquations.
First, let’s declare the Faraday Tensor and the Minkowski Metric Tensor.

202
The first set of Maxwell’s equations (Poincaré’s Lemma) is:

dF = 0 (3.13)

This can also be written in the form of the Bianchi identity.

∂γ Fαβ + ∂α Fβγ + ∂β Fγα = 0 (3.14)

You can observe that the output is an Equal List with a Length of 8.

203
You can also see one of the tasks that TensorEquations performs. It will Delet-
eDuplicates in a List. A 3-form in 4D has 43 = 4 independent components, and a


rank-3 4D tensor has 43 = 64 components. However, since TensorEquations does not


automatically apply FullSimplify to the expressions, the output contains eight com-
ponents, which is twice of the number of independent components. Each independent
component equals zero. There are opposite of them due to the fully anti-symmetry of
the 3-form.
Let’s FullSimplify and DeleteDuplicates again.

Obtain ⋆F first.

The second set of Maxwell’s equations is:

⋆d ⋆ F = J (3.15)

Obtain the left-hand side.

204
and the right-hand side, the source.

Combine them:

This is equivalent to

∇µ F µν = J ν (3.16)

Now, let’s return to the 3D vector calculus version.


We declare the 3D Cartesian Metric Tensor, E field and B field as follows:

205
Gauss’ Law:

⃗ ·E
∇ ⃗ = ∇i Ei = ρ (3.17)

Magnetic Gauss’ Law:

⃗ ·B
∇ ⃗ = ∇i Bi = 0 (3.18)

Faraday’s Law1 :

 i
⃗ ×E
∇ ⃗ + ∂t B i = 0 (3.19)

1
The upper index is equivalent to lower one in 3D Cartesian.

206
Ampère’s Law:

 i
⃗ ×B
∇ ⃗ − ∂t E i = J i (3.20)

Let’s demonstrate that the first set of Maxwell’s equations described in 4D differ-
ential geometry is equivalent to the 3D Cartesian Magnetic Gauss’ Law and Faraday’s
Law (source-free equations).

The second set of Maxwell’s equations described in 4D differential geometry is


equivalent to the 3D Cartesian Gauss’ Law and Ampère’s Law (with source).

207
3.4 Story: Kerr-Newman black hole

3.4.1 Kerr–Newman metric is an solution of Einstein-Maxwell equa-

tions

The Kerr–Newman metric describes the spacetime around a charged rotating static
black hole, with charge e and Kerr parameter a. The meaning of a is the same as that
of a Kerr black hole’s (Sec.(1.3.2)).
Now let’s declare the Kerr–Newman Metric Tensor in Boyer–Lindquist coordi-
nates.

In comparison to the Kerr black hole, the Kerr Metric and Kerr–Newman Metric
in Boyer–Lindquist coordinates share the same definition of ∆ = ρ2 . However, the
Kerr–Newman Metric has an additional term due to the presence of electric charge e

208
in natural units. By setting e = 0 in the Kerr–Newman Metric, you can obtain the Kerr
Metric.
The electromagnetic potential 1-form Aµ is defined as follows:

We can obtain Faraday Fµν through ExteriorD.

F = dA (3.21)

Now ,let’s first test the vacuum Maxwell’s equation.

∇µ Fµν = J ν = 0 (3.22)

The condition J ν = 0 implies that there is no charge/current density ρ and J i


present in the spacetime around the black hole.

209
This index notation is equivalent to the following differential form language.

⋆d ⋆ F = J = 0 (3.23)

where ⋆ is CovariantHodgeDual and J here is current density in 1-form.

As a reminder, this Maxwell’s equation correspond to the 2 Maxwell’s equations in


the language of flat vector calculus:

⃗ ·E
∇ ⃗ = ρ (Gauss’ Law) (3.24)
⃗ ×B
∇ ⃗ − ∂t E
⃗ = J⃗ (Ampère’s Law) (3.25)

The other Maxwell’s equation in the differential form language.

dF = 0 (3.26)

210
The additional ⋆ is to convert a 3-form into a 1-form. You can see this result is due
to the Poincaré’s Lemma d2 = 0 from the TensorName ddA.
this Maxwell’s equation correspond to the rest 2 Maxwell’s equations in the lan-
guage of flat vector calculus:

⃗ ·B
∇ ⃗ = 0 (Magnetic Gauss’ Law) (3.27)
⃗ ×E
∇ ⃗ + ∂t B
⃗ = 0 (Faraday’s Law) (3.28)

There are 2 invariants

 
Fab F ab = ⃗ 2 − |B|
˙ − 2 |E| ⃗ 2 (3.29)

Fab ⋆ F ab = ⃗ ·B
˙ − 4E ⃗ (3.30)

The Einstein Tensor(left-hand side of Einstein-Maxwell equations):

211
The electromagnetic stress energy tensor (in right-hand side of Einstein-Maxwell
equations):

 
αβ αµ β 1 αβ µν
T = σg F F µ − g Fµν F (3.31)
4

This is equivalent to

212
Let’s test the Einstein-Maxwell equations

Gαβ = 2T αβ (3.32)

This implies True through all comparison component-by-component.

3.4.2 Constants of Motion of a free-falling particle around

Kerr–Newman black hole

The constant of motion implies that there is a symmetry behind the geometry of the
spacetime. For a free-falling particle in an analytic curved spacetime, its geodesics can
be determined if there are enough constants of motion.
First, let’s declare the Kerr–Newman Metric Tensor again but this time with a dif-
ferent configuration for the starting point comparing to the previous section. We Clear
the assigned value of ρ and ∆. It is best not to substitute the values too early to avoid
complicating the ExpressionForm for both users and Mathematica. Most geometrical

213
objects’s operator are id2 instead of F S (FullSimplify).We also disable trigonometric
simplification in FullSimplify.

The inverse of Metric:


2
id here means taht we keep the applied objects untouched instead of performing simplification.
Caution: the result of FullSimplify in Mathematica can be quite chaotic and strongly dependent on
initial configuration. This is especially true when dealing with a complex ExpressionForm. If you
attempt to reproduce my calculation, please ensure that you have an identical configuration.

214
Geodesic Lagrangian

1
L = gµν (xα ) ẋµ ẋν + ϵẋµ Aµ (3.33)
2

The conjugate momentum defined in Hamiltonian dynamics is:

 
1
pµ ≡ ∂ẋµ L = ∂ẋµ gµν (xα ) ẋµ ẋν + ϵẋµ Aµ = gµν (xα ) ẋν + ϵAµ (3.34)
2

By choosing the affine parameter λ, we obtain the first constant of motion µ

1 1 1
H = gµν (xα ) ẋµ ẋν = g µν (xα ) (p − ϵA)µ (p − ϵA)ν = − µ2 (3.35)
2 2 2

The dot on x represent derivative with respect to the proper time τ = µλ, where µ
is the rest mass of the free-falling particle, and ϵ is the charge of the particle. H is the
Hamiltonian of the particle. L is the Lagrangian
From one set of the Hamilton’s equations:

 
1
ṗα = −∂α H = −∂µ gµν (xα ) ẋµ ẋν
2
  (3.36)
1 µ ν
=− ẋ ẋ ∂α (gµν (xα ))
2
We can see, for given α = z

∂z (gµν (xα )) = 0 (3.37)

215
implies

pz = Constant of Motion (3.38)

Now we calculate ∂t (gµν (xα ))

This show the absence of coordinate t in the Metric. Let’s examine all 4 coordinates
of Boyer–Lindquist coordinates.

Metric is also independent on ϕ. We find yet another 2 constants of motion.



pt ≡ −E

(3.39)

p ϕ ≡ l

E 3 stands for energy, and l stands for angular momentum.


3
In Mathematica, the symbol E is reserved for Euler’s number, so I named it as En

216
Now we have 3 constants of motion. These are exactly the same as the constants of
motion in Schwarzschild black hole. If you are familiar with determining the geodesic
of a free-falling particle around a Schwarzschild black hole or a Reissner–Nordström
black hole, you may ask: "Can we determine the geodesic of a particle around the
Kerr–Newman black hole with these 3 constants of motion?" The answer is no. In
the case of Schwarzschild black hole and Reissner–Nordström black hole, determining
the geodesic of a particle require only 3 constants of motion, excluding the charge
of particle ϵ. However, for all 4 type of static black holes, there are 4 constants of
motion. The reason why geodesic of these 2 black holes only requires 3 constants of
motionis that the fourth constant of motion reduces to l2 on the equatorial plane. To
determine a particle moving on equatorial plane only require 3 constant of motion.
On the other hand, to determine a particle out of the equatorial plane requires four.
Fortunately, due to the spherical symmetry property of the Schwarzschild black hole
and Reissner–Nordström black hole, we can always rotate the coordinate system so
that the geodesic lies on the equatorial plane.
The forth constant of motion correspond to a hidden symmetry of
Kerr–Newman black hole which is not so obvious to find out. Now, let’s try to discover
it.
First declare the conjugate momentum Tensor in eq.(3.34).
The Hamiltonian is:

1
H = g µν (p − ϵA)µ (p − ϵA)ν (3.40)
2

Collect pr and pθ .

217
The first term is in square of pθ and the second term is in square of pr . Notice that
there is no cross term pr pθ . Which implies that we can write H in this separable form:

H = KEr [r, θ, pr ] + KEθ [r, θ, pθ ] + V [r, θ] (3.41)

Since there is a separability. Hamilton-Jacobi theory is useful for solving the forth
constant of motion.
If we can find a solution of the Hamilton-Jacobi equation:

K = H (xµ , pµ = ∂µ F2 ; λ) − ∂λ F2 = 0 (3.42)

We transform into a new coordinate system with a new Hamiltonian K, using the
second type generating function F2 . The transformed new coordinate system {Qµ , Pµ }
satisfy all conserved quantities conditions in new Hamilton’s equations:

∂Pµ K = Q̇µ = 0
(3.43)
−∂Qµ K = Ṗµ = 0

The solution of Hamilton-Jacobi equation has the following property:

pµ = ∂µ F2 (3.44)

Combine with:

218

H ≡ − 12 µ2







pt ≡ −E (3.45)





p ϕ ≡ l

We obtain

1
F2 = − µ2 λ − Et + lϕ + F2 (r) [r] + F2 (θ) [θ] (3.46)
2

substitute all this into new Hamiltonian.

Multiply 2ρ

Now we can substitute the value of ρ and ∆.

219
At this point, the remaining work only involves algebraic calculation and does not
require the use of Functions in TensoriaCalc. Therefore, I will provide the intermediate
calculation steps in the Appendix 5.0.3. The result is:

F2 ′θ (θ)2 + µ2 a2 cos2 (θ) + (l csc(θ) − aE sin(θ))2


2
(a2 E − al + Er2 )
= −F2 ′r (r)2 a2 + e2 + r(r − rs ) + 2 − µ2 r 2

(3.47)
(a + e2 + r(r − rs ))
=K

Since it is a differential equation where the left-hand side only involves θ and the
right-hand side only involves r, both side should equal a constant K.
Substitute eq.(3.44),

pθ = ∂θ F2 = F2 ′θ (θ) (3.48)

we can obtain:

K = p2θ + µ2 a2 cos2 (θ) + (l csc(θ) − aE sin(θ))2 (3.49)

K is the fourth constant of motion of the Kerr–Newman black hole, discovered by


Carter in 1968. It is known as Carter constant, named after him.
You may wonder why we don’t use the r part to define the Carter constant since
it also equals K. The reason is that the expression of the r part will vary in different
coordinate systems of the Kerr–Newman black hole. However, when starting from
other coordinate systems, the Carter constant will appear exactly the same in terms of

220
θ and pθ . This universality extends to the results in all axially symmetric coordinate
systems of the Kerr metric.
If you start from the Boyer–Lindquist coordinates with advanced time
{u, r, θ, φ}, where


dt = du − (r +a ) dr
 2 2


(3.50)
a

dϕ = dφ −
 dr

You will end up obtaining this:

F2 ′θ (θ)2 + µ2 a2 cos2 (θ) + (l csc(θ) − aE sin(θ))2

= 2F2 ′r (r) a2 E − al + Er2 − a2 + r(r − rs) F2 ′r (r)2 − µ2 r2 (3.51)


 

=K

In comparison to eq.(3.47), this result in r part is different but same in θ part.


At this point, we obtain four constants of motion of a particle around the
Kerr–Newman black hole, i.e., µ, E, l and K. The rest part of the story is, with 4 de-
termined constants of motion. The geodesic of a particle can be obtained. However, I
will stop here. For reader who interest in could refer to Carter’s paper (1968)[5] and
the thesis written by P.C. van der Wijk (2007)[6].
In Sec.(2.0.16), I mentioned due to Noether’s theorem. If people find a Killing ten-
sor, that implies the existence corresponding conserved quantity. Here I will show
that a Killing tensor is found in Kerr spacetime, which is corresponding to the Carter
constant.
First declare a Kerr Metric in Boyer–Lindquist coordinates.

221
and the inverse Metric:

The Killing tensor is defined by 2 vectors: lµ , nν and inverse metric g µν .

222

 2 2 
µ r +a a




 l = ∆
, 1, 0, ∆

  2 2 
n =ν r +a ∆ a
, − 2Σ , 0, 2Σ (3.52)
 2Σ



K µν = Σl{µ nν} + σg r2 g µν

Let’s calculate the left-hand side of the following Killing equation.

∇{α K µν} = 0 (3.53)

It’s zero.

223
Let’s calculate the corresponding conserved quantity.

K = K µν pµ pν (3.54)

declare the rest mass µ:

µ2 = −σg g µν pµ pν (3.55)

Declare the Carter constant K.

224
This shows that the conserved quantity generated by the Killing tensor is really
Carter constant.

I show the Carter constant in Schwarzschild black hole or on equatorial plane. As I


discuss previous (See here: 3.4.2).

We can try Kerr–Newman one.

225
I skip the intermediate steps. The result is still the same:

Here are the intermediate objects that involve with e:

226
3.5 Story: Linearized gravity

The Minkowski spacetime describes the local symmetry of spacetime or a true vacuum
even without any coordinate singularity. However, General Relativity is developed to
describe how matter affects spacetime. The right-hand side of Einstein equation can’t
be always be vacuum ,since it represents the presence of matter and energy. Testing
General Relativity in extreme cases, such as the spacetime around a black hole or cap-
turing gravitational waves from distant binary systems, is challenging. A practical way
for experimental physicist to test General Relativity is within the solar system, where
the gravitational field is weak. In this regime, the effects on spacetime are not too far
from flat spacetime, and the speeds of matter are significantly lower compared to the

227
speed of light. To describe such a spacetime, the first step is to add a small perturbation
to the Minkowski Metric.

gµν = ηµν + hµν (3.56)

Where the norm of hµν should be much less than ηµν


The Frobenius norm:

p
∥h∥2,2 ≡ Tr [hT h] ≪ ∥η∥2,2 = 2 (3.57)

The Einstein tensor:

1
∂α ∂{ν hαµ} − ∂ 2 hµν − ∂µ ∂ν h − ηµν ∂α ∂β hαβ + ηµν ∂ 2 h

Gµν = (3.58)
2

where h is the trace of hµν

h ≡ Tr [hµν ] = hµµ (3.59)

Consider a trace-reversed perturbation

1
h̄µν ≡ hµν − ηµν h (3.60)
2

The trace of h̄ is zero. Now Einstein tensor become:

1
∂α ∂{ν h̄αµ} − ∂ 2 h̄µν − ηµν ∂α ∂β h̄αβ

Gµν = (3.61)
2

Consider de Donder gauge condition:

∂α h̄µα = 0 (3.62)

The Einstein tensor become:

228
1
Gµν = − ∂ 2 h̄µν (3.63)
2

Now the Einstein field equations is:

∂ 2 h̄µν = −16πGN Tµν (3.64)

The wave operator ∂ 2 is correspond to 4D Minkowski spacetime. With its Green’s


function:

1 h i
G [x, x′ ] = δ t − t′ − |⃗x − x⃗′ | (3.65)
4π|⃗x − x⃗′ |

We can solve h̄µν :

 
Z Tµν ′ ⃗′
t − t − |⃗x − x |
h̄µν = −4GN d3 x⃗′ (3.66)
|⃗x − x⃗′ |
in far-zone limit.
if we do a multiple expansion,

1 1 x′k xk
+ 3 + O r−5
 
= (3.67)
|⃗x − x⃗′ | r r

the leading order term is:


= − 4GrN M

h̄00




  
h̄0i = − 2G N ⃗
L × ⃗
x (3.68)
r3


 i


h̄ij
 =0

The M represents total mass and L represent total angular momentum.

Z  
M= d x ρ x⃗′
3 ⃗′
(3.69)

229
Z  i
i 3 ⃗′

L = d x x × p⃗ x⃗′

    (3.70)
pk x⃗′ ≡ T k0 = ρv k x⃗′

3.5.1 Newtonian gravity

The potential in Newtonian gravity is:

GN M
Φ=− (3.71)
r

Combine with eq.(3.68), now we can write:

h̄00 = 4Φ (3.72)

by assuming stress is isotropic (hxx = hyy = hzz ), we can obtained:

h00 = −h00 = 2Φ

hii = −hii = 2Φ, i = x, y, z


(3.73)
µν
h = η hµν = −4Φ
1
h00 − η00 h = 2Φ + 2Φ = 4Φ = h̄00
2
For a bounded object in weak field, its kinetic energy has the same magnitude as its
potential energy.

1
mΦ ∼ mv 2 (3.74)
2

That’s implies

Φ ∼ v2 ≪ 1 (3.75)

The linearized gravity requires non-relativistic limit.

230
The angular momentum of object in solar system is not large enough to observe its
effect in Newton’s time and even not easy to observe without conducting dedicated
experiments now.
Let’s assume

⃗ =0
L (3.76)

Now we have the metric:

(dτ )2 = (1 + 2Φ (⃗x)) (dt)2 − (1 − 2Φ) (d⃗x)2 (3.77)

Let’s declare it as a Tensor:

When we declare any small quantity in TensoriaCalc, we often add an ϵ, for the
convenience of Series expansion.
The Einstein Tensor:

Since speed is consider to be small

231
pi = ρv i ≪ ρ, for given i (3.78)

Let’s ignore pi first.


The stress–energy tensor is declared as following, and the Einstein field equations
is:

At this point, we obtain Newton’s law of universal gravitation.

⃗ 2 Φ (⃗x) = 4πGN ρ (⃗x)


∇ (3.79)

3.5.2 Gravitoelectromagnetism

⃗ again.
Let’s consider the effect of angular momentum L

GN  ⃗ 
Ai = − L × ⃗
x (3.80)
2r3 i

2GN  ⃗ 
h̄0i = − L × ⃗
x = 4Ai (3.81)
r3 i

Now we can write:

h̄0µ = 4Aµ (3.82)

declare h̄0µ

232
where Aµ is the gravitoelectromagnetic 4-potential

Aµ = (Φ, Ai ) (3.83)

Apply PartialD on the both sides of eq.(3.82)

∂ µ h̄0µ = 4∂ µ Aµ = 0 (3.84)

by utilizing the de Donder gauge, it now becomes the Lorenz gauge.

⃗ independent to t. This implies ρ and


After seeing this feature, we assume Φ and A
⃗j are also static.

233
We can now write down the gravitational version of E and B field

 
⃗ ⃗ ⃗
Eg = −∇Φ − ∂tA
 (3.85)


B⃗g = ∇
⃗ ×A
⃗ (3.86)

calculate h0i

h0i = hi0 = h̄0i = 4Ai = −4Ai (3.87)

Now we can declare the Metric:

The use of id here is important because Simplify in Mathematica could be time-


consuming. The calculation may not be finished easily if we use Simplify.
Let’s perform a Series expansion of the Metric. It also expands all internal objects
such as Riemann tensor. By performing a Series expansion on Metric first, before
extracting the Einstein Tensor, you can significantly reduce the computational burden,
especially on older computers with relatively low calculation abilities. This can be a
critical step to ensure smooth and efficient calculations in such cases.

234
We can check if the inverse one is correct:

The linearized Einstein Tensor:

Due to the absence of t in Φ, the Lorentz gauge now become Coulomb gauge:

∂i Ai = 0 (3.88)

We can use it as a rule to replace mixed derivative terms in the TensorComponents


of the Einstein Tensor.

235
The source is assumed to be static:

Now we obtain the Poisson equations:

⃗ 2 Aµ = 4πGN j µ
∇ (3.89)

The next steps is to solve the equations of motion.


Extract the non-affinely parametrized geodesic equations. This will allow us to
solve for the acceleration. Then expand ϵ and discard it.

236
Declare E⃗g , B⃗g , ⃗z, ⃗z˙ and ⃗z¨ in terms of Φ, A,
⃗ ⃗ż

237
Now we obtain the gravitational version of Lorentz Force (divided by mass m):

F⃗g ¨ m  ⃗ 
=
˙ ⃗z = z˙ × B
 Eg + 4⃗ ⃗g (3.90)
m m

Comparing to the electromagnetic one:

F⃗EM q ⃗ 
= ⃗z¨ = E + ⃗z˙ × B
⃗ (3.91)
m m
In the comparison of 2 versions of Lorentz force, it can be noticed that they are
almost the same except for a factor difference.

238
The E⃗g represents the Newton’s gravitational field. The mass can be interpreted
as the gravitational version of charge, denoted as m=q
˙ g . For particles with non-zero
mass, qg is always positive. If we consider two particles with positive m = qg , they
will attract each other. On the other hand, if we consider two particles with positive
charge q, they will repel each other. Although the sign of two version of E field con-
tributes to the force is the same, the way charges produce these field is opposite to each
F⃗
other. The term Bg
m
= 4⃗z˙ × B⃗g is a new prediction that deviates from Newton’s gravity.
This makes gravitoelectromagnetism part of the first post-Newtonian (1PN) correction
in General Relativity. The source to generate gravitomagnetic force should also acts
opposite from electromagneticone. Why? In fact, the first discovery of gravitoelec-
tromagnetism was not from linearized gravity. The history can dates back to 1893.
However, it was not easy to detect experimentally, and its significance was recognized
again with the "Gravity Probe B" experiment conducted from 2004 to 2005.
The starting point is a thought experiment. Consider 2 charges with the same mass
m and the same charge q, separated by a distance r. In the frame of reference A, these
charges are absolutely stationary. By tuning the ratio of m and q appropriately, we can
ensure that the gravitational attractive force cancels out the electric repulsive force.

 kq 2
2
⃗ GN m (3.92)
Ftotal = − 2 r̂ + 2 r̂ = 0

r r
√ √
if m : q = k: GN .
Now, let’s consider a boost to another frame B with a direction perpendicular to
r̂. In frame B, the distance r between the two charges remains the same since we
are boosting perpendicularly. However, in frame B, the two particles now move in
the same direction and generate the same directional current j. This will provide an
additional magnetic attractive force.

 kq 2
GN m2 (3.93)
F⃗total = − 2 r̂ + 2 r̂ − FBEM r̂ = −FBEM r̂ ̸= 0
r r
How is it possible that for a finite boost (which can be much smaller than the speed

239
of light), the two particles remain stationary in frame A but get closer and closer in
frame B?
The solution lies in the existence of a gravitational version of the magnetic repul-
sive force that cancels out the electromagneticversion of the magnetic attraction force.
These forces should act in opposite directions.
Oliver Heaviside was the first to discover and publish the gravitoelectromagnetism
theory. He was also the one who re-wrote electromagnetic 20 equations of Maxwell’s
equations, originally formulated by Maxwell in quaternion form, into the modern set
of four Maxwell’s equations in vector calculus. Then, he also pubished the gravitoelec-
tromagnetism’s version of it in 1983, before the discovery of General Relativity in 1915
by Einstein.

⃗ ·E
∇ ⃗ EM = ρEM ⇔ ∇
⃗ ·E
⃗ g = −4πGN ρg

⃗ ×B
∇ ⃗ EM − ∂t E
⃗ EM = J⃗EM ⇔ ∇
⃗ ×B
⃗ g − ∂t E
⃗ g = −4πGN J⃗g
(3.94)
⃗ ·B
∇ ⃗ EM = 0 ⇔ ∇
⃗ ·B
⃗g = 0

⃗ ×E
∇ ⃗ EM + ∂t B
⃗ EM = 0 ⇔ ∇
⃗ ×E
⃗ g + ∂t B
⃗g = 0

⃗ g , we need an object with


The story doesn’t ended there. To observe the effect of B
a large amount of total angular momentum. And what better object than the Earth
itself? In 2004, NASA and Stanford University launched a satellite with gyroscopes
to detect the precession effect caused by gravitoelectromagnetism. This effect includes
the spin-spin interaction between the total angular momentum of the Earth and the
spin of gyroscopes. It’s also known as Lense-Thirring precession or weak field frame-
draggin effect. Additionally, it includes the spin-orbit effect between the total angular
momentum of orbital and the spin of gyroscopes. It’s also known as the combination
of Geodesic effect and gravitational Thomas effect. The details of experimental part
can be found in the Stanford final report[7], while the theoretical aspects are covered
in the thesis (2014) by Paul Bennett[8] and the paper by B Vető (2010)[9]

240
3.6 Story: de Sitter spacetime

3.6.1 FLRW metric

Before we delve into the de Sitter spacetime, let’s first discuss the FLRW metric. The
FLRW metric describes the large-scale structure of the universe, assuming that matter
in space and space itself are homogeneous ans isotropic. By introducing a scale factor
a [t] that depends on time and multiplying it with spatial line element, it describes the
dynamic of space itself, either expanding or shrinking through time t.
A FLRW in general form with spatial curvature k is given by:

!
2 2 2 (dr)2
(dτ ) = (dt) − a [t] 2
+ r2 (dΩS2 )2 (3.95)
1 − kr

(dΩS2 )2 = dθ2 + sin2 [θ] dϕ2 (3.96)

Let’s declare the FLRW Metric first.

by consider matter in the large-scale structure of the universe act as a prefect fluid,
we can solve the non-vacuum Einstein field equations with cosmological constant Λ.

Gµν − Λgµν = 8πGN Tµν (3.97)

241
The prefect fluid stress–energy tensor in rest frame U is given by:

T µν = (ρ + p) U µ U ν − pg µν
(3.98)
U µ = (1, 0, 0, 0)

Solve the Einstein field equations with one up one down indices.

The 00 component of the Einstein field equations is the first equation of Friedmann
equations.
Define the Hubble parameter H.

242
 2
2 ȧ 8πGN k Λ
H [t] ≡ = ρ [t] − 2 + (3.99)
a 3 a 3

which can be contributed by the energy density ρ in large-scale, the radius of cur-
vature of space k and the cosmological constant Λ.
In eq.(3.99), I emphasized the time dependence of Hubble constant. The reason
is that the energy density ρ contributed by matter and photons can be changed (de-
crease) during the expansion of the universe, vice versa during universe shrinking.
However,the term "constant" in the famous Hubble constant refers to the fact that its
rate of change is not very rapid. The value of Hubble constant at the present time
(t = t0 ) is denoted as H0 .
Solve ȧ in the first Friedmann equation.

By substituting it into the spatial components of Einstein field equations, we can


obtain the second Friedmann equation.

ä 4πGN Λ
=− (ρ + 3p) + (3.100)
a 3 3

Also, there is a Killing tensor in FLRW metric.

Kµν = a2 (gµν + σg Uµ Uν )
(3.101)
Uµ = (1, 0, 0, 0)

243
The Killing tensor equation is True.

3.6.2 de Sitter metric

Einstein field equations

The de Sitter spacetime is a universe without matter and spatial curvature (k = 0, ρ =


0). It is only characterized by a non-zero cosmological constant Λ which causes the
spacetime to undergo expansion. In the case of no spatial curvature, the spatial line
element becomes curvilinear spherical coordinates, which can be transformed into 3D
Cartesian coordinates.
Additionally, by setting the stress–energy tensorT = 0 in eq.(3.97), the hubble con-
stant H becomes a true constant that solely contributed by the constant Λ and indepen-
dent to time.

r
Λ (3.102)
H=
3

The de Sitter Metric Tensor:

(dτ )2 = (dt)2 − a [t]2 (dx)2 + (dy)2 + (dz)2



(3.103)
= (dt)2 − e2Ht (dx)2 + (dy)2 + (dz)2


244
Declare the de Sitter Metric Tensor:

It is the solution of vacuum Einstein field equations with Λ.

Gµν − Λgµν = 0 (3.104)

Null List implies every term is True.

de Sitter spacetime is conformally flat

It is shown that de Sitter Metric Tensor is conformally flat in Sec.(1.3.2).


Now, let’s do a CoordinateTransformation to conformally flat coordinates (η, x, y, z).

− ln [−Hη]
t= (3.105)
H

245
The metric is now in the form:

(dτ )2 = Ω2 (dη)2 + (dx)2 + (dy)2 + (dz)2 (3.106)




1
where Ω = −Hη

Recall the definition of Weyl:

1  gµ[α gβ]ν
0 = Cµναβ ≡ Rµναβ − Rα[µ gν]β − Rβ[µ gν]α + R (3.107)
d−2 (d − 2) (d − 1)

From this analysis, we conclude that the Riemann tensor can only be constructed
using the tensor products of the Ricci tensor, Ricci scalar, and the metric in conformally
flat spacetime. Due to the symmetries of Riemann tensor, Ricci tensor and metric, there
should be an anti-symmetrization on the second and third indices.
Furthermore, considering the trace of the first and third indices of the Weyl tensor,
we find that the Ricci tensor should be constructed solely from the metric and Ricci
scalar.
Therefore, we can deduce that the Riemann tensor can only be constructed from the
Ricci scalar and the metric. There is only one combination that satisfies these require-
ments:

R
Rµναβ = gµ[α gβ]ν (3.108)
d (d − 1)

246
The factor involving dimension d requires further derivation.
The Ricci tensor:

R
Rµν = gµν (3.109)
d
1
The Ricci scalar in this case (Ω = −Hη
):

2dΛ 6dH 2
R=− =− (3.110)
d−2 d−2

Let’s verify from Ricci scalar:

Verify from Ricci tensor:

Verify from Riemann tensor:

(3.111)

247
de Sitter spacetime is maximally symmetric

The Minkowski metric is maximally symmetric, and since de Sitter spacetime is a slice
of 5-dimensional Minkowski spacetime, it also possesses maximally symmetry. In a
d(d+1)
4-dimensional maximally symmetric spacetime, there can be 2
= 10 symmetries,
each corresponding to a Killing vector.
Now, let’s show the 10 Killing equations in de Sitter spacetime.
Given the isotropy of the de Sitter spacetime, there are 3 spatial translation symme-
tries and 3 rotational symmetries.

If we project 3 boost Killing vectors from the 5-dimensional Minkowski spacetime


on to de Sitter spacetime, they also become Killing vectors in de Sitter spacetime.

248
ν
K(i) ∂ν = xi T µ ∂µ − H σ̄∂i
(3.112)
1 2  1
σ̄ ≡ η − ⃗x2 = ηµν xµ xν
2 2

There is one more Killing vector:

T µ ∂µ = −Hxµ ∂µ (3.113)

That is the meaning of this Killing vector?


If we coordinate transform T µ back to (t, x, y, z) coordinates.

e−Ht
η= (3.114)
−H

249
Now becomes

If we set Λ = 0, the 4-dimensional de Sitter spacetime becomes 4-dimensional


Minkowski spacetime. In this case, the Killing vector becomes the time translation
Killing vector in 4-dimensional Minkowski spacetime. T µ can be interpreted as the
analog of the generator of time translation in Minkowski spacetime.

Since the conformally flat Riemann tensor is composed of the metric tensors and
the Ricci scalar (which is a constant in this case), the LieDerivatives of Riemann along
the 10 Killing vectors are also zero.
If we calculate T 2 , we can observe that this is actually a time-like vector, but only in
a finite spatial region |⃗x2 | < η 2 .

250
Let’s see T µ as an example:

Rmt is declared in code.(3.111).

3.7 Story: Scalar and Vector Basis and more on S2

3.7.1 scalar basis

The scalar orthonormal basis on the S2 is given by spherical harmonics. In Mathemat-


ica, you can declare them using SphericalHarmonicY. The orthonormality of these
basis functions is shown in Appendix 5.0.4.

3.7.2 vector basis



The vector orthonormal basis on the 2-Sphere consists of 2 sets: Ail,m , Bl,m
i
. These
basis vectors are known as vector spherical harmonics, which arise from the Helmholtz
Decomposition of vectors on the S2 .


∇Y i m
Ai ≡√ l


l,m l(l+1)
(3.115)
ϵ̃ij ∂ Y m
i
≡√ i l

Bl,m

l(l+1)

I show a few examples with the definition of inner product for vector field U i and
Wi

Z
⟨U |W ⟩ ≡ d2 Ωx̂ Ū i Wi (3.116)
S2

Now declare the A and B vectors set and the inner product, with VectorSpherical-
Harmonic.

251

Let’s take a example of Am m
l |Bl′ with l = 1, m = 0, l′ = 2, m′ = 1:

Test l = 1, l′ = 1, m = −1 ∼ 1, m′ = −1 ∼ 1


Am m
l |Al′ for l = 1, l′ = 1, m = −1 ∼ 1, m′ = −1 ∼ 1:


Blm |Blm′ for l = 1, l′ = 1, m = −1 ∼ 1, m′ = −1 ∼ 1:

252
3.7.3 coordinate systems

In code.(1.19), we show that all 2D space or spacetime are conformally flat. There are
also a few coordinate systems of 2-Sphere which are conformally flat.
(x, y):

 2
2 2 2 2
(dl) = (dx) + (dy)
1 + χ2
p
χ ≡ x2 + y 2 (3.117)
     
θ θ
(x, y) ≡ tan cos [ϕ] , tan sin [ϕ]
2 2
(θ, ϕ) to (x, y):

(x, y) to (θ, ϕ):

253
(χ, ϕ):

 2
2 2
(dχ)2 + χ2 (dϕ)2

(dl) = (3.118)
1 + χ2

(χ, ϕ) to (θ, ϕ):

(z, z̄):

 2
2 2
(dl) = dzdz̄
1 + z z̄
z ≡ x + iy (3.119)

z z̄ = χ2

(θ, ϕ) to (z, z̄):

254
(z, z̄) to (θ, ϕ)

(z, z̄) to (x, y):

3.7.4 Ladder operator

The ladder operator is defined by £J±


where

J± = Jx ± iJy (3.120)

255
First declare basic objects:

Let’s test the raising operator

J+ Ylm p
= (l − m) (l + m + 1), (up to a phase) (3.121)
Ylm+1

Then test the lowering operator

J− Ylm p
= (l + m) (l − m + 1), (up to a phase) (3.122)
Ylm−1

Expand Spherical Harmonic in terms of Accociated Legendre Polynomials.

256
Utilize this recursion relation:

Pl m+1 [cos [θ]] + 2m cot [θ]−1 Pl m [cos [θ]] + (l − m + 1) (l + m) Pl m−1 [cos [θ]] (3.123)

Test the normalization:

3.7.5 EigenSystem of Spherical Harmonic

Firstly verify:

257
−i∂ϕ Yl m
=m (3.124)
Yl m

Another eigenvalue:

−□Yl m
= l (l + 1) (3.125)
Yl m

This time we also need to use the recursion relation eq.(3.123). Replace all m into
m + 1 in that equation.

3.7.6 EigenSystem of Vector Spherical Harmonic

declare a VectorSphericalHarmonic with abstract l and m.

258
h i
⃗ =0
Since ∂ϕ , ∇

∂ϕ (∇Yl m )i = ∇i ∂ϕ Yl m = m (∇Yl m )i (3.126)

Test with l = 1, m = 0:

Test with l = 0 ∼ 2, m = −2 ∼ 2:

h i
⃗ on vector spherical harmonic, we can obtain
From analysis of commutator □, ∇
the eigenvalue:

□ (∇Yl m )i = (1 − l (l + 1)) (∇Yl m )i (3.127)

Test with l = 1, m = 0:

259
Test with l = 0 ∼ 2, m = −2 ∼ 2:

3.7.7 Plot of Vector Spherical Harmonic

To plot ∇Yl m , the first task is to declare it with additional r direction with 0 value and
coordinate transform into 3D Cartesian.

Now we can use SliceVectorPlot3D to plot ∇Y2 1 :

260
∇Y2 2 :

261
Now let’s plot ⋆dYl m

⋆dY2 1 :

262
∇Yl m should perpendicular with ⋆dYl −m at every point. The proof is in Sec.(4.0.8).
Real part of ∇Y2 1 ⊥ ⋆dY2 −1 (blue for the former, red for the later):

263
Imaginary part of ∇Y2 1 ⊥ ⋆dY2 −1 (blue for the former, red for the later):

3.8 Story: Conformal Invariance

Maxwell’s Equations in 4D

In curved spacetime, the Faraday tensor obeys a wave equation.

□Fαβ + Rµναβ F µν + Rσ[α Fβ]σ = −∇[α ∇σ Fβ]σ


(3.128)
= ∇[α Jβ]

First I will demonstrate the validity of the first equality. Consider a conformally flat
spacetime, specifically the FLRW spacetime.

264
Let’s declare the Faraday Tensor with upper and lower indices.

Declare 3 terms in the left-hand side of eq.(3.128).

265
Sum them up and declare as a single Tensor.

The right-hand side of eq.(3.128).

266
If you extract any one equation from eq.(3.128), at this point, the result is not True.
Maxwell’s equations in curved spacetime need to be used.

Maxwell’s equations (Bianchi identity):

Maxwell’s equations (with source):

Change Equals into Rules. Add a set of Rules to account for the common factor of
a minus sign.

267
Also include a set of Maxwell’s equations that apply partial derivatives on both
sides.

Now, we can show that eq.(3.128) is True.

Now I will demonstrate that in the far-zone limit, eq.(3.128) reduces to:

□Fαβ + Rµναβ F µν + Rσ[α Fβ]σ = ∂ γ ∂γ Fαβ (3.129)

In far-zone limit, set current density to be zero.

eq.(3.129) is True.

268
3.9 Story: More example on CoordinateTransformation

3.9.1 Monopole

In Sec.(3.5.1), we discussed Newtonian gravity, particularly in far-zone limit. In this


limit, a source can be considered as a monopole, and the gravitational potential is
rs
composed of the Schwarzschild radius of monopole, which is |Φ| = | − 2r
| ≪1
The eq.(3.77) can also be written in tensor form as follows:

rs
gµν = ηµν + 2Φδµν = ηµν − δµν (3.130)
r

Let’s declare the Metric.

Do CoordinateTransformation from Minkowski coordinates to time+spherical co-


ordinates.

(3.131)

269
In this section, I will show that the non-rotating linearized gravity is equivalent to
the leading order of Schwarzschild metric in weak field limit.
Let’s declare a Schwarzschild Metric in Schwarzschild coordinates.

rs  2
 rs −1 2 2
2
dτ = 1 − ′ (dt) − 1 − ′ (dr′ ) − r′ (dΩS2 )2 (3.132)
r r

(dΩS2 )2 = dθ2 + sin2 [θ] dϕ2 (3.133)

By re-scaling radius r′ ,

270

rs 2
r = 1+ r (3.134)
4r

We obtained the metric in isotropic coordinates.

rs 2
1−
  rs 4
2
dτ = 4r
rs (dt)2 − 1 + (d⃗x)2 (3.135)
1+ 4r
4r

(d⃗x)2 = (dx)2 + (dy)2 + (dz)2



(3.136)
2 2 2
= (dr) + r (dΩS2 )

In the small mass limit, we can Series expand rs to the first order, which will become
the leading order since rs 2 ∂r2s ≪ rs ∂rs

271
Compare with the linearized approach in code.(3.131).

3.9.2 Coordinate Systems of Kerr black hole

In this section, I will demonstrate the CoordinateTransformation of Kerr black hole


from Kerr-Schild coordinates to Kerr coordinates, to Boyer–Lindquist coordinates with
retarded time, and finally to Boyer–Lindquist coordinates. The coordinate transforma-
tion rules can be found in this textbook chapter[10].
First, let’s declare the Kerr metric in Kerr-Schild coordinates (t̄, x, y, z).

gµν = ηµν + σg Hlµ lν (3.137)

where

rs r 3
H=
r 4 + a2 z 2
  (3.138)
rx + ay ry − ax z
lµ = 1, 2 , ,
r + a2 r 2 + a2 r

Coordinate transformation rules from Kerr-Schild to Kerr coordinates t̄, r, θ, ϕ̄ :


    



 x = r sin [θ] r cos ϕ̄ − a sin ϕ̄


(3.139)
   
 y = r sin [θ] r sin ϕ̄ + a cos ϕ̄




z = r cos [θ]

272
This CoordinateTransformation is equivalent to:



2 + a2 sin [θ] cos ϕ̄ + arctan a
   



 x = r r



2 + a2 sin [θ] sin ϕ̄ + arctan a (3.140)
  
 y = r r




z = r cos [θ]

The lµ in Kerr coordinates can be written as:

lµ = 1, 1, 0, −a sin [θ]2 (3.141)




273
From Kerr coordinates to Boyer–Lindquist coordinates with retarded time (v, r, θ, ϕ):



dt̄
 = dv − dr
(3.142)
a

dϕ̄ = dϕ +
 dr
∆[r]

The quantity ∆ [r] is defined in eq.(1.27). Since the metric is independent of r̄ and
ϕ̄, we don’t need to complete the integral in eq.(3.142). However, since it is integrable,
users can also choose to perform a CoordinateTransformation in that way if they pre-
fer.
From Boyer–Lindquist coordinates with retarded time to Boyer–Lindquist coordi-
nates (t, r, θ, ϕ):

r 2 + a2
dv = dt + dr (3.143)
∆ [r]

274
Again, the metric is ν-independent.
Declare a Boyer–Lindquist coordinates metric in ExpressionForm manually. This
should be equal to the result we obtain.

3.9.3 r + SD−1

A D-dimensional flat space metric in spherical coordinates (r, θ1 , θ2 , . . . , θD−1 ) is:

" D−2
#
Y
gij = Diag 1, r2 , r2 sin [θ1 ]2 , r2 sin [θ1 ]2 sin [θ2 ]2 , . . . , r2 sin [θi ]2 (3.144)
i=1

If you let D = 3, you obtain 3D spherical coordinates (r, θ, ϕ). You can observe that
θD−1 is ϕ and θD−2 is θ. Notice that for any D, θD−1 is always absent in metric.
Let’s consider 4D, r + S3 , with coordinates (r, Θ, θ, ϕ)

275
gij = Diag 1, r2 , r2 sin [Θ]2 , r2 sin [Θ]2 sin [θ]2 (3.145)
 

Start from a 4D Cartesian (x, y, z, w) and do a CoordinateTransformation with the


following rules to obtain eq.(3.145).



x

 = r sin [Θ] sin [θ] cos [ϕ]





y
 = r sin [Θ] sin [θ] sin [ϕ]
(3.146)




z = r sin [Θ] cos [θ]




w
 = r cos [Θ]

Now, let’s truncate the metric and project out the radius r. This gives us a 3-Sphere
with radius R.

276
Set R = 1, we obtain unit 3-Sphere.

Project out the angle Θ.

Divide by sin [Θ]2 , we obtained the unit 2-Sphere.

3.10 Story: 3D Weyl Tensor is Zero

The definition of Weyl tensor for d ≥ 4 is as follows:

1  gµ[α gβ]ν
Cµναβ ≡ Rµναβ − Rα[µ gν]β − Rβ[µ gν]α + R (3.147)
d−2 (d − 2) (d − 1)

While d = 2, it blows up, and we have proved that all 2D spacetimes/spaces are
conformally flat. However, when d = 3, spacetimes/spaces could not be conformally
flat. In this section, I will show that Weyl tensors for any 3D spacetimes/spaces are

277
always zero. As a result, the conformally flatness of 3D spacetimes/spaces is taken
care by the Cotton tensor, which I won’t discuss in this thesis.
Declare a general 3D metric first.

The first term, Riemann TensorRµναβ .

The second term, Rα[µ gν]β

The third term, Rβ[µ gν]α

278
The fourth term, gµ[α gβ]ν

Sum them up with the definition eq.(3.147).

This is a zero Tensor.

279
Chapter 4

Exercises in Schutz

In this chapter, I will provide the solution of the exercises or reproduce the content in
this book by Schutz[11].

4.0.1 Exercise 2.1

Q: Show that r̂i = (cos [θ] , sin [θ]) and ϕ̂i = (− sin [θ] , cos [θ]) do not form a good coordi-
nates.
A: Transform into polar coordinates first will be clearer.

h i
Show that r̂, ϕ̂ ̸= 0

281
4.0.2 Frobenius’ theorem

Frobenius’ theorem states, tangent vector fields to two integral curves commute if and
only if they can be integrated to form a 2D coordinate system.
In page 82 of Schutz, he provided a counter example:
Spiral curve and vector along it can not form a coordinate set.
Let’s declare the spiral curve along z-direction and z vector field. Obtain their
LieBracket.

There is no z-direction component, and only depend on z.


Plot the LieBracket and spiral curve. You can see it is a vector field of radial direc-
tion toward the spiral, which perpendicular to its tangent.

282
4.0.3 Exercise 3.7

Q: Show that in S2 , the angular momentum square operator can be written in this form.

J 2 = − £Jx £Jx + £Jy £Jy + £Jz £Jz (4.1)




A:

283
This is equivalent to negative Laplacian on 2-Sphere.

4.0.4 Local exactness of closed form

Show that β the potential form of α. We test for the case that α is a 2-form.

The β is defined by the equation (4.61) of Schutz:

Z 1
1 n
dt tp−1 αij...k tx1 , tx2 , . . . , txn xi
 
βj...k x , . . . , x = (4.2)
0

where α here is a p-form and β is a (p − 1)-form.


In this case:

Z 1
βν (x, y, z) = dt tαµν (tx, ty, tz) xi (4.3)
0

Take ExteriorD again:

284
Put minus sign inside the incomplete integral

The alternative way to declare α:

Check:

285
Z 1
d p
[t αij...k tx1 , tx2 , . . . , txn ]

(dβ)ij...k =
0 dt (4.4)
= αij...k x1 , x2 , . . . , xn


In this case:

Z 1
d 2
(dβ)µν = [t αµν (tx, ty, tz)]
0 dt (4.5)
= αµν (x, y, z)

4.0.5 ExteriorD and LieDerivative commute

In the equation (4.69) of Schutz, it states exterior derivative commute with Lie deriva-
tive. The ω in this equation is a p-form.

£V̄ (dω) = d (£V̄ ω) (4.6)

In this equation Let’s test with a 2-form ω.

286
4.0.6 Exercise 4.10
p
Q: In coordinates with ϵ̃ = |g|ϵ
Verify

1 p 
divω̃ ξ¯ = p ∂i |g|ξ i (4.7)
|g|

where the definition of divω̃ ξ¯ is:

divω̃ ξ¯ = ∇i ξ i (4.8)

A: I will show that this multiplies by ϵ̃ is True.

1 p 
divω̃ ξ¯ ϵ̃ = p ∂i |g|ξ i ϵ̃

(4.9)
|g|

Utilize the equation (4.77) of Schutz on left-hand side:

divω̃ ξ¯ ϵ̃ = ∇i ξ i ϵ̃ = d̃ ϵ̃ ξ¯ (4.10)
   

where the definition of divergence in curved spacetimes/spaces is:

divω̃ ξ¯ ≡ ∇i ξ i (4.11)

Now I will show:

1 p 
d̃ ϵ̃ ξ¯ = p ∂i |g|ξ i ϵ̃
 
(4.12)
|g|

Declare the elements in 4D spacetimes/spaces:

287
Show it:

4.0.7 Exercise 4.22

Q: Convert equation of continuity in fluid dynamic in 3D flat space ϵ̃ = d̃x ∧ d̃y ∧ d̃z:

∂ρ 
+ div ρV̄ = 0 (4.13)
∂t

into this form

 

+ £V̄ (ρϵ̃) = 0 (4.14)
∂t

A: Multiply ϵ̃ to eq.(4.13). Since ∂t
ϵ̃ = 0, we obtain:

∂ 
(ρϵ̃) = −div ρV̄ ϵ̃ (4.15)
∂t

Combine with the ansatz eq.(4.14). This is equivalent to show:

(4.16)

£V̄ (ρϵ̃) = div ρV̄ ϵ̃

Declare the Metric.

288
Declare the left-hand side and right-hand side of eq.(4.16).

We can verify the equations are True.

4.0.8 Exercise 4.34

¯ m is perpendicular with ⋆d̃Y m at every single point.


Q: Verify that ∇Y l l

A:

289
4.0.9 Exercise 5.6

Q: Defining X̄H ≡ d̄H̄, show that for any function K,

{K, H} = X̄H (K) = dK/dt (4.17)

A:
First declare Hamiltonian H through the phase space volume form ω̃ and a Hamil-
tonian vector field Ū .

The Possion Bracket {f, g} is defined by:

(4.18)

{f, g} ≡ ω̃ X̄f , X̄g

where X̄f ≡ d̄f¯ and X̄g ≡ d̄ḡ

Now we can show eq.(4.17).

290
Q: The Poisson brackets satisfy the Jacobi identity.

{f, {g, h}} + {g, {h, f }} + {h, {f, g}} = 0 (4.19)

A:

Q: Verify

(4.20)
 
X̄f , X̄g = −X̄{f,g}

A: left-hand side:

291
right-hand side:

left-hand side equals to right-hand side.

292
Chapter 5

Appendix

5.0.1 Appendix A: FullForm of a 2-Sphere Metric

293
5.0.2 Appendix B: FullForm of a Faraday Tensor declared by Non-

MetricTensor

5.0.3 Appendix C: Solve Hamilton-Jacobi equation of particles around

the Kerr–Newman black hole

The staring point is to solve this

K=0 (5.1)

Which is:

2
(a2 cos2 (θ) + r2 )
K=
(a2 + e2 + r(r − rs)) (a2 − (a2 + r2 ) csc2 (θ))2

4 2 2 2
 2 2
 3
2  (5.2)
csc (θ) a En − al + Enr − a + e + r(r − rs) aEn csc(θ) − l csc (θ)

− F2r′ (r)2 a2 + e2 + r(r − rs) + µ2 − a2 cos2 (θ) + r2 − F2θ′ (θ)2 = 0


 

Let’s first focus on the red-colored part.

294
2
a2 − a2 + r2 csc2 (θ)


2
= a2 − csc2 (θ) + a2 − r2 csc2 (θ)


2
= a2 1 − csc2 (θ) − r2 csc2 (θ) (5.3)


2
= −a2 cot2 (θ) − r2 csc2 (θ)
2
= csc4 (θ) a2 cos2 (θ) + r2

Substitute this result into blue-colored part.

2
(a2 cos2 (θ) + r2 )
(a2 + e2 + r(r − rs)) (a2 − (a2 + r2 ) csc2 (θ))2
 2 2 
csc4 (θ) a2 En − al + Enr2 − a2 + e2 + r(r − rs) aEn csc(θ) − l csc3 (θ)


2 ((( 2 2
2
((
(a( cos
(( (θ) + r )
= (
2 2 (( 2
(((
(a2 + e2 + r(r − rs)) csc4 (θ)(
(a( cos
(( (θ) + r2 )
 (5.4)
2 2 
csc4 (θ) a2 En − al + Enr2 − a2 + e2 + r(r − rs) aEn csc(θ) − l csc3 (θ)


2 (( 2
4
csc  2
(θ) (a En − al + Enr2 ) (a 2
+ e
( 2(((((
+ r(r − rs)) (aEn csc(θ) − l csc3 (θ))


= ( ( (
4
(
(a2 + e2 + r(r − rs)) 
csc (θ)

(a2 + e2(
+(r(r
(( ((
− rs)) csc4 (θ)
((((
2
(a2 En − al + Enr2 )
= 2 2
− (l csc(θ) − aEn sin(θ))2
(a + e + r(r − rs))

Substitute this result to eq.(5.2).

2
(a2 En − al + Enr2 )
2 2
− (l csc(θ) − aEn sin(θ))2
(a + e + r(r − rs)) (5.5)
− F2r′ (r)2 a2 + e2 + r(r − rs) + µ2 − a2 cos2 (θ) + r2 − F2θ′ (θ)2 = 0
 

By rearrange the terms, we can separate r and θ parts.

F2θ′ (θ)2 + µ2 a2 cos2 (θ) + (l csc(θ) − aEn sin(θ))2


2 (5.6)
′ 2 2 2 (a2 En − al + Enr2 )
− µ2 r 2

= −F2r (r) a + e + r(r − rs) + 2
(a + e2 + r(r − rs))

295
5.0.4 Appendix D: orthogonality of SphericalHarmonicY

5.0.5 List of available Functions in TensoriaCalc

Metric, EigenSystem, Series, Dimensions, Expand, ExpToTrig, TrigToExp,


TrigReduce, ComplexExpand, FunctionExpand, Normal, Conjugate, PD, Simplify,
FullSimplify, TensorSymmetry, TensorWedge, SymmetrizedArray, TensorCompo-
nents, Coordinates, Indices, StartIndex, TensorName, TensorType, TooltipDisplay,
TooltipStyle, TensorAssumption, TensorOperator, OperatorDistributeOverPlus, Op-
eratorProductRule, ToExpressionForm, ToTensorComponents, WedgeProductExpand,
NonMetricTensor, Christoffel, Riemann, Ricci, RicciScalar, Weyl, Einstein, Determi-
nant, OrthonormalFrameField, TensorsProduct, SwapIndices, MoveIndices,
RaiseAllIndices, LowerAllIndices, UniqueIndices, SymmetrizeIndices, AntiSym-
metrizeIndices, PartialD, CovariantD, CovariantBox, GradientSquared, , Interior-
Product, ExteriorD, PotentialForm, LeviCivita, CovariantHodgeDual, LieDerivative,
LieBracket, CoordinateTransformation, TensorIsZero, TensorEquations, TensorDi-
vision, GeodesicSystem,

296
GeodesicLagrangians, GeodesicHamiltonianDynamics, SphericalHarmonicYTensor,
VectorSphericalHarmonic, ElectromagneticStressEnergyTensor, MHDSystem, MHD-
Scalar, MHD3Form, MHDPlasmaCurrent, MHDMaxwell, MHDMaxwellCurrent, MH-
DRank2P, MHDEquations, MHDEnergyMomentumShearStress, MHDPlasmaEner-
gyDensity, MHDMetric, MHDLagrangian

5.0.6 List of Tensor properties

Common:
TensorComponents→_(List of Lists|SymmetrizedArray|SparseArray)
Indices→___
TensorName→_
CoordinateSystem→_List
StartIndex→_Integer
TensorType→_String
TooltipDisplay→_
TooltipStyle→_
TensorOperator→_Function
TensorAssumption→_List
TensorSymmetry→_
Metric related:
ChristoffelComponents→_List of Lists
RiemannComponents→_List of Lists
RicciComponents→_List of Lists
RicciScalarInvariant→_ExpressionForm
MetricDeterminant→_ExpressionForm
FlatMetric→_List
OrthonormalFrameField→_List of Lists
InverseOrthonormalFrameField→_List of Lists

297
OrthonormalFrameFieldOperator→_Function
CheckOrthonormalFrameField→_(True|False)

5.0.7 List of TensorTypes

"Metric", "ChristoffelSymbols", "RiemannCurvatureTensor", "RicciCurvatureTensor"


"WeylCurvatureTensor", "EinsteinTensor", "VolumeForm", "LieDerivative", "Faraday"
MHDSystem:
"Gradient", "Maxwell", "MHDMaxwell", "3-Form", "2-Form", "MHDPlasma",
"MHDMaxwellPlasma", "MaxwellCurrent", "Faraday"

5.0.8 List of OptionValues of Functions and their default values

Options[Metric]={CoordinateSystem→{}, TensorName→"g", StartIndex→0,


MetricOperator→Simplify, ChristoffelOperator→Simplify,
RiemannOperator→Simplify, RicciOperator→Simplify,
RicciScalarOperator→Simplify, OrthonormalFrameFieldOperator→Simplify,
TooltipStyle→{}, TooltipDisplay→Null, FlatMetric→Null,
OrthonormalFrameField→Null, InverseOrthonormalFrameField→Null,
CheckOrthonormalFrameField→False, OrthonormalFrameFieldIndices→Null,
TensorOperator→Simplify, TensorAssumption→{}};
Options[Christoffel]={TooltipStyle→{}, TooltipDisplay→TensorComponents};
Options[Riemann]={TooltipStyle→{}, TooltipDisplay→Null};
Options[Ricci]={TooltipStyle→{}, TooltipDisplay→Null};
Options[Einstein]={EinsteinOperator→Simplify, TooltipStyle→{},
TooltipDisplay→Null};
Options[Weyl]=WeylOperator→Simplify, TooltipStyle→{}, TooltipDisplay→Null;
Options[OrthonormalFrameField]={OrthonormalFrameFieldOperator→Simplify,
CheckOrthonormalFrameField→False, OrthonormalFrameField→Null,
InverseOrthonormalFrameField→Null, OrthonormalFrameFieldIndices→Null};

298
Options[NonMetricTensor]={StartIndex→0, TooltipDisplay→Null,
TensorType→Null, TooltipStyle→{ }, TensorOperator→Simplify,
TensorAssumption→{ }};
Options[MHDSystem]={MHDOperator→Simplify, MetricSignature→"Mostly mi-
nus"};
Options[GeodesicSystem]={AffineParameter→Unique[Symbol],
NonAffineParameter→Unique[Symbol]};
Options[GeodesicLagrangians]={AffineParameter→Unique[Symbol],
NonAffineParameter→Unique[Symbol]};
Options[CoordinateTransformation]={
CoordinateTransformationOperator→Simplify,
StartIndex→Unique[Symbol], Indices→{ },
TensorName→Unique[Symbol], TooltipStyle→{ }, TooltipDisplay→Null};
Options[LieDerivative]={LieDerivativeOperator→Simplify};
Options[LieBracket]={LieDerivativeOperator→Simplify,
LieBracketOperator→Simplify, TooltipStyle→{ },
TooltipDisplay→Null, Indices→Null};
Options[SphericalHarmonicYTensor]={TooltipStyle→{},
TooltipDisplay→Null};
Options[VectorSphericalHarmonic]={Normalize→True,
TooltipStyle→{}, TooltipDisplay→Null};
Options[SymmetrizeIndices]={SymmetrizeIndicesOperator→#1&};
Options[AntiSymmetrizeIndices]={AntiSymmetrizeIndicesOperator→#1&};
Options[TensorIsZero]={TensorIsZeroOperator→Simplify};
Options[TensorDivision]={TensorDivisionOperator→Simplify};
Options[PotentialForm]={TensorName→"β"};
Options[ToTensorComponents]={CoordinateSystem→{}};
Options[ElectromagneticStressEnergyTensor]={MetricSignature→"Mostly minus"};

299
Bibliography

[1] Yi-Zen Chu. “Analytical Methods in Physics”. In: (2018). arXiv: 1701 .00776v2
[math-ph] .

[2] Yi-Zen Chu, Wei-Hao Chen, and Vaidehi Varma. TensoriaCalc. URL:
http://www.stargazing.net/yizen/Tensoria.html .

[3] Wolfram Research, Inc. Mathematica, Version 12.1.1.0). Champaign, IL, 2020. URL:
https://www.wolfram.com/mathematica .

[4] Yi-Zen Chu and Vitaly Vanchurin. “Ideal MHD(-Einstein) Solutions Obey-
ing The Force-Free Condition”. In: (2016). arXiv: 1605.08786 [gr-qc]. URL:
http://www.stargazing.net/yizen/MHD.html .

[5] Brandon Carter. “Global Structure of the Kerr Family of Gravitational Fields”. In:
Phys. Rev. 174 (5 1968), pp. 1559–1571. DOI: 10 . 1103 / PhysRev.174.1559.URL:
https://doi.org/10.1103/physrevlett.106.221101

[6] P.C. van der Wijk. “The Kerr-Metric: describing Ro-


tating Black Holes and Geodesics”. In: (2007). URL:
https://inspirehep.net/files/4125fb620def30c9536ff6eb62ff583d

[7] C.W. F. Everitt et al. “Gravity Probe B: Final Results of a Space Experiment to Test
General Relativity”. In: Physical Review Letters 106.22 (2011). DOI: 10.1103/phys-
revlett.106.221101 . URL: https://doi.org/10.1103%2Fphysrevlett.106.221101.

[8] Paul Bennett. “Gyroscopic Precessions in Relativ-


ity and Gravitoelectromagnetism”. In: (2014). URL:
https://www.mas.ncl.ac.uk/library/display_pdf.php?id=249

301
[9] B Vetö. “Gravity Probe B experiment and gravitomagnetism”. In: European
Journal of Physics 31.5 (2010), p. 1123. DOI: 10.1088/0143-0807/31/5/014. URL:
https://dx.doi.org/10.1088/0143-0807/31/5/014.

[10] "The Kerr solution" INFN Roma


URL: https://www.roma1.infn.it/teongrav/onde19_20/kerr.pdf

[11] Bernard F. Schutz. Geometrical Methods of Mathematical Physics. Cambridge Univer-


sity Press, 1980.

302

You might also like