Manifolds Catalog#

A catalog of manifolds to rapidly create various simple manifolds.

The current entries to the catalog are obtained by typing manifolds.<tab>, where <tab> indicates pressing the Tab key. They are:

AUTHORS:

  • Florentin Jaffredo (2018) : initial version

  • Trevor K. Karn (2022) : projective space

sage.manifolds.catalog.Kerr(m=1, a=0, coordinates='BL', names=None)[source]#

Generate a Kerr spacetime.

A Kerr spacetime is a 4 dimensional manifold describing a rotating black hole. Two coordinate systems are implemented: Boyer-Lindquist and Kerr (3+1 version).

The shortcut operator .<,> can be used to specify the coordinates.

INPUT:

  • m – (default: 1) mass of the black hole in natural units (\(c=1\), \(G=1\))

  • a – (default: 0) angular momentum in natural units; if set to 0, the resulting spacetime corresponds to a Schwarzschild black hole

  • coordinates – (default: "BL") either "BL" for Boyer-Lindquist coordinates or "Kerr" for Kerr coordinates (3+1 version)

  • names – (default: None) name of the coordinates, automatically set by the shortcut operator

OUTPUT:

  • Lorentzian manifold

EXAMPLES:

sage: m, a = var('m, a')
sage: K = manifolds.Kerr(m, a)
sage: K
4-dimensional Lorentzian manifold M
sage: K.atlas()
[Chart (M, (t, r, th, ph))]
>>> from sage.all import *
>>> m, a = var('m, a')
>>> K = manifolds.Kerr(m, a)
>>> K
4-dimensional Lorentzian manifold M
>>> K.atlas()
[Chart (M, (t, r, th, ph))]

The Kerr metric in Boyer-Lindquist coordinates (cf. Wikipedia article Kerr_metric):

sage: K.metric().display()
g = (2*m*r/(a^2*cos(th)^2 + r^2) - 1) dt⊗dt
 - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dt⊗dph
 + (a^2*cos(th)^2 + r^2)/(a^2 - 2*m*r + r^2) dr⊗dr
 + (a^2*cos(th)^2 + r^2) dth⊗dth
 - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dph⊗dt
 + (2*a^2*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) + a^2 + r^2)*sin(th)^2 dph⊗dph
>>> from sage.all import *
>>> K.metric().display()
g = (2*m*r/(a^2*cos(th)^2 + r^2) - 1) dt⊗dt
 - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dt⊗dph
 + (a^2*cos(th)^2 + r^2)/(a^2 - 2*m*r + r^2) dr⊗dr
 + (a^2*cos(th)^2 + r^2) dth⊗dth
 - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dph⊗dt
 + (2*a^2*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) + a^2 + r^2)*sin(th)^2 dph⊗dph

The Schwarzschild spacetime with the mass parameter set to 1:

sage: K.<t, r, th, ph> = manifolds.Kerr()
sage: K
4-dimensional Lorentzian manifold M
sage: K.metric().display()
g = (2/r - 1) dt⊗dt + r^2/(r^2 - 2*r) dr⊗dr
 + r^2 dth⊗dth + r^2*sin(th)^2 dph⊗dph
sage: K.default_chart().coord_range()
t: (-oo, +oo); r: (0, +oo); th: (0, pi); ph: [-pi, pi] (periodic)
>>> from sage.all import *
>>> K = manifolds.Kerr(names=('t', 'r', 'th', 'ph',)); (t, r, th, ph,) = K._first_ngens(4)
>>> K
4-dimensional Lorentzian manifold M
>>> K.metric().display()
g = (2/r - 1) dt⊗dt + r^2/(r^2 - 2*r) dr⊗dr
 + r^2 dth⊗dth + r^2*sin(th)^2 dph⊗dph
>>> K.default_chart().coord_range()
t: (-oo, +oo); r: (0, +oo); th: (0, pi); ph: [-pi, pi] (periodic)

The Kerr spacetime in Kerr coordinates:

sage: m, a = var('m, a')
sage: K.<t, r, th, ph> = manifolds.Kerr(m, a, coordinates="Kerr")
sage: K
4-dimensional Lorentzian manifold M
sage: K.atlas()
[Chart (M, (t, r, th, ph))]
sage: K.metric().display()
g = (2*m*r/(a^2*cos(th)^2 + r^2) - 1) dt⊗dt
 + 2*m*r/(a^2*cos(th)^2 + r^2) dt⊗dr
 - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dt⊗dph
 + 2*m*r/(a^2*cos(th)^2 + r^2) dr⊗dt
 + (2*m*r/(a^2*cos(th)^2 + r^2) + 1) dr⊗dr
 - a*(2*m*r/(a^2*cos(th)^2 + r^2) + 1)*sin(th)^2 dr⊗dph
 + (a^2*cos(th)^2 + r^2) dth⊗dth
 - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dph⊗dt
 - a*(2*m*r/(a^2*cos(th)^2 + r^2) + 1)*sin(th)^2 dph⊗dr
 + (2*a^2*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2)
 + a^2 + r^2)*sin(th)^2 dph⊗dph
sage: K.default_chart().coord_range()
t: (-oo, +oo); r: (0, +oo); th: (0, pi); ph: [-pi, pi] (periodic)
>>> from sage.all import *
>>> m, a = var('m, a')
>>> K = manifolds.Kerr(m, a, coordinates="Kerr", names=('t', 'r', 'th', 'ph',)); (t, r, th, ph,) = K._first_ngens(4)
>>> K
4-dimensional Lorentzian manifold M
>>> K.atlas()
[Chart (M, (t, r, th, ph))]
>>> K.metric().display()
g = (2*m*r/(a^2*cos(th)^2 + r^2) - 1) dt⊗dt
 + 2*m*r/(a^2*cos(th)^2 + r^2) dt⊗dr
 - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dt⊗dph
 + 2*m*r/(a^2*cos(th)^2 + r^2) dr⊗dt
 + (2*m*r/(a^2*cos(th)^2 + r^2) + 1) dr⊗dr
 - a*(2*m*r/(a^2*cos(th)^2 + r^2) + 1)*sin(th)^2 dr⊗dph
 + (a^2*cos(th)^2 + r^2) dth⊗dth
 - 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dph⊗dt
 - a*(2*m*r/(a^2*cos(th)^2 + r^2) + 1)*sin(th)^2 dph⊗dr
 + (2*a^2*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2)
 + a^2 + r^2)*sin(th)^2 dph⊗dph
>>> K.default_chart().coord_range()
t: (-oo, +oo); r: (0, +oo); th: (0, pi); ph: [-pi, pi] (periodic)
sage.manifolds.catalog.Minkowski(positive_spacelike=True, names=None)[source]#

Generate a Minkowski space of dimension 4.

By default the signature is set to \((- + + +)\), but can be changed to \((+ - - -)\) by setting the optional argument positive_spacelike to False. The shortcut operator .<,> can be used to specify the coordinates.

INPUT:

  • positive_spacelike – (default: True) if False, then the spacelike vectors yield a negative sign (i.e., the signature is \((+ - - - )\))

  • names – (default: None) name of the coordinates, automatically set by the shortcut operator

OUTPUT:

  • Lorentzian manifold of dimension 4 with (flat) Minkowskian metric

EXAMPLES:

sage: M.<t, x, y, z> = manifolds.Minkowski()
sage: M.metric()[:]
[-1  0  0  0]
[ 0  1  0  0]
[ 0  0  1  0]
[ 0  0  0  1]

sage: M.<t, x, y, z> = manifolds.Minkowski(False)
sage: M.metric()[:]
[ 1  0  0  0]
[ 0 -1  0  0]
[ 0  0 -1  0]
[ 0  0  0 -1]
>>> from sage.all import *
>>> M = manifolds.Minkowski(names=('t', 'x', 'y', 'z',)); (t, x, y, z,) = M._first_ngens(4)
>>> M.metric()[:]
[-1  0  0  0]
[ 0  1  0  0]
[ 0  0  1  0]
[ 0  0  0  1]

>>> M = manifolds.Minkowski(False, names=('t', 'x', 'y', 'z',)); (t, x, y, z,) = M._first_ngens(4)
>>> M.metric()[:]
[ 1  0  0  0]
[ 0 -1  0  0]
[ 0  0 -1  0]
[ 0  0  0 -1]
sage.manifolds.catalog.RealProjectiveSpace(dim=2)[source]#

Generate projective space of dimension dim over the reals.

This is the topological space of lines through the origin in \(\RR^{d+1}\). The standard atlas consists of \(d+2\) charts, which sends the set \(U_i = \{[x_1, x_2, \ldots, x_{d+1}] : x_i \neq 0 \}\) to \(k^{d}\) by dividing by \(x_i\) and omitting the \(i`th coordinate `x_i/x_i = 1\).

INPUT:

  • dim – (default: 2) the dimension of projective space

OUTPUT:

  • P – the projective space \(\Bold{RP}^d\) where \(d =\) dim.

EXAMPLES:

sage: RP2 = manifolds.RealProjectiveSpace(); RP2
2-dimensional topological manifold RP2
sage: latex(RP2)
\mathbb{RP}^{2}

sage: C0, C1, C2 = RP2.top_charts()
sage: p = RP2.point((2,0), chart = C0)
sage: q = RP2.point((0,3), chart = C0)
sage: p in C0.domain()
True
sage: p in C1.domain()
True
sage: C1(p)
(1/2, 0)
sage: p in C2.domain()
False
sage: q in C0.domain()
True
sage: q in C1.domain()
False
sage: q in C2.domain()
True
sage: C2(q)
(1/3, 0)

sage: r = RP2.point((2,3))
sage: r in C0.domain() and r in C1.domain() and r in C2.domain()
True
sage: C0(r)
(2, 3)
sage: C1(r)
(1/2, 3/2)
sage: C2(r)
(1/3, 2/3)

sage: p = RP2.point((2,3), chart = C1)
sage: p in C0.domain() and p in C1.domain() and p in C2.domain()
True
sage: C0(p)
(1/2, 3/2)
sage: C2(p)
(2/3, 1/3)

sage: RP1 = manifolds.RealProjectiveSpace(1); RP1
1-dimensional topological manifold RP1
sage: C0, C1 = RP1.top_charts()
sage: p, q = RP1.point((2,)), RP1.point((0,))
sage: p in C0.domain()
True
sage: p in C1.domain()
True
sage: q in C0.domain()
True
sage: q in C1.domain()
False
sage: C1(p)
(1/2,)

sage: p, q = RP1.point((3,), chart = C1), RP1.point((0,), chart = C1)
sage: p in C0.domain()
True
sage: q in C0.domain()
False
sage: C0(p)
(1/3,)
>>> from sage.all import *
>>> RP2 = manifolds.RealProjectiveSpace(); RP2
2-dimensional topological manifold RP2
>>> latex(RP2)
\mathbb{RP}^{2}

>>> C0, C1, C2 = RP2.top_charts()
>>> p = RP2.point((Integer(2),Integer(0)), chart = C0)
>>> q = RP2.point((Integer(0),Integer(3)), chart = C0)
>>> p in C0.domain()
True
>>> p in C1.domain()
True
>>> C1(p)
(1/2, 0)
>>> p in C2.domain()
False
>>> q in C0.domain()
True
>>> q in C1.domain()
False
>>> q in C2.domain()
True
>>> C2(q)
(1/3, 0)

>>> r = RP2.point((Integer(2),Integer(3)))
>>> r in C0.domain() and r in C1.domain() and r in C2.domain()
True
>>> C0(r)
(2, 3)
>>> C1(r)
(1/2, 3/2)
>>> C2(r)
(1/3, 2/3)

>>> p = RP2.point((Integer(2),Integer(3)), chart = C1)
>>> p in C0.domain() and p in C1.domain() and p in C2.domain()
True
>>> C0(p)
(1/2, 3/2)
>>> C2(p)
(2/3, 1/3)

>>> RP1 = manifolds.RealProjectiveSpace(Integer(1)); RP1
1-dimensional topological manifold RP1
>>> C0, C1 = RP1.top_charts()
>>> p, q = RP1.point((Integer(2),)), RP1.point((Integer(0),))
>>> p in C0.domain()
True
>>> p in C1.domain()
True
>>> q in C0.domain()
True
>>> q in C1.domain()
False
>>> C1(p)
(1/2,)

>>> p, q = RP1.point((Integer(3),), chart = C1), RP1.point((Integer(0),), chart = C1)
>>> p in C0.domain()
True
>>> q in C0.domain()
False
>>> C0(p)
(1/3,)
sage.manifolds.catalog.Torus(R=2, r=1, names=None)[source]#

Generate a 2-dimensional torus embedded in Euclidean space.

The shortcut operator .<,> can be used to specify the coordinates.

INPUT:

  • R – (default: 2) distance form the center to the center of the tube

  • r – (default: 1) radius of the tube

  • names – (default: None) name of the coordinates, automatically set by the shortcut operator

OUTPUT:

  • Riemannian manifold

EXAMPLES:

sage: T.<theta, phi> = manifolds.Torus(3, 1)
sage: T
2-dimensional Riemannian submanifold T embedded in the Euclidean
 space E^3
sage: T.atlas()
[Chart (T, (theta, phi))]
sage: T.embedding().display()
T → E^3
   (theta, phi) ↦ (X, Y, Z) = ((cos(theta) + 3)*cos(phi),
                                  (cos(theta) + 3)*sin(phi),
                                  sin(theta))
sage: T.metric().display()
gamma = dtheta⊗dtheta + (cos(theta)^2 + 6*cos(theta) + 9) dphi⊗dphi
>>> from sage.all import *
>>> T = manifolds.Torus(Integer(3), Integer(1), names=('theta', 'phi',)); (theta, phi,) = T._first_ngens(2)
>>> T
2-dimensional Riemannian submanifold T embedded in the Euclidean
 space E^3
>>> T.atlas()
[Chart (T, (theta, phi))]
>>> T.embedding().display()
T → E^3
   (theta, phi) ↦ (X, Y, Z) = ((cos(theta) + 3)*cos(phi),
                                  (cos(theta) + 3)*sin(phi),
                                  sin(theta))
>>> T.metric().display()
gamma = dtheta⊗dtheta + (cos(theta)^2 + 6*cos(theta) + 9) dphi⊗dphi