# Hyperbolic plane $\mathbb{H}^2$¶

This Jupyter notebook illustrates some differential geometry capabilities of SageMath on the example of the hyperbolic plane. The corresponding tools have been developed within the SageManifolds project.

A version of SageMath at least equal to 9.4 is required to run this notebook:

In [1]:
version()

Out[1]:
'SageMath version 9.4.rc2, Release Date: 2021-08-12'

First we set up the notebook to display mathematical objects using LaTeX formatting:

In [2]:
%display latex


We also tell Maxima, which is used by SageMath for simplifications of symbolic expressions, that all computations involve real variables:

In [3]:
maxima_calculus.eval("domain: real;")

Out[3]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\verb|real|$

We declare $\mathbb{H}^2$ as a 2-dimensional differentiable manifold:

In [4]:
H2 = Manifold(2, 'H2', latex_name=r'\mathbb{H}^2', start_index=1)
print(H2)
H2

2-dimensional differentiable manifold H2

Out[4]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\mathbb{H}^2$

We shall introduce charts on $\mathbb{H}^2$ that are related to various models of the hyperbolic plane as submanifolds of $\mathbb{R}^3$. Therefore, we start by declaring $\mathbb{R}^3$ as a 3-dimensional manifold equiped with a global chart: the chart of Cartesian coordinates $(X,Y,Z)$:

In [5]:
R3 = Manifold(3, 'R3', latex_name=r'\mathbb{R}^3', start_index=1)
X3.<X,Y,Z> = R3.chart()
X3

Out[5]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(\mathbb{R}^3,(X, Y, Z)\right)$

## Hyperboloid model¶

The first chart we introduce is related to the hyperboloid model of $\mathbb{H}^2$, namely to the representation of $\mathbb{H}^2$ as the upper sheet ($Z>0$) of the hyperboloid of two sheets defined in $\mathbb{R}^3$ by the equation $X^2 + Y^2 - Z^2 = -1$:

In [6]:
X_hyp.<X,Y> = H2.chart()
X_hyp

Out[6]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(\mathbb{H}^2,(X, Y)\right)$

The corresponding embedding of $\mathbb{H}^2$ in $\mathbb{R}^3$ is

In [7]:
Phi1 = H2.diff_map(R3, [X, Y, sqrt(1+X^2+Y^2)], name='Phi_1', latex_name=r'\Phi_1')
Phi1.display()

Out[7]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{llcl} \Phi_1:& \mathbb{H}^2 & \longrightarrow & \mathbb{R}^3 \\ & \left(X, Y\right) & \longmapsto & \left(X, Y, Z\right) = \left(X, Y, \sqrt{X^{2} + Y^{2} + 1}\right) \end{array}$

By plotting the chart $\left(\mathbb{H}^2,(X,Y)\right)$ in terms of the Cartesian coordinates of $\mathbb{R}^3$, we get a graphical view of $\Phi_1(\mathbb{H}^2)$:

In [8]:
show(X_hyp.plot(X3, mapping=Phi1, number_values=15, color='blue'),
aspect_ratio=1, figsize=7)


A second chart is obtained from the polar coordinates $(r,\varphi)$ associated with $(X,Y)$. Contrary to $(X,Y)$, the polar chart is not defined on the whole $\mathbb{H}^2$, but on the complement $U$ of the segment $\{Y=0, x\geq 0\}$:

In [9]:
U = H2.open_subset('U', coord_def={X_hyp: (Y!=0, X<0)})
print(U)

Open subset U of the 2-dimensional differentiable manifold H2


Note that (y!=0, x<0) stands for $y\not=0$ OR $x<0$; the condition $y\not=0$ AND $x<0$ would have been written [y!=0, x<0] instead.

In [10]:
X_pol.<r,ph> = U.chart(r'r:(0,+oo) ph:(0,2*pi):\varphi')
X_pol

Out[10]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(U,(r, {\varphi})\right)$
In [11]:
X_pol.coord_range()

Out[11]:
$\newcommand{\Bold}[1]{\mathbf{#1}}r :\ \left( 0 , +\infty \right) ;\quad {\varphi} :\ \left( 0 , 2 \, \pi \right)$

We specify the transition map between the charts $\left(U,(r,\varphi)\right)$ and $\left(\mathbb{H}^2,(X,Y)\right)$ as $X=r\cos\varphi$, $Y=r\sin\varphi$:

In [12]:
pol_to_hyp = X_pol.transition_map(X_hyp, [r*cos(ph), r*sin(ph)])
pol_to_hyp

Out[12]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(U,(r, {\varphi})\right) \rightarrow \left(U,(X, Y)\right)$
In [13]:
pol_to_hyp.display()

Out[13]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} X & = & r \cos\left({\varphi}\right) \\ Y & = & r \sin\left({\varphi}\right) \end{array}\right.$
In [14]:
pol_to_hyp.set_inverse(sqrt(X^2+Y^2), atan2(Y, X))

Check of the inverse coordinate transformation:
r == r  *passed*
ph == arctan2(r*sin(ph), r*cos(ph))  **failed**
X == X  *passed*
Y == Y  *passed*
NB: a failed report can reflect a mere lack of simplification.

In [15]:
pol_to_hyp.inverse().display()

Out[15]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} r & = & \sqrt{X^{2} + Y^{2}} \\ {\varphi} & = & \arctan\left(Y, X\right) \end{array}\right.$

The restriction of the embedding $\Phi_1$ to $U$ has then two coordinate expressions:

In [16]:
Phi1.restrict(U).display()

Out[16]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{llcl} \Phi_1:& U & \longrightarrow & \mathbb{R}^3 \\ & \left(X, Y\right) & \longmapsto & \left(X, Y, Z\right) = \left(X, Y, \sqrt{X^{2} + Y^{2} + 1}\right) \\ & \left(r, {\varphi}\right) & \longmapsto & \left(X, Y, Z\right) = \left(r \cos\left({\varphi}\right), r \sin\left({\varphi}\right), \sqrt{r^{2} + 1}\right) \end{array}$
In [17]:
graph_hyp = X_pol.plot(X3, mapping=Phi1.restrict(U), number_values=15, ranges={r: (0,3)},
color='blue')
show(graph_hyp, aspect_ratio=1, figsize=7)

In [18]:
Phi1._coord_expression

Out[18]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\left(\left(\mathbb{H}^2,(X, Y)\right), \left(\mathbb{R}^3,(X, Y, Z)\right)\right) : \left(X, Y, \sqrt{X^{2} + Y^{2} + 1}\right)\right\}$

## Metric and curvature¶

The metric on $\mathbb{H}^2$ is that induced by the Minkowksy metric on $\mathbb{R}^3$: $$\eta = \mathrm{d}X\otimes\mathrm{d}X + \mathrm{d}Y\otimes\mathrm{d}Y - \mathrm{d}Z\otimes\mathrm{d}Z$$

In [19]:
eta = R3.lorentzian_metric('eta', latex_name=r'\eta')
eta[1,1] = 1 ; eta[2,2] = 1 ; eta[3,3] = -1
eta.display()

Out[19]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\eta = \mathrm{d} X\otimes \mathrm{d} X+\mathrm{d} Y\otimes \mathrm{d} Y-\mathrm{d} Z\otimes \mathrm{d} Z$
In [20]:
g = H2.metric('g')
g.set( Phi1.pullback(eta) )
g.display()

Out[20]:
$\newcommand{\Bold}[1]{\mathbf{#1}}g = \left( \frac{Y^{2} + 1}{X^{2} + Y^{2} + 1} \right) \mathrm{d} X\otimes \mathrm{d} X + \left( -\frac{X Y}{X^{2} + Y^{2} + 1} \right) \mathrm{d} X\otimes \mathrm{d} Y + \left( -\frac{X Y}{X^{2} + Y^{2} + 1} \right) \mathrm{d} Y\otimes \mathrm{d} X + \left( \frac{X^{2} + 1}{X^{2} + Y^{2} + 1} \right) \mathrm{d} Y\otimes \mathrm{d} Y$

The expression of the metric tensor in terms of the polar coordinates is

In [21]:
g.display(X_pol.frame(), X_pol)

Out[21]:
$\newcommand{\Bold}[1]{\mathbf{#1}}g = \left( \frac{1}{r^{2} + 1} \right) \mathrm{d} r\otimes \mathrm{d} r + r^{2} \mathrm{d} {\varphi}\otimes \mathrm{d} {\varphi}$

The Riemann curvature tensor associated with $g$ is

In [22]:
Riem = g.riemann()
print(Riem)

Tensor field Riem(g) of type (1,3) on the 2-dimensional differentiable manifold H2

In [23]:
Riem.display(X_pol.frame(), X_pol)

Out[23]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{Riem}\left(g\right) = -r^{2} \frac{\partial}{\partial r }\otimes \mathrm{d} {\varphi}\otimes \mathrm{d} r\otimes \mathrm{d} {\varphi} + r^{2} \frac{\partial}{\partial r }\otimes \mathrm{d} {\varphi}\otimes \mathrm{d} {\varphi}\otimes \mathrm{d} r + \left( \frac{1}{r^{2} + 1} \right) \frac{\partial}{\partial {\varphi} }\otimes \mathrm{d} r\otimes \mathrm{d} r\otimes \mathrm{d} {\varphi} + \left( -\frac{1}{r^{2} + 1} \right) \frac{\partial}{\partial {\varphi} }\otimes \mathrm{d} r\otimes \mathrm{d} {\varphi}\otimes \mathrm{d} r$

The Ricci tensor and the Ricci scalar:

In [24]:
Ric = g.ricci()
print(Ric)

Field of symmetric bilinear forms Ric(g) on the 2-dimensional differentiable manifold H2

In [25]:
Ric.display(X_pol.frame(), X_pol)

Out[25]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{Ric}\left(g\right) = \left( -\frac{1}{r^{2} + 1} \right) \mathrm{d} r\otimes \mathrm{d} r -r^{2} \mathrm{d} {\varphi}\otimes \mathrm{d} {\varphi}$
In [26]:
Rscal = g.ricci_scalar()
print(Rscal)

Scalar field r(g) on the 2-dimensional differentiable manifold H2

In [27]:
Rscal.display()

Out[27]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{llcl} \mathrm{r}\left(g\right):& \mathbb{H}^2 & \longrightarrow & \mathbb{R} \\ & \left(X, Y\right) & \longmapsto & -2 \\ \mbox{on}\ U : & \left(r, {\varphi}\right) & \longmapsto & -2 \end{array}$

Hence we recover the fact that $(\mathbb{H}^2,g)$ is a space of constant negative curvature.

In dimension 2, the Riemann curvature tensor is entirely determined by the Ricci scalar $R$ according to

$$R^i_{\ \, jlk} = \frac{R}{2} \left( \delta^i_{\ \, k} g_{jl} - \delta^i_{\ \, l} g_{jk} \right)$$

Let us check this formula here, under the form $R^i_{\ \, jlk} = -R g_{j[k} \delta^i_{\ \, l]}$:

In [28]:
delta = H2.tangent_identity_field()
Riem == - Rscal*(g*delta).antisymmetrize(2,3)  # 2,3 = last positions of the type-(1,3) tensor g*delta

Out[28]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}$

Similarly the relation $\mathrm{Ric} = (R/2)\; g$ must hold:

In [29]:
Ric == (Rscal/2)*g

Out[29]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\mathrm{True}$

## Poincaré disk model¶

The PoincarĂ© disk model of $\mathbb{H}^2$ is obtained by stereographic projection from the point $S=(0,0,-1)$ of the hyperboloid model to the plane $Z=0$. The radial coordinate $R$ of the image of a point of polar coordinate $(r,\varphi)$ is $$R = \frac{r}{1+\sqrt{1+r^2}}.$$ Hence we define the PoincarĂ© disk chart on $\mathbb{H}^2$ by

In [30]:
X_Pdisk.<R,ph> = U.chart(r'R:(0,1) ph:(0,2*pi):\varphi')
X_Pdisk

Out[30]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(U,(R, {\varphi})\right)$
In [31]:
X_Pdisk.coord_range()

Out[31]:
$\newcommand{\Bold}[1]{\mathbf{#1}}R :\ \left( 0 , 1 \right) ;\quad {\varphi} :\ \left( 0 , 2 \, \pi \right)$

and relate it to the hyperboloid polar chart by

In [32]:
pol_to_Pdisk = X_pol.transition_map(X_Pdisk, [r/(1+sqrt(1+r^2)), ph])
pol_to_Pdisk

Out[32]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(U,(r, {\varphi})\right) \rightarrow \left(U,(R, {\varphi})\right)$
In [33]:
pol_to_Pdisk.display()

Out[33]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} R & = & \frac{r}{\sqrt{r^{2} + 1} + 1} \\ {\varphi} & = & {\varphi} \end{array}\right.$
In [34]:
pol_to_Pdisk.set_inverse(2*R/(1-R^2), ph)
pol_to_Pdisk.inverse().display()

Out[34]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} r & = & -\frac{2 \, R}{R^{2} - 1} \\ {\varphi} & = & {\varphi} \end{array}\right.$

A view of the PoincarĂ© disk chart via the embedding $\Phi_1$:

In [35]:
show(X_Pdisk.plot(X3, mapping=Phi1.restrict(U), ranges={R: (0,0.9)}, color='blue',
number_values=15),
aspect_ratio=1, figsize=7)


The expression of the metric tensor in terms of coordinates $(R,\varphi)$:

In [36]:
g.display(X_Pdisk.frame(), X_Pdisk)

Out[36]:
$\newcommand{\Bold}[1]{\mathbf{#1}}g = \left( \frac{4}{R^{4} - 2 \, R^{2} + 1} \right) \mathrm{d} R\otimes \mathrm{d} R + \left( \frac{4 \, R^{2}}{R^{4} - 2 \, R^{2} + 1} \right) \mathrm{d} {\varphi}\otimes \mathrm{d} {\varphi}$

We may factorize each metric component:

In [37]:
for i in [1,2]:
g[X_Pdisk.frame(), i, i, X_Pdisk].factor()
g.display(X_Pdisk.frame(), X_Pdisk)

Out[37]:
$\newcommand{\Bold}[1]{\mathbf{#1}}g = \frac{4}{{\left(R + 1\right)}^{2} {\left(R - 1\right)}^{2}} \mathrm{d} R\otimes \mathrm{d} R + \frac{4 \, R^{2}}{{\left(R + 1\right)}^{2} {\left(R - 1\right)}^{2}} \mathrm{d} {\varphi}\otimes \mathrm{d} {\varphi}$

### Cartesian coordinates on the Poincaré disk¶

Let us introduce Cartesian coordinates $(u,v)$ on the PoincarĂ© disk; since the latter has a unit radius, this amounts to defining the following chart on $\mathbb{H}^2$:

In [38]:
X_Pdisk_cart.<u,v> = H2.chart('u:(-1,1) v:(-1,1)', coord_restrictions=lambda u,v: u^2+v^2 < 1)
X_Pdisk_cart

Out[38]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(\mathbb{H}^2,(u, v)\right)$

On $U$, the Cartesian coordinates $(u,v)$ are related to the polar coordinates $(R,\varphi)$ by the standard formulas:

In [39]:
Pdisk_to_Pdisk_cart = X_Pdisk.transition_map(X_Pdisk_cart, [R*cos(ph), R*sin(ph)])
Pdisk_to_Pdisk_cart

Out[39]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(U,(R, {\varphi})\right) \rightarrow \left(U,(u, v)\right)$
In [40]:
Pdisk_to_Pdisk_cart.display()

Out[40]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} u & = & R \cos\left({\varphi}\right) \\ v & = & R \sin\left({\varphi}\right) \end{array}\right.$
In [41]:
Pdisk_to_Pdisk_cart.set_inverse(sqrt(u^2+v^2), atan2(v, u))
Pdisk_to_Pdisk_cart.inverse().display()

Check of the inverse coordinate transformation:
R == R  *passed*
ph == arctan2(R*sin(ph), R*cos(ph))  **failed**
u == u  *passed*
v == v  *passed*
NB: a failed report can reflect a mere lack of simplification.

Out[41]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} R & = & \sqrt{u^{2} + v^{2}} \\ {\varphi} & = & \arctan\left(v, u\right) \end{array}\right.$

The embedding of $\mathbb{H}^2$ in $\mathbb{R}^3$ associated with the PoincarĂ© disk model is naturally defined as

In [42]:
Phi2 = H2.diff_map(R3, {(X_Pdisk_cart, X3): [u, v, 0]},
name='Phi_2', latex_name=r'\Phi_2')
Phi2.display()

Out[42]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\begin{array}{llcl} \Phi_2:& \mathbb{H}^2 & \longrightarrow & \mathbb{R}^3 \\ & \left(u, v\right) & \longmapsto & \left(X, Y, Z\right) = \left(u, v, 0\right) \end{array}$

Let us use it to draw the PoincarĂ© disk in $\mathbb{R}^3$:

In [43]:
graph_disk_uv = X_Pdisk_cart.plot(X3, mapping=Phi2, number_values=15)
show(graph_disk_uv, figsize=7)


On $U$, the change of coordinates $(r,\varphi) \rightarrow (u,v)$ is obtained by combining the changes $(r,\varphi) \rightarrow (R,\varphi)$ and $(R,\varphi) \rightarrow (u,v)$:

In [44]:
pol_to_Pdisk_cart = Pdisk_to_Pdisk_cart * pol_to_Pdisk
pol_to_Pdisk_cart

Out[44]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(U,(r, {\varphi})\right) \rightarrow \left(U,(u, v)\right)$
In [45]:
pol_to_Pdisk_cart.display()

Out[45]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} u & = & \frac{r \cos\left({\varphi}\right)}{\sqrt{r^{2} + 1} + 1} \\ v & = & \frac{r \sin\left({\varphi}\right)}{\sqrt{r^{2} + 1} + 1} \end{array}\right.$

Still on $U$, the change of coordinates $(X,Y) \rightarrow (u,v)$ is obtained by combining the changes $(X,Y) \rightarrow (r,\varphi)$ with $(r,\varphi) \rightarrow (u,v)$:

In [46]:
hyp_to_Pdisk_cart_U = pol_to_Pdisk_cart * pol_to_hyp.inverse()
hyp_to_Pdisk_cart_U

Out[46]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(U,(X, Y)\right) \rightarrow \left(U,(u, v)\right)$
In [47]:
hyp_to_Pdisk_cart_U.display()

Out[47]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} u & = & \frac{X}{\sqrt{X^{2} + Y^{2} + 1} + 1} \\ v & = & \frac{Y}{\sqrt{X^{2} + Y^{2} + 1} + 1} \end{array}\right.$

We use the above expression to extend the change of coordinates $(X,Y) \rightarrow (u,v)$ from $U$ to the whole manifold $\mathbb{H}^2$:

In [48]:
hyp_to_Pdisk_cart = X_hyp.transition_map(X_Pdisk_cart, hyp_to_Pdisk_cart_U(X,Y))
hyp_to_Pdisk_cart

Out[48]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(\mathbb{H}^2,(X, Y)\right) \rightarrow \left(\mathbb{H}^2,(u, v)\right)$
In [49]:
hyp_to_Pdisk_cart.display()

Out[49]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} u & = & \frac{X}{\sqrt{X^{2} + Y^{2} + 1} + 1} \\ v & = & \frac{Y}{\sqrt{X^{2} + Y^{2} + 1} + 1} \end{array}\right.$
In [50]:
hyp_to_Pdisk_cart.set_inverse(2*u/(1-u^2-v^2), 2*v/(1-u^2-v^2))
hyp_to_Pdisk_cart.inverse().display()

Check of the inverse coordinate transformation:
X == X  *passed*
Y == Y  *passed*
u == -2*u*abs(u^2 + v^2 - 1)/(u^4 + 2*u^2*v^2 + v^4 + (u^2 + v^2 - 1)*abs(u^2 + v^2 - 1) - 1)  **failed**
v == -2*v*abs(u^2 + v^2 - 1)/(u^4 + 2*u^2*v^2 + v^4 + (u^2 + v^2 - 1)*abs(u^2 + v^2 - 1) - 1)  **failed**
NB: a failed report can reflect a mere lack of simplification.

Out[50]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left\{\begin{array}{lcl} X & = & -\frac{2 \, u}{u^{2} + v^{2} - 1} \\ Y & = & -\frac{2 \, v}{u^{2} + v^{2} - 1} \end{array}\right.$
In [51]:
graph_Pdisk = X_pol.plot(X3, mapping=Phi2.restrict(U), ranges={r: (0, 20)}, number_values=15,
label_axes=False)
show(graph_hyp + graph_Pdisk, aspect_ratio=1, figsize=7)

In [52]:
X_pol.plot(X_Pdisk_cart, ranges={r: (0, 20)}, number_values=15)

Out[52]:

### Metric tensor in Poincaré disk coordinates $(u,v)$¶

From now on, we are using the PoincarĂ© disk chart $(\mathbb{H}^2,(u,v))$ as the default one on $\mathbb{H}^2$:

In [53]:
H2.set_default_chart(X_Pdisk_cart)
H2.set_default_frame(X_Pdisk_cart.frame())

In [54]:
g.display(X_hyp.frame())

Out[54]:
$\newcommand{\Bold}[1]{\mathbf{#1}}g = \left( \frac{u^{4} + v^{4} + 2 \, {\left(u^{2} + 1\right)} v^{2} - 2 \, u^{2} + 1}{u^{4} + v^{4} + 2 \, {\left(u^{2} + 1\right)} v^{2} + 2 \, u^{2} + 1} \right) \mathrm{d} X\otimes \mathrm{d} X + \left( -\frac{4 \, u v}{u^{4} + v^{4} + 2 \, {\left(u^{2} + 1\right)} v^{2} + 2 \, u^{2} + 1} \right) \mathrm{d} X\otimes \mathrm{d} Y + \left( -\frac{4 \, u v}{u^{4} + v^{4} + 2 \, {\left(u^{2} + 1\right)} v^{2} + 2 \, u^{2} + 1} \right) \mathrm{d} Y\otimes \mathrm{d} X + \left( \frac{u^{4} + v^{4} + 2 \, {\left(u^{2} - 1\right)} v^{2} + 2 \, u^{2} + 1}{u^{4} + v^{4} + 2 \, {\left(u^{2} + 1\right)} v^{2} + 2 \, u^{2} + 1} \right) \mathrm{d} Y\otimes \mathrm{d} Y$
In [55]:
g.display()

Out[55]:
$\newcommand{\Bold}[1]{\mathbf{#1}}g = \left( \frac{4}{u^{4} + v^{4} + 2 \, {\left(u^{2} - 1\right)} v^{2} - 2 \, u^{2} + 1} \right) \mathrm{d} u\otimes \mathrm{d} u + \left( \frac{4}{u^{4} + v^{4} + 2 \, {\left(u^{2} - 1\right)} v^{2} - 2 \, u^{2} + 1} \right) \mathrm{d} v\otimes \mathrm{d} v$
In [56]:
g[1,1].factor() ; g[2,2].factor()
g.display()

Out[56]:
$\newcommand{\Bold}[1]{\mathbf{#1}}g = \frac{4}{{\left(u^{2} + v^{2} - 1\right)}^{2}} \mathrm{d} u\otimes \mathrm{d} u + \frac{4}{{\left(u^{2} + v^{2} - 1\right)}^{2}} \mathrm{d} v\otimes \mathrm{d} v$

## Hemispherical model¶

The hemispherical model of $\mathbb{H}^2$ is obtained by the inverse stereographic projection from the point $S = (0,0,-1)$ of the PoincarĂ© disk to the unit sphere $X^2+Y^2+Z^2=1$. This induces a spherical coordinate chart on $U$:

In [57]:
X_spher.<th,ph> = U.chart(r'th:(0,pi/2):\theta ph:(0,2*pi):\varphi')
X_spher

Out[57]:
$\newcommand{\Bold}[1]{\mathbf{#1}}\left(U,({\theta}, {\varphi})\right)$

From the stereographic projection from $S$, we obtain that $$\sin\theta = \frac{2R}{1+R^2}$$ Hence the transition map:

In [58]:
Pdisk_to_spher = X_Pdisk.transition_map(X_spher, [arcsin(2*R/(1+R^2)), ph])
Pdisk_to_spher