Solution (source code)

= Solution

The disc model is
$$
D=\{z:|z|<1\},\qquad g_D=\frac{4|dz|^2}{(1-|z|^2)^2},
$$
and the upper half-plane model is
$$
\mathfrak h=\{x+iy:y>0\},\qquad g_{\mathfrak h}=\frac{dx^2+dy^2}{y^2}.
$$
The Cayley map
$$
C(z)=i\frac{1+z}{1-z}
$$
maps $D$ bijectively to $\mathfrak h$. Since $C'(z)=2i/(1-z)^2$ and $\operatorname{Im}C(z)=(1-|z|^2)/|1-z|^2$, direct substitution gives $C^*g_{\mathfrak h}=g_D$.

Representing $C$ by $K=\begin{pmatrix}i&i\\-1&1\end{pmatrix}$, the disc isometry corresponding to $g=\begin{pmatrix}a&b\\c&d\end{pmatrix}$ is represented, up to a nonzero <scalar>, by
$$
K^{-1}gK=\frac12\begin{pmatrix}
a+d+i(b-c)&a-d-i(b+c)\\
a-d+i(b+c)&a+d-i(b-c)
\end{pmatrix}.
$$