5 | | import sage.all |
6 | | from sage.manifolds.differentiable.examples.sphere import Sphere |
7 | | |
8 | | M = Sphere(2) |
9 | | M.stereographic_coordinates() |
10 | | |
11 | | print("Metric") |
12 | | for restr in M.metric()._restrictions.values(): |
13 | | print(restr) |
14 | | for comp in restr._components: |
15 | | print(comp) |
16 | | |
17 | | print("Volume form") |
18 | | for restr in M.metric().volume_form()._restrictions.values(): |
19 | | print(restr) |
20 | | for comp in restr._components: |
21 | | print(comp) |
22 | | |
23 | | print("Metric") |
24 | | for restr in M.metric()._restrictions.values(): |
25 | | print(restr) |
26 | | for comp in restr._components: |
27 | | print(comp) |
| 5 | sage: M = manifolds.Sphere(2) |
| 6 | sage: XN = M.stereographic_coordinates(pole='north') |
| 7 | sage: g = M.metric() |
| 8 | sage: U = XN.domain(); U |
| 9 | Open subset S^2-{NP} of the 2-sphere S^2 of radius 1 smoothly embedded in the |
| 10 | Euclidean space E^3 |
| 11 | sage: g.restrict(U).display() |
| 12 | g = (cos(theta)^2 - 2*cos(theta) + 1) dy1⊗dy1 |
| 13 | + (cos(theta)^2 - 2*cos(theta) + 1) dy2⊗dy2 |
29 | | produces the output |
30 | | {{{ |
31 | | Metric |
32 | | Riemannian metric g on the Open subset A of the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3 |
33 | | Coordinate frame (A, (∂/∂theta,∂/∂phi)) |
34 | | Riemannian metric g on the Open subset S^2-{NP} of the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3 |
35 | | Coordinate frame (S^2-{NP}, (∂/∂y1,∂/∂y2)) |
36 | | Riemannian metric g on the Open subset S^2-{SP} of the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3 |
37 | | Coordinate frame (S^2-{SP}, (∂/∂yp1,∂/∂yp2)) |
38 | | |
39 | | Volume form |
40 | | 2-form eps_g on the Open subset S^2-{SP} of the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3 |
41 | | Coordinate frame (S^2-{SP}, (∂/∂yp1,∂/∂yp2)) |
42 | | 2-form eps_g on the Open subset S^2-{NP} of the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3 |
43 | | Vector frame (S^2-{NP}, (f_1,f_2)) |
44 | | |
45 | | Metric |
46 | | Riemannian metric g on the Open subset A of the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3 |
47 | | Coordinate frame (A, (∂/∂theta,∂/∂phi)) |
48 | | Riemannian metric g on the Open subset S^2-{NP} of the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3 |
49 | | Coordinate frame (S^2-{NP}, (∂/∂y1,∂/∂y2)) |
50 | | Vector frame (S^2-{NP}, (f_1,f_2)) |
51 | | Riemannian metric g on the Open subset S^2-{SP} of the 2-sphere S^2 of radius 1 smoothly embedded in the Euclidean space E^3 |
52 | | Coordinate frame (S^2-{SP}, (∂/∂yp1,∂/∂yp2)) |
53 | | }}} |
54 | | As one can see, the volume form has components with respect to a coordinate frame on S2-{SP} but with respect to a vector frame on S2-{NP}. |
55 | | Also the metric itself is updated by the calculation of the volume form to have components with respect to both both frames. |
56 | | |
57 | | I'm not sure if that's a bug indeed or the expected behavior but I found it a bit strange. In the context of #30362 it leads to issues as I want to calculate contractions of certain forms, some of them only have components wrt to the vector frame (as they are derived from the volume form) while others have components only wrt to the coordinate frame. |
| 15 | One would certainly expect the components of g to be expressed in terms of (y1,y2), i.e. the chart XN, which is the only chart that covers entirely U = S^2-{NP}. |