Please go easy on me, I have just been trying to learn sagemath and one of the results I got went against my expectation. I am pretty sure this is a fairly basic math question, I am just curious where the flaw lies in my thinking.
As a toy example, I have been trying to define the hyperboloid model of hyperbolic geometry in sagemath. The full code is in the Jupyter Notebook, but here is an abridged version:
First, I defined the ambient pseudo-Riemannian manifold:
R21 = Manifold(3, 'R^{2,1}', r'\mathbb{R}^{2,1}', structure='pseudo-Riemannian', signature=1, metric_name='g')
X21.<X,Y,Z> = R21.chart()
With metric:
g = R21.metric()
g[0,0], g[1,1], g[2,2] = 1, -1, -1
If I plot the pseudo-sphere, I get the two-sheeted hyperboloid (not sure if this is the easiest way to do it, but it works):
var('x,y,z', domain='real')
p = R21.point([x,y,z])
v = R21.vector_field(X,Y,Z,name='v')
implicit_plot3d(v.norm()(p)==1, (x,-3,3), (y,-3,3), (z,-3,3))
So far, this is looking very good.
Next, I define the embedded manifold:
H2 = Manifold(2, 'H^2', latex_name=r'\mathbb{H}^2')
H0 = H2.open_subset('H_0', r'\mathcal{H}_0' )
X_hyp.<th,ph> = H0.chart(r'th:(0,+oo):\theta ph:(0,2*pi):\phi')
And a differentiable map between the manifolds using the parametric equations for the upper sheet of the hyperboloid:
var('r', domain='real')
assume(r > 0)
Phi = H2.diff_map(R21, [
r*cosh(th),
r*sinh(th)*cos(ph),
r*sinh(th)*sin(ph)
], name='Phi', latex_name=r'\Phi')
With metric:
h = H2.metric('h')
h.set(Phi.pullback(g))
And now for the unexpected part:
R = h.ricci_scalar()
If I calculate the curvature this way, the result is $\frac{2}{r^2}$. This is clearly positive, but isn't hyperbolic space supposed to be negatively curved? Where is the error in my thinking?