Section 1: Setup the metric

(* Defining coordinate system *)
coord={θ,ϕ};
(* Set these variable for coordinate, hopefully mathematica will be smarter when we Simplify *)
(* Noted that e is an expansions parameter *)
$Assumptions=t∈Reals&&r∈Reals&&θ∈Reals&&ϕ∈Reals&&e∈Reals;
metric = DiagonalMatrix[{(r^2),(r Sin[θ])^2}];
metricsign=1;

metric //MatrixForm

(* Load the package from the folder which you put diffgeo.m, See e.g. Hartnoll's notebook or diffgeomanul.nb *)
SetDirectory["C:\Users\15-P240TX\Documents"]
<<diffgeo.m

?Riemann

?raise

?RicciTensor

display[lower[raise[Riemann,{1}],{4}]]
display[RicciTensor]
RicciScalar

Hyperbolic space (H^2)

coord={θ,ϕ};
(* Set these variable for coordinate, hopefully mathematica will be smarter when we Simplify *)
(* Noted that e is an expansions parameter *)
$Assumptions=t∈Reals&&r∈Reals&&θ∈Reals&&ϕ∈Reals&&e∈Reals;metric = DiagonalMatrix[{(r^2),(r Sinh[θ])^2}];
metricsign=1;
(* Load the package from the folder which you put diffgeo.m, See e.g. Hartnoll's notebook or diffgeomanul.nb *)
SetDirectory["C:\Users\15-P240TX\Documents"]
<<diffgeo.m

display[lower[raise[Riemann,{1}],{4}]]
display[RicciTensor]
RicciScalar

Flat Space (R^2)

coord={r,ϕ};
(* Set these variable for coordinate, hopefully mathematica will be smarter when we Simplify *)
(* Noted that e is an expansions parameter *)
$Assumptions=t∈Reals&&r∈Reals&&θ∈Reals&&ϕ∈Reals&&e∈Reals;
metric = DiagonalMatrix[{1,(r)^2}];
metricsign=1;
(* Load the package from the folder which you put diffgeo.m, See e.g. Hartnoll's notebook or diffgeomanul.nb *)
SetDirectory["C:\Users\15-P240TX\Documents"]
<<diffgeo.m

Riemann
RicciTensor
RicciScalar