In[]:=
ClearAll["Global`*"];
In[]:=
gmn={{-(1-2M/r),0,0,0},{0,(1-2M/r)^(-1),0,0},{0,0,r^2,0},{0,0,0,r^2Sin[θ]^2}}
Out[]=
-1+,0,0,0,0,,0,0,{0,0,,0},{0,0,0,}
2M
r
1
1-
2M
r
2
r
2
r
2
Sin[θ]
In[]:=
MatrixForm[gmn]
Out[]//MatrixForm=
-1+ 2M r | 0 | 0 | 0 |
0 | 1 1- 2M r | 0 | 0 |
0 | 0 | 2 r | 0 |
0 | 0 | 0 | 2 r 2 Sin[θ] |
In[]:=
InverseMetric[g_]:=Simplify@Inverse@gInverseMetric[gmn]
Out[]=
,0,0,0,0,1-,0,0,0,0,,0,0,0,0,
r
2M-r
2M
r
1
2
r
2
Csc[θ]
2
r
In[]:=
MatrixForm,0,0,0,0,1-,0,0,0,0,,0,0,0,0,
r
2M-r
2M
r
1
2
r
2
Csc[θ]
2
r
Out[]//MatrixForm=
r 2M-r | 0 | 0 | 0 |
0 | 1- 2M r | 0 | 0 |
0 | 0 | 1 2 r | 0 |
0 | 0 | 0 | 2 Csc[θ] 2 r |
In[]:=
ChristoffelSymbol[g_,xx_]:=Block[{n,ig,res},n=4;ig=InverseMetric[g];res=Table[(1/2)Sum[ig[[λ,σ]]* (*σisthesummationdummyvariable. λindicatesthecomponentofthetransportedvector inthenewbasis.*)(-D[g[[μ,ν]],xx[[σ]]]+D[g[[σ,ν]],xx[[μ]]]+D[g[[σ,μ]],xx[[ν]]]),{σ,1,n}],{λ,1,n},{μ,1,n},{ν,1,n}];Simplify[res]]
In[]:=
(*ComputeChristoffelsymbols*)christoffelSymbols=ChristoffelSymbol[gmn,{t,r,θ,ϕ}];
In[]:=
christoffelSymbols
Out[]=
0,-,0,0,-,0,0,0,{0,0,0,0},{0,0,0,0},,0,0,0,0,,0,0,{0,0,2M-r,0},{0,0,0,(2M-r)},{0,0,0,0},0,0,,0,0,,0,0,{0,0,0,-Cos[θ]Sin[θ]},{0,0,0,0},0,0,0,,{0,0,0,Cot[θ]},0,,Cot[θ],0
M
2Mr-
2
r
M
2Mr-
2
r
M(-2M+r)
3
r
M
2Mr-
2
r
2
Sin[θ]
1
r
1
r
1
r
1
r
In[]:=
MatrixForm[christoffelSymbols]
Out[]//MatrixForm=
|
|
|
| ||||||||||||||||
|
|
|
| ||||||||||||||||
|
|
|
| ||||||||||||||||
|
|
|
|
(
)
|
|
|
| ||||||||||||||||
|
|
|
| ||||||||||||||||
|
|
|
| ||||||||||||||||
|
|
|
|
In[]:=
(*PrintindicesandcorrespondingChristoffelsymbols*)n=4;Do[Print["ChristoffelSymbol[",λ,", ",μ,", ",ν,"] = ", christoffelSymbols[[λ,μ,ν]]];Print["Indices: λ = ",λ,", μ = ",μ,", ν = ",ν];Print["---"];,{λ,1,n},{μ,1,n},{ν,1,n}]
ChristoffelSymbol[1, 1, 1] = 0
Indices: λ = 1, μ = 1, ν = 1
---
ChristoffelSymbol[1, 1, 2] = -
M
2Mr-
2
r
Indices: λ = 1, μ = 1, ν = 2
---
ChristoffelSymbol[1, 1, 3] = 0
Indices: λ = 1, μ = 1, ν = 3
---
ChristoffelSymbol[1, 1, 4] = 0
Indices: λ = 1, μ = 1, ν = 4
---
ChristoffelSymbol[1, 2, 1] = -
M
2Mr-
2
r
Indices: λ = 1, μ = 2, ν = 1
---
ChristoffelSymbol[1, 2, 2] = 0
Indices: λ = 1, μ = 2, ν = 2
---
ChristoffelSymbol[1, 2, 3] = 0
Indices: λ = 1, μ = 2, ν = 3
---
ChristoffelSymbol[1, 2, 4] = 0
The Ricci tensor and scalar vanish as explained in https://physics.stackexchange.com/q/715644/150551
The scalar curvature of the Schwarzschild metric is zero everywhere except at the singularity at r = 0.
This indicates that the spacetime is flat everywhere except at the singularity.
This indicates that the spacetime is flat everywhere except at the singularity.