︠8d205418-218d-4705-9127-7539783b1b61sa︠ %auto typeset_mode(True, display=False) ︡6230dd88-95ff-44da-a59b-525614e39239︡︡{"auto":true}︡{"done":true} ︠862c8c28-bf8c-45e5-8a3f-19a7fedf70f6i︠ %html
This worksheet demonstrates a few capabilities of SageManifolds (version 0.8) on the example of the 2-dimensional sphere.
The whole worksheet file can be downloaded from here.
We start by declaring $\mathbb{S}^2$ as a differentiable manifold of dimension 2 over $\mathbb{R}$:
︡fc86220e-7024-45c4-8c50-bd7e272b0635︡︡{"done":true,"html":"This worksheet demonstrates a few capabilities of SageManifolds (version 0.8) on the example of the 2-dimensional sphere.
The whole worksheet file can be downloaded from here.
\nWe start by declaring $\\mathbb{S}^2$ as a differentiable manifold of dimension 2 over $\\mathbb{R}$:
"} ︠ffa2bc19-d388-4f4b-af90-8287de53a75cs︠ S2 = Manifold(2, 'S^2', latex_name=r'\mathbb{S}^2', start_index=1) ︡4d8a603f-8dff-499c-ad9d-ccc190913cbb︡︡{"done":true} ︠dbeb270b-9483-4be1-b91f-cad9e9871f8bi︠ %htmlThe first argument, 2, is the dimension of the manifold, while the second argument is the symbol used to label the manifold.
The argument start_index sets the index range to be used on the manifold for labelling components w.r.t. a basis or a frame: start_index=1 corresponds to $\{1,2\}$; the default value is start_index=0 and yields to $\{0,1\}$.
︡d9b1fb3c-c050-4d54-803c-4cba282d7a2c︡︡{"done":true,"html":"The first argument, 2, is the dimension of the manifold, while the second argument is the symbol used to label the manifold.
\nThe argument start_index sets the index range to be used on the manifold for labelling components w.r.t. a basis or a frame: start_index=1 corresponds to $\\{1,2\\}$; the default value is start_index=0 and yields to $\\{0,1\\}$.
"} ︠0f118149-dfc2-4e7b-9c0e-0033238c1b25s︠ print S2 ︡cba86da5-eb0c-42d2-9a0f-4d779613a779︡︡{"stdout":"2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠84fcd56d-9224-46a6-a10d-5d99078471fds︠ S2 ︡bdc2ea22-049f-436c-8c72-1a2262553bbb︡︡{"html":"The manifold is a Sage Parent object:
︡7328a410-610f-45d6-ae52-67b75f5946ab︡︡{"done":true,"html":"The manifold is a Sage Parent object:
"} ︠80383391-c4b7-4f53-b14e-d9afe869f575s︠ isinstance(S2, Parent) ︡73250e67-843c-4540-b0bb-9cefb160c0ba︡︡{"html":"The sphere cannot be covered by a single chart. At least two charts are necessary, for instance the charts associated with the stereographic projections from the North pole and the South pole respectively. Let us introduce the open subsets covered by these two charts: \[ U := \mathbb{S}^2\setminus\{N\}, \] \[ V := \mathbb{S}^2\setminus\{S\}, \] where $N$ is a point of $\mathbb{S}^2$, which we shall call the North pole, and $S$ is the point of $U$ of stereographic coordinates $(0,0)$, which we call the South pole:
︡0e11c7f4-4378-4d84-ac2d-8594daa40911︡︡{"done":true,"html":"The sphere cannot be covered by a single chart. At least two charts are necessary, for instance the charts associated with the stereographic projections from the North pole and the South pole respectively. Let us introduce the open subsets covered by these two charts: \\[ U := \\mathbb{S}^2\\setminus\\{N\\}, \\] \\[ V := \\mathbb{S}^2\\setminus\\{S\\}, \\] where $N$ is a point of $\\mathbb{S}^2$, which we shall call the North pole, and $S$ is the point of $U$ of stereographic coordinates $(0,0)$, which we call the South pole:
"} ︠8c013996-5a9f-4695-91c8-862b70f37c5bs︠ U = S2.open_subset('U') ; print U ︡b4beef19-72bd-4be6-9df1-ffb3b5464336︡︡{"stdout":"open subset 'U' of the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠2bd47f07-53df-4f13-87f5-5ff6f618e7b5s︠ V = S2.open_subset('V') ; print V ︡c69bb8e3-f6d9-470f-8ef3-97205f4fc84f︡︡{"stdout":"open subset 'V' of the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠1a9d465c-a080-451f-91ed-e024142e6aa1i︠ %htmlWe declare that $\mathbb{S}^2 = U \cup V$:
︡e0bb3deb-100f-42f4-923e-155c8060da68︡︡{"done":true,"html":"We declare that $\\mathbb{S}^2 = U \\cup V$:
"} ︠ad80b297-0832-4af9-9bd4-d5a2321fcb65s︠ S2.declare_union(U, V) ︡e1322307-8d97-4cf3-ba64-c1d5cccad404︡︡{"done":true} ︠7c972f75-ad72-4fe4-83e1-a7548e44766bi︠ %htmlThen we declare the stereographic chart on $U$, denoting by $(x,y)$ the coordinates resulting from the stereographic projection from the North pole:
︡30ce4d21-ea90-443f-b6c8-4fcdf705dcbb︡︡{"done":true,"html":"Then we declare the stereographic chart on $U$, denoting by $(x,y)$ the coordinates resulting from the stereographic projection from the North pole:
"} ︠e193bab8-9bc9-4423-abbb-ed4cd892d751s︠ stereoN.Similarly, we introduce on $V$ the coordinates $(x',y')$ corresponding to the stereographic projection from the South pole:
︡8e684fbe-5e0b-4026-8832-14dbbc937516︡︡{"done":true,"html":"Similarly, we introduce on $V$ the coordinates $(x',y')$ corresponding to the stereographic projection from the South pole:
"} ︠b3377bc5-4dc9-453f-8bc2-12591fb5918es︠ stereoS.At this stage, the user's atlas on the manifold has two charts:
︡955edb1c-56d8-4e57-bef6-16d1b206bb36︡︡{"done":true,"html":"At this stage, the user's atlas on the manifold has two charts:
"} ︠f8079eab-67e6-4f1d-b0b2-67832f489bafs︠ S2.atlas() ︡87dc8757-43b6-462e-8926-4cc8e25d19db︡︡{"html":"We have to specify the transition map between the charts 'stereoN' = $(U,(x,y))$ and 'stereoS' = $(V,(x',y'))$; it is given by the standard inversion formulas:
︡b37e14d0-77ff-48ac-9bed-7a96511ed313︡︡{"done":true,"html":"We have to specify the transition map between the charts 'stereoN' = $(U,(x,y))$ and 'stereoS' = $(V,(x',y'))$; it is given by the standard inversion formulas:
"} ︠a2e575f0-7e37-498a-9b32-817a3b7b3977s︠ stereoN_to_S = stereoN.transition_map(stereoS, (x/(x^2+y^2), y/(x^2+y^2)), intersection_name='W', restrictions1= x^2+y^2!=0, restrictions2= xp^2+xp^2!=0) ︡c6b2a887-cd44-4085-a800-1d7449cd0e8d︡︡{"done":true} ︠f2201f23-8edb-4b86-8d59-acc224282b8bs︠ stereoN_to_S.display() ︡74118893-c24b-44a0-b844-893e0727ce00︡︡{"html":"In the above declaration, 'W' is the name given to the chart-overlap subset: \[ W := U\cap V, \] the condition $x^2+y^2 \not=0$ defines $W$ as a subset of $U$, and the condition $x'^2+y'^2\not=0$ defines $W$ as a subset of $V$.
The inverse coordinate transformation is computed by means of the method inverse():
︡b0580b97-e6e5-4170-8186-bab739a4a0c0︡︡{"done":true,"html":"In the above declaration, 'W' is the name given to the chart-overlap subset: \\[ W := U\\cap V, \\] the condition $x^2+y^2 \\not=0$ defines $W$ as a subset of $U$, and the condition $x'^2+y'^2\\not=0$ defines $W$ as a subset of $V$.
\n\nThe inverse coordinate transformation is computed by means of the method inverse():
"} ︠54ee6499-ca03-46b2-b19f-89d8b07b4265s︠ stereoS_to_N = stereoN_to_S.inverse() stereoS_to_N.display() ︡445c0e9b-a822-495d-994c-253183a03d92︡︡{"html":"In the present case, the situation is of course perfectly symmetric regarding the coordinates $(x,y)$ and $(x',y')$.
At this stage, the user's atlas has four charts:
︡7c314058-e7b9-46d0-af84-5567dc0b0c6c︡︡{"done":true,"html":"In the present case, the situation is of course perfectly symmetric regarding the coordinates $(x,y)$ and $(x',y')$.
\nAt this stage, the user's atlas has four charts:
"} ︠fc0c8d35-b808-4d3d-b823-363b4a3557d6s︠ S2.atlas() ︡e224177d-7791-4721-9304-7ac65cc4995e︡︡{"html":"Let us store $W = U\cap V$ into a Python variable for future use:
︡365e3be8-4600-4258-80ac-9876ad399097︡︡{"done":true,"html":"Let us store $W = U\\cap V$ into a Python variable for future use:
"} ︠bf83eaa5-a11a-46a3-8457-39ae45240c91s︠ W = U.intersection(V) ︡63408587-f45d-455b-9e2f-bf17d903164a︡︡{"done":true} ︠0c8dc60b-e365-42ea-be89-114dc66738d6i︠ %htmlSimilarly we store the charts $(W,(x,y))$ (the restriction of $(U,(x,y))$ to $W$) and $(W,(x',y'))$ (the restriction of $(V,(x',y'))$ to $W$) into Python variables:
︡b88cd8b3-70fb-4192-a5a4-c25dfe40ab7b︡︡{"done":true,"html":"Similarly we store the charts $(W,(x,y))$ (the restriction of $(U,(x,y))$ to $W$) and $(W,(x',y'))$ (the restriction of $(V,(x',y'))$ to $W$) into Python variables:
"} ︠76ac7233-4a8c-4d80-b435-5c21dedc8506s︠ stereoN_W = stereoN.restrict(W) stereoN_W ︡02fe0540-e2f6-4c40-a788-037ea0140a5a︡︡{"html":"We may plot the chart $(W, (x',y'))$ in terms of itself, as a grid:
︡0c72a3ee-696a-4c0a-96c1-4f03f95461f7︡︡{"done":true,"html":"We may plot the chart $(W, (x',y'))$ in terms of itself, as a grid:
"} ︠754c0589-4180-4ea8-95ee-337806904dc4s︠ stereoS_W.plot() ︡0718b2ff-44b5-4cb3-9bdc-51442a0f49e0︡︡{"once":false,"done":false,"file":{"show":true,"uuid":"f9ebf9c3-d8be-4679-8236-f35e649c3945","filename":"/projects/d0bf849e-0437-4f4f-9d61-c23a0d3474ae/.sage/temp/compute4-us/30455/tmp_u_eANz.svg"}}︡{"html":"","done":false}︡{"done":true} ︠28577092-c536-457d-8043-572e9c3307eai︠ %htmlMore interestingly, let us plot the stereographic chart $(x',y')$ in terms of the stereographic chart $(x,y)$ on the domain $W$ where both systems overlap (we split the plot in four parts to avoid the singularity at $(x',y')=(0,0)$):
︡55c568cf-9163-4a6a-b41d-2ae8c5547d93︡︡{"done":true,"html":"More interestingly, let us plot the stereographic chart $(x',y')$ in terms of the stereographic chart $(x,y)$ on the domain $W$ where both systems overlap (we split the plot in four parts to avoid the singularity at $(x',y')=(0,0)$):
"} ︠db9f9d93-5cfc-4e94-acf0-fa9c2be2e9b2s︠ graphSN1 = stereoS_W.plot(stereoN, ranges={xp:[-6,-0.02], yp:[-6,-0.02]}) graphSN2 = stereoS_W.plot(stereoN, ranges={xp:[-6,-0.02], yp:[0.02,6]}) graphSN3 = stereoS_W.plot(stereoN, ranges={xp:[0.02,6], yp:[-6,-0.02]}) graphSN4 = stereoS_W.plot(stereoN, ranges={xp:[0.02,6], yp:[0.02,6]}) show(graphSN1+graphSN2+graphSN3+graphSN4, xmin=-1.5, xmax=1.5, ymin=-1.5, ymax=1.5) ︡3fdf2b22-933f-4324-b687-8655861f5797︡︡{"once":false,"done":false,"file":{"show":true,"uuid":"542ce2e2-ba11-40fb-811c-2bc2bf7c0485","filename":"/projects/d0bf849e-0437-4f4f-9d61-c23a0d3474ae/.sage/temp/compute4-us/30455/tmp_XwfUWR.svg"}}︡{"html":"","done":false}︡{"done":true} ︠62bf2447-ef8c-4b65-ac0c-a6e56d9722c2i︠ %htmlThe standard spherical (or polar) coordinates $(\theta,\phi)$ are defined on the open domain $A\subset W \subset \mathbb{S}^2$ that is the complement of the "origin meridian"; since the latter is the half-circle defined by $y=0$ and $x\geq 0$, we declare:
︡2cce4cc5-ad3c-4d93-a9c2-fba401add515︡︡{"done":true,"html":"The standard spherical (or polar) coordinates $(\\theta,\\phi)$ are defined on the open domain $A\\subset W \\subset \\mathbb{S}^2$ that is the complement of the \"origin meridian\"; since the latter is the half-circle defined by $y=0$ and $x\\geq 0$, we declare:
"} ︠309dfade-97e1-4c7b-913c-bec792ee9fc9s︠ A = W.open_subset('A', coord_def={stereoN_W: (y!=0, x<0)}) print A ︡9474866f-07a0-49a6-acd1-2a75c2c27026︡︡{"stdout":"open subset 'A' of the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠bbfea1f1-42ee-42d2-b70d-e41c45a30e84i︠ %htmlThe restriction of the stereographic chart from the North pole to $A$ is
︡ef854617-9f93-49dc-91a4-1ad422e90337︡︡{"done":true,"html":"The restriction of the stereographic chart from the North pole to $A$ is
"} ︠43d0e9cc-f752-4143-baf0-2bcdab76b3ccs︠ stereoN_A = stereoN_W.restrict(A) stereoN_A ︡e3923260-30da-4f60-8647-4af55d6323b6︡︡{"html":"We then declare the chart $(A,(\theta,\phi))$ by specifying the intervals $(0,\pi)$ and $(0,2\pi)$ spanned by respectively $\theta$ and $\phi$:
︡fa3e3efe-6f72-4109-80a6-97a14a5a5ff5︡︡{"done":true,"html":"We then declare the chart $(A,(\\theta,\\phi))$ by specifying the intervals $(0,\\pi)$ and $(0,2\\pi)$ spanned by respectively $\\theta$ and $\\phi$:
"} ︠1c5024f1-0ba5-45f1-9d25-2ad7f20a9c00s︠ spher.The specification of the spherical coordinates is completed by providing the transition map with the stereographic chart $(A,(x,y))$:
︡5adb5717-8b32-49fd-9beb-0923bcac0c16︡︡{"done":true,"html":"The specification of the spherical coordinates is completed by providing the transition map with the stereographic chart $(A,(x,y))$:
"} ︠b2679cdd-2132-458a-9877-740af53253d2s︠ spher_to_stereoN = spher.transition_map(stereoN_A, (sin(th)*cos(ph)/(1-cos(th)), sin(th)*sin(ph)/(1-cos(th))) ) spher_to_stereoN.display() ︡f5e8ff28-a6bf-471e-a7aa-827b512ea72c︡︡{"html":"We also provide the inverse transition map:
︡6d1ff194-aec6-4f7b-8362-626404ebe7d1︡︡{"done":true,"html":"We also provide the inverse transition map:
"} ︠52e5bff4-d75f-450f-a7a0-8accb1a0b46bs︠ spher_to_stereoN.set_inverse(2*atan(1/sqrt(x^2+y^2)), atan2(-y,-x)+pi) ︡ef412dcf-25d0-49cc-8caa-2404911fc917︡︡{"stdout":"Check of the inverse coordinate transformation:","done":false}︡{"stdout":"\n th == ","done":false}︡{"stdout":"2*arctan(sqrt(-cos(th) + 1)/sqrt(cos(th) + 1))\n ph == ","done":false}︡{"stdout":"pi + arctan2(sin(ph)*sin(th)/(cos(th) - 1), cos(ph)*sin(th)/(cos(th) - 1))\n x == ","done":false}︡{"stdout":"x\n y == ","done":false}︡{"stdout":"y\n","done":false}︡{"done":true} ︠a6e521d5-b860-42eb-bf36-4298ece685fai︠ %htmlThe check is passed, up to some lack of simplification in the functions atan and atan2.
The user atlas of $\mathbb{S}^2$ is now
The check is passed, up to some lack of simplification in the functions atan and atan2.
\n
The user atlas of $\\mathbb{S}^2$ is now
Let us draw the grid of spherical coordinates $(\theta,\phi)$ in terms of stereographic coordinates from the North pole $(x,y)$:
︡32b897a6-876d-4a3b-86b4-e80c60c04be2︡︡{"done":true,"html":"Let us draw the grid of spherical coordinates $(\\theta,\\phi)$ in terms of stereographic coordinates from the North pole $(x,y)$:
"} ︠4f645d24-b9e2-45f2-8c1b-6f28cef219dds︠ spher.plot(stereoN, nb_values=15, ranges={th: (pi/8,pi)}) ︡94a78cb0-da1b-4686-bdcb-819eaf8d6621︡︡{"once":false,"done":false,"file":{"show":true,"uuid":"e8b90693-3400-42aa-9dfa-e04e0b52b2fe","filename":"/projects/d0bf849e-0437-4f4f-9d61-c23a0d3474ae/.sage/temp/compute4-us/30455/tmp_sS9u2i.svg"}}︡{"html":"","done":false}︡{"done":true} ︠a2eb5070-5436-476e-ad85-fa7efbce0056i︠ %htmlConversly, we may represent the grid of the stereographic coordinates $(x,y)$ restricted to $A$ in terms of the spherical coordinates $(\theta,\phi)$. We limit ourselves to one quarter (cf. the argument ranges):
︡2beddac4-7486-40c1-af39-59f78d4f5cac︡︡{"done":true,"html":"Conversly, we may represent the grid of the stereographic coordinates $(x,y)$ restricted to $A$ in terms of the spherical coordinates $(\\theta,\\phi)$. We limit ourselves to one quarter (cf. the argument ranges):
"} ︠9dddcd8f-9537-4170-9d8c-8d1cab310417s︠ stereoN_A.plot(spher, ranges={x: (0.01,8), y: (0.01,8)}, nb_values=20, plot_points=200) ︡f875cb6d-5b32-456c-a0e7-8320dc3e53b6︡︡{"once":false,"done":false,"file":{"show":true,"uuid":"c0b52d52-6550-4caf-bf4a-1da72ea570b7","filename":"/projects/d0bf849e-0437-4f4f-9d61-c23a0d3474ae/.sage/temp/compute4-us/30455/tmp_I25cvK.svg"}}︡{"html":"","done":false}︡{"done":true} ︠4c1ac003-f56c-4b87-bd6d-406d01c07838i︠ %htmlWe declare the North pole (resp. the South pole) as the point of coordinates $(0,0)$ in the chart $(V,(x',y'))$ (resp. in the chart $(U,(x,y))$):
︡19cc2bfa-fe04-49b9-89a9-6d0e60a6afc4︡︡{"done":true,"html":"We declare the North pole (resp. the South pole) as the point of coordinates $(0,0)$ in the chart $(V,(x',y'))$ (resp. in the chart $(U,(x,y))$):
"} ︠f8beacc5-25d2-4ffb-a19e-8da1a71dacacs︠ N = V.point((0,0), chart=stereoS, name='N') ; print N S = U.point((0,0), chart=stereoN, name='S') ; print S ︡e7ed0501-4249-4e76-a255-119949fe1a12︡︡{"stdout":"point 'N' on 2-dimensional manifold 'S^2'\n","done":false}︡{"stdout":"point 'S' on 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠947466e2-d53e-4bc7-b1f9-37f154c08355i︠ %htmlSince points are Sage Element's, the corresponding (facade) Parent being the manifold subsets, an equivalent writing of the above declarations is
︡ce31bb13-f507-4460-8daa-588cc29228c6︡︡{"done":true,"html":"Since points are Sage Element's, the corresponding (facade) Parent being the manifold subsets, an equivalent writing of the above declarations is
"} ︠9a43e728-db86-4ec5-a407-62f028991be4s︠ N = V((0,0), chart=stereoS, name='N') ; print N S = U((0,0), chart=stereoN, name='S') ; print S ︡087e5a7c-ce02-4c48-864e-e5c10e309de8︡︡{"stdout":"point 'N' on 2-dimensional manifold 'S^2'\n","done":false}︡{"stdout":"point 'S' on 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠7c1617da-a853-4eeb-b8b5-561007dbc32ci︠ %htmlMoreover, since stereoS in the default chart on $V$ and stereoN is the default one on $U$, their mentions can be omitted, so that the above can be shortened to
︡90f48f04-1dae-4960-a9cd-06ad861b3549︡︡{"done":true,"html":"Moreover, since stereoS in the default chart on $V$ and stereoN is the default one on $U$, their mentions can be omitted, so that the above can be shortened to
"} ︠2111e11d-ebce-4425-9e62-63fb16af2d7bs︠ N = V((0,0), name='N') ; print N S = U((0,0), name='S') ; print S ︡818eb21e-a9c3-4878-a0c4-c2de71ab2d20︡︡{"stdout":"point 'N' on 2-dimensional manifold 'S^2'\n","done":false}︡{"stdout":"point 'S' on 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠81864f2c-e944-4cdb-82e5-48b9236efcc0s︠ N.parent() ︡e5b31664-f431-4168-bd48-a21b9176ebc3︡︡{"html":"We have of course
︡6f4c5116-af5d-4348-b2bc-87e6c1cc2124︡︡{"done":true,"html":"We have of course
"} ︠2615194f-f249-4754-bb14-22cddfd40c8bs︠ N in V ︡84a70ac2-3861-4575-9a7a-a768ad808e08︡︡{"html":"Let us introduce some point at the equator:
︡cc0a2bfb-939a-4f49-89ad-75c6556a0822︡︡{"done":true,"html":"Let us introduce some point at the equator:
"} ︠3e1c2334-07b9-4a60-8075-c02c5640dd26s︠ E = S2((0,1), chart=stereoN, name='E') ︡e6f1c4d6-7eba-4eb7-bd02-c4cac7cb8147︡︡{"done":true} ︠bc45742d-913e-4e60-b1f0-97dd9ceecaeai︠ %htmlThe point $E$ is in the open subset $A$:
︡d624663c-9ae6-463d-96f2-b465a90bf3b8︡︡{"done":true,"html":"The point $E$ is in the open subset $A$:
"} ︠743d4da0-2ff7-4df3-ae57-e7f617eff871s︠ E in A ︡8276ac59-9632-41d5-8e2a-79fd2a676a4f︡︡{"html":"We may then ask for its spherical coordinates $(\theta,\phi)$:
︡92b3b352-97c1-424d-b8ad-ca958de2e057︡︡{"done":true,"html":"We may then ask for its spherical coordinates $(\\theta,\\phi)$:
"} ︠4be547c8-fb66-4f3a-a890-ece9684c327cs︠ E.coord(spher) ︡52c1e016-8c78-460f-a6ed-0cf4e34cf099︡︡{"html":"which is not possible for the point $N$:
︡e3c60050-3036-4f3d-ab8f-08c424dbe0b3︡︡{"done":true,"html":"which is not possible for the point $N$:
"} ︠51a7e930-a3dc-4000-924d-f543015481a1s︠ N.coord(spher) ︡288921b5-b529-4594-89f7-ff5cc1b968f4︡︡{"done":false,"stderr":"Error in lines 1-1\nTraceback (most recent call last):\n File \"/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, inLet us first declare $\mathbb{R}^3$ as a 3-dimensional manifold covered by a single chart (the so-called Cartesian coordinates):
︡9a35d498-a6b4-4c30-887d-99192a80500e︡︡{"done":true,"html":"Let us first declare $\\mathbb{R}^3$ as a 3-dimensional manifold covered by a single chart (the so-called Cartesian coordinates):
"} ︠707f467d-881f-4099-8237-cd013daa9eb8s︠ R3 = Manifold(3, 'R^3', r'\mathbb{R}^3', start_index=1) cart.The embedding of the sphere is defined as a differential mapping $\Phi: \mathbb{S}^2 \rightarrow \mathbb{R}^3$:
︡a4ff38f7-e026-4fb1-9bb7-cb03fe5a58f3︡︡{"done":true,"html":"The embedding of the sphere is defined as a differential mapping $\\Phi: \\mathbb{S}^2 \\rightarrow \\mathbb{R}^3$:
"} ︠2bafb76a-c9cc-4ebd-8263-76d883b362d1s︠ Phi = S2.diff_mapping(R3, {(stereoN, cart): [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)], (stereoS, cart): [2*xp/(1+xp^2+yp^2), 2*yp/(1+xp^2+yp^2), (1-xp^2-yp^2)/(1+xp^2+yp^2)]}, name='Phi', latex_name=r'\Phi') ︡968dddc0-c4c1-4366-91d2-7488a396f15e︡︡{"done":true} ︠cc651f90-af6a-4e92-af6f-953877ab0256s︠ Phi.display() ︡c1944fef-662f-4005-96dc-f3df23314675︡︡{"html":"$\Phi$ maps points of $\mathbb{S}^2$ to points of $\mathbb{R}^3$:
︡3ca004c6-8a46-4094-ab13-7be19aaab0f6︡︡{"done":true,"html":"$\\Phi$ maps points of $\\mathbb{S}^2$ to points of $\\mathbb{R}^3$:
"} ︠c0a029d5-b662-4ded-872c-810b68346f22s︠ N1 = Phi(N) ; print N1 ; N1 ; N1.coord() ︡b2641d6a-2f3a-493c-8796-6a2c0975eab5︡︡{"stdout":"point 'Phi(N)' on 3-dimensional manifold 'R^3'","done":false}︡{"stdout":"\n","done":false}︡{"html":"$\Phi$ has been defined in terms of the stereographic charts $(U,(x,y))$ and $(V,(x',y'))$, but we may ask its expression in terms of spherical coordinates. The latter is then computed by means of the transition map $(A,(x,y))\rightarrow (A,(\theta,\phi))$:
︡66467114-c6a7-43d0-b047-95681490b08d︡︡{"done":true,"html":"$\\Phi$ has been defined in terms of the stereographic charts $(U,(x,y))$ and $(V,(x',y'))$, but we may ask its expression in terms of spherical coordinates. The latter is then computed by means of the transition map $(A,(x,y))\\rightarrow (A,(\\theta,\\phi))$:
"} ︠96deddf2-f98c-4fbc-a1a8-5a000d5243a2s︠ Phi.expr(stereoN_A, cart) ︡2bcfc3c0-7e12-4cf6-84a3-c1515698cb24︡︡{"html":"Let us use $\Phi$ to draw the grid of spherical coordinates $(\theta,\phi)$ in terms of the Cartesian coordinates $(X,Y,Z)$ of $\mathbb{R}^3$:
︡6b0330c0-581e-4f2a-9c0c-7c17536021ff︡︡{"done":true,"html":"Let us use $\\Phi$ to draw the grid of spherical coordinates $(\\theta,\\phi)$ in terms of the Cartesian coordinates $(X,Y,Z)$ of $\\mathbb{R}^3$:
"} ︠5fde5f7e-efc2-4c77-bfbf-68e8ba2ae766s︠ graph_spher = spher.plot(chart=cart, mapping=Phi, nb_values=11, color='blue') show(graph_spher) ︡fb67ada8-47fa-4870-9dee-9606db24900b︡︡{"done":false,"file":{"uuid":"8e62b94a-3dde-46e8-8621-944a52fa075d","filename":"8e62b94a-3dde-46e8-8621-944a52fa075d.sage3d"}}︡{"html":"","done":false}︡{"done":true} ︠0ec2de0d-882c-447a-a601-5cd19c8ea7c2i︠ %htmlFor future use, let us store a version without any label on the axes:
︡13586c18-b8cb-4a0a-90e7-2d3cbdd50dd1︡︡{"done":true,"html":"For future use, let us store a version without any label on the axes:
"} ︠2d8c1958-1068-43a2-ba78-7351aa4d63eds︠ graph_spher = spher.plot(chart=cart, mapping=Phi, nb_values=11, color='blue', label_axes=False) ︡66c6661f-05d8-432b-85fc-e54c9d2767b8︡︡{"done":true} ︠4eb7af69-d9d1-479c-9b43-e57ac53e79c9i︠ %htmlWe may also use the embedding $\Phi$ to display the stereographic coordinate grid in terms of the Cartesian coordinates in $\mathbb{R}^3$. First for the stereographic coordinates from the North pole:
︡e51d8fc5-4f26-42b7-9a15-73bc9134ecca︡︡{"done":true,"html":"We may also use the embedding $\\Phi$ to display the stereographic coordinate grid in terms of the Cartesian coordinates in $\\mathbb{R}^3$. First for the stereographic coordinates from the North pole:
"} ︠d46357f3-2d3d-46bf-ba1a-498b91d82b2cs︠ graph_stereoN = stereoN.plot(chart=cart, mapping=Phi, nb_values=25) show(graph_stereoN) ︡0cd78216-d32b-48d0-8837-ef2111b39e06︡︡{"done":false,"file":{"uuid":"3c608cc0-4e90-452e-87e6-b6d7a0dfe747","filename":"3c608cc0-4e90-452e-87e6-b6d7a0dfe747.sage3d"}}︡{"html":"","done":false}︡{"done":true} ︠dcefd972-8ed0-42a6-902d-04f9843a782ci︠ %htmland then have a view with the stereographic coordinates from the South pole superposed (in green):
︡afd5f6d1-a638-48e2-ad81-eb7e9a95c2de︡︡{"done":true,"html":"and then have a view with the stereographic coordinates from the South pole superposed (in green):
"} ︠9356d797-b391-4cf6-ad5c-95562d494d10s︠ graph_stereoS = stereoS.plot(chart=cart, mapping=Phi, nb_values=25, color='green') show(graph_stereoN + graph_stereoS) ︡2edb356a-d670-4ea7-bfa4-73532659bd94︡︡{"done":false,"file":{"uuid":"34fc68d3-48c9-4fc7-a076-f0f7152fe6de","filename":"34fc68d3-48c9-4fc7-a076-f0f7152fe6de.sage3d"}}︡{"html":"","done":false}︡{"done":true} ︠28d40ca3-22a7-4453-924b-b8ef0e82e7f1i︠ %htmlWe may also add the two poles to the graphic:
︡7bb30a09-9b5a-4a4c-92a8-1d5abde96b7f︡︡{"done":true,"html":"We may also add the two poles to the graphic:
"} ︠6ff8e17f-b70c-45c5-ba88-3420be129376s︠ pointN = N.plot(chart=cart, mapping=Phi, color='red', label_offset=0.05) pointS = S.plot(chart=cart, mapping=Phi, color='green', label_offset=0.05) show(graph_stereoN + graph_stereoS + pointN + pointS) ︡cd179e76-0ccd-459b-ad14-4125397d88f6︡︡{"done":false,"file":{"uuid":"7227b7cf-41f7-4f7b-a481-971fac988dba","filename":"7227b7cf-41f7-4f7b-a481-971fac988dba.sage3d"}}︡{"html":"","done":false}︡{"done":true} ︠84422dc2-9854-4e42-b8ab-1f0707540225i︠ %htmlThe tangent space to the manifold $\mathbb{S}^2$ at the point $N$ is
︡e72e2de6-2eef-4d88-bedd-dfac256319ef︡︡{"done":true,"html":"The tangent space to the manifold $\\mathbb{S}^2$ at the point $N$ is
"} ︠8022358b-f46d-4086-b268-e0419c7191ads︠ T_N = N.tangent_space() print T_N ; T_N ︡3b5fec97-49c8-4e4c-a7dc-b719a89bef22︡︡{"stdout":"tangent space at point 'N' on 2-dimensional manifold 'S^2'\n","done":false}︡{"html":"$T_N \mathbb{S}^2$ is a vector space over $\mathbb{R}$ (represented here by Sage's symbolic ring SR):
︡94a40db9-bf3c-41c9-925a-01a43e48937a︡︡{"done":true,"html":"$T_N \\mathbb{S}^2$ is a vector space over $\\mathbb{R}$ (represented here by Sage's symbolic ring SR):
"} ︠cedd884f-1125-4773-a2d9-9ed6f5945f4cs︠ T_N.category() ︡10420d91-1aa0-49eb-8de9-0a0a24917270︡︡{"html":"Its dimension equals the manifold's dimension:
︡c4d5b206-6091-44d1-88b9-0eaf8090680d︡︡{"done":true,"html":"Its dimension equals the manifold's dimension:
"} ︠6c46a109-f1c8-4906-8994-649ab3c88339s︠ dim(T_N) ︡2160fb46-defd-496e-b389-e959b1007cb1︡︡{"html":"$T_N \mathbb{S}^2$ is endowed with a basis inherited from the coordinate frame defined around $N$, namely the frame associated with the chart $(V,(x',y'))$:
︡8da3d41c-54da-4aa7-b281-3e918f62b6e7︡︡{"done":true,"html":"$T_N \\mathbb{S}^2$ is endowed with a basis inherited from the coordinate frame defined around $N$, namely the frame associated with the chart $(V,(x',y'))$:
"} ︠44796341-fc74-4dda-a207-87e8dfa612acs︠ T_N.bases() ︡1c3e5890-1ea8-4dce-ba43-e4259767f8ec︡︡{"html":"$(V,(x',y'))$ is the only chart defined so far around the point $N$. If various charts have been defined around a point, then the tangent space at this point is automatically endowed with the bases inherited from the coordinate frames associated to all these charts. For instance, for the equator point $E$:
︡bc4e3d46-93c2-430f-a9a4-6c7292b3266b︡︡{"done":true,"html":"$(V,(x',y'))$ is the only chart defined so far around the point $N$. If various charts have been defined around a point, then the tangent space at this point is automatically endowed with the bases inherited from the coordinate frames associated to all these charts. For instance, for the equator point $E$:
"} ︠b468b74b-960f-4714-a810-802f65e6ef42s︠ T_E = E.tangent_space() print T_E ; T_E ︡fa10f5b8-1197-42ff-9488-b288321f474d︡︡{"stdout":"tangent space at point 'E' on 2-dimensional manifold 'S^2'\n","done":false}︡{"html":"An element of $T_E\mathbb{S}^2$:
︡87a998ec-8fd8-4383-a051-6d0529eac278︡︡{"done":true,"html":"An element of $T_E\\mathbb{S}^2$:
"} ︠79a531fa-26a6-459e-bd03-e746512ab7b1s︠ v = T_E((-3, 2), name='v') print v ︡d1de6972-4304-466d-be6e-1c44798975a7︡︡{"stdout":"tangent vector v at point 'E' on 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠57e825f4-8a7a-448e-b07e-ac4f105c141ds︠ v in T_E ︡d2491fbe-4070-42ea-8394-446e0681787a︡︡{"html":"The differential of the mapping $\Phi$ at the point $E$ is
︡e5e5f9a1-2084-4de8-8d3f-81c387a49666︡︡{"done":true,"html":"The differential of the mapping $\\Phi$ at the point $E$ is
"} ︠1c8db4d0-ce97-4073-91dd-2ff822f69126s︠ dPhi_E = Phi.differential(E) print dPhi_E ; dPhi_E ︡339c9e78-a3c8-4ead-9c1d-0ddfcb7037f2︡︡{"stdout":"Generic morphism:\n From: tangent space at point 'E' on 2-dimensional manifold 'S^2'\n To: tangent space at point 'Phi(E)' on 3-dimensional manifold 'R^3'\n","done":false}︡{"html":"The image by $\mathrm{d}\Phi_E$ of the vector $v\in T_E\mathbb{S}^2$ introduced above is
︡317b721c-592e-473d-a168-cae5e5d812c9︡︡{"done":true,"html":"The image by $\\mathrm{d}\\Phi_E$ of the vector $v\\in T_E\\mathbb{S}^2$ introduced above is
"} ︠6b1a6e4e-9cd8-4c22-a00a-41c71dbdf58es︠ dPhi_E(v) ︡003b9a71-56a8-4dbe-8e4c-8c6c45a09914︡︡{"html":"The set $C^\infty(\mathbb{S}^2)$ of all smooth functions $\mathbb{S}^2\rightarrow \mathbb{R}$ has naturally the structure of a commutative algebra over $\mathbb{R}$. $C^\infty(\mathbb{S}^2)$ is obtained via the method scalar_field_algebra() applied to the manifold $\mathbb{S}^2$:
︡8064acc7-10a3-415a-911e-1d339c80781c︡︡{"done":true,"html":"The set $C^\\infty(\\mathbb{S}^2)$ of all smooth functions $\\mathbb{S}^2\\rightarrow \\mathbb{R}$ has naturally the structure of a commutative algebra over $\\mathbb{R}$. $C^\\infty(\\mathbb{S}^2)$ is obtained via the method scalar_field_algebra() applied to the manifold $\\mathbb{S}^2$:
"} ︠a6e98a37-8b5f-4afb-99f4-d64bae13fedas︠ CS = S2.scalar_field_algebra() ; CS ︡9a1a7e0c-ee48-45b4-bdf3-811adabc2690︡︡{"html":"Since the algebra internal product is the pointwise multiplication, it is clearly commutative, so that $C^\infty(\mathbb{S}^2)$ belongs to Sage's category of commutative algebras:
︡315e39c5-4843-484d-95d3-02eb720ed3ca︡︡{"done":true,"html":"Since the algebra internal product is the pointwise multiplication, it is clearly commutative, so that $C^\\infty(\\mathbb{S}^2)$ belongs to Sage's category of commutative algebras:
"} ︠20821998-9083-4618-b1fa-fe3e25a6c056s︠ CS.category() ︡337dcf52-b5c5-48e1-a725-a0f6393159b7︡︡{"html":"The base ring of the algebra $C^\infty(\mathbb{S}^2)$ is the field $\mathbb{R}$, which is represented here by Sage's Symbolic Ring (SR):
︡482d9fe0-4969-4efd-a65d-a4223e61c9df︡︡{"done":true,"html":"The base ring of the algebra $C^\\infty(\\mathbb{S}^2)$ is the field $\\mathbb{R}$, which is represented here by Sage's Symbolic Ring (SR):
"} ︠1719e925-81a2-4f4b-bdbb-a322dce36a9es︠ CS.base_ring() ︡986835b7-72ed-4706-8be4-913b2b734110︡︡{"html":"Elements of $C^\infty(\mathbb{S}^2)$ are of course (smooth) scalar fields:
︡209d75d1-5311-4adb-93d1-36258637ded2︡︡{"done":true,"html":"Elements of $C^\\infty(\\mathbb{S}^2)$ are of course (smooth) scalar fields:
"} ︠00bbf0d7-94a9-436a-9f19-7e1a6b89e300s︠ print CS.an_element() ︡ab80d0e4-8196-4e34-bc09-eb0c030a7b87︡︡{"stdout":"scalar field on the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠5b32cbc3-1b79-4135-92f2-4efa8b493650i︠ %htmlThis example element is the constant scalar field that takes the value 2:
︡3dbead40-284b-4770-b0f3-45a2b48535f3︡︡{"done":true,"html":"This example element is the constant scalar field that takes the value 2:
"} ︠246b74b5-2e32-40aa-96e3-93baa595259fs︠ CS.an_element().display() ︡852d370d-3555-429f-b2f6-91132de23d27︡︡{"html":"A specific element is the zero one:
︡07b49c58-4590-421d-9057-3cbf3248b0e4︡︡{"done":true,"html":"A specific element is the zero one:
"} ︠892806cf-a1ef-4f08-8401-cff221abd7b4s︠ f = CS.zero() print f ︡94907b65-5685-468c-8c89-afee5f707c02︡︡{"stdout":"scalar field 'zero' on the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠bf095f9d-a6b8-4415-9b44-9c26c8c5cd08i︠ %htmlScalar fields map points of $\mathbb{S}^2$ to real numbers:
︡42cc1c0e-8cc7-4d5a-8b58-0774d09bf15b︡︡{"done":true,"html":"Scalar fields map points of $\\mathbb{S}^2$ to real numbers:
"} ︠725b1d01-f18f-4fd0-bb29-66b08e3f6e08s︠ f(N), f(E), f(S) ︡f121257f-424d-418b-94a3-1f7df2df8e34︡︡{"html":"Another specific element is the algebra unit element, i.e. the constant scalar field 1:
︡f2853ca7-255f-410f-b764-a880722ee52b︡︡{"done":true,"html":"Another specific element is the algebra unit element, i.e. the constant scalar field 1:
"} ︠ec0cdd78-5bfe-41e6-bf68-6e7c8a660f6ds︠ f = CS.one() print f ︡bb33e326-94df-4f93-b462-5f729b70008f︡︡{"stdout":"scalar field on the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠bb9f6689-e62c-4fc8-bb23-5fe36f570b77s︠ f(N), f(E), f(S) ︡8cd74eee-f9e1-4d8c-a3a2-a0142e7e0a68︡︡{"html":"Let us define a scalar field by its coordinate expression in the two stereographic charts:
︡146aef77-f9c2-4176-97c5-1e835ed87299︡︡{"done":true,"html":"Let us define a scalar field by its coordinate expression in the two stereographic charts:
"} ︠d9dd44e7-5ed6-4910-ba9d-2a4c4381a070s︠ f = CS({stereoN: pi - 2*atan(x^2+y^2), stereoS: 2*atan(xp^2+yp^2)}) f.display() ︡275e5851-8dc8-48e0-b789-a4b0e760d217︡︡{"html":"Instead of using CS() (i.e. the Parent __call__ function), we may invoke the scalar_field method on the manifold to create $f$; this allows to pass the name of the scalar field:
︡d99d9c17-cb57-43b6-9563-c82c4f46f001︡︡{"done":true,"html":"Instead of using CS() (i.e. the Parent __call__ function), we may invoke the scalar_field method on the manifold to create $f$; this allows to pass the name of the scalar field:
"} ︠275da819-b5d1-4679-b710-13ceec8e6bbcs︠ f = S2.scalar_field({stereoN: pi - 2*atan(x^2+y^2), stereoS: 2*atan(xp^2+yp^2)}, name='f') f.display() ︡0e57b052-057e-468e-8d30-44c0380642f6︡︡{"html":"Internally, the various coordinate expressions of the scalar field are stored in the dictionary _express, whose keys are the charts:
︡380a98c0-7621-4b02-b587-24c2191766b0︡︡{"done":true,"html":"Internally, the various coordinate expressions of the scalar field are stored in the dictionary _express, whose keys are the charts:
"} ︠dfaeb158-9bbd-442d-aba6-18487496dbd0s︠ f._express ︡d9c37e86-d517-4dcc-9b5d-b2680e037b81︡︡{"html":"The expression in a specific chart is recovered by passing the chart as the argument of the method display():
︡d274133b-f104-4522-a38a-ee77ebdd75c1︡︡{"done":true,"html":"The expression in a specific chart is recovered by passing the chart as the argument of the method display():
"} ︠1dd70bfa-bfd0-4d42-b686-08fe3534bf64s︠ f.display(stereoS) ︡03aeb466-d575-4923-820b-00a3514e1ba9︡︡{"html":"Scalar fields map the manifold's points to real numbers:
︡d4b978be-9448-487e-bb5e-5bca8c4a73b7︡︡{"done":true,"html":"Scalar fields map the manifold's points to real numbers:
"} ︠19d489e5-e574-493f-a08c-98e58065efc3s︠ f(N) ︡90476b97-fff7-4fe0-ad1c-8eaacdcd55e6︡︡{"html":"We may define the restrictions of $f$ to the open subsets $U$ and $V$:
︡d9d69de0-579b-4b42-adf1-79116c3812db︡︡{"done":true,"html":"We may define the restrictions of $f$ to the open subsets $U$ and $V$:
"} ︠25bdcd3c-54e2-4d96-b83e-06ad9e8623ces︠ fU = f.restrict(U) fU.display() ︡1491702f-ef20-4c8c-b02a-6b8aeefddd13︡︡{"html":"A scalar field on $\mathbb{S}^2$ can be coerced to a scalar field on $U$, the coercion being simply the restriction:
︡5f22a3de-c671-4f07-8c21-9cdec72e8dfc︡︡{"done":true,"html":"A scalar field on $\\mathbb{S}^2$ can be coerced to a scalar field on $U$, the coercion being simply the restriction:
"} ︠9250ca9d-58b6-40cf-892b-4b5240a3843as︠ CU.has_coerce_map_from(CS) ︡2765baf4-ef28-46dd-a78e-ee64b94f27f0︡︡{"html":"The arithmetic of scalar fields:
︡262bbf88-5324-4217-9257-115acb02d6fc︡︡{"done":true,"html":"The arithmetic of scalar fields:
"} ︠359fe5d8-2e10-4c8f-92a7-89ff0d38caf3s︠ g = f*f - 2*f g.display() ︡bf534c67-baf1-4f17-9c51-e4fe101e3e5a︡︡{"html":"The set $\mathcal{X}(\mathbb{S}^2)$ of all smooth vector fields on $\mathbb{S}^2$ is a module over the algebra (ring) $C^\infty(\mathbb{S}^2)$. It is obtained by the method vector_field_module():
︡6f66beef-378d-44c0-8e38-fe7f181a27ef︡︡{"done":true,"html":"The set $\\mathcal{X}(\\mathbb{S}^2)$ of all smooth vector fields on $\\mathbb{S}^2$ is a module over the algebra (ring) $C^\\infty(\\mathbb{S}^2)$. It is obtained by the method vector_field_module():
"} ︠24baaa3d-8a75-4227-8136-6824b0685f28s︠ XS = S2.vector_field_module() XS ︡cdbb0ffd-9718-4978-be0c-1052db445cf2︡︡{"html":"$\mathcal{X}(\mathbb{S}^2)$ is not a free module:
︡83e4006b-1875-4b37-b28e-f28be4e27090︡︡{"done":true,"html":"$\\mathcal{X}(\\mathbb{S}^2)$ is not a free module:
"} ︠b6dce541-b588-4da2-a667-f1d61f307294s︠ isinstance(XS, FiniteRankFreeModule) ︡9d542dd6-1441-4c3f-9cf3-c9c9ec2c73d9︡︡{"html":"because $\mathbb{S}^2$ is not a parallelizable manifold:
︡7dce1674-cdb2-41cf-9a95-ebc2f308fee6︡︡{"done":true,"html":"because $\\mathbb{S}^2$ is not a parallelizable manifold:
"} ︠8f369e77-d8b1-4012-95d6-5597d6cf8e84s︠ S2.is_manifestly_parallelizable() ︡54084796-1206-4090-b9c4-0aae1be5b57d︡︡{"html":"On the contrary, the set $\mathcal{X}(U)$ of smooth vector fields on $U$ is a free module:
︡6d669c9a-84ed-4d5a-9129-8df9acbc30ee︡︡{"done":true,"html":"On the contrary, the set $\\mathcal{X}(U)$ of smooth vector fields on $U$ is a free module:
"} ︠a5169feb-8332-4eb7-8098-1a927c7780ebs︠ XU = U.vector_field_module() isinstance(XU, FiniteRankFreeModule) ︡9026eb96-3a49-40ef-b8ce-ab9e2a508ef5︡︡{"html":"because $U$ is parallelizable:
︡6c31a4f6-39eb-4cc3-921f-f8086ec15a3d︡︡{"done":true,"html":"because $U$ is parallelizable:
"} ︠1a881c06-d3d4-41dc-a2c2-88ce00af6b46s︠ U.is_manifestly_parallelizable() ︡a137cf82-f067-4fd2-b5f6-84bf5e3e64ea︡︡{"html":"Due to the introduction of the stereographic coordinates $(x,y)$ on $U$, a basis has already been defined on the free module $\mathcal{X}(U)$, namely the coordinate basis $(\partial/\partial x, \partial/\partial y)$:
︡00ec274b-9176-4c13-87dd-315445cd80e7︡︡{"done":true,"html":"Due to the introduction of the stereographic coordinates $(x,y)$ on $U$, a basis has already been defined on the free module $\\mathcal{X}(U)$, namely the coordinate basis $(\\partial/\\partial x, \\partial/\\partial y)$:
"} ︠0c43920d-3dcc-4a62-abd3-1566d9754546s︠ XU.print_bases() ︡c8622cd4-8392-4791-9ea0-3a00e00f88f2︡︡{"stdout":"Bases defined on the free module X(U) of vector fields on the open subset 'U' of the 2-dimensional manifold 'S^2':\n - (U, (d/dx,d/dy)) (default basis)\n","done":false}︡{"done":true} ︠ead120a0-827d-4f02-8502-fc8dc3245579s︠ XU.default_basis() ︡e4795069-732b-418b-8195-f6ff63326818︡︡{"html":"Similarly
︡49fd06cc-4005-41dc-a46e-8295e119a049︡︡{"done":true,"html":"Similarly
"} ︠1a9b8276-901d-44c7-9aff-011dced55fa9s︠ XV = V.vector_field_module() XV.default_basis() ︡8c52a932-8d66-4ec9-b687-175abd621269︡︡{"html":"From the point of view of the open set $U$, eU is also the default vector frame:
︡b7270b78-bac3-42cc-8b0a-c9e8e8282942︡︡{"done":true,"html":"From the point of view of the open set $U$, eU is also the default vector frame:
"} ︠d35b8a47-3249-43b6-92b5-bbe1b2222153s︠ eU is U.default_frame() ︡22a8b0b6-2520-4f68-923e-1b5fc222528a︡︡{"html":"It is also the default vector frame on $\mathbb{S}^2$ (although not defined on the whole $\mathbb{S}^2$), for it is the first vector frame defined on an open subset of $\mathbb{S}^2$:
︡538f1a9e-a1b2-4344-b76a-b1fd2ef63427︡︡{"done":true,"html":"It is also the default vector frame on $\\mathbb{S}^2$ (although not defined on the whole $\\mathbb{S}^2$), for it is the first vector frame defined on an open subset of $\\mathbb{S}^2$:
"} ︠5511094d-b35c-415c-984f-6ce3ec1de788s︠ eU is S2.default_frame() ︡ccfbe453-26cc-4227-9fba-b325ec920806︡︡{"html":"Let us introduce a vector field on $\mathbb{S}^2$:
︡4cff22ee-2253-4a5d-8593-384c69741420︡︡{"done":true,"html":"Let us introduce a vector field on $\\mathbb{S}^2$:
"} ︠89b84fbe-2c9d-4741-a308-2a7766f168d8s︠ v = S2.vector_field(name='v') v[eU,:] = [1, -2] v.display(eU) ︡0a093946-fdc9-4002-9f19-146d9ca38abe︡︡{"html":"We extend the definition of $v$ to $V$ thanks to the above expression:
︡962908e0-a958-4507-8499-6c9ce4042b8d︡︡{"done":true,"html":"We extend the definition of $v$ to $V$ thanks to the above expression:
"} ︠3bac63d5-e7eb-46e6-b11b-8ce3fa68cd05s︠ v.add_comp_by_continuation(eV, W, chart=stereoS) ︡6fea451a-6638-4dce-9a11-10e1f1e10cde︡︡{"done":true} ︠f10d7739-ebfd-431a-bf08-3495c7fadbf2s︠ v.display(eV) ︡7f5a8ff2-74a7-4aa6-8687-f20d72d9a582︡︡{"html":"At this stage, the vector field $v$ is defined on the whole manifold $\mathbb{S}^2$; it has expressions in each of the two frames eU and eV which cover $\mathbb{S}^2$:
︡80edeb1f-95eb-49dd-b89b-0b4261e25a99︡︡{"done":true,"html":"At this stage, the vector field $v$ is defined on the whole manifold $\\mathbb{S}^2$; it has expressions in each of the two frames eU and eV which cover $\\mathbb{S}^2$:
"} ︠7a15695c-f1db-4e1d-bc1a-53ef14dde21ds︠ print v v.display(eU) ︡4dd8e4f8-0e47-4144-9721-d73fbc3f058e︡︡{"stdout":"vector field 'v' on the 2-dimensional manifold 'S^2'\n","done":false}︡{"html":"According to the hairy ball theorem, $v$ has to vanish somewhere. This occurs at the North pole:
︡8e3f0901-760e-4949-87b0-fa73cf5e5264︡︡{"done":true,"html":"According to the hairy ball theorem, $v$ has to vanish somewhere. This occurs at the North pole:
"} ︠bc1c945f-fd87-4c37-a5cd-c47b21f31b7as︠ vN = v.at(N) print vN ︡22263a2a-6237-4092-8e43-e9c8bffd4dce︡︡{"stdout":"tangent vector v at point 'N' on 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠cb6e2074-deab-4f51-9dd9-5e863d0834e0s︠ vN.display() ︡b08103ca-6bd3-45c7-9f6a-2ba408c52770︡︡{"html":"$v|_N$ is the zero vector of the tangent vector space $T_N\mathbb{S}^2$:
︡169a4f5e-802c-46c7-b11e-8e945dabc03e︡︡{"done":true,"html":"$v|_N$ is the zero vector of the tangent vector space $T_N\\mathbb{S}^2$:
"} ︠10beaff3-3315-4d74-b1b2-8b5e2b6ad486s︠ vN.parent() ︡256a5f6d-cf6d-4884-a499-29d7ad64e942︡︡{"html":"On the contrary, $v$ is non-zero at the South pole:
︡24e63c95-6547-4b9e-8a05-11076bcce58f︡︡{"done":true,"html":"On the contrary, $v$ is non-zero at the South pole:
"} ︠982d76f6-aedd-4a10-aad2-47e2d33e247es︠ vS = v.at(S) print vS ︡0e2c78ca-d95b-4ea6-b2e4-b8bf92d867a8︡︡{"stdout":"tangent vector v at point 'S' on 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠ff0b15d0-850e-48c6-8167-3c543a9443dds︠ vS.display() ︡d2fcf5c9-6342-4e45-b9de-439c62f4eff6︡︡{"html":"Let us plot the vector field $v$ is terms of the stereographic chart $(U,(x,y))$, with the South pole $S$ superposed:
︡7b0917a3-cbaa-4b43-836d-ec3a57947719︡︡{"done":true,"html":"Let us plot the vector field $v$ is terms of the stereographic chart $(U,(x,y))$, with the South pole $S$ superposed:
"} ︠67d9429e-78ef-4b18-8878-d866cdd93236r︠ v.plot(chart=stereoN, chart_domain=stereoN, max_value=4, nb_values=5, scale=0.5, aspect_ratio=1) + \ S.plot(stereoN, size=30, label_offset=0.2) ︡31e5d3cd-48cc-4273-a1d7-11edfa3cbe74︡ ︠11e05c96-3463-4f1b-ab6e-96842a10bd5ei︠ %htmlThe vector field appears homogeneous because its components w.r.t. the frame $\left(\frac{\partial}{\partial x}, \frac{\partial}{\partial y}\right)$ are constant:
︡78c8e04f-7bdc-4cfb-bfc6-b728a86c1128︡︡{"done":true,"html":"The vector field appears homogeneous because its components w.r.t. the frame $\\left(\\frac{\\partial}{\\partial x}, \\frac{\\partial}{\\partial y}\\right)$ are constant:
"} ︠99ec0dbb-6943-4a67-8d46-a1f7461668a0r︠ v.display(stereoN.frame()) ︡f7938d0c-5cee-4ac1-a682-1c58c6c02d1c︡ ︠91b994ca-6791-4f15-9ae1-1bd47e17067bi︠ %htmlOn the contrary, once drawn in terms of the stereographic chart $(V, (x',y'))$, $v$ does no longer appears homogeneous:
︡b4350ce4-7aa7-4522-958c-7fa3f29e1222︡︡{"done":true,"html":"On the contrary, once drawn in terms of the stereographic chart $(V, (x',y'))$, $v$ does no longer appears homogeneous:
"} ︠37e637af-8b9d-414c-a92c-7855a98b61bar︠ v.plot(chart=stereoS, chart_domain=stereoS, max_value=4, scale=0.02, aspect_ratio=1) + \ N.plot(chart=stereoS, size=30, label_offset=0.2) ︡13b31a43-08fe-4f31-bc1b-67f5816cf7fc︡ ︠f78cd24a-04e4-4096-84d1-ae97193fe700i︠ %htmlFinally, a 3D view of the vector field $v$ is obtained via the embedding $\Phi$:
︡d37e06e8-99c1-4c58-a95a-9adf5c927c08︡︡{"done":true,"html":"Finally, a 3D view of the vector field $v$ is obtained via the embedding $\\Phi$:
"} ︠000217b6-bb49-4905-af26-1b40fadcee71s︠ graph_v = v.plot(chart=cart, mapping=Phi, chart_domain=spher, nb_values=11, scale=0.2) show(graph_v + graph_spher, aspect_ratio=1) ︡6a41f7f6-c0b5-46e0-9884-910fb7eb8d46︡︡{"done":false,"stderr":"Error in lines 1-1\n"}︡{"done":false,"stderr":"Traceback (most recent call last):\n File \"/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, inSimilarly, let us draw the first vector field of the stereographic frame from the North pole, namely $\frac{\partial}{\partial x}$:
︡ef369267-bbdd-4ab9-85c7-8d91df1e19ea︡︡{"done":true,"html":"Similarly, let us draw the first vector field of the stereographic frame from the North pole, namely $\\frac{\\partial}{\\partial x}$:
"} ︠d08041f8-d1f6-49da-b7bb-79507802e1e4r︠ ex = stereoN.frame()[1] ex ︡b869736b-2f83-4222-b891-46d994c784fa︡ ︠7afafbbd-7fe4-4fb8-9c6c-4fae9e457d39s︠ graph_ex = ex.plot(chart=cart, mapping=Phi, chart_domain=spher, nb_values=11, scale=0.4, width=1) show(graph_ex + graph_spher, aspect_ratio=1) ︡dd0993c2-5cfa-43e2-b8b8-0467e288c13a︡︡{"done":false,"stderr":"Error in lines 1-2\nTraceback (most recent call last):\n File \"/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, inFor the second vector field of the stereographic frame from the North pole, namely $\frac{\partial}{\partial y}$, we get
︡2d0dc373-92f6-458b-8f50-244df092434c︡︡{"done":true,"html":"For the second vector field of the stereographic frame from the North pole, namely $\\frac{\\partial}{\\partial y}$, we get
"} ︠895c0a4f-7dda-4529-bf80-86fe5c260185r︠ ey = stereoN.frame()[2] ey ︡b27d21a4-b93b-467a-8ba4-d757e0e33fb6︡ ︠9acbfae9-6e00-4d2a-8aae-b069d2478718r︠ graph_ey = ey.plot(chart=cart, mapping=Phi, chart_domain=spher, nb_values=11, scale=0.4, width=1, color='red', label_axes=False) show(graph_ey + graph_spher, aspect_ratio=1) ︡4c8e36fd-c04f-493a-a2d8-ec82820dc95a︡ ︠c3a37747-99ff-4dd0-a66e-1117b31793a7i︠ %htmlWe may superpose the two graphs, to get a 3D view of the frame associated with the stereographic coordinates from the North pole:
︡d9dfc35e-db69-4d7c-8e31-87e3d8e1a9cf︡︡{"done":true,"html":"We may superpose the two graphs, to get a 3D view of the frame associated with the stereographic coordinates from the North pole:
"} ︠bdae2a13-e412-4fba-b919-0dbd459320e0s︠ show(graph_ex + graph_ey + graph_spher + N.plot(cart, mapping=Phi, label_offset=0.05) + S.plot(cart, mapping=Phi, label_offset=0.05), aspect_ratio=1) ︡9e0f4b3c-2e00-481e-867b-1041a03bc69a︡︡{"done":false,"stderr":"Error in lines 1-4\nTraceback (most recent call last):\n File \"/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 2, inA Tachyon view of the same frame:
︡b1798747-43b2-4ae3-9c32-efc59f343e9d︡︡{"done":true,"html":"A Tachyon view of the same frame:
"} ︠07da8527-3121-4ce5-b9fb-a26655922836r︠ show(graph_ex + graph_ey + graph_spher + N.plot(cart, mapping=Phi, label_offset=0.05, size=5) + S.plot(cart, mapping=Phi, label_offset=0.05, size=5) + sphere(opacity=0.5), aspect_ratio=1, viewer='tachyon', figsize=10) ︡aa5dda9e-7c40-46b9-b5a8-642bd0e474da︡ ︠02c95c4f-b178-4d4a-b00c-85e3f4a82e3ei︠ %html$v$ and $f$ are both fields defined on the whole sphere (respectively a vector field and a scalar field). By the very definition of a vector field, $v$ acts on $f$:
︡c7d7001f-da53-40d1-a44f-676576dc5299︡︡{"done":true,"html":"$v$ and $f$ are both fields defined on the whole sphere (respectively a vector field and a scalar field). By the very definition of a vector field, $v$ acts on $f$:
"} ︠7091405e-e6e0-4ae1-a4c3-539b7570cbbdr︠ vf = v(f) print vf vf.display() ︡ab800427-8d54-4ff8-b679-738105226368︡ ︠e02bb0d9-3a91-41ef-a890-8adc11ac3075i︠ %htmlValues of $v(f)$ at the North pole, at the equator point $E$ and at the South pole:
︡bebd7c46-5f52-4d4c-9f65-f643dbb5ddda︡︡{"done":true,"html":"Values of $v(f)$ at the North pole, at the equator point $E$ and at the South pole:
"} ︠ae5b6a72-063f-455a-bfbe-776678a7c79dr︠ vf(N) ︡e24354d5-3c1e-4797-af45-47abf8ed0fe9︡ ︠158036c2-4f1e-40d3-a89e-df84209a6852s︠ vf(E) ︡19d163a9-9a3f-4fcd-8869-807bc68990a3︡︡{"done":false,"stderr":"Error in lines 1-1\nTraceback (most recent call last):\n File \"/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, inA 1-form on $\mathbb{S}^2$ is a field of linear forms on the tangent spaces. For instance it can the differential of a scalar field:
︡02fba505-cae9-4f5b-aeaf-c96755e9749a︡︡{"done":true,"html":"A 1-form on $\\mathbb{S}^2$ is a field of linear forms on the tangent spaces. For instance it can the differential of a scalar field:
"} ︠6ce1f53d-5669-42c2-a089-e6a8b9bd6665r︠ df = f.differential() ; print df ︡20ee3e49-7ecb-471b-b7e7-4204eb35007c︡ ︠aab1288b-47dc-449b-b2fe-fc03f67560ffs︠ df.display() ︡d70ae44d-be80-40a2-93a6-09b193ddf9ae︡︡{"done":false,"stderr":"Error in lines 1-1\nTraceback (most recent call last):\n File \"/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, inThe 1-form acting on a vector field:
︡f865aed5-2a88-4cfb-90cb-2c3b5d47ece5︡︡{"done":true,"html":"The 1-form acting on a vector field:
"} ︠fe9ce6a5-29d1-4378-9963-00025a109f80s︠ print df(v) ; df(v).display() ︡b706293b-9fd5-453b-82f1-f75a6cb28823︡︡{"done":false,"stderr":"Error in lines 1-1\nTraceback (most recent call last):\n File \"/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, inLet us check the identity $\mathrm{d}f(v) = v(f)$:
︡b4c77009-f23d-409d-b94d-2802baed408d︡︡{"done":true,"html":"Let us check the identity $\\mathrm{d}f(v) = v(f)$:
"} ︠f7462198-846c-490c-99b5-ee723e5d39e6s︠ df(v) == v(f) ︡3c5f642d-059a-45d1-a545-aa22816f9084︡︡{"done":false,"stderr":"Error in lines 1-1\nTraceback (most recent call last):\n File \"/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, inSimilarly, we have $\mathcal{L}_v f = v(f)$:
︡a5a1620b-b324-464c-bff3-f60067aca9ad︡︡{"done":true,"html":"Similarly, we have $\\mathcal{L}_v f = v(f)$:
"} ︠d012493c-f5cc-4580-97d9-5ae3f74bd090s︠ f.lie_der(v) == v(f) ︡c92063c2-88bf-458e-9e6c-eb3f9865f0f8︡︡{"html":"In order to define curves in $\mathbb{S}^2$, we first introduce the field of real numbers $\mathbb{R}$ as a 1-dimensional smooth manifold with a canonical coordinate chart:
︡5e70c05a-21d9-41e1-98f1-75501df5563f︡︡{"done":true,"html":"In order to define curves in $\\mathbb{S}^2$, we first introduce the field of real numbers $\\mathbb{R}$ as a 1-dimensional smooth manifold with a canonical coordinate chart:
"} ︠f6624320-b8f8-4a7d-b4ed-8fbe4f41d3c5s︠ R.Let us define a loxodrome of the sphere in terms of its parametric equation with respect to the chart spher = $(A,(\theta,\phi))$
︡788f99d6-9a7c-46c1-83f3-3de9de516fbd︡︡{"done":true,"html":"Let us define a loxodrome of the sphere in terms of its parametric equation with respect to the chart spher = $(A,(\\theta,\\phi))$
"} ︠37b85d39-dc7d-4187-b4e1-8248d13b7d3cs︠ c = S2.curve({spher: [2*atan(exp(-t/10)), t]}, (t, -oo, +oo), name='c') ︡5ab3734f-5a32-4972-a5f3-8d2d608b5023︡︡{"done":true} ︠286e5ac7-375e-464d-b187-adbdec33998bi︠ %htmlCurves in $\mathbb{S}^2$ are considered as morphisms from the manifold $\mathbb{R}$ to the manifold $\mathbb{S}^2$:
︡7a6d95dc-6d14-44eb-9d1c-df89753c567f︡︡{"done":true,"html":"Curves in $\\mathbb{S}^2$ are considered as morphisms from the manifold $\\mathbb{R}$ to the manifold $\\mathbb{S}^2$:
"} ︠6822b499-870d-40db-9361-c0a337675623s︠ c.parent() ︡e5075336-6e5a-4e15-ac43-f2073b2315d1︡︡{"html":"The curve $c$ can be plotted in terms of stereographic coordinates $(x,y)$:
︡8465fc5c-593d-4942-964b-aeba8c76d9a6︡︡{"done":true,"html":"The curve $c$ can be plotted in terms of stereographic coordinates $(x,y)$:
"} ︠49b17464-affc-4cd0-b1bd-ab6137ed0cb6s︠ c.plot(chart=stereoN, aspect_ratio=1) ︡1133554f-44f6-4468-ab20-662eb02429a0︡︡{"once":false,"done":false,"file":{"show":true,"uuid":"925ad0b6-04be-4717-ab87-5469ed35f19a","filename":"/projects/d0bf849e-0437-4f4f-9d61-c23a0d3474ae/.sage/temp/compute4-us/30455/tmp_vZ4pme.svg"}}︡{"html":"","done":false}︡{"done":true} ︠c6a8c1fc-6750-48e5-80bb-22585275fbcei︠ %htmlWe recover the well-known fact that the graph of a loxodrome in terms of stereographic coordinates is a logarithmic spiral.
Thanks to the embedding $\Phi$, we may also plot $c$ in terms of the Cartesian coordinates of $\mathbb{R}^3$:
︡cd2478ee-8e45-44bd-9ff0-a8f46df7c6cd︡︡{"done":true,"html":"We recover the well-known fact that the graph of a loxodrome in terms of stereographic coordinates is a logarithmic spiral.
\nThanks to the embedding $\\Phi$, we may also plot $c$ in terms of the Cartesian coordinates of $\\mathbb{R}^3$:
"} ︠ea334b39-db83-4dc1-a30c-70bb576185b6s︠ graph_c = c.plot(mapping=Phi, max_value=40, plot_points=200, thickness=2) show(graph_spher + graph_c) ︡22537e13-4271-499e-a52c-c63d5a0cc65b︡︡{"done":false,"file":{"uuid":"ad9ddf4d-4882-4439-b874-5f38066ff69b","filename":"ad9ddf4d-4882-4439-b874-5f38066ff69b.sage3d"}}︡{"html":"","done":false}︡{"done":true} ︠b7657b98-6884-49bb-9a6a-c65506fb9eafi︠ %htmlThe tangent vector field (or velocity vector) to the curve $c$ is
︡95733d0e-15c7-4bcb-9df7-3b3fdd6c37f7︡︡{"done":true,"html":"The tangent vector field (or velocity vector) to the curve $c$ is
"} ︠2171ccf9-e3a3-4dc5-825f-98bccd011d07s︠ vc = c.tangent_vector_field() vc ︡8909300c-a71b-4233-8644-8e60adca7a05︡︡{"html":"$c'$ is a vector field along $\mathbb{R}$ taking its values in tangent spaces to $\mathbb{S}^2$:
︡4061d605-fa9a-44dc-8406-16826439c3d6︡︡{"done":true,"html":"$c'$ is a vector field along $\\mathbb{R}$ taking its values in tangent spaces to $\\mathbb{S}^2$:
"} ︠abaca02e-202a-4cdf-85da-5d7f63529ecds︠ print vc ︡e4c028e5-cd70-4a28-bf70-48c2c2b36e8d︡︡{"stdout":"vector field 'c'' along the field R of real numbers with values on the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠7cf2a5b9-331a-46f5-a57a-9f711af27c90i︠ %htmlThe set of vector fields along $\mathbb{R}$ taking their values on $\mathbb{S}^2$ via the differential mapping $c: \mathbb{R} \rightarrow \mathbb{S}^2$ is denoted by $\mathcal{X}(\mathbb{R},c)$; it is a module over the algebra $C^\infty(\mathbb{R})$:
︡80c6ae99-5684-4b3d-8ff4-358e2c6cfea3︡︡{"done":true,"html":"The set of vector fields along $\\mathbb{R}$ taking their values on $\\mathbb{S}^2$ via the differential mapping $c: \\mathbb{R} \\rightarrow \\mathbb{S}^2$ is denoted by $\\mathcal{X}(\\mathbb{R},c)$; it is a module over the algebra $C^\\infty(\\mathbb{R})$:
"} ︠b497a78b-64d1-4caf-bda1-d99782ebf5b3s︠ vc.parent() ︡f0954769-b9d4-40ad-b8a6-b74e5a8d3f0e︡︡{"html":"A coordinate view of $c'$:
︡24014836-cafa-4522-82fc-62012d98f948︡︡{"done":true,"html":"A coordinate view of $c'$:
"} ︠0a0c9967-a92a-4183-a3a4-44db708775d0s︠ vc.display() ︡025400a5-bebf-4610-9a3c-8b8a911ee58b︡︡{"html":"Let us plot the vector field $c'$ in terms of the stereographic chart $(U,(x,y))$:
︡be3e1da0-4ec7-4371-a222-0d522eb80200︡︡{"done":true,"html":"Let us plot the vector field $c'$ in terms of the stereographic chart $(U,(x,y))$:
"} ︠403ca29e-fd34-4ceb-a586-52dfabcb717cs︠ show(vc.plot(chart=stereoN, nb_values=30, scale=0.5, color='red') + c.plot(chart=stereoN), aspect_ratio=1) ︡def0b0fb-be89-4700-a5b9-9eeefdaec5af︡︡{"once":false,"done":false,"file":{"show":true,"uuid":"90a65db1-7f40-42d2-86c7-6c9618c499ef","filename":"/projects/d0bf849e-0437-4f4f-9d61-c23a0d3474ae/.sage/temp/compute4-us/27865/tmp_y7ACrW.svg"}}︡{"html":"","done":false}︡{"done":true}︡{"once":false,"done":false,"file":{"show":true,"uuid":"90a65db1-7f40-42d2-86c7-6c9618c499ef","filename":"/projects/d0bf849e-0437-4f4f-9d61-c23a0d3474ae/.sage/temp/compute4-us/30455/tmp_wS49L8.svg"}}︡{"html":"","done":false}︡{"done":true} ︠20e825a8-5e70-4bb5-b58e-cd7a5b79b307i︠ %htmlA 3D view of $c'$ is obtained via the embedding $\Phi$:
︡824765e2-e559-4946-907e-b551d18e42e0︡︡{"done":true,"html":"A 3D view of $c'$ is obtained via the embedding $\\Phi$:
"} ︠2bb72a8d-e277-484f-9df8-61eed72a3b82s︠ graph_vc = vc.plot(chart=cart, mapping=Phi, ranges={t: (-20, 20)}, nb_values=30, scale=0.5, color='red', label_axes=False) show(graph_vc + graph_spher + graph_c, aspect_ratio=1) ︡10e80065-4ef2-455b-9d9b-b87136020254︡︡{"done":false,"stderr":"Error in lines 1-2\n"}︡{"done":false,"stderr":"Traceback (most recent call last):\n File \"/projects/sage/sage-6.9/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 2, inThe standard metric on $\mathbb{S}^2$ is that induced by the Euclidean metric of $\mathbb{R}^3$. Let us start by defining the latter:
︡dabdad68-3a1c-43c6-a99e-d18bf5f200ab︡︡{"done":true,"html":"The standard metric on $\\mathbb{S}^2$ is that induced by the Euclidean metric of $\\mathbb{R}^3$. Let us start by defining the latter:
"} ︠0da78d1e-abe3-44ae-bb98-abd2077fd398s︠ h = R3.riemann_metric('h') h[1,1], h[2,2], h[3, 3] = 1, 1, 1 h.display() ︡9ca3ed81-690c-49e5-9204-f093dc219231︡︡{"html":"The metric $g$ on $\mathbb{S}^2$ is the pullback of $h$ associated with the embedding $\Phi$:
︡d150e62e-24d3-4b25-83df-4224e50cf1af︡︡{"done":true,"html":"The metric $g$ on $\\mathbb{S}^2$ is the pullback of $h$ associated with the embedding $\\Phi$:
"} ︠68f44ae9-897f-45dc-bcd4-c99a1d348ba6s︠ g = S2.riemann_metric('g') g.set( Phi.pullback(h) ) print g ︡b64224e3-49b2-4faa-b5fd-155447a7d1b0︡︡{"stdout":"Riemannian metric 'g' on the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠38e4335f-a6df-4d82-9aed-b5b6b11d61b7i︠ %htmlNote that we could have defined $g$ intrinsically, i.e. by providing its components in the two frames stereoN and stereoS, as we did for the metric $h$ on $\mathbb{R}^3$. Instead, we have chosen to get it as the pullback of $h$, as an example of pullback associated with some differential map.
The metric is a symmetric tensor field of type (0,2):
︡2e77e86d-424d-4eb8-b194-7744360ef494︡︡{"done":true,"html":"Note that we could have defined $g$ intrinsically, i.e. by providing its components in the two frames stereoN and stereoS, as we did for the metric $h$ on $\\mathbb{R}^3$. Instead, we have chosen to get it as the pullback of $h$, as an example of pullback associated with some differential map.
\nThe metric is a symmetric tensor field of type (0,2):
"} ︠218c2cca-883c-45c1-8a34-d9dab473dd16s︠ print g.parent() ︡08ece149-7c85-43c9-a541-6e221d6693fa︡︡{"stdout":"module T^(0,2)(S^2) of type-(0,2) tensors fields on the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠329aeb0e-bb55-43bd-9e49-8c034a6e9130s︠ g.tensor_type() ︡e31efda3-db90-4ea4-b4a6-e1fc8e66c35b︡︡{"html":"The expression of the metric in terms of the default frame on $\mathbb{S}^2$ (stereoN):
︡193d41d2-b432-4674-bb2b-5ebae90a422d︡︡{"done":true,"html":"The expression of the metric in terms of the default frame on $\\mathbb{S}^2$ (stereoN):
"} ︠9ae60ead-d504-4921-9fd3-76b298b8b162s︠ g.display() ︡ed0dbf7f-81e9-4887-99d1-1a9ac2729226︡︡{"html":"We may factorize the metric components:
︡40a8892c-997e-4d13-a2c6-a74ab655c246︡︡{"done":true,"html":"We may factorize the metric components:
"} ︠95f85761-115b-41d2-ac7d-0faa57399deas︠ g[1,1].factor() ; g[2,2].factor() ︡fa2f29d6-e4d2-4f15-b378-63905b4ab201︡︡{"html":"A matrix view of the components of $g$ in the manifold's default frame:
︡ea4381b0-2b1b-4d01-a42d-c9e452a1fd7f︡︡{"done":true,"html":"A matrix view of the components of $g$ in the manifold's default frame:
"} ︠5debab2b-793b-40ee-ba49-eaaa35d84eaas︠ g[:] ︡cd674c74-3e92-458e-87ba-327467aa8788︡︡{"html":"Display in terms of the vector frame $(V, (\partial_{x'}, \partial_{y'}))$:
︡a3cfb4f7-3321-40c6-974d-afabc78631a7︡︡{"done":true,"html":"Display in terms of the vector frame $(V, (\\partial_{x'}, \\partial_{y'}))$:
"} ︠a00750d4-1373-4223-bb40-4fc733775cbbs︠ g.display(stereoS.frame()) ︡2766ba5c-fbaf-41f9-8788-ccd891bdaf97︡︡{"html":"The metric acts on vector field pairs, resulting in a scalar field:
︡0ee246d7-c5fc-4acd-ace5-992b67617372︡︡{"done":true,"html":"The metric acts on vector field pairs, resulting in a scalar field:
"} ︠9ebe46a1-2393-47e1-a868-d018117ed68es︠ print g(v,v) ︡d744f729-b1df-4e51-bc90-096507830cc3︡︡{"stdout":"scalar field 'g(v,v)' on the 2-dimensional manifold 'S^2'","done":false}︡{"stdout":"\n","done":false}︡{"done":true} ︠6afb8cb6-54a5-46d3-9378-153eaeaed79cs︠ g(v,v).parent() ︡778d34a8-b478-40f4-9a29-f1b7dc0abb74︡︡{"html":"The Levi-Civitation connection associated with the metric $g$:
︡eeec2768-8994-478e-8809-f88021db777e︡︡{"done":true,"html":"The Levi-Civitation connection associated with the metric $g$:
"} ︠a529d4f4-bcb7-44bd-8319-7cd19085c966s︠ nab = g.connection() print nab nab ︡a84f4c66-c923-4fc5-a682-0d9a720456cb︡︡{"stdout":"Levi-Civita connection 'nabla_g' associated with the Riemannian metric 'g' on the 2-dimensional manifold 'S^2'\n","done":false}︡{"html":"As a test, we verify that $\nabla_g$ acting on $g$ results in zero:
︡8c6023df-085a-411c-a362-d139e9f3efa7︡︡{"done":true,"html":"As a test, we verify that $\\nabla_g$ acting on $g$ results in zero:
"} ︠95e8edf8-95b6-4375-9869-c3ca91acc1efs︠ nab(g).display() ︡aeed7744-b985-4ede-a439-b724c7c1d3dd︡︡{"html":"The nonzero Christoffel symbols of $g$ (skipping those that can be deduced by symmetry on the last two indices) w.r.t. two charts:
︡0e8f8230-67f9-4629-a79a-1f38b74d20ea︡︡{"done":true,"html":"The nonzero Christoffel symbols of $g$ (skipping those that can be deduced by symmetry on the last two indices) w.r.t. two charts:
"} ︠34aa556d-1581-43d6-908c-9a2872845a4fs︠ g.christoffel_symbols_display(chart=stereoN) ︡37cb3119-1481-4795-a79a-2fcc0ff4befc︡︡{"html":"$\nabla_g$ acting on the vector field $v$:
︡c2af863d-8aca-42f7-ac59-2a75625f6566︡︡{"done":true,"html":"$\\nabla_g$ acting on the vector field $v$:
"} ︠bc78f362-2138-4a2e-a45b-a01caabbf15fs︠ print nab(v) ︡36d68e34-094c-4625-a1a0-b891f8b1e7dd︡︡{"stdout":"tensor field 'nabla_g v' of type (1,1) on the 2-dimensional manifold 'S^2'","done":false}︡{"stdout":"\n","done":false}︡{"done":true} ︠152beedf-71ac-4a0a-86ec-92c66dcc402fs︠ nab(v).display(stereoN.frame()) ︡02c8e54f-b4c7-4a78-8642-f3d7ccc7555a︡︡{"html":"The Riemann tensor associated with the metric $g$:
︡9e7626ae-8de4-4e7b-8004-d3f56dbaa66f︡︡{"done":true,"html":"The Riemann tensor associated with the metric $g$:
"} ︠1585fea7-eae2-4132-a201-3996d3ed0c8as︠ Riem = g.riemann() print Riem Riem.display() ︡903b7500-8932-4427-afee-e623531585ca︡︡{"stdout":"tensor field 'Riem(g)' of type (1,3) on the 2-dimensional manifold 'S^2'\n","done":false}︡{"html":"The components of the Riemann tensor in the default frame on $\mathbb{S}^2$:
︡4530de5f-3e49-4234-bf1d-0e2555a6d4cd︡︡{"done":true,"html":"The components of the Riemann tensor in the default frame on $\\mathbb{S}^2$:
"} ︠5b574048-33d1-4361-b3d1-cfb4f0364f9fs︠ Riem.display_comp() ︡1bf5dd89-c4c0-411a-abc4-f1995d1298e7︡︡{"html":"The components in the frame associated with spherical coordinates:
︡e3b40476-f98f-43ce-98b3-9b63207646be︡︡{"done":true,"html":"The components in the frame associated with spherical coordinates:
"} ︠2905cd77-15c4-4d99-865c-61b2ab2fae58s︠ Riem.display_comp(spher.frame(), chart=spher) ︡b4837292-765a-4891-ae76-808c99354e56︡︡{"html":"The Riemann tensor associated with the Euclidean metric $h$ on $\mathbb{R}^3$:
︡204e8c45-8ad7-424d-9ef1-e56eafc5bec7︡︡{"done":true,"html":"The Riemann tensor associated with the Euclidean metric $h$ on $\\mathbb{R}^3$:
"} ︠5ab88dd4-a825-4e8f-a415-17179caef2ces︠ h.riemann().display() ︡7b0b9c7a-2d41-4afb-b805-3206e0205c7c︡︡{"html":"The Ricci tensor and the Ricci scalar:
︡bf51e1df-7706-4639-89bf-9d5324718a48︡︡{"done":true,"html":"The Ricci tensor and the Ricci scalar:
"} ︠df7dadc3-fc54-45bf-8c9a-840f1c59b527s︠ Ric = g.ricci() Ric.display() ︡1bb6b4a7-56a8-44dc-8d48-7fcc67ea1b7f︡︡{"html":"Hence we recover the fact that $(\mathbb{S}^2,g)$ is a Riemannian manifold of constant positive curvature.
In dimension 2, the Riemann curvature tensor is entirely determined by the Ricci scalar $R$ according to
$R^i_{\ \, jlk} = \frac{R}{2} \left( \delta^i_{\ \, k} g_{jl} - \delta^i_{\ \, l} g_{jk} \right)$
Let us check this formula here, under the form $R^i_{\ \, jlk} = -R g_{j[k} \delta^i_{\ \, l]}$:
︡c2ed8d15-94e9-40b4-a512-f27019e0f9bb︡︡{"done":true,"html":"Hence we recover the fact that $(\\mathbb{S}^2,g)$ is a Riemannian manifold of constant positive curvature.
\nIn dimension 2, the Riemann curvature tensor is entirely determined by the Ricci scalar $R$ according to
\n$R^i_{\\ \\, jlk} = \\frac{R}{2} \\left( \\delta^i_{\\ \\, k} g_{jl} - \\delta^i_{\\ \\, l} g_{jk} \\right)$
\nLet us check this formula here, under the form $R^i_{\\ \\, jlk} = -R g_{j[k} \\delta^i_{\\ \\, l]}$:
"} ︠25cc3479-dcd2-4c39-93b9-fc2423adf95fs︠ delta = S2.tangent_identity_field() Riem == - R*(g*delta).antisymmetrize(2,3) ︡b09669c7-1447-4314-8aa0-6f33490159b7︡︡{"html":"Similarly the relation $\mathrm{Ric} = (R/2)\; g$ must hold:
︡0aa494d9-b557-4789-a037-058d3f1b47f1︡︡{"done":true,"html":"Similarly the relation $\\mathrm{Ric} = (R/2)\\; g$ must hold:
"} ︠5df081b8-359d-4b6f-8918-d0b92b01dfc1s︠ Ric == (R/2)*g ︡b0248bb6-8d35-4d49-b522-dbdb6e1a9e01︡︡{"html":"The Levi-Civita tensor associated with $g$:
︡9153fc4d-1d65-4139-b103-c82266e11791︡︡{"done":true,"html":"The Levi-Civita tensor associated with $g$:
"} ︠0f9b0452-2e1b-4b4d-be2c-4dede02b2c54s︠ eps = g.volume_form() print eps eps.display() ︡c926b945-5822-46c4-97ed-a61449d52c8b︡︡{"stdout":"2-form 'eps_g' on the 2-dimensional manifold 'S^2'\n","done":false}︡{"html":"The exterior derivative of the 2-form $\epsilon_g$:
︡c6ac1194-3947-45ac-9970-5ebf9847abdc︡︡{"done":true,"html":"The exterior derivative of the 2-form $\\epsilon_g$:
"} ︠52025e93-f4e7-40cd-bb86-46afb8bddf56s︠ print eps.exterior_der() ︡977b82de-df01-435e-b510-e470a5456b82︡︡{"stdout":"3-form 'deps_g' on the 2-dimensional manifold 'S^2'\n","done":false}︡{"done":true} ︠b2ebaf25-1c8b-4ccb-b3d3-38da90b4cc89i︠ %htmlOf course, since $\mathbb{S}^2$ has dimension 2, all 3-forms vanish identically:
︡9e9730f7-173c-4b3b-8fc5-c5b3d30ae3a1︡︡{"done":true,"html":"Of course, since $\\mathbb{S}^2$ has dimension 2, all 3-forms vanish identically:
"} ︠4a32641f-2d22-4600-b9d6-b0f3eb055030s︠ eps.exterior_der().display() ︡6fccb41f-0a0f-47f8-89af-943038140e83︡︡{"html":"Up to know, all the vector frames introduced on $\mathbb{S}^2$ have been coordinate frames. Let us introduce a non-coordinate frame on the open subset $A$. To ease the notations, we change first the default chart and default frame on $A$ to the spherical coordinate ones:
︡d555706e-c5a2-4c89-a38d-947ab05248c1︡︡{"done":true,"html":"Up to know, all the vector frames introduced on $\\mathbb{S}^2$ have been coordinate frames. Let us introduce a non-coordinate frame on the open subset $A$. To ease the notations, we change first the default chart and default frame on $A$ to the spherical coordinate ones:
"} ︠55066bf0-58f6-460c-ae68-372602e54856s︠ A.default_chart() ︡cc7295a7-8a7c-4267-b165-a86277f52aec︡︡{"html":"We define the new frame $e$ by relating it the coordinate frame $\left(\frac{\partial}{\partial\theta}, \frac{\partial}{\partial\phi}\right)$ via a field of tangent-space automorphisms:
︡7f116ba4-2be4-4d21-83ae-c03722250c06︡︡{"done":true,"html":"We define the new frame $e$ by relating it the coordinate frame $\\left(\\frac{\\partial}{\\partial\\theta}, \\frac{\\partial}{\\partial\\phi}\\right)$ via a field of tangent-space automorphisms:
"} ︠8adaafbb-252b-46ee-884a-394e23709dd0s︠ a = A.automorphism_field() a[1,1], a[2,2] = 1, 1/sin(th) a.display() ︡1725a02e-390d-4c84-b584-0bfefcd6ff19︡︡{"html":"The new frame is an orthonormal frame for the metric $g$:
︡441b95a0-e3ac-414a-b920-5078eadfdb03︡︡{"done":true,"html":"The new frame is an orthonormal frame for the metric $g$:
"} ︠4fa83555-5793-44cb-8229-d1be945e5865s︠ g(e[1],e[1]).expr() ︡2887cd28-4f91-48b7-a617-88cb167f92c3︡︡{"html":"It is non-holonomic: its structure coefficients are not identically zero:
︡81afbcfd-7e60-4d31-ad27-8ee0db9d05e6︡︡{"done":true,"html":"It is non-holonomic: its structure coefficients are not identically zero:
"} ︠b33346ad-9f4e-4e1a-80a0-c9037a2de622s︠ e.structure_coef()[:] ︡60515e20-38ba-4177-85d7-7da16b6705e9︡︡{"html":"while we have of course
︡86e3efe7-56e5-4aea-9683-70a3ba5ad5cc︡︡{"done":true,"html":"while we have of course
"} ︠41c53f9a-dfc5-40dc-9bf9-9ccbe15f3bfbs︠ spher.frame().structure_coef()[:] ︡7d8292ea-81ad-43fe-a9b8-2631a1d45641︡︡{"html":"