https://physics.stackexchange.com/questions/733433/christoffel-symbols-for-schwarzschild-metric
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+
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[]:=
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@g​​InverseMetric[gmn]​​
Out[]=

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[]:=
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

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,-
M
2Mr-
2
r
,0,0,-
M
2Mr-
2
r
,0,0,0,{0,0,0,0},{0,0,0,0},
M(-2M+r)
3
r
,0,0,0,0,
M
2Mr-
2
r
,0,0,{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γ
θt
ϕ
Γ
θr
ϕ
Γ
θθ
ϕ
Γ
θϕ
ϕ
Γ
ϕt
ϕ
Γ
ϕr
ϕ
Γ
ϕθ
ϕ
Γ
ϕϕ
)
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.