{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Short demo of differentiable manifolds in SageMath" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First we set up the notebook to display math with LaTeX:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%display latex" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Declaring a manifold" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We introduce a 2-dimensional manifold $S$, aimed to represent the sphere $\\mathbb{S}^2$ (or more precisely the part of $\\mathbb{S}^2$ covered by spherical coordinates):" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2-dimensional differentiable manifold S\n" ] } ], "source": [ "S = Manifold(2, 'S')\n", "print(S)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This manifold is created \"bare\", with no chart in its (user) atlas. This means that the manifold is not fully defined yet:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\right]$" ], "text/plain": [ "[]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "S.atlas()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Adding a coordinate chart" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We create the chart of spherical coordinates $(\\theta, \\phi)$ via the method `chart()`, by providing the coordinate ranges and their LaTeX symbols:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "X.