## Example notebooks

The notebooks are in the Jupyter format (ipynb).
**They can be read directly in
the browser by just clicking on their names in the list below.**
The notebooks are opened in read-only mode, but you can access to an interactive version by clicking on *Execute on Binder* in the top right menu.

To download a notebook and run it on your computer, click on [ipynb] (or on the download button in the notebook top right menu) and type

sage -n jupyter example_file.ipynb

See also the tutorial notebook (Japanese version is here), the tutorial videos, the plot tutorial (plots of coordinate charts, manifold points, vector fields and curves), the tutorial on pseudo-Riemannian manifolds (metric, Levi-Civita connection, curvature, geodesics) [video] and the series of notebooks Introduction to manifolds in SageMath.

### 2-dimensional manifolds

- Sphere S
^{2}[pdf] [ipynb] (multiple domains and charts, transition maps, scalar and vector fields, tangent spaces, curves, plot of charts and vector fields, embedding, pullback, Riemannian metric); a version using SymPy as symbolic backend, instead of SageMath default is here; a simplified version on CoCalc is here - Mercator projection and connection with torsion on S
^{2}[ipynb] (a nice example of an affine connection with non-zero torsion) - Euclidean plane E
^{2}[ipynb] [CoCalc] (Cartesian and polar coordinates, vector calculus) - Hyperbolic plane H
^{2}[pdf] [ipynb] (many charts associated with various models of H^{2}, embedding, pullback, curvature, changes of chart, graphics) - Real projective plane RP
^{2}[pdf] [ipynb] (minimal atlas with 3 charts, transition maps, differential mappings, Roman surface, Boy surface)

### 3-dimensional manifolds

- Euclidean space E
^{3}(Cartesian, spherical and cylindrical coordinates, vector calculus) - Sphere S
^{3}: charts, quaternions and Hopf fibration [ipynb] (various charts, embedding in R^{4}, maps, curves, 3D graphics) - Sphere S
^{3}: vector fields and left-invariant parallelization [ipynb] (right translations, global vector fields and global frame, link with the Hopf fibration) - Sphere S
^{3}: round metric [ipynb] (round metric as the pullback of Euclidean metric on R^{4}, Riemann tensor, volume 3-form)

### Tensor algebra

- Tensors on free modules of finite rank [pdf] [ipynb] (pure algebraic part of SageManifolds)

### Maximally symmetric spacetimes

- Minkowski spacetime [ipynb] (null coordinates, induced metric, conformal completion, Penrose diagram, embedding in the Einstein cylinder)
- Anti-de Sitter spacetime
[ipynb]
(immersion in R
^{2,3}, induced metric, curvature, geodesics, Einstein cylinder, Poincaré patch) - Poincaré horizon in anti-de Sitter spacetime [ipynb] (degenerate Killing horizon) [video]
- de Sitter spacetime [pdf] [ipynb] (map between manifolds, induced metric, curvature, maximally symmetric space)

### Black hole spacetimes

- Schwarzschild spacetime (basics) [ipynb] (Christoffel symbols, Riemann tensor, Kretschmann scalar)
- Schwarzschild spacetime [pdf] [ipynb] (Einstein equation, Bianchi identity, change of chart, change of vector frame, Kruskal-Szekeres coordinates)
- Introducing pseudo-Riemannian manifolds on the Schwarzchild spacetime example [ipynb] (manifold, charts, points, vector fields, metric, curvature, geodesics)
- Computing a geodesic in Schwarzschild spacetime [ipynb] (numerical integration of the geodesic equation)
- More geodesics in Schwarzschild spacetime [ipynb] (numerical integration of the geodesic equation)
- Image of an accretion disk around a Schwarzschild black hole [ipynb] (numerical integration of many geodesics)
- Carter-Penrose diagram of Schwarzschild spacetime [pdf] [ipynb] (change of chart, change of vector frame)
- Kerr spacetime [pdf] [ipynb] (Killing equation, Einstein equation, Bianchi identity, Kretschmann scalar)
- Kerr-Newman spacetime [pdf] [ipynb] (Maxwell equations, Killing equation, Bianchi identity, Einstein equation, Kretschmann scalar)
- Kerr spacetime: plot of the horizons and ergosurfaces [ipynb] (Rational polynomial, Kerr and Kerr-Schild coordinates, Kretschmann scalar, animated plot of the horizons and ergosurfaces)
- Principal null directions in Kerr spacetime [ipynb] (Weyl tensor, principal null vectors, index notations)
- Walker-Penrose Killing tensor in Kerr spacetime [ipynb] (Killing equation, principal null vectors, symmetrization, Killing tensor)
- 3+1 slicing of Kerr spacetime [pdf] [ipynb] (3-metric, lapse, shift, extrinsic curvature, 3+1 Einstein equations, electric and magnetic parts of the Weyl tensor)
- Simon-Mars tensor and Kerr spacetime [pdf] [ipynb] (Weyl tensor, self-dual Killing form, Simon-Mars tensor)
- 3+1 Simon-Mars tensor in Kerr spacetime [pdf] [ipynb] (3+1 Einstein equations, 3+1 decomposition of the Simon-Mars tensor)
- Near-horizon geometry of the extremal Kerr black hole [ipynb] (coordinate changes, tensor series expansion, Killing form)
- 5-dimensional Kerr-AdS spacetime [ipynb] (5-dimensional Einstein equation)
- Chaotic photon orbits and shadows of a non-Kerr object described by the Hartle-Thorne spacetime: notebook 1, notebook 2, notebook 3

Other examples regarding black hole spacetimes are posted here.

Examples regarding black branes in 5-dimensional spacetimes: black branes in Lifshitz-like spacetimes and Vaidya-Lifshitz solution

### Cosmological spacetimes

- Friedmann equations [pdf] [ipynb] (FLRW metric, Einstein equation)

### Other examples in General Relativity

- Tolman-Oppenheimer-Volkoff equations [pdf] [ipynb] (Derivation of the TOV equations from the Einstein equation, numerical resolution to get models of relativistic stars)
- Lemaître-Tolman solutions [ipynb] (Solving the Einstein equation for spherically symmetric pressureless fluids)
- Curzon-Chazy spacetime: Simon-Mars tensor [pdf] [ipynb] (Weyl tensor, self-dual Killing form, Simon-Mars tensor)
- Tomimatsu-Sato spacetime: Einstein equations [pdf] [ipynb] (3+1 Einstein equations)
- Tomimatsu-Sato spacetime: Simon-Mars tensor [pdf] [ipynb] (3+1 decomposition of the Simon-Mars tensor, 2D and 3D graphics)

### Examples in solid state physics and electromagnetism

- Elasticity theory in Euclidean space (Cartesian coordinates) [pdf] [ipynb] (strain and stress tensors, Hooke's law)
- Elasticity theory in Euclidean space (spherical coordinates) [pdf] [ipynb] (strain and stress tensors, Hooke's law)
- Electromagnetism in Minkowski spacetime [ipynb] (Electromagnetic field 2-form from E and B, Maxwell equations, conserved current, Lorentz force, Poynting vector)

### Analysis on manifolds

### Submanifolds

- Foliation of Kerr spacetime by spacelike hypersurfaces [ipynb] (intrinsic and extrinsic geometry)
- Manifolds and submanifolds equipped with a degenerate metric [ipynb] (degenerate metric, rigging, screen distribution, Weingarten map, shape operator)
- Event horizon of Schwarzschild black hole as a degenerate submanifold [ipynb] (degenerate metric, embedding, screen distribution, Weingarten map)

### Vector bundles

- Simple vector bundles [ipynb] (vector bundle, tensor bundle, section)
- Mixed differential forms and characteristic classes [ipynb] (graded algebra of mixed differential forms, characteristic class, Chern class, Euler class)
- Characteristic classes in SageMath (a general introduction)

See also the tutorial notebook (Japanese version is here) and the tutorial videos for a basic introduction, as well as the plot tutorial for plots of coordinate charts, manifold points, vector fields and curves.