{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Sage多様体演習 Sage manifold tutorial\n", "\n", "このワークシートはSageMathにおける微分可能多様体の取り扱いについての簡単な紹介です。以下で紹介するツールは[SageManifolds](https://sagemanifolds.obspm.fr/) プロジェクト (version 1.2, included in SageMath 8.2).を通じて実装されました。\n", "ipnyb形式のワークシートファイルは[ここ](https://raw.githubusercontent.com/sagemanifolds/SageManifolds/master/Notebooks/SM_tutorial.ipynb) からダウンロード可能です。このワークシートを実行するには、コマンド`sage -n jupyter`などを使ってSageMathのJupyterノートブックインタフェースを起動する必要があります。\n", "\n", "[訳注:この日本語版翻訳は山本 昇によって作成されました。翻訳者へのご連絡は、https://souran.kek.jp/kss/top/ を経由して、 職員情報詳細ページ内の「メール送信」リンクをご利用ください。この翻訳版作成にあたり、東海大学理学部北林さんには貴重なコメントをいただきました。この場を借りてお礼申しあげます。\n", "(2023/05/02追記:原文の更新を反映しました。)]\n", "\n", "This notebook provides a short introduction to differentiable manifolds in SageMath. The tools described\n", "below have been implemented through the [SageManifolds](https://sagemanifolds.obspm.fr/) project.\n", "\n", "Click [here](https://raw.githubusercontent.com/sagemanifolds/SageManifolds/master/Notebooks/SM_tutorial.ipynb) to download the worksheet file (ipynb format). To run it, you must start SageMath with the Jupyter notebook, via the command `sage -n jupyter`\n", "\n", "[Note for Japanese version.: this document was translated into Japanese by Noboru Yamamoto. You can reach him through https://souran.kek.jp/kss/top/. \"Staff Detail Information\" page includes a link \"send email\". The translator thanks Prof. Kitabayashi of Tokai University for his valuable comments on the draft of the documents.]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "このワークシートはSageMathのバージョン 9.2 (あるいはそれ以降)を必要としています、それ以前のバージョンではSageManifoldsの全ての機能が利用可能というわけではないからです。 [訳注:このjupyter notebookはSageMath 9.8 を使って実行しています。]\n", "\n", "This notebook is valid for version 9.2 or higher of SageMath:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'SageMath version 9.8, Release Date: 2023-02-11'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "version()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "最初に、ノートブックが結果をLaTexを使った数式表示で表示するようにします。\n", "\n", "First we set up the notebook to display mathematical objects using LaTeX rendering:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "%display latex" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 多様体の定義 Defining a manifold\n", "\n", "例として、 $\\mathbb{R}$上の3次元の微分可能多様体を定義します。\n", "\n", "As an example let us define a differentiable manifold of dimension 3 over $\\mathbb{R}$:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "M = Manifold(3, 'M', latex_name=r'\\mathcal{M}', start_index=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- 最初の引数、`3`, は多様体の次元です。SageManifoldsでは任意の正の整数を指定できます。\n", "- 2番目の引数, `'M'`, は多様体の名前を与える文字列です。この名前は = 記号の左辺にあるシンボルの名前(ここでは`M`)と\n", "異なっていても構いません。左辺のシンボル名はコンピュータメモリのなかの多様体オブジェクトを参照しています。一方、\n", "引数であたえる名前は、多様体に与えられた数学的な名前です。\n", "- 省略可能な引数, `latex_name=r'\\mathcal{M}'`, はこの多様体をLaTeXで表示する際に使う名前を指定します。\n", "最初の引用符の前の 'r' に注意してください。:これはこの文字列が *raw* 文字列であることを示しています。\n", "それによって文字列`\\mathcal`中のバックスラッシュ '\\\\' は通常の文字として取り扱われます( '\\\\\\\\' としてエスケープする必要がないということです)。\n", "この引数(`latex_name`)が省略された場合は、第2引数に与えられた名前(ここでは`M`です)が使われます。\n", "- 次の省略可能な引数`start_index=1`は多様体のテンソル成分の指標の範囲を指定しています。これを1とすることは指標の範囲が$\\{1,2,3\\}$であることを示しています。この引数の既定値は `start_index=0` です。\n", "\n", "- The first argument, `3`, is the manifold dimension. In SageManifolds, it can be any\n", " positive integer.\n", "- The second argument, `'M'`, is a string defining the manifold's name; it may be \n", " different from the symbol set on the left-hand side of the = sign (here `M`): the latter\n", " stands for a mere Python variable, which refers to the manifold object in the computer \n", " memory, while the string `'M'` is the mathematical symbol chosen for the manifold.\n", "- The optional argument `latex_name=r'\\mathcal{M}'` sets the LaTeX\n", " symbol to display the manifold. Note the letter 'r' in front on the first quote: \n", " it indicates that the string is a *raw* one, so that the backslash character \n", " in `\\mathcal` is considered as an ordinary character (otherwise, the backslash is \n", " used to escape some special characters). If the argument `latex_name` is not \n", " provided by the user, it is set to the string used as the second argument (here `'M'`)\n", "- The optional argument `start_index=1` defines the range of indices to be used for \n", " tensor components on the manifold: setting it to 1 means that indices will range \n", " in $\\{1,2,3\\}$. The default value is `start_index=0`.\n", "\n", "規定のベースフィールド(基底)は$\\mathbb{R}$であることに注意してください。もし、\n", "`field='complex'`,が与えられていれば、複素数体$\\mathbb{C}$を基底として持つ\n", "多様体が定義されます。[[list of all options](http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/manifold.html#sage.manifolds.manifold.Manifold) を参照のこと]\n", "\n", "Note that the default base field is $\\mathbb{R}$. If we would have used the optional\n", "argument `field='complex'`, we would have defined a manifold over $\\mathbb{C}$. See the\n", "[list of all options](http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/manifold.html#sage.manifolds.manifold.Manifold) for more details. \n", "\n", "Mを要求すると、そのLaTexのシンボルとして表示されます。\n", "\n", "If we ask for M, it is displayed via its LaTeX symbol:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathcal{M}\\)" ], "text/latex": [ "$\\displaystyle \\mathcal{M}$" ], "text/plain": [ "3-dimensional differentiable manifold M" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "代わりに `print` 関数を使うと、簡潔な記述が表示されます。\n", "\n", "If we use the `print` function instead, we get a short description of the object:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(M)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`type` コマンドを使うと、`M`に対応するPythonオブジェクトのタイプ(`DifferentiableManifold_with_category`)が表示できます。\n", "\n", "
Via the command type, we get the type of the Python object corresponding to M (here the Python class DifferentiableManifold_with_category):
" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The indices on the manifold are generated by the method irange(), to be used in loops:
" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[1, 2, 3\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[1, 2, 3\\right]$" ], "text/plain": [ "[1, 2, 3]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[i for i in M.irange()]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`start_index` パラメータが明示的に指定されていない場合、多様体の指標は 0 からはじまります、例えばこの例のように(0,1,2) の範囲となります。\n", "\n", "If the parameter start_index had not been specified, the default range of the indices would have been $\\{0,1,2\\}$ instead:
" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[0, 1, 2\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[0, 1, 2\\right]$" ], "text/plain": [ "[0, 1, 2]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M0 = Manifold(3, 'M', r'\\mathcal{M}')\n", "[i for i in M0.irange()]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 多様体上の座標系(chart)の定義:Defining a chart on the manifold\n", "まずは、多様体 $\\mathcal{M}$ は一つの座標系で覆われると仮定します(そうでない場合は以下で議論されます)。\n", "座標系は次のように宣言されます。\n", "Let us assume that the manifold $\\mathcal{M}$ can be covered by a single chart (other cases are discussed below); the chart is declared as follows:
" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "X.The chart is displayed as a pair formed by the open set covered by it (here the whole manifold) and the coordinates:
" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Chart (M, (x, y, z))\n" ] } ], "source": [ "print(X)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\mathcal{M},(x, y, z)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\mathcal{M},(x, y, z)\\right)$" ], "text/plain": [ "Chart (M, (x, y, z))" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "それぞれの座標値は指標を使って入手できます。指標の指定方法は多様体の定義時の設定(`start_index=1`)に従います。\n", "\n", "The coordinates can be accessed individually, by means of their indices, following the convention defined by start_index=1 in the manifold's definition:
" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle x\\)" ], "text/latex": [ "$\\displaystyle x$" ], "text/plain": [ "x" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X[1]" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle y\\)" ], "text/latex": [ "$\\displaystyle y$" ], "text/plain": [ "y" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X[2]" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle z\\)" ], "text/latex": [ "$\\displaystyle z$" ], "text/plain": [ "z" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X[3]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "座標の全体は`[:]` 演算子を使って取得します。\n", "The full set of coordinates is obtained by means of the operator [:]:
" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(x, y, z\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(x, y, z\\right)$" ], "text/plain": [ "(x, y, z)" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "座標系定義で使った `Real-valued functions of the chart coordinates (mathematically speaking, functions defined on the chart codomain) are generated via the method function() acting on the chart:
" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle z^{3} + y^{2} + x\\)" ], "text/latex": [ "$\\displaystyle z^{3} + y^{2} + x$" ], "text/plain": [ "z^3 + y^2 + x" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f = X.function(x+y^2+z^3) \n", "f" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(x, y, z\\right) \\mapsto z^{3} + y^{2} + x\\)" ], "text/latex": [ "$\\displaystyle \\left(x, y, z\\right) \\mapsto z^{3} + y^{2} + x$" ], "text/plain": [ "(x, y, z) ↦ z^3 + y^2 + x" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.display()" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle 32\\)" ], "text/latex": [ "$\\displaystyle 32$" ], "text/plain": [ "32" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f(1,2,3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "これらの関数は、SageManiforldsのクラス `ChartFunction` (実際には、そのサブクラス`𝙲𝚑𝚊𝚛𝚝𝙵𝚞𝚗𝚌𝚝𝚒𝚘𝚗𝚁𝚒𝚗𝚐_𝚠𝚒𝚝h_𝚌𝚊𝚝𝚎𝚐𝚘𝚛𝚢.𝚎𝚕𝚎𝚖𝚎𝚗t_𝚌𝚕𝚊𝚜𝚜`)に属しています。\n", "\n", "They belong to the class `ChartFunction` (actually the subclass `𝙲𝚑𝚊𝚛𝚝𝙵𝚞𝚗𝚌𝚝𝚒𝚘𝚗𝚁𝚒𝚗𝚐_𝚠𝚒𝚝h_𝚌𝚊𝚝𝚎𝚐𝚘𝚛𝚢.𝚎𝚕𝚎𝚖𝚎𝚗t_𝚌𝚕𝚊𝚜𝚜`):" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "and differ from SageMath standard symbolic functions by automatic simplifications in all operations. For instance, adding the two symbolic functions
" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [], "source": [ "f0(x,y,z) = cos(x)^2 ; g0(x,y,z) = sin(x)^2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "は、次の結果になります。\n", "\n", "results in
" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left( x, y, z \\right) \\ {\\mapsto} \\ \\cos\\left(x\\right)^{2} + \\sin\\left(x\\right)^{2}\\)" ], "text/latex": [ "$\\displaystyle \\left( x, y, z \\right) \\ {\\mapsto} \\ \\cos\\left(x\\right)^{2} + \\sin\\left(x\\right)^{2}$" ], "text/plain": [ "(x, y, z) |--> cos(x)^2 + sin(x)^2" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f0 + g0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "一方、`ChartFunction` クラスに属する関数は自動的に簡約化されます。\n", "\n", "while the sum of the corresponding functions in the class ChartFunction is automatically simplified:
" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle 1\\)" ], "text/latex": [ "$\\displaystyle 1$" ], "text/plain": [ "1" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f1 = X.function(cos(x)^2) ; g1 = X.function(sin(x)^2)\n", "f1 + g1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "同じ結果を記号的関数でも得るためには、`simplify_trig()` メソッドを使います。\n", "\n", "To get the same output with symbolic functions, one has to invoke the method simplify_trig():
" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left( x, y, z \\right) \\ {\\mapsto} \\ 1\\)" ], "text/latex": [ "$\\displaystyle \\left( x, y, z \\right) \\ {\\mapsto} \\ 1$" ], "text/plain": [ "(x, y, z) |--> 1" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(f0 + g0).simplify_trig()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "違いは表示方法にもあります。記号関数 `f0` を表示させると、\n", "\n", "Another difference regards the display; if we ask for the symbolic function f0, we get:
" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left( x, y, z \\right) \\ {\\mapsto} \\ \\cos\\left(x\\right)^{2}\\)" ], "text/latex": [ "$\\displaystyle \\left( x, y, z \\right) \\ {\\mapsto} \\ \\cos\\left(x\\right)^{2}$" ], "text/plain": [ "(x, y, z) |--> cos(x)^2" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "となりますが、座標関数 `f1` を表示させると、座標表示だけが表示されます。\n", "\n", "while if we ask for the chart function f1, we get only the coordinate expression:
" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\cos\\left(x\\right)^{2}\\)" ], "text/latex": [ "$\\displaystyle \\cos\\left(x\\right)^{2}$" ], "text/plain": [ "cos(x)^2" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`f0` の場合と同じような表示を望む場合には、 `display()` メソッドを使います。\n", "\n", "To get an output similar to that of f0, one should call the method display():
" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(x, y, z\\right) \\mapsto \\cos\\left(x\\right)^{2}\\)" ], "text/latex": [ "$\\displaystyle \\left(x, y, z\\right) \\mapsto \\cos\\left(x\\right)^{2}$" ], "text/plain": [ "(x, y, z) ↦ cos(x)^2" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f1.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`expr()`メソッドは基になる記号表現を返すことを覚えておいてください。\n", "Note that the method `expr()` returns the underlying symbolic expression:" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\cos\\left(x\\right)^{2}\\)" ], "text/latex": [ "$\\displaystyle \\cos\\left(x\\right)^{2}$" ], "text/plain": [ "cos(x)^2" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f1.expr()" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "We introduce another chart on $U$, with spherical-type coordinates $(r,\\theta,\\phi)$:
" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(U,(r, {\\theta}, {\\phi})\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(U,(r, {\\theta}, {\\phi})\\right)$" ], "text/plain": [ "Chart (U, (r, th, ph))" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y.The function chart() has now some argument; it is a string, which contains specific LaTeX symbols, hence the prefix 'r' to it (for raw string). It also contains the coordinate ranges, since they are different from the default value, which is $(-\\infty, +\\infty)$. For a given coordinate, the various fields are separated by the character ':' and a space character separates the coordinates. Note that for the coordinate $r$, there are only two fields, since the LaTeX symbol has not to be specified. The LaTeX symbols are used for the outputs:
" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left({\\theta}, {\\phi}\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left({\\theta}, {\\phi}\\right)$" ], "text/plain": [ "(th, ph)" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "th, ph" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left({\\theta}, {\\phi}\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left({\\theta}, {\\phi}\\right)$" ], "text/plain": [ "(th, ph)" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y[2], Y[3]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Sageが使っている座標の条件は、`assumptions()`メソッドを使って確認することができます。\n", "\n", "The declared coordinate ranges are now known to Sage, as we may check by means of the command assumptions():
" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\verb|x|\\verb| |\\verb|is|\\verb| |\\verb|real|, \\verb|y|\\verb| |\\verb|is|\\verb| |\\verb|real|, \\verb|z|\\verb| |\\verb|is|\\verb| |\\verb|real|, \\verb|r|\\verb| |\\verb|is|\\verb| |\\verb|real|, r > 0, \\verb|th|\\verb| |\\verb|is|\\verb| |\\verb|real|, {\\theta} > 0, {\\theta} < \\pi, \\verb|ph|\\verb| |\\verb|is|\\verb| |\\verb|real|, {\\phi} > 0, {\\phi} < 2 \\, \\pi\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\verb|x|\\verb| |\\verb|is|\\verb| |\\verb|real|, \\verb|y|\\verb| |\\verb|is|\\verb| |\\verb|real|, \\verb|z|\\verb| |\\verb|is|\\verb| |\\verb|real|, \\verb|r|\\verb| |\\verb|is|\\verb| |\\verb|real|, r > 0, \\verb|th|\\verb| |\\verb|is|\\verb| |\\verb|real|, {\\theta} > 0, {\\theta} < \\pi, \\verb|ph|\\verb| |\\verb|is|\\verb| |\\verb|real|, {\\phi} > 0, {\\phi} < 2 \\, \\pi\\right]$" ], "text/plain": [ "[x is real,\n", " y is real,\n", " z is real,\n", " r is real,\n", " r > 0,\n", " th is real,\n", " th > 0,\n", " th < pi,\n", " ph is real,\n", " ph > 0,\n", " ph < 2*pi]" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "assumptions()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "これらの条件は、表現の簡約化の際に使われます。\n", "\n", "They are used in simplifications:
" ] }, { "cell_type": "code", "execution_count": 38, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle r\\)" ], "text/latex": [ "$\\displaystyle r$" ], "text/plain": [ "r" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "simplify(abs(r))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$r >0$ と仮定されているので、$\\mathrm{abs}(r)$ は $r$ に簡約されます。" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle {\\left| x \\right|}\\)" ], "text/latex": [ "$\\displaystyle {\\left| x \\right|}$" ], "text/plain": [ "abs(x)" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "simplify(abs(x)) # no simplification occurs since x can take any value in R " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$x$ は$R$の負の値を含むどんな値でも取ることができますから、$\\mathrm{abs}(x)$ は簡約できません。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "座標 $Y$が宣言されたあとで、さらに 遷移写像を指定することで、$Y$の$X_U$への関係を完全に特定することができます。\n", "After having been declared, the chart Y can be fully specified by its relation to the chart X_U, via a transition map:
" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(U,(r, {\\theta}, {\\phi})\\right) \\rightarrow \\left(U,(x, y, z)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(U,(r, {\\theta}, {\\phi})\\right) \\rightarrow \\left(U,(x, y, z)\\right)$" ], "text/plain": [ "Change of coordinates from Chart (U, (r, th, ph)) to Chart (U, (x, y, z))" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "transit_Y_to_X = Y.transition_map(X_U,\n", " [r*sin(th)*cos(ph), r*sin(th)*sin(ph), r*cos(th)])\n", "transit_Y_to_X" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left\\{\\begin{array}{lcl} x & = & r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\\\ y & = & r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\\\ z & = & r \\cos\\left({\\theta}\\right) \\end{array}\\right.\\)" ], "text/latex": [ "$\\displaystyle \\left\\{\\begin{array}{lcl} x & = & r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\\\ y & = & r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\\\ z & = & r \\cos\\left({\\theta}\\right) \\end{array}\\right.$" ], "text/plain": [ "x = r*cos(ph)*sin(th)\n", "y = r*sin(ph)*sin(th)\n", "z = r*cos(th)" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "transit_Y_to_X.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`set_inverse()` メソッドを用いることで、遷移写像の逆写像を指定することができます。\n", "\n", "The inverse of the transition map can be specified by means of the method set_inverse():
" ] }, { "cell_type": "code", "execution_count": 42, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Check of the inverse coordinate transformation:\n", " r == r *passed*\n", " th == arctan2(r*sin(th), r*cos(th)) **failed**\n", " ph == arctan2(r*sin(ph)*sin(th), r*cos(ph)*sin(th)) **failed**\n", " x == x *passed*\n", " y == y *passed*\n", " z == z *passed*\n", "NB: a failed report can reflect a mere lack of simplification.\n" ] } ], "source": [ "transit_Y_to_X.set_inverse(sqrt(x^2+y^2+z^2), atan2(sqrt(x^2+y^2),z), atan2(y, x))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "導かれた逆写像は、それと元の写像を組み合わせることで検証できます。\n", "左辺と右辺がそれぞれに対応しています。\n", "上の結果が示しているように、thとphの検証が失敗したと報告されているのは、\n", "arctan2が関係する表式の単純化が不十分であることに起因しています。\n", "\n", "A check of the provided inverse is performed by composing \n", "it with the original transition map, on the left and\n", "on the right respectively. As indicated, the reported failure for th and ph is actually due to a lack of\n", "simplification of expressions involving arctan2 .\n", "We have then" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left\\{\\begin{array}{lcl} r & = & \\sqrt{x^{2} + y^{2} + z^{2}} \\\\ {\\theta} & = & \\arctan\\left(\\sqrt{x^{2} + y^{2}}, z\\right) \\\\ {\\phi} & = & \\arctan\\left(y, x\\right) \\end{array}\\right.\\)" ], "text/latex": [ "$\\displaystyle \\left\\{\\begin{array}{lcl} r & = & \\sqrt{x^{2} + y^{2} + z^{2}} \\\\ {\\theta} & = & \\arctan\\left(\\sqrt{x^{2} + y^{2}}, z\\right) \\\\ {\\phi} & = & \\arctan\\left(y, x\\right) \\end{array}\\right.$" ], "text/plain": [ "r = sqrt(x^2 + y^2 + z^2)\n", "th = arctan2(sqrt(x^2 + y^2), z)\n", "ph = arctan2(y, x)" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "transit_Y_to_X.inverse().display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "この段階で、多様体のアトラス( `user atlas`であって最大アトラスではありません)は三つの座標系を含んでいます。\n", "\n", "At this stage, the manifold's atlas (the \"user atlas\", not the maximal atlas!) contains three charts:
" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left(\\mathcal{M},(x, y, z)\\right), \\left(U,(x, y, z)\\right), \\left(U,(r, {\\theta}, {\\phi})\\right)\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left(\\mathcal{M},(x, y, z)\\right), \\left(U,(x, y, z)\\right), \\left(U,(r, {\\theta}, {\\phi})\\right)\\right]$" ], "text/plain": [ "[Chart (M, (x, y, z)), Chart (U, (x, y, z)), Chart (U, (r, th, ph))]" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.atlas()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "多様体に最初に定義された座標系は既定の座標系とみなされます。既定座標系はあとで、`set_default_chart()`メソッドを使って変更できます。\n", "\n", "The first chart defined on the manifold is considered as the manifold's default chart (it can be changed by the method set_default_chart()):
" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\mathcal{M},(x, y, z)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\mathcal{M},(x, y, z)\\right)$" ], "text/plain": [ "Chart (M, (x, y, z))" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.default_chart()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "各々の開部分空間は各自のアトラスを持っています。開部分空間はそれ自身でも多様体であるからです。\n", "Each open subset has its own atlas (since an open subset of a manifold is a manifold by itself):
" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left(U,(x, y, z)\\right), \\left(U,(r, {\\theta}, {\\phi})\\right)\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left(U,(x, y, z)\\right), \\left(U,(r, {\\theta}, {\\phi})\\right)\\right]$" ], "text/plain": [ "[Chart (U, (x, y, z)), Chart (U, (r, th, ph))]" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "U.atlas()" ] }, { "cell_type": "code", "execution_count": 47, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(U,(x, y, z)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(U,(x, y, z)\\right)$" ], "text/plain": [ "Chart (U, (x, y, z))" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "U.default_chart()" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "Graphics3d Object" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y.plot(X,color={r:'red', th:'green', ph:'blue'})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`Y.plot(X)` コマンドを使って、座標系$Y$を座標系$X$を使って表示することができます。このコマンドは、座標系$Y$で一定の座標値を持つ線を、座標系$X$に基づく\"直交フレーム\"中に表示します。\n", "\n", "We can draw the chart $Y$ in terms of the chart $X$ via the command `Y.plot(X)`, which shows the lines of constant coordinates from the $Y$ chart in a \"Cartesian frame\" based on the $X$ coordinates:" ] }, { "cell_type": "code", "execution_count": 49, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "Graphics3d Object" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y.plot(X, color={r:'blue', th:'green', ph:'red'}, aspect_ratio=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "コマンド`plot()`は多くのオプションを持っています。オプションを使い、描画される座標線の数、スタイル、色、そして座標の範囲などを指定します。\n", "(参照:[list of all options](http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/chart.html#sage.manifolds.chart.RealChart.plot)):\n", "\n", "The command plot() allows for many options, to control the number of coordinate lines to be drawn, their style and color, as well as the coordinate ranges (cf. the [list of all options](http://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/chart.html#sage.manifolds.chart.RealChart.plot)):" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "Graphics3d Object" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y.plot(X, ranges={r:(1,2), th:(0,pi/2)}, number_values=4, \n", " color={r:'blue', th:'green', ph:'red'}, aspect_ratio=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "逆に、(制限された)座標系 $X|_{U}$ を座標系$Y$を使って表示することも可能です。この場合、座標系 $X$ の全てを表示することはできません、なぜなら $X$ の定義域(ドメイン)は $Y$ のそれより広いからです。\n", "\n", "Conversly, the chart $X|_{U}$ can be plotted in terms of the chart $Y$ (this is not possible for the whole chart $X$ since its domain is larger than that of chart $Y$):
" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "Graphics3d Object" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "graph = X_U.plot(Y,color={x:'blue',y:'green', z:'red'})\n", "show(graph, axes_labels=['r','theta','phi'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "オプションを追加してすることで、グラフを見やすくできます。" ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "Graphics3d Object" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "graph = X_U.plot(Y, ranges={x:(0,2), y:(0,2),z:(0,2),\n", " r:(0,5), th:(0,pi/2), ph:(0, 2*pi) }, \n", " number_values=4, \n", " color={x:'blue',y:'green', z:'red'})\n", "show(graph, axes_labels=['r','theta','phi'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 多様体上の点 :Points on the manifold\n", "\n", "多様体$\\mathcal{M}$上の点は、与えられた座標系での座標を使って定義されます。\n", "\n", "A point on $\\mathcal{M}$ is defined by its coordinates in a given chart:
" ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Point p on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle p\\)" ], "text/latex": [ "$\\displaystyle p$" ], "text/plain": [ "Point p on the 3-dimensional differentiable manifold M" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p = M.point((1,2,-1), chart=X, name='p') ; print(p) ; p" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$X=(\\mathcal{M}, (x,y,z))$ は既定の座標系ですから、その名前を省略することが可能です。\n", "Since $X=(\\mathcal{M}, (x,y,z))$ is the manifold's default chart, its name can be omitted:
" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Point p on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle p\\)" ], "text/latex": [ "$\\displaystyle p$" ], "text/plain": [ "Point p on the 3-dimensional differentiable manifold M" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p = M.point((1,2,-1), name='p') ; print(p) ; p" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "もちろんpは多様体$\\mathcal{M}$中の点です。\n", "Of course, $p$ belongs to $\\mathcal{M}$:
" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p in M" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "この点は$U$の中の点でもあります。\n", "\n", "It is also in $U$:
" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p in U" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "実際、点$p$の座標 $y$ は 0 ではありません ( $y\\not=0$ ):(Uは $ y!=0 || x<0 $で定義された開領域)\n", "\n", "Indeed the coordinates of $p$ have $y\\not=0$:
" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(1, 2, -1\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(1, 2, -1\\right)$" ], "text/plain": [ "(1, 2, -1)" ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p.coord(X)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ここで、$X$は$\\mathcal{M}$の既定座標系であることから `coord()` にわたす引数では、省略可能であることに注意してください。\n", "\n", "Note in passing that since $X$ is the default chart on $\\mathcal{M}$, its name can be omitted in the arguments of coord():
" ] }, { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(1, 2, -1\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(1, 2, -1\\right)$" ], "text/plain": [ "(1, 2, -1)" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p.coord()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$p$の座標値は、座標系を点$p$に作用させることによっても得ることができます(座標系の定義により!):\n", "\n", "The coordinates of $p$ can also be obtained by letting the chart acting of the point (from the very definition of a chart!):
" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(1, 2, -1\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(1, 2, -1\\right)$" ], "text/plain": [ "(1, 2, -1)" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "別の点 $q$ を $y = 0$ and $x \\geq 0$を満たす一つの点として定義します。\n", "Let $q$ be a point with $y = 0$ and $x \\geq 0$:
" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [], "source": [ "q = M.point((1,0,2), name='q')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$q$は$U$には属しません。\n", "\n", "This time, the point does not belong to $U$:
" ] }, { "cell_type": "code", "execution_count": 61, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{False}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{False}$" ], "text/plain": [ "False" ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q in U" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "従って、点$q$の座標系$Y=(U, (r,\\theta,\\phi))$ での座標値を求めることはできません。\n", "Accordingly, we cannot ask for the coordinates of $q$ in the chart $Y=(U, (r,\\theta,\\phi))$:
" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Error: the point does not belong to the domain of Chart (U, (r, th, ph))\n" ] } ], "source": [ "try:\n", " q.coord(Y)\n", "except ValueError as exc:\n", " print(\"Error: \" + str(exc))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "しかし、点$p$については可能です。\n", "\n", "but we can for point $p$:
" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\sqrt{3} \\sqrt{2}, \\pi - \\arctan\\left(\\sqrt{5}\\right), \\arctan\\left(2\\right)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\sqrt{3} \\sqrt{2}, \\pi - \\arctan\\left(\\sqrt{5}\\right), \\arctan\\left(2\\right)\\right)$" ], "text/plain": [ "(sqrt(3)*sqrt(2), pi - arctan(sqrt(5)), arctan(2))" ] }, "execution_count": 63, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p.coord(Y)" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\sqrt{3} \\sqrt{2}, \\pi - \\arctan\\left(\\sqrt{5}\\right), \\arctan\\left(2\\right)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\sqrt{3} \\sqrt{2}, \\pi - \\arctan\\left(\\sqrt{5}\\right), \\arctan\\left(2\\right)\\right)$" ], "text/plain": [ "(sqrt(3)*sqrt(2), pi - arctan(sqrt(5)), arctan(2))" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "点は比較可能です。:\n", "Points can be compared:
" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{False}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{False}$" ], "text/plain": [ "False" ] }, "execution_count": 65, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q == p" ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 66, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p1 = U.point((sqrt(3)*sqrt(2), pi-atan(sqrt(5)), atan(2)), chart=Y)\n", "p1 == p" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "SageMathの用語では、点は それが定義された多様体を **親(parents)** として持つ **要素(elements)** です。\n", "In SageMath's terminology, points are elements, whose parents are the manifold on which they have been defined:
" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathcal{M}\\)" ], "text/latex": [ "$\\displaystyle \\mathcal{M}$" ], "text/plain": [ "3-dimensional differentiable manifold M" ] }, "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p.parent()" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathcal{M}\\)" ], "text/latex": [ "$\\displaystyle \\mathcal{M}$" ], "text/plain": [ "3-dimensional differentiable manifold M" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q.parent()" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle U\\)" ], "text/latex": [ "$\\displaystyle U$" ], "text/plain": [ "Open subset U of the 3-dimensional differentiable manifold M" ] }, "execution_count": 69, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p1.parent()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## スカラー場:Scalar fields\n", "***スカラー場*** は微分可能な写像 $U \\longrightarrow \\mathbb{R}$ のことです。ここで $U$ は多様体$\\mathcal{M}$の開部分集合です。\n", "スカラー場はその定義域を覆う座標系を使った式で定義されます。一般には、一つ以上の座標系が定義域全体を覆うためには必要となります。\n", "\n", "A **scalar field** is a differentiable map $U \\to \\mathbb{R}$, where $U$ is an open subset of $\\mathcal{M}$.\n", "\n", "A scalar field is defined by its expressions in terms of charts covering its domain (in general more than one chart is necessary to cover all the domain):" ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field f on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "f = U.scalar_field({X_U: x+y^2+z^3}, name='f') ; print(f)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "座標で書かれた表式は、座標系をキーとしたPythonの辞書型データ`{X_U: x+y^2+z^3}`として渡されます。\n", "この例では、辞書には一つの座標系しかありませんので、次のような表現も可能です。\n", "\n", "The coordinate expressions of the scalar field are passed as a Python dictionary, with the charts as keys, hence the writing {X_U: x+y^2+z^3}.
\n", "Since in the present case, there is only one chart in the dictionary, an alternative writing is
" ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field f on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "f = U.scalar_field({X_U:x+y^2+z^3}, name='f') \n", "print(f)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$X_U$ は定義域 ($U$) の既定の座標系ですので、上記の表現では省略可能です。\n", "\n", "Since X_U is the domain's default chart, it can be omitted in the above declaration:
" ] }, { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field f on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "f = U.scalar_field(x+y^2+z^3, name='f') ; print(f)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "スカラー場は定義域となる多様体から実数体への写像ですから、それは点に対して働き、座標値に対して働くものではありません。\n", "As a mapping $U\\subset\\mathcal{M}\\longrightarrow\\mathbb{R}$, a scalar field acts on points, not on coordinates:" ] }, { "cell_type": "code", "execution_count": 73, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle 4\\)" ], "text/latex": [ "$\\displaystyle 4$" ], "text/plain": [ "4" ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "スカラー場の`display()` メソッドは与えられた座標系でのスカラー場の表現を表示します。\n", "\n", "The method `display()` provides the expression of the scalar field in terms of a given chart:" ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x \\end{array}$" ], "text/plain": [ "f: U → ℝ\n", " (x, y, z) ↦ z^3 + y^2 + x" ] }, "execution_count": 74, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.display(X_U)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "引数なしで呼び出された場合、`display()`メソッドは 定義域 $U$ の上で定義された全ての座標系について、座標表現を表示します。\n", "(但し*副座標系*,即ち制限された副定義域のみで定義された座標系は除きます。)\n", "\n", "If no argument is provided, the method `display()` shows the coordinate expression of the scalar field in all the charts defined on the domain (except for *subcharts*, i.e. the restrictions of some chart to a subdomain):" ] }, { "cell_type": "code", "execution_count": 75, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\end{array}$" ], "text/plain": [ "f: U → ℝ\n", " (x, y, z) ↦ z^3 + y^2 + x\n", " (r, th, ph) ↦ r^3*cos(th)^3 + r^2*sin(ph)^2*sin(th)^2 + r*cos(ph)*sin(th)" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "スカラー場 $f$の 座標$(r,\\theta,\\phi)$ での表現はユーザによって与えられたものではなく、座標系の遷移写像で定義された座標変換のルールを使って自動的に導出されていることに注意してください。\n", "\n", "Note that the expression of $f$ in terms of the coordinates $(r,\\theta,\\phi)$ has not been provided by the user but has been automatically computed by means of the change-of-coordinate formula declared above in the transition map.
" ] }, { "cell_type": "code", "execution_count": 76, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\end{array}$" ], "text/plain": [ "f: U → ℝ\n", " (r, th, ph) ↦ r^3*cos(th)^3 + r^2*sin(ph)^2*sin(th)^2 + r*cos(ph)*sin(th)" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.display(Y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "各座標系で、スカラー場は座標の関数(`CoordFunctionSymb` のオブジェクト)として表現されます。このオブジェクトは`coord_function()`メソッドを通じてアクセス可能です。\n", "In each chart, the scalar field is represented by a function of the chart coordinates (an object of the type CoordFunctionSymb described above), which is accessible via the method coord_function():
" ] }, { "cell_type": "code", "execution_count": 77, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle z^{3} + y^{2} + x\\)" ], "text/latex": [ "$\\displaystyle z^{3} + y^{2} + x$" ], "text/plain": [ "z^3 + y^2 + x" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.coord_function(X_U)" ] }, { "cell_type": "code", "execution_count": 78, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(x, y, z\\right) \\mapsto z^{3} + y^{2} + x\\)" ], "text/latex": [ "$\\displaystyle \\left(x, y, z\\right) \\mapsto z^{3} + y^{2} + x$" ], "text/plain": [ "(x, y, z) ↦ z^3 + y^2 + x" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.coord_function(X_U).display()" ] }, { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)\\)" ], "text/latex": [ "$\\displaystyle r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)$" ], "text/plain": [ "r^3*cos(th)^3 + r^2*sin(ph)^2*sin(th)^2 + r*cos(ph)*sin(th)" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.coord_function(Y)" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(r, {\\theta}, {\\phi}\\right) \\mapsto r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(r, {\\theta}, {\\phi}\\right) \\mapsto r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)$" ], "text/plain": [ "(r, th, ph) ↦ r^3*cos(th)^3 + r^2*sin(ph)^2*sin(th)^2 + r*cos(ph)*sin(th)" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.coord_function(Y).display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"生\"の記号的表現は、`expr()`メソッドの戻り値として返されます。\n", "The \"raw\" symbolic expression is returned by the method expr():
" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle z^{3} + y^{2} + x\\)" ], "text/latex": [ "$\\displaystyle z^{3} + y^{2} + x$" ], "text/plain": [ "z^3 + y^2 + x" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.expr(X_U)" ] }, { "cell_type": "code", "execution_count": 82, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)\\)" ], "text/latex": [ "$\\displaystyle r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)$" ], "text/plain": [ "r^3*cos(th)^3 + r^2*sin(ph)^2*sin(th)^2 + r*cos(ph)*sin(th)" ] }, "execution_count": 82, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.expr(Y)" ] }, { "cell_type": "code", "execution_count": 83, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 83, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.expr(Y) is f.coord_function(Y).expr()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "スカラー場は具体的な式ではなく、座標値の関数を用いて定義することも可能です。\n", "A scalar field can also be defined by some unspecified function of the coordinates:
" ] }, { "cell_type": "code", "execution_count": 84, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field h on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "h = U.scalar_field(function('H')(x, y, z), name='h') ; print(h)" ] }, { "cell_type": "code", "execution_count": 85, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} h:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & H\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & H\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} h:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & H\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & H\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}$" ], "text/plain": [ "h: U → ℝ\n", " (x, y, z) ↦ H(x, y, z)\n", " (r, th, ph) ↦ H(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th))" ] }, "execution_count": 85, "metadata": {}, "output_type": "execute_result" } ], "source": [ "h.display()" ] }, { "cell_type": "code", "execution_count": 86, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} h:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & H\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} h:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & H\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}$" ], "text/plain": [ "h: U → ℝ\n", " (r, th, ph) ↦ H(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th))" ] }, "execution_count": 86, "metadata": {}, "output_type": "execute_result" } ], "source": [ "h.display(Y)" ] }, { "cell_type": "code", "execution_count": 87, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle H\\left(1, 2, -1\\right)\\)" ], "text/latex": [ "$\\displaystyle H\\left(1, 2, -1\\right)$" ], "text/plain": [ "H(1, 2, -1)" ] }, "execution_count": 87, "metadata": {}, "output_type": "execute_result" } ], "source": [ "h(p) # remember that p is the point of coordinates (1,2,-1) in the chart X_U" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$f$の親(parent)は すべての $U$ 上の滑らかなスカラー場からなる集合 $C^\\infty(U)$ です。これは$\\mathbb{R}$上の 可換代数です。\n", "\n", "The parent of $f$ is the set $C^\\infty(U)$ of all smooth scalar fields on $U$, which is a commutative algebra over $\\mathbb{R}$:
" ] }, { "cell_type": "code", "execution_count": 88, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle C^{\\infty}\\left(U\\right)\\)" ], "text/latex": [ "$\\displaystyle C^{\\infty}\\left(U\\right)$" ], "text/plain": [ "Algebra of differentiable scalar fields on the Open subset U of the 3-dimensional differentiable manifold M" ] }, "execution_count": 88, "metadata": {}, "output_type": "execute_result" } ], "source": [ "CU = f.parent() ; CU" ] }, { "cell_type": "code", "execution_count": 89, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Algebra of differentiable scalar fields on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(CU)" ] }, { "cell_type": "code", "execution_count": 90, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathbf{JoinCategory}\\)" ], "text/latex": [ "$\\displaystyle \\mathbf{JoinCategory}$" ], "text/plain": [ "Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces" ] }, "execution_count": 90, "metadata": {}, "output_type": "execute_result" } ], "source": [ "CU.category()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "代数$CU$の基礎体となる環は実数体$\\mathbb{R}$です。それはSageMathではSymbolic Ring (SR)で表現されます。\n", "\n", "The base ring of the algebra is the field $\\mathbb{R}$, which is represented here by SageMath's Symbolic Ring (`SR`):" ] }, { "cell_type": "code", "execution_count": 91, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\text{SR}\\)" ], "text/latex": [ "$\\displaystyle \\text{SR}$" ], "text/plain": [ "Symbolic Ring" ] }, "execution_count": 91, "metadata": {}, "output_type": "execute_result" } ], "source": [ "CU.base_ring()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "スカラー場の代数計算は代数構造を通じて定義されます。\n", "\n", "Arithmetic operations on scalar fields are defined through the algebra structure:
" ] }, { "cell_type": "code", "execution_count": 92, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "s = f + 2*h ; print(s)" ] }, { "cell_type": "code", "execution_count": 93, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} & U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x + 2 \\, H\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + 2 \\, H\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} & U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x + 2 \\, H\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + 2 \\, H\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}$" ], "text/plain": [ "U → ℝ\n", "(x, y, z) ↦ z^3 + y^2 + x + 2*H(x, y, z)\n", "(r, th, ph) ↦ r^3*cos(th)^3 + r^2*sin(ph)^2*sin(th)^2 + r*cos(ph)*sin(th) + 2*H(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th))" ] }, "execution_count": 93, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 接空間:Tangent spaces\n", "\n", "点 $p$での多様体の接ベクトル空間を次のようにして取り出します。\n", "\n", "The tangent vector space to the manifold at point $p$ is obtained as follows:
" ] }, { "cell_type": "code", "execution_count": 94, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle T_{p}\\,\\mathcal{M}\\)" ], "text/latex": [ "$\\displaystyle T_{p}\\,\\mathcal{M}$" ], "text/plain": [ "Tangent space at Point p on the 3-dimensional differentiable manifold M" ] }, "execution_count": 94, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Tp = M.tangent_space(p) ; Tp" ] }, { "cell_type": "code", "execution_count": 95, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tangent space at Point p on the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(Tp)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$T_p\\, \\mathcal{M}$は $\\mathbb{R}$上の3次元のベクトル空間です。\n", "\n", "$T_p\\, \\mathcal{M}$ is a 3-dimensional vector space over $\\mathbb{R}$ (represented here by SageMath's Symbolic Ring (SR)) :
" ] }, { "cell_type": "code", "execution_count": 96, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Category of finite dimensional vector spaces over Symbolic Ring\n" ] } ], "source": [ "print(Tp.category())" ] }, { "cell_type": "code", "execution_count": 97, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle 3\\)" ], "text/latex": [ "$\\displaystyle 3$" ], "text/plain": [ "3" ] }, "execution_count": 97, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Tp.dim()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$T_p\\, \\mathcal{M}$のベクトルの基底は点$p$の周りのベクトルフレームから誘導されます。\n", "\n", "
$T_p\\, \\mathcal{M}$ is automatically endowed with vector bases deduced from the vector frames defined around the point:
" ] }, { "cell_type": "code", "execution_count": 98, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right), \\left(\\frac{\\partial}{\\partial r },\\frac{\\partial}{\\partial {\\theta} },\\frac{\\partial}{\\partial {\\phi} }\\right)\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right), \\left(\\frac{\\partial}{\\partial r },\\frac{\\partial}{\\partial {\\theta} },\\frac{\\partial}{\\partial {\\phi} }\\right)\\right]$" ], "text/plain": [ "[Basis (∂/∂x,∂/∂y,∂/∂z) on the Tangent space at Point p on the 3-dimensional differentiable manifold M,\n", " Basis (∂/∂r,∂/∂th,∂/∂ph) on the Tangent space at Point p on the 3-dimensional differentiable manifold M]" ] }, "execution_count": 98, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Tp.bases()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "対照的に、点 $q$ については、あらかじめ定義された基底は一つだけです。 $q$ はドメイン $U$ に含まれませんので、$(r,\\theta,\\phi)$ に関連づけれられていません。\n", "\n", "For the tangent space at the point $q$, on the contrary, there is only one pre-defined basis, since $q$ is not in the domain $U$ of the frame associated with coordinates $(r,\\theta,\\phi)$:
" ] }, { "cell_type": "code", "execution_count": 99, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right]$" ], "text/plain": [ "[Basis (∂/∂x,∂/∂y,∂/∂z) on the Tangent space at Point q on the 3-dimensional differentiable manifold M]" ] }, "execution_count": 99, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Tq = M.tangent_space(q)\n", "Tq.bases()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ランダムな要素:\n", "\n", "A random element:
" ] }, { "cell_type": "code", "execution_count": 100, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tangent vector at Point p on the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "v = Tp.an_element() ; print(v)" ] }, { "cell_type": "code", "execution_count": 101, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\frac{\\partial}{\\partial x } + 2 \\frac{\\partial}{\\partial y } + 3 \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle \\frac{\\partial}{\\partial x } + 2 \\frac{\\partial}{\\partial y } + 3 \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "∂/∂x + 2 ∂/∂y + 3 ∂/∂z" ] }, "execution_count": 101, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.display()" ] }, { "cell_type": "code", "execution_count": 102, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tangent vector at Point q on the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "u = Tq.an_element() ; print(u)" ] }, { "cell_type": "code", "execution_count": 103, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\frac{\\partial}{\\partial x } + 2 \\frac{\\partial}{\\partial y } + 3 \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle \\frac{\\partial}{\\partial x } + 2 \\frac{\\partial}{\\partial y } + 3 \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "∂/∂x + 2 ∂/∂y + 3 ∂/∂z" ] }, "execution_count": 103, "metadata": {}, "output_type": "execute_result" } ], "source": [ "u.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "上記の簡略化された表現(基底ベクトルに点$p$あるいは$q$の指定がない)から類推されるのとは異なり、$u$と$v$は異なるベクトルです。これらは異なったベクトル空間に属しています。:\n", "\n", "Note that, despite what the above simplified writing may suggest (the mention of the point $p$ or $q$ is omitted in the basis vectors), $u$ and $v$ are different vectors, for they belong to different vector spaces:
" ] }, { "cell_type": "code", "execution_count": 104, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle T_{p}\\,\\mathcal{M}\\)" ], "text/latex": [ "$\\displaystyle T_{p}\\,\\mathcal{M}$" ], "text/plain": [ "Tangent space at Point p on the 3-dimensional differentiable manifold M" ] }, "execution_count": 104, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.parent()" ] }, { "cell_type": "code", "execution_count": 105, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle T_{q}\\,\\mathcal{M}\\)" ], "text/latex": [ "$\\displaystyle T_{q}\\,\\mathcal{M}$" ], "text/plain": [ "Tangent space at Point q on the 3-dimensional differentiable manifold M" ] }, "execution_count": 105, "metadata": {}, "output_type": "execute_result" } ], "source": [ "u.parent()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "とくに $u$と$v$を足し合わせることはできません。\n", "In particular, it is not possible to add $u$ and $v$:
" ] }, { "cell_type": "code", "execution_count": 106, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Error: unsupported operand parent(s) for +: 'Tangent space at Point q on the 3-dimensional differentiable manifold M' and 'Tangent space at Point p on the 3-dimensional differentiable manifold M'\n" ] } ], "source": [ "try:\n", " s = u + v\n", "except TypeError as exc:\n", " print(\"Error: \" + str(exc))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## べクトル場:Vector Fields\n", "全ての座標系は座標系のドメインの上のベクトルフレームを持っています。これは、`coordinate basis`と呼ばれます、\n", "\n", "Each chart defines a vector frame on the chart domain: the so-called coordinate basis:
" ] }, { "cell_type": "code", "execution_count": 107, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\mathcal{M}, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\mathcal{M}, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right)$" ], "text/plain": [ "Coordinate frame (M, (∂/∂x,∂/∂y,∂/∂z))" ] }, "execution_count": 107, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X.frame()" ] }, { "cell_type": "code", "execution_count": 108, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathcal{M}\\)" ], "text/latex": [ "$\\displaystyle \\mathcal{M}$" ], "text/plain": [ "3-dimensional differentiable manifold M" ] }, "execution_count": 108, "metadata": {}, "output_type": "execute_result" } ], "source": [ "X.frame().domain() # this frame is defined on the whole manifold このフレームは多様体全体で定義されています。" ] }, { "cell_type": "code", "execution_count": 109, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(U, \\left(\\frac{\\partial}{\\partial r },\\frac{\\partial}{\\partial {\\theta} },\\frac{\\partial}{\\partial {\\phi} }\\right)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(U, \\left(\\frac{\\partial}{\\partial r },\\frac{\\partial}{\\partial {\\theta} },\\frac{\\partial}{\\partial {\\phi} }\\right)\\right)$" ], "text/plain": [ "Coordinate frame (U, (∂/∂r,∂/∂th,∂/∂ph))" ] }, "execution_count": 109, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y.frame()" ] }, { "cell_type": "code", "execution_count": 110, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle U\\)" ], "text/latex": [ "$\\displaystyle U$" ], "text/plain": [ "Open subset U of the 3-dimensional differentiable manifold M" ] }, "execution_count": 110, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Y.frame().domain() # this frame is defined only on U このフレームは部分多様体 $U$でのみ定義されています。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`frames()`メソッドによって、与えられた開空間で定義されたフレームのリストが入手可能です。\n", "\n", "The list of frames defined on a given open subset is returned by the method frames():
" ] }, { "cell_type": "code", "execution_count": 111, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left(\\mathcal{M}, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right), \\left(U, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right), \\left(U, \\left(\\frac{\\partial}{\\partial r },\\frac{\\partial}{\\partial {\\theta} },\\frac{\\partial}{\\partial {\\phi} }\\right)\\right)\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left(\\mathcal{M}, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right), \\left(U, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right), \\left(U, \\left(\\frac{\\partial}{\\partial r },\\frac{\\partial}{\\partial {\\theta} },\\frac{\\partial}{\\partial {\\phi} }\\right)\\right)\\right]$" ], "text/plain": [ "[Coordinate frame (M, (∂/∂x,∂/∂y,∂/∂z)),\n", " Coordinate frame (U, (∂/∂x,∂/∂y,∂/∂z)),\n", " Coordinate frame (U, (∂/∂r,∂/∂th,∂/∂ph))]" ] }, "execution_count": 111, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.frames()" ] }, { "cell_type": "code", "execution_count": 112, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left(U, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right), \\left(U, \\left(\\frac{\\partial}{\\partial r },\\frac{\\partial}{\\partial {\\theta} },\\frac{\\partial}{\\partial {\\phi} }\\right)\\right)\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left(U, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right), \\left(U, \\left(\\frac{\\partial}{\\partial r },\\frac{\\partial}{\\partial {\\theta} },\\frac{\\partial}{\\partial {\\phi} }\\right)\\right)\\right]$" ], "text/plain": [ "[Coordinate frame (U, (∂/∂x,∂/∂y,∂/∂z)),\n", " Coordinate frame (U, (∂/∂r,∂/∂th,∂/∂ph))]" ] }, "execution_count": 112, "metadata": {}, "output_type": "execute_result" } ], "source": [ "U.frames()" ] }, { "cell_type": "code", "execution_count": 113, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\mathcal{M}, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\mathcal{M}, \\left(\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right)$" ], "text/plain": [ "Coordinate frame (M, (∂/∂x,∂/∂y,∂/∂z))" ] }, "execution_count": 113, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.default_frame()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`set_default_frame()`メソッドで別途明示的に指定されない限り、基底の座標系に関連づけられるベクトルフレームが基底のフレームです。\n", "\n", "Unless otherwise specified (via the command set_default_frame()), the default frame is that associated with the default chart:
" ] }, { "cell_type": "code", "execution_count": 114, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 114, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.default_frame() is M.default_chart().frame()" ] }, { "cell_type": "code", "execution_count": 115, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 115, "metadata": {}, "output_type": "execute_result" } ], "source": [ "U.default_frame() is U.default_chart().frame()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "フレームのそれぞれの要素は指標を使って指定できます。\n", "\n", "Individual elements of a frame can be accessed by means of their indices:
" ] }, { "cell_type": "code", "execution_count": 116, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\frac{\\partial}{\\partial y }\\)" ], "text/latex": [ "$\\displaystyle \\frac{\\partial}{\\partial y }$" ], "text/plain": [ "Vector field ∂/∂y on the Open subset U of the 3-dimensional differentiable manifold M" ] }, "execution_count": 116, "metadata": {}, "output_type": "execute_result" } ], "source": [ "e = U.default_frame() ; e2 = e[2] ; e2" ] }, { "cell_type": "code", "execution_count": 117, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Vector field ∂/∂y on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(e2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "新しいベクトル場を次のようにして、定義できます。\n", "We may define a new vector field as follows:
" ] }, { "cell_type": "code", "execution_count": 118, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Vector field on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "v = e[2] + 2*x*e[3] ; print(v)" ] }, { "cell_type": "code", "execution_count": 119, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\frac{\\partial}{\\partial y } + 2 \\, x \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle \\frac{\\partial}{\\partial y } + 2 \\, x \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "∂/∂y + 2*x ∂/∂z" ] }, "execution_count": 119, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ベクトル場は与えられたベクトルフレームに関する要素を指定することで、定義できます。\n", "もしベクトルフレームが指定されていない場合には、既定のフレームがもちろん仮定されます。\n", "\n", "A vector field can be defined by its components with respect to a given vector frame. When the latter is not specified, the open set's default frame is of course assumed:
" ] }, { "cell_type": "code", "execution_count": 120, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle v = \\left( y + 1 \\right) \\frac{\\partial}{\\partial x } -x \\frac{\\partial}{\\partial y } + x y z \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle v = \\left( y + 1 \\right) \\frac{\\partial}{\\partial x } -x \\frac{\\partial}{\\partial y } + x y z \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "v = (y + 1) ∂/∂x - x ∂/∂y + x*y*z ∂/∂z" ] }, "execution_count": 120, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v = U.vector_field(name='v') # vector field defined on the open set U\n", "v[1] = 1+y\n", "v[2] = -x\n", "v[3] = x*y*z\n", "v.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "SageMath 8.8 以降では、ベクトルフィールドの成分はそれを宣言する時に設定することができます。従って、上記は次の宣言と等価です。\n", "\n", "Since version 8.8 of SageMath, it is possible to initialize the components of the vector field while declaring it, so that the above is equivalent to" ] }, { "cell_type": "code", "execution_count": 121, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle v = \\left( y + 1 \\right) \\frac{\\partial}{\\partial x } -x \\frac{\\partial}{\\partial y } + x y z \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle v = \\left( y + 1 \\right) \\frac{\\partial}{\\partial x } -x \\frac{\\partial}{\\partial y } + x y z \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "v = (y + 1) ∂/∂x - x ∂/∂y + x*y*z ∂/∂z" ] }, "execution_count": 121, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v = U.vector_field(1+y, -x, x*y*z, name='v') # valid only in SageMath 8.8 and higher\n", "v.display() " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$U$上のベクトル場はSageの **要素(element)** オブジェクトです。その **親(parent)** は $U$上で定義されたベクトル場の$\\mathfrak{X}(U)$集合に設定されています。\n", "\n", "Vector fields on $U$ are Sage element objects, whose parent is the set $\\mathfrak{X}(U)$ of vector fields defined on $U$:
" ] }, { "cell_type": "code", "execution_count": 122, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathfrak{X}\\left(U\\right)\\)" ], "text/latex": [ "$\\displaystyle \\mathfrak{X}\\left(U\\right)$" ], "text/plain": [ "Free module X(U) of vector fields on the Open subset U of the 3-dimensional differentiable manifold M" ] }, "execution_count": 122, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.parent()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "集合 $\\mathfrak{X}(U)$ は$U$で定義されたのスカラー場の可換代数$C^\\infty(U)$上のモジュールです。\n", "\n", "The set $\\mathfrak{X}(U)$ is a module over the commutative algebra $C^\\infty(U)$ of scalar fields on $U$:
" ] }, { "cell_type": "code", "execution_count": 123, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Free module X(U) of vector fields on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(v.parent())" ] }, { "cell_type": "code", "execution_count": 124, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Category of finite dimensional modules over Algebra of differentiable scalar fields on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(v.parent().category())" ] }, { "cell_type": "code", "execution_count": 125, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle C^{\\infty}\\left(U\\right)\\)" ], "text/latex": [ "$\\displaystyle C^{\\infty}\\left(U\\right)$" ], "text/plain": [ "Algebra of differentiable scalar fields on the Open subset U of the 3-dimensional differentiable manifold M" ] }, "execution_count": 125, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.parent().base_ring()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ベクトル場はスカラー場に作用します。\n", "\n", "A vector field acts on scalar fields:
" ] }, { "cell_type": "code", "execution_count": 126, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\end{array}$" ], "text/plain": [ "f: U → ℝ\n", " (x, y, z) ↦ z^3 + y^2 + x\n", " (r, th, ph) ↦ r^3*cos(th)^3 + r^2*sin(ph)^2*sin(th)^2 + r*cos(ph)*sin(th)" ] }, "execution_count": 126, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.display()" ] }, { "cell_type": "code", "execution_count": 127, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field v(f) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "s = v(f) ; print(s)" ] }, { "cell_type": "code", "execution_count": 128, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} v\\left(f\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & 3 \\, x y z^{3} - {\\left(2 \\, x - 1\\right)} y + 1 \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) - 2 \\, r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} + 1 \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} v\\left(f\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & 3 \\, x y z^{3} - {\\left(2 \\, x - 1\\right)} y + 1 \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) - 2 \\, r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} + 1 \\end{array}$" ], "text/plain": [ "v(f): U → ℝ\n", " (x, y, z) ↦ 3*x*y*z^3 - (2*x - 1)*y + 1\n", " (r, th, ph) ↦ r*sin(ph)*sin(th) + (3*r^5*cos(ph)*cos(th)^3*sin(ph) - 2*r^2*cos(ph)*sin(ph))*sin(th)^2 + 1" ] }, "execution_count": 128, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.display()" ] }, { "cell_type": "code", "execution_count": 129, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\frac{\\partial}{\\partial z } = \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle \\frac{\\partial}{\\partial z } = \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "∂/∂z = ∂/∂z" ] }, "execution_count": 129, "metadata": {}, "output_type": "execute_result" } ], "source": [ "e[3].display()" ] }, { "cell_type": "code", "execution_count": 130, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} \\frac{\\partial}{\\partial z }\\left(f\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & 3 \\, z^{2} \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & 3 \\, r^{2} \\cos\\left({\\theta}\\right)^{2} \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} \\frac{\\partial}{\\partial z }\\left(f\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & 3 \\, z^{2} \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & 3 \\, r^{2} \\cos\\left({\\theta}\\right)^{2} \\end{array}$" ], "text/plain": [ "∂/∂z(f): U → ℝ\n", " (x, y, z) ↦ 3*z^2\n", " (r, th, ph) ↦ 3*r^2*cos(th)^2" ] }, "execution_count": 130, "metadata": {}, "output_type": "execute_result" } ], "source": [ "e[3](f).display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "設定されていない要素は、0 と仮定されます。\n", "\n", "Unset components are assumed to be zero:
" ] }, { "cell_type": "code", "execution_count": 131, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle w = 3 \\frac{\\partial}{\\partial y }\\)" ], "text/latex": [ "$\\displaystyle w = 3 \\frac{\\partial}{\\partial y }$" ], "text/plain": [ "w = 3 ∂/∂y" ] }, "execution_count": 131, "metadata": {}, "output_type": "execute_result" } ], "source": [ "w = U.vector_field(name='w')\n", "w[2] = 3\n", "w.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$U$上のベクトル場は座標系 $(r,\\theta,\\phi)$ に関係付けられているベクトルフレームで展開することができます。\n", "\n", "A vector field on $U$ can be expanded in the vector frame associated with the chart $(r,\\theta,\\phi)$:
" ] }, { "cell_type": "code", "execution_count": 132, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle v = \\left( \\frac{x y z^{2} + x}{\\sqrt{x^{2} + y^{2} + z^{2}}} \\right) \\frac{\\partial}{\\partial r } + \\left( -\\frac{{\\left(x^{3} y + x y^{3} - x\\right)} \\sqrt{x^{2} + y^{2}} z}{x^{4} + 2 \\, x^{2} y^{2} + y^{4} + {\\left(x^{2} + y^{2}\\right)} z^{2}} \\right) \\frac{\\partial}{\\partial {\\theta} } + \\left( -\\frac{x^{2} + y^{2} + y}{x^{2} + y^{2}} \\right) \\frac{\\partial}{\\partial {\\phi} }\\)" ], "text/latex": [ "$\\displaystyle v = \\left( \\frac{x y z^{2} + x}{\\sqrt{x^{2} + y^{2} + z^{2}}} \\right) \\frac{\\partial}{\\partial r } + \\left( -\\frac{{\\left(x^{3} y + x y^{3} - x\\right)} \\sqrt{x^{2} + y^{2}} z}{x^{4} + 2 \\, x^{2} y^{2} + y^{4} + {\\left(x^{2} + y^{2}\\right)} z^{2}} \\right) \\frac{\\partial}{\\partial {\\theta} } + \\left( -\\frac{x^{2} + y^{2} + y}{x^{2} + y^{2}} \\right) \\frac{\\partial}{\\partial {\\phi} }$" ], "text/plain": [ "v = (x*y*z^2 + x)/sqrt(x^2 + y^2 + z^2) ∂/∂r - (x^3*y + x*y^3 - x)*sqrt(x^2 + y^2)*z/(x^4 + 2*x^2*y^2 + y^4 + (x^2 + y^2)*z^2) ∂/∂th - (x^2 + y^2 + y)/(x^2 + y^2) ∂/∂ph" ] }, "execution_count": 132, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.display(Y.frame())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "既定の設定では、要素は既定の座標 $(x,y,z)$ を用いて、表現されます。これらの要素を 別の座標 $(r,\\theta,\\phi)$ を用いて表現するには、\n", "`display()`メソッドの2番目の引数として、対応する座標系を指定することが必要です。\n", "\n", "By default, the components are expressed in terms of the default coordinates $(x,y,z)$. To express them in terms of the coordinates $(r,\\theta,\\phi)$, one should add the corresponding chart as the second argument of the method display():
" ] }, { "cell_type": "code", "execution_count": 133, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle v = \\left( r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} + \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\right) \\frac{\\partial}{\\partial r } + \\left( -\\frac{r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3} - \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)}{r} \\right) \\frac{\\partial}{\\partial {\\theta} } + \\left( -\\frac{r \\sin\\left({\\theta}\\right) + \\sin\\left({\\phi}\\right)}{r \\sin\\left({\\theta}\\right)} \\right) \\frac{\\partial}{\\partial {\\phi} }\\)" ], "text/latex": [ "$\\displaystyle v = \\left( r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} + \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\right) \\frac{\\partial}{\\partial r } + \\left( -\\frac{r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3} - \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)}{r} \\right) \\frac{\\partial}{\\partial {\\theta} } + \\left( -\\frac{r \\sin\\left({\\theta}\\right) + \\sin\\left({\\phi}\\right)}{r \\sin\\left({\\theta}\\right)} \\right) \\frac{\\partial}{\\partial {\\phi} }$" ], "text/plain": [ "v = (r^3*cos(ph)*cos(th)^2*sin(ph)*sin(th)^2 + cos(ph)*sin(th)) ∂/∂r - (r^3*cos(ph)*cos(th)*sin(ph)*sin(th)^3 - cos(ph)*cos(th))/r ∂/∂th - (r*sin(th) + sin(ph))/(r*sin(th)) ∂/∂ph" ] }, "execution_count": 133, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.display(Y.frame(), Y)" ] }, { "cell_type": "code", "execution_count": 134, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\frac{\\partial}{\\partial x } = \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\frac{\\partial}{\\partial r } + \\frac{\\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)}{r} \\frac{\\partial}{\\partial {\\theta} } -\\frac{\\sin\\left({\\phi}\\right)}{r \\sin\\left({\\theta}\\right)} \\frac{\\partial}{\\partial {\\phi} }\\)" ], "text/latex": [ "$\\displaystyle \\frac{\\partial}{\\partial x } = \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\frac{\\partial}{\\partial r } + \\frac{\\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)}{r} \\frac{\\partial}{\\partial {\\theta} } -\\frac{\\sin\\left({\\phi}\\right)}{r \\sin\\left({\\theta}\\right)} \\frac{\\partial}{\\partial {\\phi} }$" ], "text/plain": [ "∂/∂x = cos(ph)*sin(th) ∂/∂r + cos(ph)*cos(th)/r ∂/∂th - sin(ph)/(r*sin(th)) ∂/∂ph" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\\(\\displaystyle \\frac{\\partial}{\\partial y } = \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\frac{\\partial}{\\partial r } + \\frac{\\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)}{r} \\frac{\\partial}{\\partial {\\theta} } + \\frac{\\cos\\left({\\phi}\\right)}{r \\sin\\left({\\theta}\\right)} \\frac{\\partial}{\\partial {\\phi} }\\)" ], "text/latex": [ "$\\displaystyle \\frac{\\partial}{\\partial y } = \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\frac{\\partial}{\\partial r } + \\frac{\\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)}{r} \\frac{\\partial}{\\partial {\\theta} } + \\frac{\\cos\\left({\\phi}\\right)}{r \\sin\\left({\\theta}\\right)} \\frac{\\partial}{\\partial {\\phi} }$" ], "text/plain": [ "∂/∂y = sin(ph)*sin(th) ∂/∂r + cos(th)*sin(ph)/r ∂/∂th + cos(ph)/(r*sin(th)) ∂/∂ph" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\\(\\displaystyle \\frac{\\partial}{\\partial z } = \\cos\\left({\\theta}\\right) \\frac{\\partial}{\\partial r } -\\frac{\\sin\\left({\\theta}\\right)}{r} \\frac{\\partial}{\\partial {\\theta} }\\)" ], "text/latex": [ "$\\displaystyle \\frac{\\partial}{\\partial z } = \\cos\\left({\\theta}\\right) \\frac{\\partial}{\\partial r } -\\frac{\\sin\\left({\\theta}\\right)}{r} \\frac{\\partial}{\\partial {\\theta} }$" ], "text/plain": [ "∂/∂z = cos(th) ∂/∂r - sin(th)/r ∂/∂th" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "for i in M.irange(): \n", " show(e[i].display(Y.frame(), Y))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "既定のフレームに関するテンソル場の要素は、コマンド `[:]` を使うことで、リストとして取り出せます。\n", "\n", "The components of a tensor field w.r.t. the default frame can also be obtained as a list, via the command [:]:
" ] }, { "cell_type": "code", "execution_count": 135, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[y + 1, -x, x y z\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[y + 1, -x, x y z\\right]$" ], "text/plain": [ "[y + 1, -x, x*y*z]" ] }, "execution_count": 135, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "別の方法として、`display_comp()`メソッドを使うこともできます。\n", "\n", "An alternative is to use the method display_comp():
" ] }, { "cell_type": "code", "execution_count": 136, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{lcl} v_{\\phantom{\\, x}}^{ \\, x } & = & y + 1 \\\\ v_{\\phantom{\\, y}}^{ \\, y } & = & -x \\\\ v_{\\phantom{\\, z}}^{ \\, z } & = & x y z \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{lcl} v_{\\phantom{\\, x}}^{ \\, x } & = & y + 1 \\\\ v_{\\phantom{\\, y}}^{ \\, y } & = & -x \\\\ v_{\\phantom{\\, z}}^{ \\, z } & = & x y z \\end{array}$" ], "text/plain": [ "v^x = y + 1 \n", "v^y = -x \n", "v^z = x*y*z " ] }, "execution_count": 136, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.display_comp()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "別のフレームについての要素を取り出すには、`comp()` メソッドを通じて要素を取り出すフレームを指定する必要があります。\n", "\n", "To obtain the components w.r.t. to another frame, one may go through the method comp() and specify the frame:
" ] }, { "cell_type": "code", "execution_count": 137, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\frac{x y z^{2} + x}{\\sqrt{x^{2} + y^{2} + z^{2}}}, -\\frac{{\\left(x^{3} y + x y^{3} - x\\right)} \\sqrt{x^{2} + y^{2}} z}{x^{4} + 2 \\, x^{2} y^{2} + y^{4} + {\\left(x^{2} + y^{2}\\right)} z^{2}}, -\\frac{x^{2} + y^{2} + y}{x^{2} + y^{2}}\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\frac{x y z^{2} + x}{\\sqrt{x^{2} + y^{2} + z^{2}}}, -\\frac{{\\left(x^{3} y + x y^{3} - x\\right)} \\sqrt{x^{2} + y^{2}} z}{x^{4} + 2 \\, x^{2} y^{2} + y^{4} + {\\left(x^{2} + y^{2}\\right)} z^{2}}, -\\frac{x^{2} + y^{2} + y}{x^{2} + y^{2}}\\right]$" ], "text/plain": [ "[(x*y*z^2 + x)/sqrt(x^2 + y^2 + z^2),\n", " -(x^3*y + x*y^3 - x)*sqrt(x^2 + y^2)*z/(x^4 + 2*x^2*y^2 + y^4 + (x^2 + y^2)*z^2),\n", " -(x^2 + y^2 + y)/(x^2 + y^2)]" ] }, "execution_count": 137, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.comp(Y.frame())[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "しかしながら、最初の引数にフレームを与える 短縮表現も用意されています。\n", "\n", "However a shortcut is to provide the frame as the first argument of the square brackets:
" ] }, { "cell_type": "code", "execution_count": 138, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\frac{x y z^{2} + x}{\\sqrt{x^{2} + y^{2} + z^{2}}}, -\\frac{{\\left(x^{3} y + x y^{3} - x\\right)} \\sqrt{x^{2} + y^{2}} z}{x^{4} + 2 \\, x^{2} y^{2} + y^{4} + {\\left(x^{2} + y^{2}\\right)} z^{2}}, -\\frac{x^{2} + y^{2} + y}{x^{2} + y^{2}}\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\frac{x y z^{2} + x}{\\sqrt{x^{2} + y^{2} + z^{2}}}, -\\frac{{\\left(x^{3} y + x y^{3} - x\\right)} \\sqrt{x^{2} + y^{2}} z}{x^{4} + 2 \\, x^{2} y^{2} + y^{4} + {\\left(x^{2} + y^{2}\\right)} z^{2}}, -\\frac{x^{2} + y^{2} + y}{x^{2} + y^{2}}\\right]$" ], "text/plain": [ "[(x*y*z^2 + x)/sqrt(x^2 + y^2 + z^2),\n", " -(x^3*y + x*y^3 - x)*sqrt(x^2 + y^2)*z/(x^4 + 2*x^2*y^2 + y^4 + (x^2 + y^2)*z^2),\n", " -(x^2 + y^2 + y)/(x^2 + y^2)]" ] }, "execution_count": 138, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v[Y.frame(), :]" ] }, { "cell_type": "code", "execution_count": 139, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{lcl} v_{\\phantom{\\, r}}^{ \\, r } & = & \\frac{x y z^{2} + x}{\\sqrt{x^{2} + y^{2} + z^{2}}} \\\\ v_{\\phantom{\\, {\\theta}}}^{ \\, {\\theta} } & = & -\\frac{{\\left(x^{3} y + x y^{3} - x\\right)} \\sqrt{x^{2} + y^{2}} z}{x^{4} + 2 \\, x^{2} y^{2} + y^{4} + {\\left(x^{2} + y^{2}\\right)} z^{2}} \\\\ v_{\\phantom{\\, {\\phi}}}^{ \\, {\\phi} } & = & -\\frac{x^{2} + y^{2} + y}{x^{2} + y^{2}} \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{lcl} v_{\\phantom{\\, r}}^{ \\, r } & = & \\frac{x y z^{2} + x}{\\sqrt{x^{2} + y^{2} + z^{2}}} \\\\ v_{\\phantom{\\, {\\theta}}}^{ \\, {\\theta} } & = & -\\frac{{\\left(x^{3} y + x y^{3} - x\\right)} \\sqrt{x^{2} + y^{2}} z}{x^{4} + 2 \\, x^{2} y^{2} + y^{4} + {\\left(x^{2} + y^{2}\\right)} z^{2}} \\\\ v_{\\phantom{\\, {\\phi}}}^{ \\, {\\phi} } & = & -\\frac{x^{2} + y^{2} + y}{x^{2} + y^{2}} \\end{array}$" ], "text/plain": [ "v^r = (x*y*z^2 + x)/sqrt(x^2 + y^2 + z^2) \n", "v^th = -(x^3*y + x*y^3 - x)*sqrt(x^2 + y^2)*z/(x^4 + 2*x^2*y^2 + y^4 + (x^2 + y^2)*z^2) \n", "v^ph = -(x^2 + y^2 + y)/(x^2 + y^2) " ] }, "execution_count": 139, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.display_comp(Y.frame())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "要素は、既定の座標系の座標で表現されます。これらの別の座標系の座標、例えば$(r,\\theta,\\phi)$、で表現したい時には、\n", "`[]`の最後の引数として、座標系の名前を与えます。\n", "\n", "Components are shown expressed in terms of the default's coordinates; to get them in terms of the coordinates $(r,\\theta,\\phi)$ instead, add the chart name as the last argument in the square brackets:
" ] }, { "cell_type": "code", "execution_count": 140, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} + \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), -\\frac{r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3} - \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)}{r}, -\\frac{r \\sin\\left({\\theta}\\right) + \\sin\\left({\\phi}\\right)}{r \\sin\\left({\\theta}\\right)}\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} + \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), -\\frac{r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3} - \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)}{r}, -\\frac{r \\sin\\left({\\theta}\\right) + \\sin\\left({\\phi}\\right)}{r \\sin\\left({\\theta}\\right)}\\right]$" ], "text/plain": [ "[r^3*cos(ph)*cos(th)^2*sin(ph)*sin(th)^2 + cos(ph)*sin(th),\n", " -(r^3*cos(ph)*cos(th)*sin(ph)*sin(th)^3 - cos(ph)*cos(th))/r,\n", " -(r*sin(th) + sin(ph))/(r*sin(th))]" ] }, "execution_count": 140, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v[Y.frame(), :, Y]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "あるいは、`display_comp()` の引数に座標系の名前を与えます。\n", "\n", "or specify the chart in display_comp():
A vector field can be defined with components being unspecified functions of the coordinates:
" ] }, { "cell_type": "code", "execution_count": 145, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle u = u_{x}\\left(x, y, z\\right) \\frac{\\partial}{\\partial x } + u_{y}\\left(x, y, z\\right) \\frac{\\partial}{\\partial y } + u_{z}\\left(x, y, z\\right) \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle u = u_{x}\\left(x, y, z\\right) \\frac{\\partial}{\\partial x } + u_{y}\\left(x, y, z\\right) \\frac{\\partial}{\\partial y } + u_{z}\\left(x, y, z\\right) \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "u = u_x(x, y, z) ∂/∂x + u_y(x, y, z) ∂/∂y + u_z(x, y, z) ∂/∂z" ] }, "execution_count": 145, "metadata": {}, "output_type": "execute_result" } ], "source": [ "u = U.vector_field(name='u')\n", "u[:] = [function('u_x')(x,y,z), \n", " function('u_y')(x,y,z), \n", " function('u_z')(x,y,z)]\n", "u.display()" ] }, { "cell_type": "code", "execution_count": 146, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle s = \\left( y + u_{x}\\left(x, y, z\\right) + 1 \\right) \\frac{\\partial}{\\partial x } + \\left( -x + u_{y}\\left(x, y, z\\right) \\right) \\frac{\\partial}{\\partial y } + \\left( x y z + u_{z}\\left(x, y, z\\right) \\right) \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle s = \\left( y + u_{x}\\left(x, y, z\\right) + 1 \\right) \\frac{\\partial}{\\partial x } + \\left( -x + u_{y}\\left(x, y, z\\right) \\right) \\frac{\\partial}{\\partial y } + \\left( x y z + u_{z}\\left(x, y, z\\right) \\right) \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "s = (y + u_x(x, y, z) + 1) ∂/∂x + (-x + u_y(x, y, z)) ∂/∂y + (x*y*z + u_z(x, y, z)) ∂/∂z" ] }, "execution_count": 146, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s = v + u ; s.set_name('s') ; s.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### ある点でのベクトル場の値:Values of vector fields at a given point\n", "多様体中のある点でのベクトル場の値は`at()`メソッドを通じて入手します。\n", "\n", "The value of a vector field at some point of the manifold is obtained via the method at():
" ] }, { "cell_type": "code", "execution_count": 147, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tangent vector v at Point p on the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "vp = v.at(p) ; print(vp)" ] }, { "cell_type": "code", "execution_count": 148, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle v = 3 \\frac{\\partial}{\\partial x } -\\frac{\\partial}{\\partial y } -2 \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle v = 3 \\frac{\\partial}{\\partial x } -\\frac{\\partial}{\\partial y } -2 \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "v = 3 ∂/∂x - ∂/∂y - 2 ∂/∂z" ] }, "execution_count": 148, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vp.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "座標系 $X_U$ = $(x,y,z)$ を使った、点$p$の座標と、ベクトル場$v$の要素は次のようになっていたことを思い出してください。\n", "\n", "Indeed, recall that, w.r.t. chart X_U=$(x,y,z)$, the coordinates of the point $p$ and the components of the vector field $v$ are
" ] }, { "cell_type": "code", "execution_count": 149, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(1, 2, -1\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(1, 2, -1\\right)$" ], "text/plain": [ "(1, 2, -1)" ] }, "execution_count": 149, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p.coord(X_U)" ] }, { "cell_type": "code", "execution_count": 150, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle v = \\left( y + 1 \\right) \\frac{\\partial}{\\partial x } -x \\frac{\\partial}{\\partial y } + x y z \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle v = \\left( y + 1 \\right) \\frac{\\partial}{\\partial x } -x \\frac{\\partial}{\\partial y } + x y z \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "v = (y + 1) ∂/∂x - x ∂/∂y + x*y*z ∂/∂z" ] }, "execution_count": 150, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.display(X_U.frame(), X_U)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "記述を簡単にするために、点$p$でのベクトル場の値とベクトル場は同じ記号($v$)を使って表示されています。`set_name()`メソッドを使うことで、\n", "表示に使われる記号を変更できます。\n", "\n", "Note that to simplify the writing, the symbol used to denote the value of the vector field at point $p$ is the same as that of the vector field itself (namely $v$); this can be changed by the method set_name():
" ] }, { "cell_type": "code", "execution_count": 151, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle v|_p = 3 \\frac{\\partial}{\\partial x } -\\frac{\\partial}{\\partial y } -2 \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle v|_p = 3 \\frac{\\partial}{\\partial x } -\\frac{\\partial}{\\partial y } -2 \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "v = 3 ∂/∂x - ∂/∂y - 2 ∂/∂z" ] }, "execution_count": 151, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vp.set_name(latex_name='v|_p')\n", "vp.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "もちろん、$v|_p$ は$p$の接ベクトル空間に属しています。\n", "\n", "Of course, $v|_p$ belongs to the tangent space at $p$:
" ] }, { "cell_type": "code", "execution_count": 152, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle T_{p}\\,\\mathcal{M}\\)" ], "text/latex": [ "$\\displaystyle T_{p}\\,\\mathcal{M}$" ], "text/plain": [ "Tangent space at Point p on the 3-dimensional differentiable manifold M" ] }, "execution_count": 152, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vp.parent()" ] }, { "cell_type": "code", "execution_count": 153, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 153, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vp in M.tangent_space(p)" ] }, { "cell_type": "code", "execution_count": 154, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tangent vector u at Point p on the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "up = u.at(p) ; print(up)" ] }, { "cell_type": "code", "execution_count": 155, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle u = u_{x}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial x } + u_{y}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial y } + u_{z}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle u = u_{x}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial x } + u_{y}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial y } + u_{z}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "u = u_x(1, 2, -1) ∂/∂x + u_y(1, 2, -1) ∂/∂y + u_z(1, 2, -1) ∂/∂z" ] }, "execution_count": 155, "metadata": {}, "output_type": "execute_result" } ], "source": [ "up.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1-形式: 1-forms\n", "$\\mathcal{M}$の1-形式とは、線形形式の場です。例えば、スカラー場の微分は1ー形式です。\n", " \n", "A 1-form on $\\mathcal{M}$ is a field of linear forms. For instance, it can be the differential of a scalar field:
" ] }, { "cell_type": "code", "execution_count": 156, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form df on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "df = f.differential() ; print(df)" ] }, { "cell_type": "code", "execution_count": 157, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{d}f = \\mathrm{d} x + 2 \\, y \\mathrm{d} y + 3 \\, z^{2} \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{d}f = \\mathrm{d} x + 2 \\, y \\mathrm{d} y + 3 \\, z^{2} \\mathrm{d} z$" ], "text/plain": [ "df = dx + 2*y dy + 3*z^2 dz" ] }, "execution_count": 157, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "上記の表現では、1-形式は座標系 $(x,y,z)$から導かれる基底$(\\mathrm{d}x, \\mathrm{d}y, \\mathrm{d}z)$で展開されています。\n", "この基底は`coframe()`メソッドで取り出すことが可能です。\n", "\n", "In the above writing, the 1-form is expanded over the basis $(\\mathrm{d}x, \\mathrm{d}y, \\mathrm{d}z)$ associated with the chart $(x,y,z)$. This basis can be accessed via the method coframe():
" ] }, { "cell_type": "code", "execution_count": 158, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\mathcal{M}, \\left(\\mathrm{d} x,\\mathrm{d} y,\\mathrm{d} z\\right)\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\mathcal{M}, \\left(\\mathrm{d} x,\\mathrm{d} y,\\mathrm{d} z\\right)\\right)$" ], "text/plain": [ "Coordinate coframe (M, (dx,dy,dz))" ] }, "execution_count": 158, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dX = X.coframe() ; dX" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "多様体 $M$の上に存在する全ての coframe のリストは `coframes()` メソッドを使って取り出します。\n", "\n", "The list of all coframes defined on a given manifold open subset is returned by the method coframes():
" ] }, { "cell_type": "code", "execution_count": 159, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left(\\mathcal{M}, \\left(\\mathrm{d} x,\\mathrm{d} y,\\mathrm{d} z\\right)\\right), \\left(U, \\left(\\mathrm{d} x,\\mathrm{d} y,\\mathrm{d} z\\right)\\right), \\left(U, \\left(\\mathrm{d} r,\\mathrm{d} {\\theta},\\mathrm{d} {\\phi}\\right)\\right)\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left(\\mathcal{M}, \\left(\\mathrm{d} x,\\mathrm{d} y,\\mathrm{d} z\\right)\\right), \\left(U, \\left(\\mathrm{d} x,\\mathrm{d} y,\\mathrm{d} z\\right)\\right), \\left(U, \\left(\\mathrm{d} r,\\mathrm{d} {\\theta},\\mathrm{d} {\\phi}\\right)\\right)\\right]$" ], "text/plain": [ "[Coordinate coframe (M, (dx,dy,dz)),\n", " Coordinate coframe (U, (dx,dy,dz)),\n", " Coordinate coframe (U, (dr,dth,dph))]" ] }, "execution_count": 159, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.coframes()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ベクトル場として、多様体上の点 $p$ における微分形式の値は `at()` メソッドで取り出します。\n", "\n", "As for a vector field, the value of the differential form at some point on the manifold is obtained by the method at():
" ] }, { "cell_type": "code", "execution_count": 160, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Linear form df on the Tangent space at Point p on the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "dfp = df.at(p) ; print(dfp)" ] }, { "cell_type": "code", "execution_count": 161, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{d}f = \\mathrm{d} x + 4 \\mathrm{d} y + 3 \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{d}f = \\mathrm{d} x + 4 \\mathrm{d} y + 3 \\mathrm{d} z$" ], "text/plain": [ "df = dx + 4 dy + 3 dz" ] }, "execution_count": 161, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfp.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "なお、$p$の座標は次のようなものでした。\n", "Recall that
" ] }, { "cell_type": "code", "execution_count": 162, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(1, 2, -1\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(1, 2, -1\\right)$" ], "text/plain": [ "(1, 2, -1)" ] }, "execution_count": 162, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p.coord()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "線形形式 $\\mathrm{d}f|_p$ は$p$の接ベクトル空間の双対に所属しています。\n", "\n", "The linear form $\\mathrm{d}f|_p$ belongs to the dual of the tangent vector space at $p$:
" ] }, { "cell_type": "code", "execution_count": 163, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle T_{p}\\,\\mathcal{M}^*\\)" ], "text/latex": [ "$\\displaystyle T_{p}\\,\\mathcal{M}^*$" ], "text/plain": [ "Dual of the Tangent space at Point p on the 3-dimensional differentiable manifold M" ] }, "execution_count": 163, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfp.parent()" ] }, { "cell_type": "code", "execution_count": 164, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 164, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfp.parent() is M.tangent_space(p).dual()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "その結果、線形形式を$p$の接ベクトルに作用させると、実数が結果として得られます。\n", "\n", "As such, it is acting on vectors at $p$, yielding a real number:
" ] }, { "cell_type": "code", "execution_count": 165, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tangent vector v at Point p on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle v|_p = 3 \\frac{\\partial}{\\partial x } -\\frac{\\partial}{\\partial y } -2 \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle v|_p = 3 \\frac{\\partial}{\\partial x } -\\frac{\\partial}{\\partial y } -2 \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "v = 3 ∂/∂x - ∂/∂y - 2 ∂/∂z" ] }, "execution_count": 165, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(vp) ; vp.display()" ] }, { "cell_type": "code", "execution_count": 166, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle -7\\)" ], "text/latex": [ "$\\displaystyle -7$" ], "text/plain": [ "-7" ] }, "execution_count": 166, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfp(vp)" ] }, { "cell_type": "code", "execution_count": 167, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tangent vector u at Point p on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle u = u_{x}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial x } + u_{y}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial y } + u_{z}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial z }\\)" ], "text/latex": [ "$\\displaystyle u = u_{x}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial x } + u_{y}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial y } + u_{z}\\left(1, 2, -1\\right) \\frac{\\partial}{\\partial z }$" ], "text/plain": [ "u = u_x(1, 2, -1) ∂/∂x + u_y(1, 2, -1) ∂/∂y + u_z(1, 2, -1) ∂/∂z" ] }, "execution_count": 167, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(up) ; up.display()" ] }, { "cell_type": "code", "execution_count": 168, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle u_{x}\\left(1, 2, -1\\right) + 4 \\, u_{y}\\left(1, 2, -1\\right) + 3 \\, u_{z}\\left(1, 2, -1\\right)\\)" ], "text/latex": [ "$\\displaystyle u_{x}\\left(1, 2, -1\\right) + 4 \\, u_{y}\\left(1, 2, -1\\right) + 3 \\, u_{z}\\left(1, 2, -1\\right)$" ], "text/plain": [ "u_x(1, 2, -1) + 4*u_y(1, 2, -1) + 3*u_z(1, 2, -1)" ] }, "execution_count": 168, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfp(up)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The differential 1-form of the unspecified scalar field $h$:
" ] }, { "cell_type": "code", "execution_count": 169, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} h:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & H\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & H\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} h:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & H\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & H\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}$" ], "text/plain": [ "h: U → ℝ\n", " (x, y, z) ↦ H(x, y, z)\n", " (r, th, ph) ↦ H(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th))" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{d}h = \\frac{\\partial\\,H}{\\partial x} \\mathrm{d} x + \\frac{\\partial\\,H}{\\partial y} \\mathrm{d} y + \\frac{\\partial\\,H}{\\partial z} \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{d}h = \\frac{\\partial\\,H}{\\partial x} \\mathrm{d} x + \\frac{\\partial\\,H}{\\partial y} \\mathrm{d} y + \\frac{\\partial\\,H}{\\partial z} \\mathrm{d} z$" ], "text/plain": [ "dh = d(H)/dx dx + d(H)/dy dy + d(H)/dz dz" ] }, "execution_count": 169, "metadata": {}, "output_type": "execute_result" } ], "source": [ "show(h.display())\n", "dh = h.differential() ; \n", "dh.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1-形式を何もないところから、定義することもできます。\n", "\n", "A 1-form can also be defined from scratch:
" ] }, { "cell_type": "code", "execution_count": 170, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form omega on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "om = U.one_form(name='omega', latex_name=r'\\omega')\n", "print(om)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "与えられたcoframeの要素をあたえることで、この1-形式を特定できます。\n", "\n", "It can be specified by providing its components in a given coframe:
" ] }, { "cell_type": "code", "execution_count": 171, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\omega = \\left( x^{2} + y^{2} \\right) \\mathrm{d} x + z \\mathrm{d} y + \\left( x - z \\right) \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\omega = \\left( x^{2} + y^{2} \\right) \\mathrm{d} x + z \\mathrm{d} y + \\left( x - z \\right) \\mathrm{d} z$" ], "text/plain": [ "omega = (x^2 + y^2) dx + z dy + (x - z) dz" ] }, "execution_count": 171, "metadata": {}, "output_type": "execute_result" } ], "source": [ "om[:] = [x^2+y^2, z, x-z] # components in the default coframe (dx,dy,dz)\n", "om.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "SageMath 8.8 以降では、1-形式の成分を宣言時に初期化することができます。上記の式は次の式と等価です。\n", "\n", "Since version 8.8 of SageMath, it is possible to initialize the components of the 1-form while declaring it, so that the above is equivalent to" ] }, { "cell_type": "code", "execution_count": 172, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\omega = \\left( x^{2} + y^{2} \\right) \\mathrm{d} x + z \\mathrm{d} y + \\left( x - z \\right) \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\omega = \\left( x^{2} + y^{2} \\right) \\mathrm{d} x + z \\mathrm{d} y + \\left( x - z \\right) \\mathrm{d} z$" ], "text/plain": [ "omega = (x^2 + y^2) dx + z dy + (x - z) dz" ] }, "execution_count": 172, "metadata": {}, "output_type": "execute_result" } ], "source": [ "om = U.one_form(x^2+y^2, z, x-z, name='omega', # valid only in \n", " latex_name=r'\\omega') # SageMath 8.8 and higher\n", "om.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "もちろん、既定のフレームとは異なるフレームでの要素を指定することもできます。\n", "Of course, one may set the components in a frame different from the default one:
" ] }, { "cell_type": "code", "execution_count": 173, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\omega = r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\mathrm{d} r + r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\mathrm{d} {\\phi}\\)" ], "text/latex": [ "$\\displaystyle \\omega = r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\mathrm{d} r + r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\mathrm{d} {\\phi}$" ], "text/plain": [ "omega = r*cos(ph)*sin(th) dr + r*sin(ph)*sin(th) dph" ] }, "execution_count": 173, "metadata": {}, "output_type": "execute_result" } ], "source": [ "om[Y.frame(), :, Y] = [r*sin(th)*cos(ph), 0, r*sin(th)*sin(ph)]\n", "om.display(Y.frame(), Y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "この場合、coframe $(\\mathrm{d}x,\\mathrm{d}y,\\mathrm{d}z)$での要素は自動的に更新されます。\n", "\n", "The components in the coframe $(\\mathrm{d}x,\\mathrm{d}y,\\mathrm{d}z)$ are updated automatically:
" ] }, { "cell_type": "code", "execution_count": 174, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\omega = \\left( \\frac{x^{4} + x^{2} y^{2} - \\sqrt{x^{2} + y^{2} + z^{2}} y^{2}}{\\sqrt{x^{2} + y^{2} + z^{2}} {\\left(x^{2} + y^{2}\\right)}} \\right) \\mathrm{d} x + \\left( \\frac{x^{3} y + x y^{3} + \\sqrt{x^{2} + y^{2} + z^{2}} x y}{\\sqrt{x^{2} + y^{2} + z^{2}} {\\left(x^{2} + y^{2}\\right)}} \\right) \\mathrm{d} y + \\left( \\frac{x z}{\\sqrt{x^{2} + y^{2} + z^{2}}} \\right) \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\omega = \\left( \\frac{x^{4} + x^{2} y^{2} - \\sqrt{x^{2} + y^{2} + z^{2}} y^{2}}{\\sqrt{x^{2} + y^{2} + z^{2}} {\\left(x^{2} + y^{2}\\right)}} \\right) \\mathrm{d} x + \\left( \\frac{x^{3} y + x y^{3} + \\sqrt{x^{2} + y^{2} + z^{2}} x y}{\\sqrt{x^{2} + y^{2} + z^{2}} {\\left(x^{2} + y^{2}\\right)}} \\right) \\mathrm{d} y + \\left( \\frac{x z}{\\sqrt{x^{2} + y^{2} + z^{2}}} \\right) \\mathrm{d} z$" ], "text/plain": [ "omega = (x^4 + x^2*y^2 - sqrt(x^2 + y^2 + z^2)*y^2)/(sqrt(x^2 + y^2 + z^2)*(x^2 + y^2)) dx + (x^3*y + x*y^3 + sqrt(x^2 + y^2 + z^2)*x*y)/(sqrt(x^2 + y^2 + z^2)*(x^2 + y^2)) dy + x*z/sqrt(x^2 + y^2 + z^2) dz" ] }, "execution_count": 174, "metadata": {}, "output_type": "execute_result" } ], "source": [ "om.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "元の要素の値に戻してみます。\n", "\n", "Let us revert to the values set previously:
" ] }, { "cell_type": "code", "execution_count": 175, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\omega = \\left( x^{2} + y^{2} \\right) \\mathrm{d} x + z \\mathrm{d} y + \\left( x - z \\right) \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\omega = \\left( x^{2} + y^{2} \\right) \\mathrm{d} x + z \\mathrm{d} y + \\left( x - z \\right) \\mathrm{d} z$" ], "text/plain": [ "omega = (x^2 + y^2) dx + z dy + (x - z) dz" ] }, "execution_count": 175, "metadata": {}, "output_type": "execute_result" } ], "source": [ "om[:] = [x^2+y^2, z, x-z]\n", "om.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "今度は、coframe $(\\mathrm{d}r, \\mathrm{d}\\theta,\\mathrm{d}\\phi)$ についての要素は自動的に更新されています。\n", "\n", "This time, the components in the coframe $(\\mathrm{d}r, \\mathrm{d}\\theta,\\mathrm{d}\\phi)$ are those that are updated:
" ] }, { "cell_type": "code", "execution_count": 176, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\omega = \\left( r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3} + r {\\left(\\cos\\left({\\phi}\\right) + \\sin\\left({\\phi}\\right)\\right)} \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) - r \\cos\\left({\\theta}\\right)^{2} \\right) \\mathrm{d} r + \\left( r^{2} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + r^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) + {\\left(r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) - r^{2} \\cos\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} \\right) \\mathrm{d} {\\theta} + \\left( -r^{3} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3} + r^{2} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) \\right) \\mathrm{d} {\\phi}\\)" ], "text/latex": [ "$\\displaystyle \\omega = \\left( r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3} + r {\\left(\\cos\\left({\\phi}\\right) + \\sin\\left({\\phi}\\right)\\right)} \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) - r \\cos\\left({\\theta}\\right)^{2} \\right) \\mathrm{d} r + \\left( r^{2} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + r^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) + {\\left(r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) - r^{2} \\cos\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} \\right) \\mathrm{d} {\\theta} + \\left( -r^{3} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3} + r^{2} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) \\right) \\mathrm{d} {\\phi}$" ], "text/plain": [ "omega = (r^2*cos(ph)*sin(th)^3 + r*(cos(ph) + sin(ph))*cos(th)*sin(th) - r*cos(th)^2) dr + (r^2*cos(th)^2*sin(ph) + r^2*cos(th)*sin(th) + (r^3*cos(ph)*cos(th) - r^2*cos(ph))*sin(th)^2) dth + (-r^3*sin(ph)*sin(th)^3 + r^2*cos(ph)*cos(th)*sin(th)) dph" ] }, "execution_count": 176, "metadata": {}, "output_type": "execute_result" } ], "source": [ "om.display(Y.frame(), Y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1-形式は、ベクトル場に作用して、スカラー場を与えます。\n", "\n", "A 1-form acts on vector fields, resulting in a scalar field:
" ] }, { "cell_type": "code", "execution_count": 177, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field omega(v) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} \\omega\\left(v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & -x y z^{2} + x^{2} y + y^{3} + x^{2} + y^{2} + {\\left(x^{2} y - x\\right)} z \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & -r^{2} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) + {\\left(r^{4} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + r^{3} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} - {\\left(r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) - r^{2}\\right)} \\sin\\left({\\theta}\\right)^{2} \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} \\omega\\left(v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & -x y z^{2} + x^{2} y + y^{3} + x^{2} + y^{2} + {\\left(x^{2} y - x\\right)} z \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & -r^{2} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) + {\\left(r^{4} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + r^{3} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} - {\\left(r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) - r^{2}\\right)} \\sin\\left({\\theta}\\right)^{2} \\end{array}$" ], "text/plain": [ "omega(v): U → ℝ\n", " (x, y, z) ↦ -x*y*z^2 + x^2*y + y^3 + x^2 + y^2 + (x^2*y - x)*z\n", " (r, th, ph) ↦ -r^2*cos(ph)*cos(th)*sin(th) + (r^4*cos(ph)^2*cos(th)*sin(ph) + r^3*sin(ph))*sin(th)^3 - (r^4*cos(ph)*cos(th)^2*sin(ph) - r^2)*sin(th)^2" ] }, "execution_count": 177, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(om(v)) ; om(v).display()" ] }, { "cell_type": "code", "execution_count": 178, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field df(v) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} \\mathrm{d}f\\left(v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & 3 \\, x y z^{3} - {\\left(2 \\, x - 1\\right)} y + 1 \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) - 2 \\, r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} + 1 \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} \\mathrm{d}f\\left(v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & 3 \\, x y z^{3} - {\\left(2 \\, x - 1\\right)} y + 1 \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) - 2 \\, r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} + 1 \\end{array}$" ], "text/plain": [ "df(v): U → ℝ\n", " (x, y, z) ↦ 3*x*y*z^3 - (2*x - 1)*y + 1\n", " (r, th, ph) ↦ r*sin(ph)*sin(th) + (3*r^5*cos(ph)*cos(th)^3*sin(ph) - 2*r^2*cos(ph)*sin(ph))*sin(th)^2 + 1" ] }, "execution_count": 178, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(df(v)) ; df(v).display()" ] }, { "cell_type": "code", "execution_count": 179, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} \\omega\\left(u\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & x^{2} u_{x}\\left(x, y, z\\right) + y^{2} u_{x}\\left(x, y, z\\right) + z {\\left(u_{y}\\left(x, y, z\\right) - u_{z}\\left(x, y, z\\right)\\right)} + x u_{z}\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{2} \\sin\\left({\\theta}\\right)^{2} u_{x}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) + r \\cos\\left({\\theta}\\right) u_{y}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) + {\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) - r \\cos\\left({\\theta}\\right)\\right)} u_{z}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} \\omega\\left(u\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & x^{2} u_{x}\\left(x, y, z\\right) + y^{2} u_{x}\\left(x, y, z\\right) + z {\\left(u_{y}\\left(x, y, z\\right) - u_{z}\\left(x, y, z\\right)\\right)} + x u_{z}\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{2} \\sin\\left({\\theta}\\right)^{2} u_{x}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) + r \\cos\\left({\\theta}\\right) u_{y}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) + {\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) - r \\cos\\left({\\theta}\\right)\\right)} u_{z}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}$" ], "text/plain": [ "omega(u): U → ℝ\n", " (x, y, z) ↦ x^2*u_x(x, y, z) + y^2*u_x(x, y, z) + z*(u_y(x, y, z) - u_z(x, y, z)) + x*u_z(x, y, z)\n", " (r, th, ph) ↦ r^2*sin(th)^2*u_x(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th)) + r*cos(th)*u_y(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th)) + (r*cos(ph)*sin(th) - r*cos(th))*u_z(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th))" ] }, "execution_count": 179, "metadata": {}, "output_type": "execute_result" } ], "source": [ "om(u).display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "スカラー場$f$から導かれた1ー形式については、次の恒等式が成立します。\n", "\n", "In the case of a differential 1-form, the following identity holds:
" ] }, { "cell_type": "code", "execution_count": 180, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 180, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df(v) == v(f)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1-形式は、*親*が $U$上で定義された全ての1ー形式からなる$C^\\infty(U)$-module $\\Omega^{1}(U)$ であるSageの *element* オブジェクトです。\n", "\n", "1-forms are Sage *element* objects, whose *parent* is the $C^\\infty(U)$-module $\\Omega^{1}(U)$ of all 1-forms defined on $U$:" ] }, { "cell_type": "code", "execution_count": 181, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\Omega^{1}\\left(U\\right)\\)" ], "text/latex": [ "$\\displaystyle \\Omega^{1}\\left(U\\right)$" ], "text/plain": [ "Free module Omega^1(U) of 1-forms on the Open subset U of the 3-dimensional differentiable manifold M" ] }, "execution_count": 181, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.parent()" ] }, { "cell_type": "code", "execution_count": 182, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Free module Omega^1(U) of 1-forms on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(df.parent())" ] }, { "cell_type": "code", "execution_count": 183, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Free module Omega^1(U) of 1-forms on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(om.parent())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$\\Omega^{1}(U)$は自由モジュール $\\mathfrak{X}(U)$の双対です。\n", "\n", "$\\Omega^{1}(U)$ is actually the dual of the free module $\\mathfrak{X}(U)$:" ] }, { "cell_type": "code", "execution_count": 184, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 184, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.parent() is v.parent().dual()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 微分形式と外積, 外微分\n", "二つの1ー形式の **外積** は `wedge()` メソッドを使って求められます。その結果は 2-形式となります。\n", "\n", "The exterior product of two 1-forms is taken via the method wedge() and results in a 2-form:
" ] }, { "cell_type": "code", "execution_count": 185, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2-form omega∧df on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\omega\\wedge \\mathrm{d}f = \\left( 2 \\, x^{2} y + 2 \\, y^{3} - z \\right) \\mathrm{d} x\\wedge \\mathrm{d} y + \\left( 3 \\, {\\left(x^{2} + y^{2}\\right)} z^{2} - x + z \\right) \\mathrm{d} x\\wedge \\mathrm{d} z + \\left( 3 \\, z^{3} - 2 \\, x y + 2 \\, y z \\right) \\mathrm{d} y\\wedge \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\omega\\wedge \\mathrm{d}f = \\left( 2 \\, x^{2} y + 2 \\, y^{3} - z \\right) \\mathrm{d} x\\wedge \\mathrm{d} y + \\left( 3 \\, {\\left(x^{2} + y^{2}\\right)} z^{2} - x + z \\right) \\mathrm{d} x\\wedge \\mathrm{d} z + \\left( 3 \\, z^{3} - 2 \\, x y + 2 \\, y z \\right) \\mathrm{d} y\\wedge \\mathrm{d} z$" ], "text/plain": [ "omega∧df = (2*x^2*y + 2*y^3 - z) dx∧dy + (3*(x^2 + y^2)*z^2 - x + z) dx∧dz + (3*z^3 - 2*x*y + 2*y*z) dy∧dz" ] }, "execution_count": 185, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a = om.wedge(df) ; print(a) ; a.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "行列形式での要素の表示:\n", "A matrix view of the components:
" ] }, { "cell_type": "code", "execution_count": 186, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\begin{array}{rrr}\n", "0 & 2 \\, x^{2} y + 2 \\, y^{3} - z & 3 \\, {\\left(x^{2} + y^{2}\\right)} z^{2} - x + z \\\\\n", "-2 \\, x^{2} y - 2 \\, y^{3} + z & 0 & 3 \\, z^{3} - 2 \\, x y + 2 \\, y z \\\\\n", "-3 \\, {\\left(x^{2} + y^{2}\\right)} z^{2} + x - z & -3 \\, z^{3} + 2 \\, x y - 2 \\, y z & 0\n", "\\end{array}\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\begin{array}{rrr}\n", "0 & 2 \\, x^{2} y + 2 \\, y^{3} - z & 3 \\, {\\left(x^{2} + y^{2}\\right)} z^{2} - x + z \\\\\n", "-2 \\, x^{2} y - 2 \\, y^{3} + z & 0 & 3 \\, z^{3} - 2 \\, x y + 2 \\, y z \\\\\n", "-3 \\, {\\left(x^{2} + y^{2}\\right)} z^{2} + x - z & -3 \\, z^{3} + 2 \\, x y - 2 \\, y z & 0\n", "\\end{array}\\right)$" ], "text/plain": [ "[ 0 2*x^2*y + 2*y^3 - z 3*(x^2 + y^2)*z^2 - x + z]\n", "[ -2*x^2*y - 2*y^3 + z 0 3*z^3 - 2*x*y + 2*y*z]\n", "[-3*(x^2 + y^2)*z^2 + x - z -3*z^3 + 2*x*y - 2*y*z 0]" ] }, "execution_count": 186, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "歪対称性から導かれる余分な要素を省き、ゼロでない成分だけを表示します:\n", "Displaying only the non-vanishing components, skipping the redundant ones (i.e. those that can be deduced by antisymmetry):
" ] }, { "cell_type": "code", "execution_count": 187, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{lcl} \\omega\\wedge \\mathrm{d}f_{ \\, x \\, y }^{ \\phantom{\\, x}\\phantom{\\, y} } & = & 2 \\, x^{2} y + 2 \\, y^{3} - z \\\\ \\omega\\wedge \\mathrm{d}f_{ \\, x \\, z }^{ \\phantom{\\, x}\\phantom{\\, z} } & = & 3 \\, {\\left(x^{2} + y^{2}\\right)} z^{2} - x + z \\\\ \\omega\\wedge \\mathrm{d}f_{ \\, y \\, z }^{ \\phantom{\\, y}\\phantom{\\, z} } & = & 3 \\, z^{3} - 2 \\, x y + 2 \\, y z \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{lcl} \\omega\\wedge \\mathrm{d}f_{ \\, x \\, y }^{ \\phantom{\\, x}\\phantom{\\, y} } & = & 2 \\, x^{2} y + 2 \\, y^{3} - z \\\\ \\omega\\wedge \\mathrm{d}f_{ \\, x \\, z }^{ \\phantom{\\, x}\\phantom{\\, z} } & = & 3 \\, {\\left(x^{2} + y^{2}\\right)} z^{2} - x + z \\\\ \\omega\\wedge \\mathrm{d}f_{ \\, y \\, z }^{ \\phantom{\\, y}\\phantom{\\, z} } & = & 3 \\, z^{3} - 2 \\, x y + 2 \\, y z \\end{array}$" ], "text/plain": [ "omega∧df_xy = 2*x^2*y + 2*y^3 - z \n", "omega∧df_xz = 3*(x^2 + y^2)*z^2 - x + z \n", "omega∧df_yz = 3*z^3 - 2*x*y + 2*y*z " ] }, "execution_count": 187, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a.display_comp(only_nonredundant=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "2-形式$\\omega\\wedge\\mathrm{d}f$を コフレーム$(\\mathrm{d}r,\\mathrm{d}\\theta,\\mathrm{d}\\phi)$ での成分に展開することもできます。\n", "\n", "The 2-form $\\omega\\wedge\\mathrm{d}f$ can be expanded on the $(\\mathrm{d}r,\\mathrm{d}\\theta,\\mathrm{d}\\phi)$ coframe:
" ] }, { "cell_type": "code", "execution_count": 188, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\omega\\wedge \\mathrm{d}f = \\left( 3 \\, r^{5} \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{4} - {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) - 3 \\, r^{4} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) - 2 \\, r^{3} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right)^{2} - {\\left(3 \\, r^{4} \\sin\\left({\\phi}\\right) + r^{2} \\cos\\left({\\phi}\\right)\\right)} \\cos\\left({\\theta}\\right) - {\\left(2 \\, r^{3} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)^{2} - r^{2} \\cos\\left({\\phi}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right) \\right) \\mathrm{d} r\\wedge \\mathrm{d} {\\theta} + \\left( 2 \\, r^{4} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{5} + {\\left(3 \\, r^{5} \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) + 2 \\, r^{3} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} - {\\left(2 \\, r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + {\\left(\\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right) + 1\\right)} r^{2} \\cos\\left({\\theta}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} - {\\left(3 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{4} - r^{2} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right) \\right) \\mathrm{d} r\\wedge \\mathrm{d} {\\phi} + \\left( -r^{3} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\theta}\\right) - {\\left(3 \\, r^{6} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + 2 \\, r^{4} \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\phi}\\right) - 2 \\, r^{5} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{4} + {\\left(2 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + r^{3} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} - r^{3} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} \\right) \\mathrm{d} {\\theta}\\wedge \\mathrm{d} {\\phi}\\)" ], "text/latex": [ "$\\displaystyle \\omega\\wedge \\mathrm{d}f = \\left( 3 \\, r^{5} \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{4} - {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) - 3 \\, r^{4} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) - 2 \\, r^{3} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right)^{2} - {\\left(3 \\, r^{4} \\sin\\left({\\phi}\\right) + r^{2} \\cos\\left({\\phi}\\right)\\right)} \\cos\\left({\\theta}\\right) - {\\left(2 \\, r^{3} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)^{2} - r^{2} \\cos\\left({\\phi}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right) \\right) \\mathrm{d} r\\wedge \\mathrm{d} {\\theta} + \\left( 2 \\, r^{4} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{5} + {\\left(3 \\, r^{5} \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) + 2 \\, r^{3} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} - {\\left(2 \\, r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + {\\left(\\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right) + 1\\right)} r^{2} \\cos\\left({\\theta}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} - {\\left(3 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{4} - r^{2} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right) \\right) \\mathrm{d} r\\wedge \\mathrm{d} {\\phi} + \\left( -r^{3} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\theta}\\right) - {\\left(3 \\, r^{6} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + 2 \\, r^{4} \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\phi}\\right) - 2 \\, r^{5} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{4} + {\\left(2 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + r^{3} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} - r^{3} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} \\right) \\mathrm{d} {\\theta}\\wedge \\mathrm{d} {\\phi}$" ], "text/plain": [ "omega∧df = (3*r^5*cos(ph)*sin(th)^4 - (3*r^5*cos(ph) - 3*r^4*cos(th)*sin(ph) - 2*r^3*cos(ph)*sin(ph)^2)*sin(th)^2 - (3*r^4*sin(ph) + r^2*cos(ph))*cos(th) - (2*r^3*cos(th)*sin(ph)^2 - r^2*cos(ph)^2)*sin(th)) dr∧dth + (2*r^4*sin(ph)*sin(th)^5 + (3*r^5*cos(th)^3*sin(ph) + 2*r^3*cos(ph)^2*cos(th)*sin(ph))*sin(th)^3 - (2*r^3*cos(ph)*cos(th)^2*sin(ph) + (cos(ph)*sin(ph) + 1)*r^2*cos(th))*sin(th)^2 - (3*r^4*cos(ph)*cos(th)^4 - r^2*cos(th)^2*sin(ph))*sin(th)) dr∧dph + (-r^3*cos(th)^2*sin(th) - (3*r^6*cos(th)^2*sin(ph) + 2*r^4*cos(ph)^2*sin(ph) - 2*r^5*cos(th)*sin(ph))*sin(th)^4 + (2*r^4*cos(ph)*cos(th)*sin(ph) + r^3*cos(ph)*sin(ph))*sin(th)^3 + (3*r^5*cos(ph)*cos(th)^3 - r^3*cos(th)*sin(ph))*sin(th)^2) dth∧dph" ] }, "execution_count": 188, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a.display(Y.frame(), Y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$A:=\\omega\\wedge\\mathrm{d}f$ は2-形式として 二組のベクトルに作用させることができ、また歪対称です。\n", "\n", "As a 2-form, $A:=\\omega\\wedge\\mathrm{d}f$ can be applied to a pair of vectors and is antisymmetric:
" ] }, { "cell_type": "code", "execution_count": 189, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field A(u,v) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} A\\left(u,v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & 3 \\, x y z^{4} u_{y}\\left(x, y, z\\right) - 2 \\, x^{2} y^{2} u_{y}\\left(x, y, z\\right) - 2 \\, y^{4} u_{y}\\left(x, y, z\\right) - 2 \\, {\\left(x u_{x}\\left(x, y, z\\right) + u_{y}\\left(x, y, z\\right)\\right)} y^{3} + 3 \\, {\\left(x^{3} y u_{x}\\left(x, y, z\\right) + x y^{3} u_{x}\\left(x, y, z\\right) + x u_{z}\\left(x, y, z\\right)\\right)} z^{3} - {\\left(3 \\, y^{3} u_{z}\\left(x, y, z\\right) - {\\left(2 \\, x u_{y}\\left(x, y, z\\right) - 3 \\, u_{z}\\left(x, y, z\\right)\\right)} y^{2} + 3 \\, x^{2} u_{z}\\left(x, y, z\\right) + {\\left(3 \\, x^{2} u_{z}\\left(x, y, z\\right) - x u_{x}\\left(x, y, z\\right)\\right)} y\\right)} z^{2} - {\\left(2 \\, x^{3} u_{x}\\left(x, y, z\\right) + 2 \\, x^{2} u_{y}\\left(x, y, z\\right) + {\\left(2 \\, x^{2} - x\\right)} u_{z}\\left(x, y, z\\right)\\right)} y - {\\left(2 \\, x^{2} y^{2} u_{y}\\left(x, y, z\\right) + {\\left(x^{2} u_{x}\\left(x, y, z\\right) - {\\left(2 \\, x - 1\\right)} u_{z}\\left(x, y, z\\right) - u_{y}\\left(x, y, z\\right)\\right)} y - x u_{x}\\left(x, y, z\\right) - u_{y}\\left(x, y, z\\right) + u_{z}\\left(x, y, z\\right)\\right)} z + x u_{z}\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & {\\left(r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} + {\\left(\\sin\\left({\\phi}\\right)^{3} - \\sin\\left({\\phi}\\right)\\right)} r^{4} \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right)^{3} + r^{2} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) + {\\left(3 \\, r^{7} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) - 2 \\, r^{4} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{4}\\right)} u_{x}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) + {\\left(3 \\, r^{6} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{4} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} + r^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + 2 \\, {\\left({\\left(\\sin\\left({\\phi}\\right)^{4} - \\sin\\left({\\phi}\\right)^{2}\\right)} r^{5} \\cos\\left({\\theta}\\right) - r^{4} \\sin\\left({\\phi}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right)^{4} + 2 \\, {\\left(r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right)^{2} - r^{3} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} + r \\cos\\left({\\theta}\\right)\\right)} u_{y}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) - {\\left({\\left(3 \\, r^{5} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) - 2 \\, {\\left(\\sin\\left({\\phi}\\right)^{3} - \\sin\\left({\\phi}\\right)\\right)} r^{3}\\right)} \\sin\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{4} \\cos\\left({\\theta}\\right)^{2} - 2 \\, r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) - r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\theta}\\right) - {\\left(3 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} - r^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + r \\cos\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)\\right)} u_{z}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} A\\left(u,v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & 3 \\, x y z^{4} u_{y}\\left(x, y, z\\right) - 2 \\, x^{2} y^{2} u_{y}\\left(x, y, z\\right) - 2 \\, y^{4} u_{y}\\left(x, y, z\\right) - 2 \\, {\\left(x u_{x}\\left(x, y, z\\right) + u_{y}\\left(x, y, z\\right)\\right)} y^{3} + 3 \\, {\\left(x^{3} y u_{x}\\left(x, y, z\\right) + x y^{3} u_{x}\\left(x, y, z\\right) + x u_{z}\\left(x, y, z\\right)\\right)} z^{3} - {\\left(3 \\, y^{3} u_{z}\\left(x, y, z\\right) - {\\left(2 \\, x u_{y}\\left(x, y, z\\right) - 3 \\, u_{z}\\left(x, y, z\\right)\\right)} y^{2} + 3 \\, x^{2} u_{z}\\left(x, y, z\\right) + {\\left(3 \\, x^{2} u_{z}\\left(x, y, z\\right) - x u_{x}\\left(x, y, z\\right)\\right)} y\\right)} z^{2} - {\\left(2 \\, x^{3} u_{x}\\left(x, y, z\\right) + 2 \\, x^{2} u_{y}\\left(x, y, z\\right) + {\\left(2 \\, x^{2} - x\\right)} u_{z}\\left(x, y, z\\right)\\right)} y - {\\left(2 \\, x^{2} y^{2} u_{y}\\left(x, y, z\\right) + {\\left(x^{2} u_{x}\\left(x, y, z\\right) - {\\left(2 \\, x - 1\\right)} u_{z}\\left(x, y, z\\right) - u_{y}\\left(x, y, z\\right)\\right)} y - x u_{x}\\left(x, y, z\\right) - u_{y}\\left(x, y, z\\right) + u_{z}\\left(x, y, z\\right)\\right)} z + x u_{z}\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & {\\left(r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} + {\\left(\\sin\\left({\\phi}\\right)^{3} - \\sin\\left({\\phi}\\right)\\right)} r^{4} \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right)^{3} + r^{2} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) + {\\left(3 \\, r^{7} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) - 2 \\, r^{4} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{4}\\right)} u_{x}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) + {\\left(3 \\, r^{6} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{4} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} + r^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + 2 \\, {\\left({\\left(\\sin\\left({\\phi}\\right)^{4} - \\sin\\left({\\phi}\\right)^{2}\\right)} r^{5} \\cos\\left({\\theta}\\right) - r^{4} \\sin\\left({\\phi}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right)^{4} + 2 \\, {\\left(r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right)^{2} - r^{3} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} + r \\cos\\left({\\theta}\\right)\\right)} u_{y}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) - {\\left({\\left(3 \\, r^{5} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) - 2 \\, {\\left(\\sin\\left({\\phi}\\right)^{3} - \\sin\\left({\\phi}\\right)\\right)} r^{3}\\right)} \\sin\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{4} \\cos\\left({\\theta}\\right)^{2} - 2 \\, r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) - r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\theta}\\right) - {\\left(3 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} - r^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + r \\cos\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)\\right)} u_{z}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}$" ], "text/plain": [ "A(u,v): U → ℝ\n", " (x, y, z) ↦ 3*x*y*z^4*u_y(x, y, z) - 2*x^2*y^2*u_y(x, y, z) - 2*y^4*u_y(x, y, z) - 2*(x*u_x(x, y, z) + u_y(x, y, z))*y^3 + 3*(x^3*y*u_x(x, y, z) + x*y^3*u_x(x, y, z) + x*u_z(x, y, z))*z^3 - (3*y^3*u_z(x, y, z) - (2*x*u_y(x, y, z) - 3*u_z(x, y, z))*y^2 + 3*x^2*u_z(x, y, z) + (3*x^2*u_z(x, y, z) - x*u_x(x, y, z))*y)*z^2 - (2*x^3*u_x(x, y, z) + 2*x^2*u_y(x, y, z) + (2*x^2 - x)*u_z(x, y, z))*y - (2*x^2*y^2*u_y(x, y, z) + (x^2*u_x(x, y, z) - (2*x - 1)*u_z(x, y, z) - u_y(x, y, z))*y - x*u_x(x, y, z) - u_y(x, y, z) + u_z(x, y, z))*z + x*u_z(x, y, z)\n", " (r, th, ph) ↦ (r^4*cos(ph)*cos(th)^2*sin(ph)*sin(th)^2 + (sin(ph)^3 - sin(ph))*r^4*cos(th)*sin(th)^3 + r^2*cos(ph)*cos(th)*sin(th) + (3*r^7*cos(ph)*cos(th)^3*sin(ph) - 2*r^4*cos(ph)*sin(ph))*sin(th)^4)*u_x(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th)) + (3*r^6*cos(ph)*cos(th)^4*sin(ph)*sin(th)^2 + r^2*cos(th)*sin(ph)*sin(th) + 2*((sin(ph)^4 - sin(ph)^2)*r^5*cos(th) - r^4*sin(ph)^2)*sin(th)^4 + 2*(r^5*cos(ph)*cos(th)^2*sin(ph)^2 - r^3*sin(ph))*sin(th)^3 + r*cos(th))*u_y(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th)) - ((3*r^5*cos(th)^2*sin(ph) - 2*(sin(ph)^3 - sin(ph))*r^3)*sin(th)^3 + (3*r^4*cos(th)^2 - 2*r^3*cos(ph)*cos(th)*sin(ph) - r^2*cos(ph)*sin(ph))*sin(th)^2 + r*cos(th) - (3*r^4*cos(ph)*cos(th)^3 - r^2*cos(th)*sin(ph) + r*cos(ph))*sin(th))*u_z(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th))" ] }, "execution_count": 189, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a.set_name('A')\n", "print(a(u,v)) ; a(u,v).display()" ] }, { "cell_type": "code", "execution_count": 190, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 190, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a(u,v) == - a(v,u)" ] }, { "cell_type": "code", "execution_count": 191, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "no symmetry; antisymmetry: (0, 1)\n" ] } ], "source": [ "a.symmetries()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ある微分形式の **外微分** は以下のように、`exterior_derivative()`メソッドを使って求めます。\n", "\n", "The exterior derivative of a differential form:
" ] }, { "cell_type": "code", "execution_count": 192, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2-form domega on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{d}\\omega = -2 \\, y \\mathrm{d} x\\wedge \\mathrm{d} y +\\mathrm{d} x\\wedge \\mathrm{d} z -\\mathrm{d} y\\wedge \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{d}\\omega = -2 \\, y \\mathrm{d} x\\wedge \\mathrm{d} y +\\mathrm{d} x\\wedge \\mathrm{d} z -\\mathrm{d} y\\wedge \\mathrm{d} z$" ], "text/plain": [ "domega = -2*y dx∧dy + dx∧dz - dy∧dz" ] }, "execution_count": 192, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dom = om.exterior_derivative() ; print(dom) ; dom.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`exterior_derivative()`メソッドを作用させる代わりに、関数 `diff()` を使うこともできます(SageMath 9.2以降で利用可能)。\n", "\n", "Instead of invoking the method `exterior_derivative()`, one can use the function `diff()` (available in SageMath 9.2 or higher):" ] }, { "cell_type": "code", "execution_count": 193, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{d}\\omega\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{d}\\omega$" ], "text/plain": [ "2-form domega on the Open subset U of the 3-dimensional differentiable manifold M" ] }, "execution_count": 193, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dom = diff(om)\n", "dom" ] }, { "cell_type": "code", "execution_count": 194, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3-form dA on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{d}A = \\left( -6 \\, y z^{2} - 2 \\, y - 1 \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{d}A = \\left( -6 \\, y z^{2} - 2 \\, y - 1 \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z$" ], "text/plain": [ "dA = (-6*y*z^2 - 2*y - 1) dx∧dy∧dz" ] }, "execution_count": 194, "metadata": {}, "output_type": "execute_result" } ], "source": [ "da = diff(a) ; print(da) ; da.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**外微分** を続けて作用させると、結果は0になります。\n", "\n", "The exterior derivative is nilpotent:
" ] }, { "cell_type": "code", "execution_count": 195, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{d}\\mathrm{d}f = 0\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{d}\\mathrm{d}f = 0$" ], "text/plain": [ "ddf = 0" ] }, "execution_count": 195, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ddf = diff(df) ; ddf.display()" ] }, { "cell_type": "code", "execution_count": 196, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{d}\\mathrm{d}\\omega = 0\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{d}\\mathrm{d}\\omega = 0$" ], "text/plain": [ "ddomega = 0" ] }, "execution_count": 196, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ddom = diff(dom) ; ddom.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Lie 微分: Lie derivative\n", "テンソル場のあるベクトル場に関するLie微分は、`lie_derivative()` メソッドを用いて計算します。\n", "\n", "The Lie derivative of any tensor field with respect to a vector field is computed by the method lie_derivative(), with the vector field as the argument:
" ] }, { "cell_type": "code", "execution_count": 197, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\left( -y z^{2} + {\\left(x y - 1\\right)} z + 2 \\, x \\right) \\mathrm{d} x + \\left( -x z^{2} + x^{2} + y^{2} + {\\left(x^{2} + x y\\right)} z \\right) \\mathrm{d} y + \\left( -2 \\, x y z + {\\left(x^{2} + 1\\right)} y + 1 \\right) \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\left( -y z^{2} + {\\left(x y - 1\\right)} z + 2 \\, x \\right) \\mathrm{d} x + \\left( -x z^{2} + x^{2} + y^{2} + {\\left(x^{2} + x y\\right)} z \\right) \\mathrm{d} y + \\left( -2 \\, x y z + {\\left(x^{2} + 1\\right)} y + 1 \\right) \\mathrm{d} z$" ], "text/plain": [ "(-y*z^2 + (x*y - 1)*z + 2*x) dx + (-x*z^2 + x^2 + y^2 + (x^2 + x*y)*z) dy + (-2*x*y*z + (x^2 + 1)*y + 1) dz" ] }, "execution_count": 197, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lv_om = om.lie_derivative(v) ; print(lv_om) ; \n", "lv_om.display()" ] }, { "cell_type": "code", "execution_count": 198, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\left( u_{x}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x ^ 2} + u_{y}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x\\partial y} + u_{z}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x\\partial z} + \\frac{\\partial\\,H}{\\partial x} \\frac{\\partial\\,u_{x}}{\\partial x} + \\frac{\\partial\\,H}{\\partial y} \\frac{\\partial\\,u_{y}}{\\partial x} + \\frac{\\partial\\,H}{\\partial z} \\frac{\\partial\\,u_{z}}{\\partial x} \\right) \\mathrm{d} x + \\left( u_{x}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x\\partial y} + u_{y}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial y ^ 2} + u_{z}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial y\\partial z} + \\frac{\\partial\\,H}{\\partial x} \\frac{\\partial\\,u_{x}}{\\partial y} + \\frac{\\partial\\,H}{\\partial y} \\frac{\\partial\\,u_{y}}{\\partial y} + \\frac{\\partial\\,H}{\\partial z} \\frac{\\partial\\,u_{z}}{\\partial y} \\right) \\mathrm{d} y + \\left( u_{x}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x\\partial z} + u_{y}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial y\\partial z} + u_{z}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial z ^ 2} + \\frac{\\partial\\,H}{\\partial x} \\frac{\\partial\\,u_{x}}{\\partial z} + \\frac{\\partial\\,H}{\\partial y} \\frac{\\partial\\,u_{y}}{\\partial z} + \\frac{\\partial\\,H}{\\partial z} \\frac{\\partial\\,u_{z}}{\\partial z} \\right) \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\left( u_{x}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x ^ 2} + u_{y}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x\\partial y} + u_{z}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x\\partial z} + \\frac{\\partial\\,H}{\\partial x} \\frac{\\partial\\,u_{x}}{\\partial x} + \\frac{\\partial\\,H}{\\partial y} \\frac{\\partial\\,u_{y}}{\\partial x} + \\frac{\\partial\\,H}{\\partial z} \\frac{\\partial\\,u_{z}}{\\partial x} \\right) \\mathrm{d} x + \\left( u_{x}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x\\partial y} + u_{y}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial y ^ 2} + u_{z}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial y\\partial z} + \\frac{\\partial\\,H}{\\partial x} \\frac{\\partial\\,u_{x}}{\\partial y} + \\frac{\\partial\\,H}{\\partial y} \\frac{\\partial\\,u_{y}}{\\partial y} + \\frac{\\partial\\,H}{\\partial z} \\frac{\\partial\\,u_{z}}{\\partial y} \\right) \\mathrm{d} y + \\left( u_{x}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial x\\partial z} + u_{y}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial y\\partial z} + u_{z}\\left(x, y, z\\right) \\frac{\\partial^2\\,H}{\\partial z ^ 2} + \\frac{\\partial\\,H}{\\partial x} \\frac{\\partial\\,u_{x}}{\\partial z} + \\frac{\\partial\\,H}{\\partial y} \\frac{\\partial\\,u_{y}}{\\partial z} + \\frac{\\partial\\,H}{\\partial z} \\frac{\\partial\\,u_{z}}{\\partial z} \\right) \\mathrm{d} z$" ], "text/plain": [ "(u_x(x, y, z)*d^2(H)/dx^2 + u_y(x, y, z)*d^2(H)/dxdy + u_z(x, y, z)*d^2(H)/dxdz + d(H)/dx*d(u_x)/dx + d(H)/dy*d(u_y)/dx + d(H)/dz*d(u_z)/dx) dx + (u_x(x, y, z)*d^2(H)/dxdy + u_y(x, y, z)*d^2(H)/dy^2 + u_z(x, y, z)*d^2(H)/dydz + d(H)/dx*d(u_x)/dy + d(H)/dy*d(u_y)/dy + d(H)/dz*d(u_z)/dy) dy + (u_x(x, y, z)*d^2(H)/dxdz + u_y(x, y, z)*d^2(H)/dydz + u_z(x, y, z)*d^2(H)/dz^2 + d(H)/dx*d(u_x)/dz + d(H)/dy*d(u_y)/dz + d(H)/dz*d(u_z)/dz) dz" ] }, "execution_count": 198, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lu_dh = dh.lie_derivative(u) ; print(lu_dh) ; \n", "lu_dh.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*Cartanの恒等式*を確かめてみましょう\n", "\n", "1-形式$\\omega$についての*Cartanの恒等式*\n", "$$\\mathcal{L}_v \\omega = v\\cdot \\mathrm{d}\\omega + \\mathrm{d}\\langle \\omega, v\\rangle$$\n", "2-形式$\\omega$についての*Cartanの恒等式*\n", "$$\\mathcal{L}_v A = v\\cdot \\mathrm{d}A + \\mathrm{d}(v\\cdot A)$$\n", "\n", "Let us check Cartan identity on the 1-form $\\omega$:
\n", "$\\mathcal{L}_v \\omega = v\\cdot \\mathrm{d}\\omega + \\mathrm{d}\\langle \\omega, v\\rangle$
\n", "and on the 2-form $A$:
\n", "$\\mathcal{L}_v A = v\\cdot \\mathrm{d}A + \\mathrm{d}(v\\cdot A)$
" ] }, { "cell_type": "code", "execution_count": 199, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 199, "metadata": {}, "output_type": "execute_result" } ], "source": [ "om.lie_derivative(v) == v.contract(diff(om)) + diff(om(v))" ] }, { "cell_type": "code", "execution_count": 200, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 200, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a.lie_derivative(v) == v.contract(diff(a)) + diff(v.contract(a))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ベクトル場の別のベクトル場によるLie微分は、二つのベクトル場による **交換子積**(あるいは **交換子**) になります。\n", "\n", "The Lie derivative of a vector field along another one is the commutator of the two vectors fields:
" ] }, { "cell_type": "code", "execution_count": 201, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 201, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v.lie_derivative(u)(f) == u(v(f)) - v(u(f))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 任意の階数のテンソル場:Tensor fields of arbitrary rank\n", "これまでに、次のようなテンソル場をみてきました。\n", "\n", " - (0,0)形式のテンソル :スカラー場,\n", " - (1,0) 形式のテンソル :ベクトル場,\n", " - (0,1)形式のテンソル :1ー形式あるいは一階の微分形式,\n", " - (0,2)形式で歪対称のテンソル :2ー形式あるいは二階の微分形式.\n", "\n", "より一般に、$(p,q)$型のテンソル場をSageManifoldsに導入することができます。\n", "例えば、副多様体$U$上の(1,2)型のテンソル場を次のように宣言します。\n", "\n", "Up to now, we have encountered tensor fields\n", "\n", "- of type (0,0) (i.e. scalar fields),\n", "- of type (1,0) (i.e. vector fields),\n", "- of type (0,1) (i.e. 1-forms),\n", "- of type (0,2) and antisymmetric (i.e. 2-forms).\n", "\n", "More generally, tensor fields of any type $(p,q)$ can be introduced in SageMath. For instance a tensor field of type (1,2) on the open subset $U$ is declared as follows:" ] }, { "cell_type": "code", "execution_count": 202, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field T of type (1,2) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "t = U.tensor_field(1, 2, name='T') ; print(t)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ベクトルや1-形式と同じように、テンソル場の既定のフレームに関する要素を `[]`演算子を使って設定できます。\n", "\n", "As for vectors or 1-forms, the tensor's components with respect to the domain's default frame are set by means of square brackets:
" ] }, { "cell_type": "code", "execution_count": 203, "metadata": {}, "outputs": [], "source": [ "t[1,2,1] = 1 + x^2\n", "t[3,2,1] = x*y*z" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "設定されていない要素は0です。\n", "Unset components are zero:
" ] }, { "cell_type": "code", "execution_count": 204, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle T = \\left( x^{2} + 1 \\right) \\frac{\\partial}{\\partial x }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x + x y z \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x\\)" ], "text/latex": [ "$\\displaystyle T = \\left( x^{2} + 1 \\right) \\frac{\\partial}{\\partial x }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x + x y z \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x$" ], "text/plain": [ "T = (x^2 + 1) ∂/∂x⊗dy⊗dx + x*y*z ∂/∂z⊗dy⊗dx" ] }, "execution_count": 204, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t.display()" ] }, { "cell_type": "code", "execution_count": 205, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left[\\left[0, 0, 0\\right], \\left[x^{2} + 1, 0, 0\\right], \\left[0, 0, 0\\right]\\right], \\left[\\left[0, 0, 0\\right], \\left[0, 0, 0\\right], \\left[0, 0, 0\\right]\\right], \\left[\\left[0, 0, 0\\right], \\left[x y z, 0, 0\\right], \\left[0, 0, 0\\right]\\right]\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left[\\left[0, 0, 0\\right], \\left[x^{2} + 1, 0, 0\\right], \\left[0, 0, 0\\right]\\right], \\left[\\left[0, 0, 0\\right], \\left[0, 0, 0\\right], \\left[0, 0, 0\\right]\\right], \\left[\\left[0, 0, 0\\right], \\left[x y z, 0, 0\\right], \\left[0, 0, 0\\right]\\right]\\right]$" ], "text/plain": [ "[[[0, 0, 0], [x^2 + 1, 0, 0], [0, 0, 0]],\n", " [[0, 0, 0], [0, 0, 0], [0, 0, 0]],\n", " [[0, 0, 0], [x*y*z, 0, 0], [0, 0, 0]]]" ] }, "execution_count": 205, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "0 でない要素を表示します。\n", "Display of the nonzero components:
" ] }, { "cell_type": "code", "execution_count": 206, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{lcl} T_{ \\phantom{\\, x} \\, y \\, x }^{ \\, x \\phantom{\\, y} \\phantom{\\, x} } & = & x^{2} + 1 \\\\ T_{ \\phantom{\\, z} \\, y \\, x }^{ \\, z \\phantom{\\, y} \\phantom{\\, x} } & = & x y z \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{lcl} T_{ \\phantom{\\, x} \\, y \\, x }^{ \\, x \\phantom{\\, y} \\phantom{\\, x} } & = & x^{2} + 1 \\\\ T_{ \\phantom{\\, z} \\, y \\, x }^{ \\, z \\phantom{\\, y} \\phantom{\\, x} } & = & x y z \\end{array}$" ], "text/plain": [ "T^x_yx = x^2 + 1 \n", "T^z_yx = x*y*z " ] }, "execution_count": 206, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t.display_comp()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "二重括弧`[[]]`演算子は既定のフレームに関する成分をスカラー場として返します。一方、一重の括弧`[]`演算子はこのスカラー場の既定の座標系についての表現を返します。\n", "Double square brackets return the component (still w.r.t. the default frame) as a scalar field, while single square brackets return the expression of this scalar field in terms of the domain's default coordinates:
" ] }, { "cell_type": "code", "execution_count": 207, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} & U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & x^{2} + 1 \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{2} \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + 1 \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} & U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & x^{2} + 1 \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{2} \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + 1 \\end{array}$" ], "text/plain": [ "U → ℝ\n", "(x, y, z) ↦ x^2 + 1\n", "(r, th, ph) ↦ r^2*cos(ph)^2*sin(th)^2 + 1" ] }, "execution_count": 207, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(t[[1,2,1]]) ; \n", "t[[1,2,1]].display()" ] }, { "cell_type": "code", "execution_count": 208, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "x^2 + 1\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle x^{2} + 1\\)" ], "text/latex": [ "$\\displaystyle x^{2} + 1$" ], "text/plain": [ "x^2 + 1" ] }, "execution_count": 208, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(t[1,2,1])\n", "t[1,2,1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "(1,2)型のテンソル場は (1-形式、ベクトル場、ベクトル場)からなる3成分のタプルをスカラー場に写像します。\n", "\n", "A tensor field of type (1,2) maps a 3-tuple (1-form, vector field, vector field) to a scalar field:
" ] }, { "cell_type": "code", "execution_count": 209, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field T(omega,u,v) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} T\\left(\\omega,u,v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & {\\left(x^{2} + 1\\right)} y^{3} u_{y}\\left(x, y, z\\right) + {\\left(x^{2} + 1\\right)} y^{2} u_{y}\\left(x, y, z\\right) - {\\left(x y^{2} u_{y}\\left(x, y, z\\right) + x y u_{y}\\left(x, y, z\\right)\\right)} z^{2} + {\\left(x^{4} + x^{2}\\right)} y u_{y}\\left(x, y, z\\right) + {\\left(x^{2} y^{2} u_{y}\\left(x, y, z\\right) + x^{2} y u_{y}\\left(x, y, z\\right)\\right)} z + {\\left(x^{4} + x^{2}\\right)} u_{y}\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & {\\left(r^{5} \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{5} - {\\left({\\left(\\cos\\left({\\phi}\\right)^{4} - \\cos\\left({\\phi}\\right)^{2}\\right)} r^{5} \\cos\\left({\\theta}\\right) - r^{4} \\cos\\left({\\phi}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right)^{4} + {\\left({\\left(\\cos\\left({\\phi}\\right)^{3} - \\cos\\left({\\phi}\\right)\\right)} r^{5} \\cos\\left({\\theta}\\right)^{2} + r^{4} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + r^{3} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} - {\\left(r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) - r^{2}\\right)} \\sin\\left({\\theta}\\right)^{2}\\right)} u_{y}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} T\\left(\\omega,u,v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & {\\left(x^{2} + 1\\right)} y^{3} u_{y}\\left(x, y, z\\right) + {\\left(x^{2} + 1\\right)} y^{2} u_{y}\\left(x, y, z\\right) - {\\left(x y^{2} u_{y}\\left(x, y, z\\right) + x y u_{y}\\left(x, y, z\\right)\\right)} z^{2} + {\\left(x^{4} + x^{2}\\right)} y u_{y}\\left(x, y, z\\right) + {\\left(x^{2} y^{2} u_{y}\\left(x, y, z\\right) + x^{2} y u_{y}\\left(x, y, z\\right)\\right)} z + {\\left(x^{4} + x^{2}\\right)} u_{y}\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & {\\left(r^{5} \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{5} - {\\left({\\left(\\cos\\left({\\phi}\\right)^{4} - \\cos\\left({\\phi}\\right)^{2}\\right)} r^{5} \\cos\\left({\\theta}\\right) - r^{4} \\cos\\left({\\phi}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right)^{4} + {\\left({\\left(\\cos\\left({\\phi}\\right)^{3} - \\cos\\left({\\phi}\\right)\\right)} r^{5} \\cos\\left({\\theta}\\right)^{2} + r^{4} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + r^{3} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} - {\\left(r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) - r^{2}\\right)} \\sin\\left({\\theta}\\right)^{2}\\right)} u_{y}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}$" ], "text/plain": [ "T(omega,u,v): U → ℝ\n", " (x, y, z) ↦ (x^2 + 1)*y^3*u_y(x, y, z) + (x^2 + 1)*y^2*u_y(x, y, z) - (x*y^2*u_y(x, y, z) + x*y*u_y(x, y, z))*z^2 + (x^4 + x^2)*y*u_y(x, y, z) + (x^2*y^2*u_y(x, y, z) + x^2*y*u_y(x, y, z))*z + (x^4 + x^2)*u_y(x, y, z)\n", " (r, th, ph) ↦ (r^5*cos(ph)^2*sin(ph)*sin(th)^5 - ((cos(ph)^4 - cos(ph)^2)*r^5*cos(th) - r^4*cos(ph)^2)*sin(th)^4 + ((cos(ph)^3 - cos(ph))*r^5*cos(th)^2 + r^4*cos(ph)^2*cos(th)*sin(ph) + r^3*sin(ph))*sin(th)^3 - (r^4*cos(ph)*cos(th)^2*sin(ph) - r^2)*sin(th)^2)*u_y(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th))" ] }, "execution_count": 209, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(t(om, u, v))\n", "t(om, u, v).display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ベクトル場や微分形式と同じように、多様体に定義されたどのフレームついてのテンソル場の成分も取り出せます。\n", "\n", "As for vectors and differential forms, the tensor components can be taken in any frame defined on the manifold:
" ] }, { "cell_type": "code", "execution_count": 210, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle r^{2} \\cos\\left({\\phi}\\right)^{4} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{5} + {\\left(\\cos\\left({\\phi}\\right)^{4} - \\cos\\left({\\phi}\\right)^{2}\\right)} r^{3} \\sin\\left({\\theta}\\right)^{6} - {\\left(\\cos\\left({\\phi}\\right)^{4} - \\cos\\left({\\phi}\\right)^{2}\\right)} r^{3} \\sin\\left({\\theta}\\right)^{4} + \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3}\\)" ], "text/latex": [ "$\\displaystyle r^{2} \\cos\\left({\\phi}\\right)^{4} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{5} + {\\left(\\cos\\left({\\phi}\\right)^{4} - \\cos\\left({\\phi}\\right)^{2}\\right)} r^{3} \\sin\\left({\\theta}\\right)^{6} - {\\left(\\cos\\left({\\phi}\\right)^{4} - \\cos\\left({\\phi}\\right)^{2}\\right)} r^{3} \\sin\\left({\\theta}\\right)^{4} + \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{3}$" ], "text/plain": [ "r^2*cos(ph)^4*sin(ph)*sin(th)^5 + (cos(ph)^4 - cos(ph)^2)*r^3*sin(th)^6 - (cos(ph)^4 - cos(ph)^2)*r^3*sin(th)^4 + cos(ph)^2*sin(ph)*sin(th)^3" ] }, "execution_count": 210, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t[Y.frame(), 1,1,1, Y]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## テンソル計算:Tensor calculus\n", "テンソル積$\\otimes$ は `*`で示されます。\n", "\n", "The tensor product $\\otimes$ is denoted by `*`:
" ] }, { "cell_type": "code", "execution_count": 211, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(1, 0)\n", "(0, 2)\n" ] } ], "source": [ "print(v.tensor_type())\n", "print(a.tensor_type())" ] }, { "cell_type": "code", "execution_count": 212, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field v⊗A of type (1,2) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle v\\otimes A\\)" ], "text/latex": [ "$\\displaystyle v\\otimes A$" ], "text/plain": [ "Tensor field v⊗A of type (1,2) on the Open subset U of the 3-dimensional differentiable manifold M" ] }, "execution_count": 212, "metadata": {}, "output_type": "execute_result" } ], "source": [ "b = v*a \n", "print(b)\n", "b" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "テンソル積は、(歪)対称性を保ちます。$A$は2-形式なので、二つの引数(位置0および1)について歪対称です。結果として$b$は最後の二つの引数(位置1および2)について歪対称となります。\n", "\n", "The tensor product preserves the (anti)symmetries: since $A$ is a 2-form, it is antisymmetric with respect to its two arguments (positions 0 and 1); as a result, b is antisymmetric with respect to its last two arguments (positions 1 and 2):
" ] }, { "cell_type": "code", "execution_count": 213, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "no symmetry; antisymmetry: (0, 1)\n" ] } ], "source": [ "a.symmetries()" ] }, { "cell_type": "code", "execution_count": 214, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "no symmetry; antisymmetry: (1, 2)\n" ] } ], "source": [ "b.symmetries()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "標準的な **テンソル 計算** は実装済みです。\n", "\n", "Standard tensor arithmetics is implemented:
" ] }, { "cell_type": "code", "execution_count": 215, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (1,2) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "s = - t + 2*f* b\n", "print(s)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**テンソルの縮約 **は `trace()`メソッドおよび `contract()` メソッドで取り扱われます。例として、テンソル $T$ の最初の二つの引数(位置 0 および 1) について縮約してみましょう。つまり、$c_i = T^k_{\\ \\, k i}$で与えられるテンソル $c$を構築してみましょう。\n", "\n", "**Tensor contractions** are dealt with by the methods`trace()` and `contract()`: for instance, let us contract the tensor $T$ w.r.t. its first two arguments (positions 0 and 1), i.e. let us form the tensor $c$ of components $c_i = T^k_{\\ \\, k i}$:" ] }, { "cell_type": "code", "execution_count": 216, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "c = t.trace(0,1)\n", "print(c)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`trace(0,1)`と入力する代わりに、**指標表記** を使って縮約を指定できます。指標は文字列として`[]`演算子の中に記述されます。\n", "文字列中で、\"^\" は反変指標の前、\"_\" は共変指標の前、に置かれます。\n", "\n", "An alternative to the writing `trace(0,1)` is to use the **index notation** to denote the contraction: the indices are given in a string inside the `[]` operator, with `'^'` in front of the contravariant indices and `'_'` in front of the covariant ones:" ] }, { "cell_type": "code", "execution_count": 217, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 217, "metadata": {}, "output_type": "execute_result" } ], "source": [ "c1 = t['^k_ki']\n", "print(c1)\n", "c1 == c" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "縮約は繰り返された指標(ここでは $k$ です)について実行されます。それ以外の文字(ここでは $i$ )は任意です。\n", "\n", "The contraction is performed on the repeated index (here `k`); the letter denoting the remaining index (here `i`) is arbitrary:" ] }, { "cell_type": "code", "execution_count": 218, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 218, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t['^k_kj'] == c" ] }, { "cell_type": "code", "execution_count": 219, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 219, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t['^b_ba'] == c" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "縮約されない指標については \".\"(ドット)で置き換え可能です。\n", "\n", "It can even be replaced by a dot:
" ] }, { "cell_type": "code", "execution_count": 220, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 220, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t['^k_k.'] == c" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "この文字列中ではLaTeX式の指定も可能です。\n", "\n", "LaTeX notations are allowed:
" ] }, { "cell_type": "code", "execution_count": 221, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 221, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t['^{k}_{ki}'] == c" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "SageMath 9.2以降では、ギリシャ文字を使うことも可能です。\n", "\n", "as well as Greek letters (only for SageMath 9.2 or higher):" ] }, { "cell_type": "code", "execution_count": 222, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 222, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t['^μ_μα'] == c" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "テンソル場 $T$ とベクトル場 $v$ の縮約 $T^i_{\\ j k} v^k$ は次のようにして、実行されます。ここで、2は$T$の最後の指標の場所、0は$v$の唯一の指標の場所です。\n", "\n", "The contraction $T^i_{\\ j k} v^k$ of the tensor fields $T$ and $v$ is taken as follows (2 refers to the last index position of $T$ and 0 to the only index position of v):
" ] }, { "cell_type": "code", "execution_count": 223, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (1,1) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "tv = t.contract(2, v, 0)\n", "print(tv)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "2はTの最後の指標の場所、0は$v$の唯一の指標の場所ですので、上記の表記の簡略版は次のようになります。\n", "\n", "Since 2 corresponds to the last index position of $T$ and 0 to the first index position of $v$, a shortcut for the above is
" ] }, { "cell_type": "code", "execution_count": 224, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (1,1) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "tv1 = t.contract(v)\n", "print(tv1)" ] }, { "cell_type": "code", "execution_count": 225, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 225, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tv1 == tv" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`contract()` メソッドに替わって、**指標表記** と 直積演算子 `*` を組み合わせることで、縮約を表現できます。\n", "\n", "Instead of contract(), the index notation, combined with the * operator, can be used to denote the contraction:
" ] }, { "cell_type": "code", "execution_count": 226, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 226, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t['^i_jk']*v['^k'] == tv" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "繰り替えされない指標については、`.`で置き換えることができます。\n", "\n", "The non-repeated indices can be replaced by dots:
" ] }, { "cell_type": "code", "execution_count": 227, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 227, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t['^._.k']*v['^k'] == tv" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 計量構造: Metric structures\n", "多様体$\\mathcal{M}$の**Riemann 計量** はつぎのように宣言されます。\n", "\n", "A Riemannian metric on the manifold $\\mathcal{M}$ is declared as follows:
" ] }, { "cell_type": "code", "execution_count": 228, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Riemannian metric g on the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "g = M.riemannian_metric('g')\n", "print(g)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "計量 $g$ は対称な (0,2) 型のテンソル場です。\n", "\n", "It is a symmetric tensor field of type (0,2):
" ] }, { "cell_type": "code", "execution_count": 229, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathcal{T}^{(0, 2)}\\left(\\mathcal{M}\\right)\\)" ], "text/latex": [ "$\\displaystyle \\mathcal{T}^{(0, 2)}\\left(\\mathcal{M}\\right)$" ], "text/plain": [ "Free module T^(0,2)(M) of type-(0,2) tensors fields on the 3-dimensional differentiable manifold M" ] }, "execution_count": 229, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.parent()" ] }, { "cell_type": "code", "execution_count": 230, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Free module T^(0,2)(M) of type-(0,2) tensors fields on the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(g.parent())" ] }, { "cell_type": "code", "execution_count": 231, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "symmetry: (0, 1); no antisymmetry\n" ] } ], "source": [ "g.symmetries()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "計量は、あるベクトルフレームに関する要素で初期化されます。例えば、\n", "$\\mathcal{M}$の既定のフレームを使って、\n", "The metric is initialized by its components with respect to some vector frame. For instance, using the default frame of $\\mathcal{M}$:
" ] }, { "cell_type": "code", "execution_count": 232, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle g = \\mathrm{d} x\\otimes \\mathrm{d} x+\\mathrm{d} y\\otimes \\mathrm{d} y+\\mathrm{d} z\\otimes \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle g = \\mathrm{d} x\\otimes \\mathrm{d} x+\\mathrm{d} y\\otimes \\mathrm{d} y+\\mathrm{d} z\\otimes \\mathrm{d} z$" ], "text/plain": [ "g = dx⊗dx + dy⊗dy + dz⊗dz" ] }, "execution_count": 232, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g[1,1], g[2,2], g[3,3] = 1, 1, 1\n", "g.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "別のベクトルフレームに関する成分を表示します。\n", "The components w.r.t. another vector frame are obtained as for any tensor field:
" ] }, { "cell_type": "code", "execution_count": 233, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle g = \\mathrm{d} r\\otimes \\mathrm{d} r + r^{2} \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\)" ], "text/latex": [ "$\\displaystyle g = \\mathrm{d} r\\otimes \\mathrm{d} r + r^{2} \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}$" ], "text/plain": [ "g = dr⊗dr + r^2 dth⊗dth + r^2*sin(th)^2 dph⊗dph" ] }, "execution_count": 233, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.display(Y.frame(), Y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "もちろん計量は二つのベクトルに作用します。\n", "\n", "Of course, the metric acts on vector pairs:
" ] }, { "cell_type": "code", "execution_count": 234, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field g(u,v) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} g\\left(u,v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & x y z u_{z}\\left(x, y, z\\right) + y u_{x}\\left(x, y, z\\right) - x u_{y}\\left(x, y, z\\right) + u_{x}\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} u_{z}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) - r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) u_{y}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) + {\\left(r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + 1\\right)} u_{x}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} g\\left(u,v\\right):& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & x y z u_{z}\\left(x, y, z\\right) + y u_{x}\\left(x, y, z\\right) - x u_{y}\\left(x, y, z\\right) + u_{x}\\left(x, y, z\\right) \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} u_{z}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) - r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) u_{y}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) + {\\left(r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) + 1\\right)} u_{x}\\left(r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right), r \\cos\\left({\\theta}\\right)\\right) \\end{array}$" ], "text/plain": [ "g(u,v): U → ℝ\n", " (x, y, z) ↦ x*y*z*u_z(x, y, z) + y*u_x(x, y, z) - x*u_y(x, y, z) + u_x(x, y, z)\n", " (r, th, ph) ↦ r^3*cos(ph)*cos(th)*sin(ph)*sin(th)^2*u_z(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th)) - r*cos(ph)*sin(th)*u_y(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th)) + (r*sin(ph)*sin(th) + 1)*u_x(r*cos(ph)*sin(th), r*sin(ph)*sin(th), r*cos(th))" ] }, "execution_count": 234, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(g(u,v)) ; \n", "g(u,v).display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "計量 $g$に付随する **Levi-Civita 接続**は、:\n", "\n", "The Levi-Civita connection associated to the metric $g$:
" ] }, { "cell_type": "code", "execution_count": 235, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Levi-Civita connection nabla_g associated with the Riemannian metric g on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\nabla_{g}\\)" ], "text/latex": [ "$\\displaystyle \\nabla_{g}$" ], "text/plain": [ "Levi-Civita connection nabla_g associated with the Riemannian metric g on the 3-dimensional differentiable manifold M" ] }, "execution_count": 235, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla = g.connection() \n", "print(nabla)\n", "nabla" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "多様体の既定の座標をつかってChristoffel記号を書き出します。\n", "\n", "The Christoffel symbols with respect to the manifold's default coordinates:
" ] }, { "cell_type": "code", "execution_count": 236, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left[\\left[0, 0, 0\\right], \\left[0, 0, 0\\right], \\left[0, 0, 0\\right]\\right], \\left[\\left[0, 0, 0\\right], \\left[0, 0, 0\\right], \\left[0, 0, 0\\right]\\right], \\left[\\left[0, 0, 0\\right], \\left[0, 0, 0\\right], \\left[0, 0, 0\\right]\\right]\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left[\\left[0, 0, 0\\right], \\left[0, 0, 0\\right], \\left[0, 0, 0\\right]\\right], \\left[\\left[0, 0, 0\\right], \\left[0, 0, 0\\right], \\left[0, 0, 0\\right]\\right], \\left[\\left[0, 0, 0\\right], \\left[0, 0, 0\\right], \\left[0, 0, 0\\right]\\right]\\right]$" ], "text/plain": [ "[[[0, 0, 0], [0, 0, 0], [0, 0, 0]],\n", " [[0, 0, 0], [0, 0, 0], [0, 0, 0]],\n", " [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]" ] }, "execution_count": 236, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla.coef()[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "次に、座標$(r,\\theta,\\phi)$を使って、Christoffel記号を書き出します。\n", "\n", "The Christoffel symbols with respect to the coordinates $(r,\\theta,\\phi)$:
" ] }, { "cell_type": "code", "execution_count": 237, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left[\\left[\\left[0, 0, 0\\right], \\left[0, -r, 0\\right], \\left[0, 0, -r \\sin\\left({\\theta}\\right)^{2}\\right]\\right], \\left[\\left[0, \\frac{1}{r}, 0\\right], \\left[\\frac{1}{r}, 0, 0\\right], \\left[0, 0, -\\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right)\\right]\\right], \\left[\\left[0, 0, \\frac{1}{r}\\right], \\left[0, 0, \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)}\\right], \\left[\\frac{1}{r}, \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)}, 0\\right]\\right]\\right]\\)" ], "text/latex": [ "$\\displaystyle \\left[\\left[\\left[0, 0, 0\\right], \\left[0, -r, 0\\right], \\left[0, 0, -r \\sin\\left({\\theta}\\right)^{2}\\right]\\right], \\left[\\left[0, \\frac{1}{r}, 0\\right], \\left[\\frac{1}{r}, 0, 0\\right], \\left[0, 0, -\\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right)\\right]\\right], \\left[\\left[0, 0, \\frac{1}{r}\\right], \\left[0, 0, \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)}\\right], \\left[\\frac{1}{r}, \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)}, 0\\right]\\right]\\right]$" ], "text/plain": [ "[[[0, 0, 0], [0, -r, 0], [0, 0, -r*sin(th)^2]],\n", " [[0, 1/r, 0], [1/r, 0, 0], [0, 0, -cos(th)*sin(th)]],\n", " [[0, 0, 1/r], [0, 0, cos(th)/sin(th)], [1/r, cos(th)/sin(th), 0]]]" ] }, "execution_count": 237, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla.coef(Y.frame())[:, Y]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`display()` を使って、見易く表示させて見ます。既定の設定では非零の接続係数のみが表示されます。\n", "\n", "A nice view is obtained via the method `display()` (by default, only the nonzero connection coefficients are shown):" ] }, { "cell_type": "code", "execution_count": 238, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{lcl} \\Gamma_{ \\phantom{\\, r} \\, {\\theta} \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} } & = & -r \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\phi} \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -r \\sin\\left({\\theta}\\right)^{2} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, r \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, {\\theta} \\, r }^{ \\, {\\theta} \\phantom{\\, {\\theta}} \\phantom{\\, r} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, {\\phi} \\, {\\phi} }^{ \\, {\\theta} \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -\\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, r \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\theta} \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\phi} \\, r }^{ \\, {\\phi} \\phantom{\\, {\\phi}} \\phantom{\\, r} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\phi} \\, {\\theta} }^{ \\, {\\phi} \\phantom{\\, {\\phi}} \\phantom{\\, {\\theta}} } & = & \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)} \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{lcl} \\Gamma_{ \\phantom{\\, r} \\, {\\theta} \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} } & = & -r \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\phi} \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -r \\sin\\left({\\theta}\\right)^{2} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, r \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, {\\theta} \\, r }^{ \\, {\\theta} \\phantom{\\, {\\theta}} \\phantom{\\, r} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, {\\phi} \\, {\\phi} }^{ \\, {\\theta} \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -\\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, r \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\theta} \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\phi} \\, r }^{ \\, {\\phi} \\phantom{\\, {\\phi}} \\phantom{\\, r} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\phi} \\, {\\theta} }^{ \\, {\\phi} \\phantom{\\, {\\phi}} \\phantom{\\, {\\theta}} } & = & \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)} \\end{array}$" ], "text/plain": [ "Gam^r_th,th = -r \n", "Gam^r_ph,ph = -r*sin(th)^2 \n", "Gam^th_r,th = 1/r \n", "Gam^th_th,r = 1/r \n", "Gam^th_ph,ph = -cos(th)*sin(th) \n", "Gam^ph_r,ph = 1/r \n", "Gam^ph_th,ph = cos(th)/sin(th) \n", "Gam^ph_ph,r = 1/r \n", "Gam^ph_ph,th = cos(th)/sin(th) " ] }, "execution_count": 238, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla.display(frame=Y.frame(), chart=Y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "計量の`christoffel_symbols_display()`メソッドを使うこともできます。この関数は(既定の設定では)独立なChristoffel記号だけを表示します。\n", "\n", "One may also use the method `christoffel_symbols_display()` of the metric, which (by default) displays only the non-redundant Christoffel symbols:" ] }, { "cell_type": "code", "execution_count": 239, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{lcl} \\Gamma_{ \\phantom{\\, r} \\, {\\theta} \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} } & = & -r \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\phi} \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -r \\sin\\left({\\theta}\\right)^{2} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, r \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, {\\phi} \\, {\\phi} }^{ \\, {\\theta} \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -\\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, r \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\theta} \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)} \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{lcl} \\Gamma_{ \\phantom{\\, r} \\, {\\theta} \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} } & = & -r \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\phi} \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -r \\sin\\left({\\theta}\\right)^{2} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, r \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, {\\phi} \\, {\\phi} }^{ \\, {\\theta} \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -\\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, r \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\theta} \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)} \\end{array}$" ], "text/plain": [ "Gam^r_th,th = -r \n", "Gam^r_ph,ph = -r*sin(th)^2 \n", "Gam^th_r,th = 1/r \n", "Gam^th_ph,ph = -cos(th)*sin(th) \n", "Gam^ph_r,ph = 1/r \n", "Gam^ph_th,ph = cos(th)/sin(th) " ] }, "execution_count": 239, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.christoffel_symbols_display(Y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "接続の共変微分に対する作用。\n", "\n", "The connection acting as a covariant derivative:
" ] }, { "cell_type": "code", "execution_count": 240, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field nabla_g(v) of type (1,1) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\nabla_{g} v = \\frac{\\partial}{\\partial x }\\otimes \\mathrm{d} y-\\frac{\\partial}{\\partial y }\\otimes \\mathrm{d} x + y z \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} x + x z \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} y + x y \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\nabla_{g} v = \\frac{\\partial}{\\partial x }\\otimes \\mathrm{d} y-\\frac{\\partial}{\\partial y }\\otimes \\mathrm{d} x + y z \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} x + x z \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} y + x y \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} z$" ], "text/plain": [ "nabla_g(v) = ∂/∂x⊗dy - ∂/∂y⊗dx + y*z ∂/∂z⊗dx + x*z ∂/∂z⊗dy + x*y ∂/∂z⊗dz" ] }, "execution_count": 240, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nab_v = nabla(v)\n", "print(nab_v) ; nab_v.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Levi-Civita 接続係数として, $\\nabla_g$ には捩れ(torsion)がありません。\n", "\n", "Being a Levi-Civita connection, $\\nabla_g$ is torsion.free:
" ] }, { "cell_type": "code", "execution_count": 241, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (1,2) on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle 0\\)" ], "text/latex": [ "$\\displaystyle 0$" ], "text/plain": [ "0" ] }, "execution_count": 241, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(nabla.torsion()) ; nabla.torsion().display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "この例ではさらに、多様体は平坦(フラット, 曲率が0)です。\n", "\n", "In the present case, it is also flat:
" ] }, { "cell_type": "code", "execution_count": 242, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field Riem(g) of type (1,3) on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{Riem}\\left(g\\right) = 0\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{Riem}\\left(g\\right) = 0$" ], "text/plain": [ "Riem(g) = 0" ] }, "execution_count": 242, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(nabla.riemann()) ; nabla.riemann().display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$g_{rr}$ を $1/(1+r^2)$と変更することで、曲率のある空間を考えましょう。\n", "\n", "Let us consider a non-flat metric, by changing $g_{rr}$ to $1/(1+r^2)$:
" ] }, { "cell_type": "code", "execution_count": 243, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle g = \\left( \\frac{1}{r^{2} + 1} \\right) \\mathrm{d} r\\otimes \\mathrm{d} r + r^{2} \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\)" ], "text/latex": [ "$\\displaystyle g = \\left( \\frac{1}{r^{2} + 1} \\right) \\mathrm{d} r\\otimes \\mathrm{d} r + r^{2} \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}$" ], "text/plain": [ "g = 1/(r^2 + 1) dr⊗dr + r^2 dth⊗dth + r^2*sin(th)^2 dph⊗dph" ] }, "execution_count": 243, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g[Y.frame(), 1,1, Y] = 1/(1+r^2)\n", "g.display(Y.frame(), Y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "簡単の為に、副多様体$U$の既定の座標系をY=$(U,(r,\\theta,\\phi))$に変更します。\n", "\n", "For convenience, we change the default chart on the domain $U$ to Y=$(U,(r,\\theta,\\phi))$:
" ] }, { "cell_type": "code", "execution_count": 244, "metadata": {}, "outputs": [], "source": [ "U.set_default_chart(Y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "これによって、 $(r,\\theta,\\phi)$を使った座標表現を求める際に座標系 $Y$ を指定する必要がありません。\n", "\n", "In this way, we do not have to specify Y when asking for coordinate expressions in terms of $(r,\\theta,\\phi)$:
" ] }, { "cell_type": "code", "execution_count": 245, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle g = \\left( \\frac{1}{r^{2} + 1} \\right) \\mathrm{d} r\\otimes \\mathrm{d} r + r^{2} \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\)" ], "text/latex": [ "$\\displaystyle g = \\left( \\frac{1}{r^{2} + 1} \\right) \\mathrm{d} r\\otimes \\mathrm{d} r + r^{2} \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}$" ], "text/plain": [ "g = 1/(r^2 + 1) dr⊗dr + r^2 dth⊗dth + r^2*sin(th)^2 dph⊗dph" ] }, "execution_count": 245, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.display(Y.frame())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "この計量は双曲空間 $\\mathbb{H}^3$の計量だと気がつきます。座標系 $(U,(x,y,z))$についての表現は、次のようになります。\n", "\n", "We recognize the metric of the hyperbolic space $\\mathbb{H}^3$. Its expression in terms of the chart $(U,(x,y,z))$ is
" ] }, { "cell_type": "code", "execution_count": 246, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle g = \\left( \\frac{y^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} x + \\left( -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} y + \\left( -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} z + \\left( -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} x + \\left( \\frac{x^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} y + \\left( -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} z + \\left( -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} x + \\left( -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} y + \\left( \\frac{x^{2} + y^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle g = \\left( \\frac{y^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} x + \\left( -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} y + \\left( -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} z + \\left( -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} x + \\left( \\frac{x^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} y + \\left( -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} z + \\left( -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} x + \\left( -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} y + \\left( \\frac{x^{2} + y^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} z$" ], "text/plain": [ "g = (y^2 + z^2 + 1)/(x^2 + y^2 + z^2 + 1) dx⊗dx - x*y/(x^2 + y^2 + z^2 + 1) dx⊗dy - x*z/(x^2 + y^2 + z^2 + 1) dx⊗dz - x*y/(x^2 + y^2 + z^2 + 1) dy⊗dx + (x^2 + z^2 + 1)/(x^2 + y^2 + z^2 + 1) dy⊗dy - y*z/(x^2 + y^2 + z^2 + 1) dy⊗dz - x*z/(x^2 + y^2 + z^2 + 1) dz⊗dx - y*z/(x^2 + y^2 + z^2 + 1) dz⊗dy + (x^2 + y^2 + 1)/(x^2 + y^2 + z^2 + 1) dz⊗dz" ] }, "execution_count": 246, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.display(X_U.frame(), X_U)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "要素の行列表示の方がより適切かもしれません。\n", "\n", "A matrix view of the components may be more appropriate:
" ] }, { "cell_type": "code", "execution_count": 247, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\left(\\begin{array}{rrr}\n", "\\frac{y^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} & -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} & -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\\\\n", "-\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} & \\frac{x^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} & -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\\\\n", "-\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} & -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} & \\frac{x^{2} + y^{2} + 1}{x^{2} + y^{2} + z^{2} + 1}\n", "\\end{array}\\right)\\)" ], "text/latex": [ "$\\displaystyle \\left(\\begin{array}{rrr}\n", "\\frac{y^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} & -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} & -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\\\\n", "-\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} & \\frac{x^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} & -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\\\\n", "-\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} & -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} & \\frac{x^{2} + y^{2} + 1}{x^{2} + y^{2} + z^{2} + 1}\n", "\\end{array}\\right)$" ], "text/plain": [ "[(y^2 + z^2 + 1)/(x^2 + y^2 + z^2 + 1) -x*y/(x^2 + y^2 + z^2 + 1) -x*z/(x^2 + y^2 + z^2 + 1)]\n", "[ -x*y/(x^2 + y^2 + z^2 + 1) (x^2 + z^2 + 1)/(x^2 + y^2 + z^2 + 1) -y*z/(x^2 + y^2 + z^2 + 1)]\n", "[ -x*z/(x^2 + y^2 + z^2 + 1) -y*z/(x^2 + y^2 + z^2 + 1) (x^2 + y^2 + 1)/(x^2 + y^2 + z^2 + 1)]" ] }, "execution_count": 247, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g[X_U.frame(), :, X_U]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "もともとは $U$でのみ定義されていたこれらの成分を、全体の多様体$\\mathcal{M}$までに拡張します。拡張は、座標系 X=$(\\mathcal{M},(x,y,z))$ に付随するフレームでの座標表現が同じであることを要求して実行されます。\n", "\n", "We extend these components, a priori defined only on $U$, to the whole manifold $\\mathcal{M}$, by demanding the same coordinate expressions in the frame associated to the chart X=$(\\mathcal{M},(x,y,z))$:
" ] }, { "cell_type": "code", "execution_count": 248, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle g = \\left( \\frac{y^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} x + \\left( -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} y + \\left( -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} z + \\left( -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} x + \\left( \\frac{x^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} y + \\left( -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} z + \\left( -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} x + \\left( -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} y + \\left( \\frac{x^{2} + y^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle g = \\left( \\frac{y^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} x + \\left( -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} y + \\left( -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} x\\otimes \\mathrm{d} z + \\left( -\\frac{x y}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} x + \\left( \\frac{x^{2} + z^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} y + \\left( -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} y\\otimes \\mathrm{d} z + \\left( -\\frac{x z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} x + \\left( -\\frac{y z}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} y + \\left( \\frac{x^{2} + y^{2} + 1}{x^{2} + y^{2} + z^{2} + 1} \\right) \\mathrm{d} z\\otimes \\mathrm{d} z$" ], "text/plain": [ "g = (y^2 + z^2 + 1)/(x^2 + y^2 + z^2 + 1) dx⊗dx - x*y/(x^2 + y^2 + z^2 + 1) dx⊗dy - x*z/(x^2 + y^2 + z^2 + 1) dx⊗dz - x*y/(x^2 + y^2 + z^2 + 1) dy⊗dx + (x^2 + z^2 + 1)/(x^2 + y^2 + z^2 + 1) dy⊗dy - y*z/(x^2 + y^2 + z^2 + 1) dy⊗dz - x*z/(x^2 + y^2 + z^2 + 1) dz⊗dx - y*z/(x^2 + y^2 + z^2 + 1) dz⊗dy + (x^2 + y^2 + 1)/(x^2 + y^2 + z^2 + 1) dz⊗dz" ] }, "execution_count": 248, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.add_comp_by_continuation(X.frame(), U, X)\n", "g.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Levi-Civita接続は、計量 $g$の変更後、自動的に再計算されます。\n", "\n", "The Levi-Civita connection is automatically recomputed, after the change in $g$:
" ] }, { "cell_type": "code", "execution_count": 249, "metadata": {}, "outputs": [], "source": [ "nabla = g.connection()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "とくに、Christoffel 係数は、異なっています。\n", "In particular, the Christoffel symbols are different:
" ] }, { "cell_type": "code", "execution_count": 250, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{lcl} \\Gamma_{ \\phantom{\\, x} \\, x \\, x }^{ \\, x \\phantom{\\, x} \\phantom{\\, x} } & = & -\\frac{x y^{2} + x z^{2} + x}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, x \\, y }^{ \\, x \\phantom{\\, x} \\phantom{\\, y} } & = & \\frac{x^{2} y}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, x \\, z }^{ \\, x \\phantom{\\, x} \\phantom{\\, z} } & = & \\frac{x^{2} z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, y \\, y }^{ \\, x \\phantom{\\, y} \\phantom{\\, y} } & = & -\\frac{x^{3} + x z^{2} + x}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, y \\, z }^{ \\, x \\phantom{\\, y} \\phantom{\\, z} } & = & \\frac{x y z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, z \\, z }^{ \\, x \\phantom{\\, z} \\phantom{\\, z} } & = & -\\frac{x^{3} + x y^{2} + x}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, x \\, x }^{ \\, y \\phantom{\\, x} \\phantom{\\, x} } & = & -\\frac{y^{3} + y z^{2} + y}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, x \\, y }^{ \\, y \\phantom{\\, x} \\phantom{\\, y} } & = & \\frac{x y^{2}}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, x \\, z }^{ \\, y \\phantom{\\, x} \\phantom{\\, z} } & = & \\frac{x y z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, y \\, y }^{ \\, y \\phantom{\\, y} \\phantom{\\, y} } & = & -\\frac{y z^{2} + {\\left(x^{2} + 1\\right)} y}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, y \\, z }^{ \\, y \\phantom{\\, y} \\phantom{\\, z} } & = & \\frac{y^{2} z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, z \\, z }^{ \\, y \\phantom{\\, z} \\phantom{\\, z} } & = & -\\frac{y^{3} + {\\left(x^{2} + 1\\right)} y}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, x \\, x }^{ \\, z \\phantom{\\, x} \\phantom{\\, x} } & = & -\\frac{z^{3} + {\\left(y^{2} + 1\\right)} z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, x \\, y }^{ \\, z \\phantom{\\, x} \\phantom{\\, y} } & = & \\frac{x y z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, x \\, z }^{ \\, z \\phantom{\\, x} \\phantom{\\, z} } & = & \\frac{x z^{2}}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, y \\, y }^{ \\, z \\phantom{\\, y} \\phantom{\\, y} } & = & -\\frac{z^{3} + {\\left(x^{2} + 1\\right)} z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, y \\, z }^{ \\, z \\phantom{\\, y} \\phantom{\\, z} } & = & \\frac{y z^{2}}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, z \\, z }^{ \\, z \\phantom{\\, z} \\phantom{\\, z} } & = & -\\frac{{\\left(x^{2} + y^{2} + 1\\right)} z}{x^{2} + y^{2} + z^{2} + 1} \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{lcl} \\Gamma_{ \\phantom{\\, x} \\, x \\, x }^{ \\, x \\phantom{\\, x} \\phantom{\\, x} } & = & -\\frac{x y^{2} + x z^{2} + x}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, x \\, y }^{ \\, x \\phantom{\\, x} \\phantom{\\, y} } & = & \\frac{x^{2} y}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, x \\, z }^{ \\, x \\phantom{\\, x} \\phantom{\\, z} } & = & \\frac{x^{2} z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, y \\, y }^{ \\, x \\phantom{\\, y} \\phantom{\\, y} } & = & -\\frac{x^{3} + x z^{2} + x}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, y \\, z }^{ \\, x \\phantom{\\, y} \\phantom{\\, z} } & = & \\frac{x y z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, x} \\, z \\, z }^{ \\, x \\phantom{\\, z} \\phantom{\\, z} } & = & -\\frac{x^{3} + x y^{2} + x}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, x \\, x }^{ \\, y \\phantom{\\, x} \\phantom{\\, x} } & = & -\\frac{y^{3} + y z^{2} + y}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, x \\, y }^{ \\, y \\phantom{\\, x} \\phantom{\\, y} } & = & \\frac{x y^{2}}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, x \\, z }^{ \\, y \\phantom{\\, x} \\phantom{\\, z} } & = & \\frac{x y z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, y \\, y }^{ \\, y \\phantom{\\, y} \\phantom{\\, y} } & = & -\\frac{y z^{2} + {\\left(x^{2} + 1\\right)} y}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, y \\, z }^{ \\, y \\phantom{\\, y} \\phantom{\\, z} } & = & \\frac{y^{2} z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, y} \\, z \\, z }^{ \\, y \\phantom{\\, z} \\phantom{\\, z} } & = & -\\frac{y^{3} + {\\left(x^{2} + 1\\right)} y}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, x \\, x }^{ \\, z \\phantom{\\, x} \\phantom{\\, x} } & = & -\\frac{z^{3} + {\\left(y^{2} + 1\\right)} z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, x \\, y }^{ \\, z \\phantom{\\, x} \\phantom{\\, y} } & = & \\frac{x y z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, x \\, z }^{ \\, z \\phantom{\\, x} \\phantom{\\, z} } & = & \\frac{x z^{2}}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, y \\, y }^{ \\, z \\phantom{\\, y} \\phantom{\\, y} } & = & -\\frac{z^{3} + {\\left(x^{2} + 1\\right)} z}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, y \\, z }^{ \\, z \\phantom{\\, y} \\phantom{\\, z} } & = & \\frac{y z^{2}}{x^{2} + y^{2} + z^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, z} \\, z \\, z }^{ \\, z \\phantom{\\, z} \\phantom{\\, z} } & = & -\\frac{{\\left(x^{2} + y^{2} + 1\\right)} z}{x^{2} + y^{2} + z^{2} + 1} \\end{array}$" ], "text/plain": [ "Gam^x_xx = -(x*y^2 + x*z^2 + x)/(x^2 + y^2 + z^2 + 1) \n", "Gam^x_xy = x^2*y/(x^2 + y^2 + z^2 + 1) \n", "Gam^x_xz = x^2*z/(x^2 + y^2 + z^2 + 1) \n", "Gam^x_yy = -(x^3 + x*z^2 + x)/(x^2 + y^2 + z^2 + 1) \n", "Gam^x_yz = x*y*z/(x^2 + y^2 + z^2 + 1) \n", "Gam^x_zz = -(x^3 + x*y^2 + x)/(x^2 + y^2 + z^2 + 1) \n", "Gam^y_xx = -(y^3 + y*z^2 + y)/(x^2 + y^2 + z^2 + 1) \n", "Gam^y_xy = x*y^2/(x^2 + y^2 + z^2 + 1) \n", "Gam^y_xz = x*y*z/(x^2 + y^2 + z^2 + 1) \n", "Gam^y_yy = -(y*z^2 + (x^2 + 1)*y)/(x^2 + y^2 + z^2 + 1) \n", "Gam^y_yz = y^2*z/(x^2 + y^2 + z^2 + 1) \n", "Gam^y_zz = -(y^3 + (x^2 + 1)*y)/(x^2 + y^2 + z^2 + 1) \n", "Gam^z_xx = -(z^3 + (y^2 + 1)*z)/(x^2 + y^2 + z^2 + 1) \n", "Gam^z_xy = x*y*z/(x^2 + y^2 + z^2 + 1) \n", "Gam^z_xz = x*z^2/(x^2 + y^2 + z^2 + 1) \n", "Gam^z_yy = -(z^3 + (x^2 + 1)*z)/(x^2 + y^2 + z^2 + 1) \n", "Gam^z_yz = y*z^2/(x^2 + y^2 + z^2 + 1) \n", "Gam^z_zz = -(x^2 + y^2 + 1)*z/(x^2 + y^2 + z^2 + 1) " ] }, "execution_count": 250, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla.display(only_nonredundant=True)" ] }, { "cell_type": "code", "execution_count": 251, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{lcl} \\Gamma_{ \\phantom{\\, r} \\, r \\, r }^{ \\, r \\phantom{\\, r} \\phantom{\\, r} } & = & -\\frac{r}{r^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\theta} \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} } & = & -r^{3} - r \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\phi} \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -{\\left(r^{3} + r\\right)} \\sin\\left({\\theta}\\right)^{2} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, r \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, {\\phi} \\, {\\phi} }^{ \\, {\\theta} \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -\\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, r \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\theta} \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)} \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{lcl} \\Gamma_{ \\phantom{\\, r} \\, r \\, r }^{ \\, r \\phantom{\\, r} \\phantom{\\, r} } & = & -\\frac{r}{r^{2} + 1} \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\theta} \\, {\\theta} }^{ \\, r \\phantom{\\, {\\theta}} \\phantom{\\, {\\theta}} } & = & -r^{3} - r \\\\ \\Gamma_{ \\phantom{\\, r} \\, {\\phi} \\, {\\phi} }^{ \\, r \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -{\\left(r^{3} + r\\right)} \\sin\\left({\\theta}\\right)^{2} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, r \\, {\\theta} }^{ \\, {\\theta} \\phantom{\\, r} \\phantom{\\, {\\theta}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\theta}} \\, {\\phi} \\, {\\phi} }^{ \\, {\\theta} \\phantom{\\, {\\phi}} \\phantom{\\, {\\phi}} } & = & -\\cos\\left({\\theta}\\right) \\sin\\left({\\theta}\\right) \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, r \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, r} \\phantom{\\, {\\phi}} } & = & \\frac{1}{r} \\\\ \\Gamma_{ \\phantom{\\, {\\phi}} \\, {\\theta} \\, {\\phi} }^{ \\, {\\phi} \\phantom{\\, {\\theta}} \\phantom{\\, {\\phi}} } & = & \\frac{\\cos\\left({\\theta}\\right)}{\\sin\\left({\\theta}\\right)} \\end{array}$" ], "text/plain": [ "Gam^r_r,r = -r/(r^2 + 1) \n", "Gam^r_th,th = -r^3 - r \n", "Gam^r_ph,ph = -(r^3 + r)*sin(th)^2 \n", "Gam^th_r,th = 1/r \n", "Gam^th_ph,ph = -cos(th)*sin(th) \n", "Gam^ph_r,ph = 1/r \n", "Gam^ph_th,ph = cos(th)/sin(th) " ] }, "execution_count": 251, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla.display(frame=Y.frame(), chart=Y, only_nonredundant=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Rimannテンソルは、今や:\n", "The Riemann tensor is now
" ] }, { "cell_type": "code", "execution_count": 252, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field Riem(g) of type (1,3) on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{Riem}\\left(g\\right) = -r^{2} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta} + r^{2} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r -r^{2} \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r + \\left( \\frac{1}{r^{2} + 1} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta} + \\left( -\\frac{1}{r^{2} + 1} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r -r^{2} \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta} + \\left( \\frac{1}{r^{2} + 1} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi} + \\left( -\\frac{1}{r^{2} + 1} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r + r^{2} \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi} -r^{2} \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{Riem}\\left(g\\right) = -r^{2} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta} + r^{2} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r -r^{2} \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial r }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r + \\left( \\frac{1}{r^{2} + 1} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta} + \\left( -\\frac{1}{r^{2} + 1} \\right) \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} r -r^{2} \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi} + r^{2} \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial {\\theta} }\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta} + \\left( \\frac{1}{r^{2} + 1} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi} + \\left( -\\frac{1}{r^{2} + 1} \\right) \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} r\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} r + r^{2} \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi} -r^{2} \\frac{\\partial}{\\partial {\\phi} }\\otimes \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\theta}$" ], "text/plain": [ "Riem(g) = -r^2 ∂/∂r⊗dth⊗dr⊗dth + r^2 ∂/∂r⊗dth⊗dth⊗dr - r^2*sin(th)^2 ∂/∂r⊗dph⊗dr⊗dph + r^2*sin(th)^2 ∂/∂r⊗dph⊗dph⊗dr + 1/(r^2 + 1) ∂/∂th⊗dr⊗dr⊗dth - 1/(r^2 + 1) ∂/∂th⊗dr⊗dth⊗dr - r^2*sin(th)^2 ∂/∂th⊗dph⊗dth⊗dph + r^2*sin(th)^2 ∂/∂th⊗dph⊗dph⊗dth + 1/(r^2 + 1) ∂/∂ph⊗dr⊗dr⊗dph - 1/(r^2 + 1) ∂/∂ph⊗dr⊗dph⊗dr + r^2 ∂/∂ph⊗dth⊗dth⊗dph - r^2 ∂/∂ph⊗dth⊗dph⊗dth" ] }, "execution_count": 252, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Riem = nabla.riemann()\n", "print(Riem) ; Riem.display(Y.frame())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "リーマンテンソルは接続などを明示的に求めることなく、計量$g$から直接算出できます。\n", "\n", "Note that it can be accessed directely via the metric, without any explicit mention of the connection:
" ] }, { "cell_type": "code", "execution_count": 253, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 253, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.riemann() is nabla.riemann()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Ricci テンソル** はこのようになります。\n", "\n", "The Ricci tensor is
" ] }, { "cell_type": "code", "execution_count": 254, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Field of symmetric bilinear forms Ric(g) on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{Ric}\\left(g\\right) = \\left( -\\frac{2}{r^{2} + 1} \\right) \\mathrm{d} r\\otimes \\mathrm{d} r -2 \\, r^{2} \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta} -2 \\, r^{2} \\sin\\left({\\theta}\\right)^{2} \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{Ric}\\left(g\\right) = \\left( -\\frac{2}{r^{2} + 1} \\right) \\mathrm{d} r\\otimes \\mathrm{d} r -2 \\, r^{2} \\mathrm{d} {\\theta}\\otimes \\mathrm{d} {\\theta} -2 \\, r^{2} \\sin\\left({\\theta}\\right)^{2} \\mathrm{d} {\\phi}\\otimes \\mathrm{d} {\\phi}$" ], "text/plain": [ "Ric(g) = -2/(r^2 + 1) dr⊗dr - 2*r^2 dth⊗dth - 2*r^2*sin(th)^2 dph⊗dph" ] }, "execution_count": 254, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Ric = g.ricci()\n", "print(Ric)\n", "Ric.display(Y.frame())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Weyl テンソル** は:\n", "The Weyl tensor is:
" ] }, { "cell_type": "code", "execution_count": 255, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field C(g) of type (1,3) on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{C}\\left(g\\right) = 0\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{C}\\left(g\\right) = 0$" ], "text/plain": [ "C(g) = 0" ] }, "execution_count": 255, "metadata": {}, "output_type": "execute_result" } ], "source": [ "C = g.weyl()\n", "print(C) ; C.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "多様体 $\\mathcal{M}$ の次元が 3 なので、**Weyl テンソル** は恒等的に0になります。\n", "最後に **Ricci スカラ(曲率)** を求めます。\n", "\n", "The Weyl tensor vanishes identically because the dimension of $\\mathcal{M}$ is 3.
\n", "Finally, the Ricci scalar is
" ] }, { "cell_type": "code", "execution_count": 256, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field r(g) on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} \\mathrm{r}\\left(g\\right):& \\mathcal{M} & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & -6 \\\\ \\mbox{on}\\ U : & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & -6 \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} \\mathrm{r}\\left(g\\right):& \\mathcal{M} & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & -6 \\\\ \\mbox{on}\\ U : & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & -6 \\end{array}$" ], "text/plain": [ "r(g): M → ℝ\n", " (x, y, z) ↦ -6\n", "on U: (r, th, ph) ↦ -6" ] }, "execution_count": 256, "metadata": {}, "output_type": "execute_result" } ], "source": [ "R = g.ricci_scalar()\n", "print(R) ; R.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We recover the fact that $\\mathbb{H}^3$ is a Riemannian manifold of constant negative curvature.
\n", "\n", "## 計量によって引き起こされるテンソル場の変形:Tensor transformations induced by a metric\n", "\n", "もっとも重要な軽量 $g$によって引き起こされるテンソル場の変形は、**musical isomorphism** あるいは **指標の引き上げ** および **指標の引き下げ**と呼ばれるものです。\n", "\n", "The most important tensor transformation induced by the metric $g$ is the so-called musical isomorphism, or index raising and index lowering:
" ] }, { "cell_type": "code", "execution_count": 257, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field T of type (1,2) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(t)" ] }, { "cell_type": "code", "execution_count": 258, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle T = \\left( r^{2} \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + 1 \\right) \\frac{\\partial}{\\partial x }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x + r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x\\)" ], "text/latex": [ "$\\displaystyle T = \\left( r^{2} \\cos\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + 1 \\right) \\frac{\\partial}{\\partial x }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x + r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{2} \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x$" ], "text/plain": [ "T = (r^2*cos(ph)^2*sin(th)^2 + 1) ∂/∂x⊗dy⊗dx + r^3*cos(ph)*cos(th)*sin(ph)*sin(th)^2 ∂/∂z⊗dy⊗dx" ] }, "execution_count": 258, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t.display()" ] }, { "cell_type": "code", "execution_count": 259, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle T = \\left( x^{2} + 1 \\right) \\frac{\\partial}{\\partial x }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x + x y z \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x\\)" ], "text/latex": [ "$\\displaystyle T = \\left( x^{2} + 1 \\right) \\frac{\\partial}{\\partial x }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x + x y z \\frac{\\partial}{\\partial z }\\otimes \\mathrm{d} y\\otimes \\mathrm{d} x$" ], "text/plain": [ "T = (x^2 + 1) ∂/∂x⊗dy⊗dx + x*y*z ∂/∂z⊗dy⊗dx" ] }, "execution_count": 259, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t.display(X_U.frame(), X_U)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "テンソル場 $T$の最後の指標(位置は2)を計量 $g$ について、引き上げます。\n", "\n", "Raising the last index (position 2) of $T$ with $g$:" ] }, { "cell_type": "code", "execution_count": 260, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field T of type (1,2) on the Open subset U of the 3-dimensional differentiable manifold M Tensor field of type (2,1) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "s = t.up(g, 2)\n", "print(t,s)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "上記の式で引き上げられた指標は反変な指数のうち最後のものになることに注意しましょう。つまり、メソッド`up`が返すテンソル $s$ は\n", "$$ s^{ab}_{\\ \\ \\ \\, c} = g^{bi} T^a_{\\ \\ ic}$$\n", "です。\n", "\n", "Note that the raised index becomes the *last* one among the contravariant indices, i.e. the tensor $s$ returned by the method `up` is \n", "$$ s^{ab}_{\\ \\ \\ \\, c} = g^{bi} T^a_{\\ \\ ic}$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "これについての詳細は[up()の解説](https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/tensorfield.html#sage.manifolds.differentiable.tensorfield.TensorField.up) をご覧ください。\n", "\n", "See the [up() documentation](https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/tensorfield.html#sage.manifolds.differentiable.tensorfield.TensorField.up) for more details." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$T$の全ての共変な指標(この例では 位置 1と2)を引き上げます。\n", "\n", "Raising all the covariant indices of $T$ (i.e. those at the positions 1 and 2):
" ] }, { "cell_type": "code", "execution_count": 261, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (3,0) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "s = t.up(g)\n", "print(s)" ] }, { "cell_type": "code", "execution_count": 262, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Tensor field of type (0,3) on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "s = t.down(g)\n", "print(s)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "上記の式で引き下げられた指標は 共変な指標のうち *最初* の指標になることに注意しましょう。 即ち、`down`メソッドが返すテンソル $s$ は、\n", "$$ s_{abc} = g_{ai} T^i_{\\ \\ bc}$$\n", "となります。\n", "\n", "\n", "Note that the lowered index becomes the *first* one among the covariant indices, i.e. the tensor $s$ returned by the method `down` is \n", "$$ s_{abc} = g_{ai} T^i_{\\ \\ bc}$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "これについての詳細は[down()の解説](https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/tensorfield.html#sage.manifolds.differentiable.tensorfield.TensorField.down) をご覧ください。\n", "\n", "See the [down() documentation](https://doc.sagemath.org/html/en/reference/manifolds/sage/manifolds/differentiable/tensorfield.html#sage.manifolds.differentiable.tensorfield.TensorField.down) for more details." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Hodge双対(星印演算子) :Hodge duality\n", "計量 $g$についての体積 3-形式(Levi-Civita テンソル )は\n", "\n", "The volume 3-form (Levi-Civita tensor) associated with the metric $g$ is
" ] }, { "cell_type": "code", "execution_count": 263, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3-form eps_g on the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\epsilon_{g} = \\left( \\frac{1}{\\sqrt{x^{2} + y^{2} + z^{2} + 1}} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\epsilon_{g} = \\left( \\frac{1}{\\sqrt{x^{2} + y^{2} + z^{2} + 1}} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z$" ], "text/plain": [ "eps_g = 1/sqrt(x^2 + y^2 + z^2 + 1) dx∧dy∧dz" ] }, "execution_count": 263, "metadata": {}, "output_type": "execute_result" } ], "source": [ "epsilon = g.volume_form()\n", "print(epsilon)\n", "epsilon.display()" ] }, { "cell_type": "code", "execution_count": 264, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\epsilon_{g} = \\left( \\frac{r^{2} \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} r\\wedge \\mathrm{d} {\\theta}\\wedge \\mathrm{d} {\\phi}\\)" ], "text/latex": [ "$\\displaystyle \\epsilon_{g} = \\left( \\frac{r^{2} \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} r\\wedge \\mathrm{d} {\\theta}\\wedge \\mathrm{d} {\\phi}$" ], "text/plain": [ "eps_g = r^2*sin(th)/sqrt(r^2 + 1) dr∧dth∧dph" ] }, "execution_count": 264, "metadata": {}, "output_type": "execute_result" } ], "source": [ "epsilon.display(Y.frame())" ] }, { "cell_type": "code", "execution_count": 265, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field f on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} f:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & z^{3} + y^{2} + x \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right) \\end{array}$" ], "text/plain": [ "f: U → ℝ\n", " (x, y, z) ↦ z^3 + y^2 + x\n", " (r, th, ph) ↦ r^3*cos(th)^3 + r^2*sin(ph)^2*sin(th)^2 + r*cos(ph)*sin(th)" ] }, "execution_count": 265, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(f) ; f.display()" ] }, { "cell_type": "code", "execution_count": 266, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3-form *f on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\star f = \\left( \\frac{r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\star f = \\left( \\frac{r^{3} \\cos\\left({\\theta}\\right)^{3} + r^{2} \\sin\\left({\\phi}\\right)^{2} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z$" ], "text/plain": [ "*f = (r^3*cos(th)^3 + r^2*sin(ph)^2*sin(th)^2 + r*cos(ph)*sin(th))/sqrt(r^2 + 1) dx∧dy∧dz" ] }, "execution_count": 266, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf = f.hodge_dual(g.restrict(U))\n", "print(sf)\n", "sf.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "古典的な式$\\star f = f\\, \\epsilon_g$, より正確には$\\star f = f\\, \\epsilon_g|_U$, を確かめてみましょう。\n", "$f$ は $U$ 上でのみ定義されていることに注意します。\n", "\n", "We check the classical formula $\\star f = f\\, \\epsilon_g$, or, more precisely, $\\star f = f\\, \\epsilon_g|_U$ (for $f$ is defined on $U$ only):
" ] }, { "cell_type": "code", "execution_count": 267, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 267, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf == f * epsilon.restrict(U)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1-形式のHodge 双対は、2ー形式 です。(3次元多様体の場合);\n", "The Hodge dual of a 2-form is a 1-form:
" ] }, { "cell_type": "code", "execution_count": 270, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2-form A on the Open subset U of the 3-dimensional differentiable manifold M\n" ] } ], "source": [ "print(a)" ] }, { "cell_type": "code", "execution_count": 271, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form *A on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\star A = \\left( \\frac{3 \\, r^{5} \\cos\\left({\\theta}\\right)^{5} + 3 \\, r^{3} \\cos\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{6} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) - 2 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) - 2 \\, r^{4} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)^{3}\\right)} \\sin\\left({\\theta}\\right)^{4} + {\\left(2 \\, r^{4} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)^{3} + {\\left(\\sin\\left({\\phi}\\right)^{3} - \\sin\\left({\\phi}\\right)\\right)} r^{3}\\right)} \\sin\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{5} \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right)^{2} - 2 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) - 2 \\, r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} + {\\left(2 \\, r^{4} \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) + r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} + 2 \\, r^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} x + \\left( -\\frac{r^{3} \\cos\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{6} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right)^{2} - 2 \\, {\\left(\\cos\\left({\\phi}\\right)^{2} - 1\\right)} r^{5} \\cos\\left({\\theta}\\right) + 2 \\, {\\left(\\cos\\left({\\phi}\\right)^{4} - \\cos\\left({\\phi}\\right)^{2}\\right)} r^{4}\\right)} \\sin\\left({\\theta}\\right)^{4} - {\\left(r^{3} \\cos\\left({\\phi}\\right)^{3} + 2 \\, {\\left(\\cos\\left({\\phi}\\right)^{3} - \\cos\\left({\\phi}\\right)\\right)} r^{4} \\cos\\left({\\theta}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{6} \\cos\\left({\\theta}\\right)^{4} + 3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) + r^{3} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) + 3 \\, r^{4} \\cos\\left({\\theta}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\theta}\\right) - {\\left(r^{3} {\\left(\\cos\\left({\\phi}\\right) + \\sin\\left({\\phi}\\right)\\right)} \\cos\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} y + \\left( \\frac{2 \\, r^{5} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{5} + {\\left(3 \\, r^{6} \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) + 2 \\, r^{4} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + 2 \\, r^{3} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} - {\\left(2 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + {\\left(\\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right) + 1\\right)} r^{3} \\cos\\left({\\theta}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} - r \\cos\\left({\\theta}\\right) - {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{4} - r^{3} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\star A = \\left( \\frac{3 \\, r^{5} \\cos\\left({\\theta}\\right)^{5} + 3 \\, r^{3} \\cos\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{6} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) - 2 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) - 2 \\, r^{4} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)^{3}\\right)} \\sin\\left({\\theta}\\right)^{4} + {\\left(2 \\, r^{4} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)^{3} + {\\left(\\sin\\left({\\phi}\\right)^{3} - \\sin\\left({\\phi}\\right)\\right)} r^{3}\\right)} \\sin\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{5} \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right)^{2} - 2 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) - 2 \\, r^{2} \\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} + {\\left(2 \\, r^{4} \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) + r^{3} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} + 2 \\, r^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} x + \\left( -\\frac{r^{3} \\cos\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{6} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right)^{2} - 2 \\, {\\left(\\cos\\left({\\phi}\\right)^{2} - 1\\right)} r^{5} \\cos\\left({\\theta}\\right) + 2 \\, {\\left(\\cos\\left({\\phi}\\right)^{4} - \\cos\\left({\\phi}\\right)^{2}\\right)} r^{4}\\right)} \\sin\\left({\\theta}\\right)^{4} - {\\left(r^{3} \\cos\\left({\\phi}\\right)^{3} + 2 \\, {\\left(\\cos\\left({\\phi}\\right)^{3} - \\cos\\left({\\phi}\\right)\\right)} r^{4} \\cos\\left({\\theta}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} + {\\left(3 \\, r^{6} \\cos\\left({\\theta}\\right)^{4} + 3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) + r^{3} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) + 3 \\, r^{4} \\cos\\left({\\theta}\\right)^{2}\\right)} \\sin\\left({\\theta}\\right)^{2} + r \\cos\\left({\\theta}\\right) - {\\left(r^{3} {\\left(\\cos\\left({\\phi}\\right) + \\sin\\left({\\phi}\\right)\\right)} \\cos\\left({\\theta}\\right)^{2} + r \\cos\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} y + \\left( \\frac{2 \\, r^{5} \\sin\\left({\\phi}\\right) \\sin\\left({\\theta}\\right)^{5} + {\\left(3 \\, r^{6} \\cos\\left({\\theta}\\right)^{3} \\sin\\left({\\phi}\\right) + 2 \\, r^{4} \\cos\\left({\\phi}\\right)^{2} \\cos\\left({\\theta}\\right) \\sin\\left({\\phi}\\right) + 2 \\, r^{3} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)^{3} - {\\left(2 \\, r^{4} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + {\\left(\\cos\\left({\\phi}\\right) \\sin\\left({\\phi}\\right) + 1\\right)} r^{3} \\cos\\left({\\theta}\\right)\\right)} \\sin\\left({\\theta}\\right)^{2} - r \\cos\\left({\\theta}\\right) - {\\left(3 \\, r^{5} \\cos\\left({\\phi}\\right) \\cos\\left({\\theta}\\right)^{4} - r^{3} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right)}{\\sqrt{r^{2} + 1}} \\right) \\mathrm{d} z$" ], "text/plain": [ "*A = (3*r^5*cos(th)^5 + 3*r^3*cos(th)^3 + (3*r^6*cos(ph)*cos(th)^2*sin(ph) - 2*r^5*cos(ph)*cos(th)*sin(ph) - 2*r^4*cos(ph)*sin(ph)^3)*sin(th)^4 + (2*r^4*cos(th)*sin(ph)^3 + (sin(ph)^3 - sin(ph))*r^3)*sin(th)^3 + (3*r^5*cos(th)^3*sin(ph)^2 - 2*r^4*cos(ph)*cos(th)^2*sin(ph) + r^3*cos(ph)*cos(th)*sin(ph) - 2*r^2*cos(ph)*sin(ph))*sin(th)^2 + (2*r^4*cos(th)^3*sin(ph) + r^3*cos(ph)*cos(th)^2 + 2*r^2*cos(th)*sin(ph))*sin(th))/sqrt(r^2 + 1) dx - (r^3*cos(th)^3 + (3*r^6*cos(ph)^2*cos(th)^2 - 2*(cos(ph)^2 - 1)*r^5*cos(th) + 2*(cos(ph)^4 - cos(ph)^2)*r^4)*sin(th)^4 - (r^3*cos(ph)^3 + 2*(cos(ph)^3 - cos(ph))*r^4*cos(th))*sin(th)^3 + (3*r^6*cos(th)^4 + 3*r^5*cos(ph)*cos(th)^3*sin(ph) + r^3*cos(ph)^2*cos(th) + 3*r^4*cos(th)^2)*sin(th)^2 + r*cos(th) - (r^3*(cos(ph) + sin(ph))*cos(th)^2 + r*cos(ph))*sin(th))/sqrt(r^2 + 1) dy + (2*r^5*sin(ph)*sin(th)^5 + (3*r^6*cos(th)^3*sin(ph) + 2*r^4*cos(ph)^2*cos(th)*sin(ph) + 2*r^3*sin(ph))*sin(th)^3 - (2*r^4*cos(ph)*cos(th)^2*sin(ph) + (cos(ph)*sin(ph) + 1)*r^3*cos(th))*sin(th)^2 - r*cos(th) - (3*r^5*cos(ph)*cos(th)^4 - r^3*cos(th)^2*sin(ph))*sin(th))/sqrt(r^2 + 1) dz" ] }, "execution_count": 271, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sa = a.hodge_dual(g)\n", "print(sa)\n", "sa.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "最後に3ー形式のHodge 双対は 0-forms です。\n", "Finally, the Hodge dual of a 3-form is a 0-form:
" ] }, { "cell_type": "code", "execution_count": 272, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3-form dA on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{d}A = \\left( -2 \\, {\\left(3 \\, r^{3} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + r \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right) - 1 \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{d}A = \\left( -2 \\, {\\left(3 \\, r^{3} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + r \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right) - 1 \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z$" ], "text/plain": [ "dA = (-2*(3*r^3*cos(th)^2*sin(ph) + r*sin(ph))*sin(th) - 1) dx∧dy∧dz" ] }, "execution_count": 272, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(da)\n", "da.display()" ] }, { "cell_type": "code", "execution_count": 273, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field *dA on the Open subset U of the 3-dimensional differentiable manifold M\n" ] }, { "data": { "text/html": [ "\\(\\displaystyle \\begin{array}{llcl} \\star \\mathrm{d}A:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & -{\\left(6 \\, y z^{2} + 2 \\, y + 1\\right)} \\sqrt{x^{2} + y^{2} + z^{2} + 1} \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & -\\sqrt{r^{2} + 1} {\\left(2 \\, {\\left(3 \\, r^{3} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + r \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right) + 1\\right)} \\end{array}\\)" ], "text/latex": [ "$\\displaystyle \\begin{array}{llcl} \\star \\mathrm{d}A:& U & \\longrightarrow & \\mathbb{R} \\\\ & \\left(x, y, z\\right) & \\longmapsto & -{\\left(6 \\, y z^{2} + 2 \\, y + 1\\right)} \\sqrt{x^{2} + y^{2} + z^{2} + 1} \\\\ & \\left(r, {\\theta}, {\\phi}\\right) & \\longmapsto & -\\sqrt{r^{2} + 1} {\\left(2 \\, {\\left(3 \\, r^{3} \\cos\\left({\\theta}\\right)^{2} \\sin\\left({\\phi}\\right) + r \\sin\\left({\\phi}\\right)\\right)} \\sin\\left({\\theta}\\right) + 1\\right)} \\end{array}$" ], "text/plain": [ "*dA: U → ℝ\n", " (x, y, z) ↦ -(6*y*z^2 + 2*y + 1)*sqrt(x^2 + y^2 + z^2 + 1)\n", " (r, th, ph) ↦ -sqrt(r^2 + 1)*(2*(3*r^3*cos(th)^2*sin(ph) + r*sin(ph))*sin(th) + 1)" ] }, "execution_count": 273, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sda = da.hodge_dual(g)\n", "print(sda)\n", "sda.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "3次元のリーマン計量に対して、Hodge 双対はidempotent、つまり2回続けて作用させると元に戻ります。\n", "\n", "In dimension 3 and for a Riemannian metric, the Hodge star is idempotent:
" ] }, { "cell_type": "code", "execution_count": 274, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 274, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sf.hodge_dual(g) == f" ] }, { "cell_type": "code", "execution_count": 275, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 275, "metadata": {}, "output_type": "execute_result" } ], "source": [ "som.hodge_dual(g) == om" ] }, { "cell_type": "code", "execution_count": 276, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 276, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sa.hodge_dual(g) == a" ] }, { "cell_type": "code", "execution_count": 277, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\\(\\displaystyle \\mathrm{True}\\)" ], "text/latex": [ "$\\displaystyle \\mathrm{True}$" ], "text/plain": [ "True" ] }, "execution_count": 277, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sda.hodge_dual(g.restrict(U)) == da" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 助けを求める:Getting help\n", "\n", "オブジェクトが呼び出すことのできる関数(メソッドを入手するには、オブジェクトの名前を入力したのち、\".\"とTABを入力します。\n", "つまり、`sa.To get the list of functions (methods) that can be called on a object, type the name of the object, followed by a dot and the TAB key, e.g.
\n", "sa.
To get information on an object or a method, use the question mark:
" ] }, { "cell_type": "code", "execution_count": 278, "metadata": {}, "outputs": [], "source": [ "nabla?" ] }, { "cell_type": "code", "execution_count": 279, "metadata": {}, "outputs": [], "source": [ "g.ricci_scalar?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "二つの疑問符 `??` は **Pythonソースコード** に直接導かれます。(SageMathはオープンソースです、そうでしょう?)\n", "\n", "Using a double question mark leads directly to the **Python source code** (SageMath is **open source**, isn't it?):" ] }, { "cell_type": "code", "execution_count": 280, "metadata": {}, "outputs": [], "source": [ "g.ricci_scalar??" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## さらに先へ:Going further\n", "\n", "[ページ:SageManifolds の例](https://sagemanifolds.obspm.fr/examples.html)をご覧ください。とくに、平行化不能な多様体(スカラー場は少なくとも二つの座標系で定義される必要があり、\n", "モジュール $\\mathfrak{X}(\\mathcal{M})$はもはやフリーではなく、\n", "テンソル場は少なくとも二つのフレームで定義される必要があります)\n", "での使い方については、\n", "[2-次元 球面](https://nbviewer.jupyter.org/github/sagemanifolds/SageManifolds/blob/master/Notebooks/SM_sphere_S2.ipynb)\n", "が役に立つでしょう。\n", "\n", "Christian Bär氏による[チュートリアル ビデオ](https://www.youtube.com/playlist?list=PLnrOCYZpQUuJlnQbQ48zgGk-Ks1t145Yw)もご覧ください。\n", "\n", "Have a look at the [examples on SageManifolds page](https://sagemanifolds.obspm.fr/examples.html), especially the \n", "[2-dimensional sphere](https://nbviewer.jupyter.org/github/sagemanifolds/SageManifolds/blob/master/Notebooks/SM_sphere_S2.ipynb) for usage on a non-parallelizable manifold (each scalar field has to be defined in at least two coordinate charts, the $C^\\infty(\\mathcal{M})$-module $\\mathfrak{X}(\\mathcal{M})$ is no longer free and each tensor field has to be defined in at least two vector frames).\n", "\n", "You may also take a look at the [tutorial videos](https://www.youtube.com/playlist?list=PLnrOCYZpQUuJlnQbQ48zgGk-Ks1t145Yw) by Christian Bär." ] } ], "metadata": { "kernelspec": { "display_name": "SageMath 9.8", "language": "sage", "name": "sagemath" }, "language": "python", "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 4 }