passagemath-symbolics 10.6.43__cp314-cp314t-musllinux_1_2_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-symbolics might be problematic. Click here for more details.

Files changed (171) hide show
  1. passagemath_symbolics/__init__.py +3 -0
  2. passagemath_symbolics-10.6.43.dist-info/METADATA +187 -0
  3. passagemath_symbolics-10.6.43.dist-info/RECORD +171 -0
  4. passagemath_symbolics-10.6.43.dist-info/WHEEL +5 -0
  5. passagemath_symbolics-10.6.43.dist-info/top_level.txt +3 -0
  6. sage/all__sagemath_symbolics.py +17 -0
  7. sage/calculus/all.py +14 -0
  8. sage/calculus/calculus.py +2826 -0
  9. sage/calculus/desolvers.py +1866 -0
  10. sage/calculus/predefined.py +51 -0
  11. sage/calculus/tests.py +225 -0
  12. sage/calculus/var.cpython-314t-x86_64-linux-musl.so +0 -0
  13. sage/calculus/var.pyx +401 -0
  14. sage/dynamics/all__sagemath_symbolics.py +6 -0
  15. sage/dynamics/complex_dynamics/all.py +5 -0
  16. sage/dynamics/complex_dynamics/mandel_julia.py +765 -0
  17. sage/dynamics/complex_dynamics/mandel_julia_helper.cpython-314t-x86_64-linux-musl.so +0 -0
  18. sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +1035 -0
  19. sage/ext/all__sagemath_symbolics.py +1 -0
  20. sage/ext_data/kenzo/CP2.txt +45 -0
  21. sage/ext_data/kenzo/CP3.txt +349 -0
  22. sage/ext_data/kenzo/CP4.txt +4774 -0
  23. sage/ext_data/kenzo/README.txt +49 -0
  24. sage/ext_data/kenzo/S4.txt +20 -0
  25. sage/ext_data/magma/latex/latex.m +1021 -0
  26. sage/ext_data/magma/latex/latex.spec +1 -0
  27. sage/ext_data/magma/sage/basic.m +356 -0
  28. sage/ext_data/magma/sage/sage.spec +1 -0
  29. sage/ext_data/magma/spec +9 -0
  30. sage/geometry/all__sagemath_symbolics.py +8 -0
  31. sage/geometry/hyperbolic_space/all.py +5 -0
  32. sage/geometry/hyperbolic_space/hyperbolic_coercion.py +743 -0
  33. sage/geometry/hyperbolic_space/hyperbolic_constants.py +5 -0
  34. sage/geometry/hyperbolic_space/hyperbolic_geodesic.py +2409 -0
  35. sage/geometry/hyperbolic_space/hyperbolic_interface.py +206 -0
  36. sage/geometry/hyperbolic_space/hyperbolic_isometry.py +1082 -0
  37. sage/geometry/hyperbolic_space/hyperbolic_model.py +1502 -0
  38. sage/geometry/hyperbolic_space/hyperbolic_point.py +621 -0
  39. sage/geometry/riemannian_manifolds/all.py +7 -0
  40. sage/geometry/riemannian_manifolds/parametrized_surface3d.py +1632 -0
  41. sage/geometry/riemannian_manifolds/surface3d_generators.py +461 -0
  42. sage/interfaces/all__sagemath_symbolics.py +1 -0
  43. sage/interfaces/magma.py +3017 -0
  44. sage/interfaces/magma_free.py +92 -0
  45. sage/interfaces/maple.py +1397 -0
  46. sage/interfaces/mathematica.py +1345 -0
  47. sage/interfaces/mathics.py +1312 -0
  48. sage/interfaces/sympy.py +1398 -0
  49. sage/interfaces/sympy_wrapper.py +197 -0
  50. sage/interfaces/tides.py +938 -0
  51. sage/libs/all__sagemath_symbolics.py +6 -0
  52. sage/manifolds/all.py +7 -0
  53. sage/manifolds/calculus_method.py +555 -0
  54. sage/manifolds/catalog.py +437 -0
  55. sage/manifolds/chart.py +4019 -0
  56. sage/manifolds/chart_func.py +3419 -0
  57. sage/manifolds/continuous_map.py +2183 -0
  58. sage/manifolds/continuous_map_image.py +155 -0
  59. sage/manifolds/differentiable/affine_connection.py +2475 -0
  60. sage/manifolds/differentiable/all.py +1 -0
  61. sage/manifolds/differentiable/automorphismfield.py +1383 -0
  62. sage/manifolds/differentiable/automorphismfield_group.py +604 -0
  63. sage/manifolds/differentiable/bundle_connection.py +1445 -0
  64. sage/manifolds/differentiable/characteristic_cohomology_class.py +1840 -0
  65. sage/manifolds/differentiable/chart.py +1241 -0
  66. sage/manifolds/differentiable/curve.py +1028 -0
  67. sage/manifolds/differentiable/de_rham_cohomology.py +541 -0
  68. sage/manifolds/differentiable/degenerate.py +559 -0
  69. sage/manifolds/differentiable/degenerate_submanifold.py +1671 -0
  70. sage/manifolds/differentiable/diff_form.py +1658 -0
  71. sage/manifolds/differentiable/diff_form_module.py +1062 -0
  72. sage/manifolds/differentiable/diff_map.py +1315 -0
  73. sage/manifolds/differentiable/differentiable_submanifold.py +291 -0
  74. sage/manifolds/differentiable/examples/all.py +1 -0
  75. sage/manifolds/differentiable/examples/euclidean.py +2517 -0
  76. sage/manifolds/differentiable/examples/real_line.py +897 -0
  77. sage/manifolds/differentiable/examples/sphere.py +1186 -0
  78. sage/manifolds/differentiable/examples/symplectic_space.py +187 -0
  79. sage/manifolds/differentiable/examples/symplectic_space_test.py +40 -0
  80. sage/manifolds/differentiable/integrated_curve.py +4035 -0
  81. sage/manifolds/differentiable/levi_civita_connection.py +841 -0
  82. sage/manifolds/differentiable/manifold.py +4254 -0
  83. sage/manifolds/differentiable/manifold_homset.py +1826 -0
  84. sage/manifolds/differentiable/metric.py +3032 -0
  85. sage/manifolds/differentiable/mixed_form.py +1507 -0
  86. sage/manifolds/differentiable/mixed_form_algebra.py +559 -0
  87. sage/manifolds/differentiable/multivector_module.py +800 -0
  88. sage/manifolds/differentiable/multivectorfield.py +1520 -0
  89. sage/manifolds/differentiable/poisson_tensor.py +268 -0
  90. sage/manifolds/differentiable/pseudo_riemannian.py +755 -0
  91. sage/manifolds/differentiable/pseudo_riemannian_submanifold.py +1839 -0
  92. sage/manifolds/differentiable/scalarfield.py +1343 -0
  93. sage/manifolds/differentiable/scalarfield_algebra.py +472 -0
  94. sage/manifolds/differentiable/symplectic_form.py +910 -0
  95. sage/manifolds/differentiable/symplectic_form_test.py +220 -0
  96. sage/manifolds/differentiable/tangent_space.py +412 -0
  97. sage/manifolds/differentiable/tangent_vector.py +616 -0
  98. sage/manifolds/differentiable/tensorfield.py +4665 -0
  99. sage/manifolds/differentiable/tensorfield_module.py +963 -0
  100. sage/manifolds/differentiable/tensorfield_paral.py +2450 -0
  101. sage/manifolds/differentiable/tensorfield_paral_test.py +16 -0
  102. sage/manifolds/differentiable/vector_bundle.py +1728 -0
  103. sage/manifolds/differentiable/vectorfield.py +1717 -0
  104. sage/manifolds/differentiable/vectorfield_module.py +2445 -0
  105. sage/manifolds/differentiable/vectorframe.py +1832 -0
  106. sage/manifolds/family.py +270 -0
  107. sage/manifolds/local_frame.py +1490 -0
  108. sage/manifolds/manifold.py +3090 -0
  109. sage/manifolds/manifold_homset.py +452 -0
  110. sage/manifolds/operators.py +359 -0
  111. sage/manifolds/point.py +994 -0
  112. sage/manifolds/scalarfield.py +3718 -0
  113. sage/manifolds/scalarfield_algebra.py +629 -0
  114. sage/manifolds/section.py +3111 -0
  115. sage/manifolds/section_module.py +831 -0
  116. sage/manifolds/structure.py +229 -0
  117. sage/manifolds/subset.py +2764 -0
  118. sage/manifolds/subsets/all.py +1 -0
  119. sage/manifolds/subsets/closure.py +131 -0
  120. sage/manifolds/subsets/pullback.py +885 -0
  121. sage/manifolds/topological_submanifold.py +891 -0
  122. sage/manifolds/trivialization.py +733 -0
  123. sage/manifolds/utilities.py +1348 -0
  124. sage/manifolds/vector_bundle.py +1342 -0
  125. sage/manifolds/vector_bundle_fiber.py +332 -0
  126. sage/manifolds/vector_bundle_fiber_element.py +111 -0
  127. sage/matrix/all__sagemath_symbolics.py +1 -0
  128. sage/matrix/matrix_symbolic_dense.cpython-314t-x86_64-linux-musl.so +0 -0
  129. sage/matrix/matrix_symbolic_dense.pxd +6 -0
  130. sage/matrix/matrix_symbolic_dense.pyx +1022 -0
  131. sage/matrix/matrix_symbolic_sparse.cpython-314t-x86_64-linux-musl.so +0 -0
  132. sage/matrix/matrix_symbolic_sparse.pxd +6 -0
  133. sage/matrix/matrix_symbolic_sparse.pyx +1029 -0
  134. sage/modules/all__sagemath_symbolics.py +1 -0
  135. sage/modules/vector_callable_symbolic_dense.py +105 -0
  136. sage/modules/vector_symbolic_dense.py +116 -0
  137. sage/modules/vector_symbolic_sparse.py +118 -0
  138. sage/rings/all__sagemath_symbolics.py +4 -0
  139. sage/rings/asymptotic/all.py +6 -0
  140. sage/rings/asymptotic/asymptotic_expansion_generators.py +1485 -0
  141. sage/rings/asymptotic/asymptotic_ring.py +4858 -0
  142. sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py +4153 -0
  143. sage/rings/asymptotic/growth_group.py +5373 -0
  144. sage/rings/asymptotic/growth_group_cartesian.py +1400 -0
  145. sage/rings/asymptotic/term_monoid.py +5237 -0
  146. sage/rings/function_field/all__sagemath_symbolics.py +2 -0
  147. sage/rings/polynomial/all__sagemath_symbolics.py +1 -0
  148. sage/symbolic/all.py +15 -0
  149. sage/symbolic/assumptions.py +985 -0
  150. sage/symbolic/benchmark.py +93 -0
  151. sage/symbolic/callable.py +459 -0
  152. sage/symbolic/complexity_measures.py +35 -0
  153. sage/symbolic/constants.py +1287 -0
  154. sage/symbolic/expression_conversion_algebraic.py +310 -0
  155. sage/symbolic/expression_conversion_sympy.py +317 -0
  156. sage/symbolic/expression_conversions.py +1713 -0
  157. sage/symbolic/function_factory.py +355 -0
  158. sage/symbolic/integration/all.py +1 -0
  159. sage/symbolic/integration/external.py +270 -0
  160. sage/symbolic/integration/integral.py +1115 -0
  161. sage/symbolic/maxima_wrapper.py +162 -0
  162. sage/symbolic/operators.py +267 -0
  163. sage/symbolic/random_tests.py +462 -0
  164. sage/symbolic/relation.py +1907 -0
  165. sage/symbolic/ring.cpython-314t-x86_64-linux-musl.so +0 -0
  166. sage/symbolic/ring.pxd +5 -0
  167. sage/symbolic/ring.pyx +1396 -0
  168. sage/symbolic/subring.py +1025 -0
  169. sage/symbolic/symengine.py +19 -0
  170. sage/symbolic/tests.py +40 -0
  171. sage/symbolic/units.py +1470 -0
@@ -0,0 +1,1490 @@
1
+ # sage_setup: distribution = sagemath-symbolics
2
+ r"""
3
+ Local Frames
4
+
5
+ The class :class:`LocalFrame` implements local frames on vector bundles
6
+ (see :class:`~sage.manifolds.vector_bundle.TopologicalVectorBundle` or
7
+ :class:`~sage.manifolds.differentiable.vector_bundle.DifferentiableVectorBundle`).
8
+
9
+ For `k=0,1,\dots`, a *local frame* on a vector bundle `E \to M` of class `C^k`
10
+ and rank `n` is a local section `(e_1,\dots,e_n):U \to E^n` of class `C^k`
11
+ defined on some subset `U` of the base space `M`, such that `e(p)` is a basis of
12
+ the fiber `E_p` for any `p \in U`.
13
+
14
+ AUTHORS:
15
+
16
+ - Michael Jung (2019): initial version
17
+
18
+ EXAMPLES:
19
+
20
+ Defining a global frame on a topological vector bundle of rank 3::
21
+
22
+ sage: M = Manifold(3, 'M', structure='top')
23
+ sage: E = M.vector_bundle(3, 'E')
24
+ sage: e = E.local_frame('e'); e
25
+ Local frame (E|_M, (e_0,e_1,e_2))
26
+
27
+ This frame is now the default frame of the corresponding section module and
28
+ saved in the vector bundle::
29
+
30
+ sage: e in E.frames()
31
+ True
32
+ sage: sec_module = E.section_module(); sec_module
33
+ Free module C^0(M;E) of sections on the 3-dimensional topological manifold M
34
+ with values in the real vector bundle E of rank 3
35
+ sage: sec_module.default_basis()
36
+ Local frame (E|_M, (e_0,e_1,e_2))
37
+
38
+ However, the default frame can be changed::
39
+
40
+ sage: sec_module.set_default_basis(e)
41
+ sage: sec_module.default_basis()
42
+ Local frame (E|_M, (e_0,e_1,e_2))
43
+
44
+ The elements of a local frame are local sections in the vector bundle::
45
+
46
+ sage: for vec in e:
47
+ ....: print(vec)
48
+ Section e_0 on the 3-dimensional topological manifold M with values in the
49
+ real vector bundle E of rank 3
50
+ Section e_1 on the 3-dimensional topological manifold M with values in the
51
+ real vector bundle E of rank 3
52
+ Section e_2 on the 3-dimensional topological manifold M with values in the
53
+ real vector bundle E of rank 3
54
+
55
+ Each element of a vector frame can be accessed by its index::
56
+
57
+ sage: e[0]
58
+ Section e_0 on the 3-dimensional topological manifold M with values in the
59
+ real vector bundle E of rank 3
60
+
61
+ The slice operator ``:`` can be used to access to more than one element::
62
+
63
+ sage: e[0:2]
64
+ (Section e_0 on the 3-dimensional topological manifold M with values in the
65
+ real vector bundle E of rank 3,
66
+ Section e_1 on the 3-dimensional topological manifold M with values in the
67
+ real vector bundle E of rank 3)
68
+ sage: e[:]
69
+ (Section e_0 on the 3-dimensional topological manifold M with values in the
70
+ real vector bundle E of rank 3,
71
+ Section e_1 on the 3-dimensional topological manifold M with values in the
72
+ real vector bundle E of rank 3,
73
+ Section e_2 on the 3-dimensional topological manifold M with values in the
74
+ real vector bundle E of rank 3)
75
+
76
+ The index range depends on the starting index defined on the manifold::
77
+
78
+ sage: M = Manifold(3, 'M', structure='top', start_index=1)
79
+ sage: c_xyz.<x,y,z> = M.chart()
80
+ sage: U = M.open_subset('U')
81
+ sage: c_xyz_U = c_xyz.restrict(U)
82
+ sage: E = M.vector_bundle(3, 'E')
83
+ sage: e = E.local_frame('e', domain=U); e
84
+ Local frame (E|_U, (e_1,e_2,e_3))
85
+ sage: [e[i] for i in M.irange()]
86
+ [Section e_1 on the Open subset U of the 3-dimensional topological manifold
87
+ M with values in the real vector bundle E of rank 3,
88
+ Section e_2 on the Open subset U of the 3-dimensional topological manifold
89
+ M with values in the real vector bundle E of rank 3,
90
+ Section e_3 on the Open subset U of the 3-dimensional topological manifold
91
+ M with values in the real vector bundle E of rank 3]
92
+ sage: e[1], e[2], e[3]
93
+ (Section e_1 on the Open subset U of the 3-dimensional topological manifold
94
+ M with values in the real vector bundle E of rank 3,
95
+ Section e_2 on the Open subset U of the 3-dimensional topological manifold
96
+ M with values in the real vector bundle E of rank 3,
97
+ Section e_3 on the Open subset U of the 3-dimensional topological manifold
98
+ M with values in the real vector bundle E of rank 3)
99
+
100
+ Let us check that the local sections ``e[i]`` are indeed the frame vectors
101
+ from their components with respect to the frame `e`::
102
+
103
+ sage: e[1].comp(e)[:]
104
+ [1, 0, 0]
105
+ sage: e[2].comp(e)[:]
106
+ [0, 1, 0]
107
+ sage: e[3].comp(e)[:]
108
+ [0, 0, 1]
109
+
110
+ Defining a local frame on a vector bundle, the dual coframe is automatically
111
+ created, which, by default, bares the same name (here `e`)::
112
+
113
+ sage: E.coframes()
114
+ [Local coframe (E|_U, (e^1,e^2,e^3))]
115
+ sage: e_dual = E.coframes()[0] ; e_dual
116
+ Local coframe (E|_U, (e^1,e^2,e^3))
117
+ sage: e_dual is e.coframe()
118
+ True
119
+
120
+ Let us check that the coframe `(e^i)` is indeed the dual of the vector
121
+ frame `(e_i)`::
122
+
123
+ sage: e_dual[1](e[1]) # linear form e^1 applied to local section e_1
124
+ Scalar field e^1(e_1) on the Open subset U of the 3-dimensional topological
125
+ manifold M
126
+ sage: e_dual[1](e[1]).expr() # the explicit expression of e^1(e_1)
127
+ 1
128
+ sage: e_dual[1](e[1]).expr(), e_dual[1](e[2]).expr(), e_dual[1](e[3]).expr()
129
+ (1, 0, 0)
130
+ sage: e_dual[2](e[1]).expr(), e_dual[2](e[2]).expr(), e_dual[2](e[3]).expr()
131
+ (0, 1, 0)
132
+ sage: e_dual[3](e[1]).expr(), e_dual[3](e[2]).expr(), e_dual[3](e[3]).expr()
133
+ (0, 0, 1)
134
+
135
+ Via bundle automorphisms, a new frame can be created from an existing one::
136
+
137
+ sage: sec_module_U = E.section_module(domain=U)
138
+ sage: change_frame = sec_module_U.automorphism()
139
+ sage: change_frame[:] = [[0,1,0],[0,0,1],[1,0,0]]
140
+ sage: f = e.new_frame(change_frame, 'f'); f
141
+ Local frame (E|_U, (f_1,f_2,f_3))
142
+
143
+ A copy of this automorphism and its inverse is now part of the vector bundle's
144
+ frame changes::
145
+
146
+ sage: E.change_of_frame(e, f)
147
+ Automorphism of the Free module C^0(U;E) of sections on the Open subset U of
148
+ the 3-dimensional topological manifold M with values in the real vector
149
+ bundle E of rank 3
150
+ sage: E.change_of_frame(e, f) == change_frame
151
+ True
152
+ sage: E.change_of_frame(f, e) == change_frame.inverse()
153
+ True
154
+
155
+ Let us check the components of `f` with respect to the frame `e`::
156
+
157
+ sage: f[1].comp(e)[:]
158
+ [0, 0, 1]
159
+ sage: f[2].comp(e)[:]
160
+ [1, 0, 0]
161
+ sage: f[3].comp(e)[:]
162
+ [0, 1, 0]
163
+ """
164
+
165
+ # *****************************************************************************
166
+ # Copyright (C) 2013-2018 Eric Gourgoulhon <eric.gourgoulhon@obspm.fr>
167
+ # Copyright (C) 2019 Michael Jung <micjung@uni-potsdam.de>
168
+ #
169
+ # Distributed under the terms of the GNU General Public License (GPL)
170
+ # as published by the Free Software Foundation; either version 2 of
171
+ # the License, or (at your option) any later version.
172
+ # https://www.gnu.org/licenses/
173
+ # *****************************************************************************
174
+
175
+ from sage.tensor.modules.finite_rank_free_module import FiniteRankFreeModule
176
+ from sage.tensor.modules.free_module_basis import FreeModuleBasis, FreeModuleCoBasis
177
+
178
+
179
+ class LocalCoFrame(FreeModuleCoBasis):
180
+ r"""
181
+ Local coframe on a vector bundle.
182
+
183
+ A *local coframe* on a vector bundle `E \to M` of class `C^k` is a
184
+ local section `e^*: U \to E^n` of class `C^k` on some subset `U` of the base
185
+ space `M`, such that `e^*(p)` is a basis of the fiber `E^*_p` of the dual
186
+ bundle for any `p \in U`.
187
+
188
+ INPUT:
189
+
190
+ - ``frame`` -- the local frame dual to the coframe
191
+ - ``symbol`` -- either a string, to be used as a common base for the
192
+ symbols of the linear forms constituting the coframe, or a tuple of
193
+ strings, representing the individual symbols of the linear forms
194
+ - ``latex_symbol`` -- (default: ``None``) either a string, to be used
195
+ as a common base for the LaTeX symbols of the linear forms constituting
196
+ the coframe, or a tuple of strings, representing the individual LaTeX
197
+ symbols of the linear forms; if ``None``, ``symbol`` is used in place of
198
+ ``latex_symbol``
199
+ - ``indices`` -- (default: ``None``; used only if ``symbol`` is a single
200
+ string) tuple of strings representing the indices labelling the linear
201
+ forms of the coframe; if ``None``, the indices will be generated as
202
+ integers within the range declared on the coframe's domain
203
+ - ``latex_indices`` -- (default: ``None``) tuple of strings representing
204
+ the indices for the LaTeX symbols of the linear forms of the coframe; if
205
+ ``None``, ``indices`` is used instead
206
+
207
+ EXAMPLES:
208
+
209
+ Local coframe on a topological vector bundle of rank 3::
210
+
211
+ sage: M = Manifold(3, 'M', structure='top', start_index=1)
212
+ sage: X.<x,y,z> = M.chart()
213
+ sage: E = M.vector_bundle(3, 'E')
214
+ sage: e = E.local_frame('e')
215
+ sage: from sage.manifolds.local_frame import LocalCoFrame
216
+ sage: f = LocalCoFrame(e, 'f'); f
217
+ Local coframe (E|_M, (f^1,f^2,f^3))
218
+
219
+ The local coframe can also be obtained by using the method
220
+ :meth:`~sage.tensor.modules.free_module_basis.FreeModuleBasis.dual_basis` or
221
+ :meth:`~sage.manifolds.local_frame.LocalFrame.coframe`::
222
+
223
+ sage: e_dual = e.dual_basis(); e_dual
224
+ Local coframe (E|_M, (e^1,e^2,e^3))
225
+ sage: e_dual is e.coframe()
226
+ True
227
+ sage: e_dual is f
228
+ False
229
+ sage: e_dual[:] == f[:]
230
+ True
231
+ sage: f[1].display(e)
232
+ f^1 = e^1
233
+
234
+ The consisted linear forms can be obtained via the operator ``[]``::
235
+
236
+ sage: f[1], f[2], f[3]
237
+ (Linear form f^1 on the Free module C^0(M;E) of sections on the
238
+ 3-dimensional topological manifold M with values in the real vector
239
+ bundle E of rank 3,
240
+ Linear form f^2 on the Free module C^0(M;E) of sections on the
241
+ 3-dimensional topological manifold M with values in the real vector
242
+ bundle E of rank 3,
243
+ Linear form f^3 on the Free module C^0(M;E) of sections on the
244
+ 3-dimensional topological manifold M with values in the real vector
245
+ bundle E of rank 3)
246
+
247
+ Checking that `f` is the dual of `e`::
248
+
249
+ sage: f[1](e[1]).expr(), f[1](e[2]).expr(), f[1](e[3]).expr()
250
+ (1, 0, 0)
251
+ sage: f[2](e[1]).expr(), f[2](e[2]).expr(), f[2](e[3]).expr()
252
+ (0, 1, 0)
253
+ sage: f[3](e[1]).expr(), f[3](e[2]).expr(), f[3](e[3]).expr()
254
+ (0, 0, 1)
255
+ """
256
+ def __init__(self, frame, symbol, latex_symbol=None, indices=None,
257
+ latex_indices=None):
258
+ r"""
259
+ Construct a local coframe, dual to a given local frame.
260
+
261
+ TESTS::
262
+
263
+ sage: M = Manifold(3, 'M')
264
+ sage: E = M.vector_bundle(2, 'E')
265
+ sage: e = E.local_frame('e')
266
+ sage: from sage.manifolds.local_frame import LocalCoFrame
267
+ sage: f = LocalCoFrame(e, 'f'); f
268
+ Local coframe (E|_M, (f^0,f^1))
269
+ sage: TestSuite(f).run()
270
+ """
271
+ self._domain = frame.domain()
272
+ self._base_space = frame.base_space()
273
+ self._vbundle = frame.vector_bundle()
274
+ FreeModuleCoBasis.__init__(self, frame, symbol,
275
+ latex_symbol=latex_symbol, indices=indices,
276
+ latex_indices=latex_indices)
277
+ # The coframe is added to the vector bundle's set of coframes
278
+ self._vbundle._coframes.append(self)
279
+
280
+ def _repr_(self):
281
+ r"""
282
+ String representation of ``self``.
283
+
284
+ TESTS::
285
+
286
+ sage: M = Manifold(3, 'M', structure='top')
287
+ sage: E = M.vector_bundle(2, 'E')
288
+ sage: e = E.local_frame('e')
289
+ sage: f = e.coframe()
290
+ sage: f._repr_()
291
+ 'Local coframe (E|_M, (e^0,e^1))'
292
+ sage: repr(f) # indirect doctest
293
+ 'Local coframe (E|_M, (e^0,e^1))'
294
+ sage: f # indirect doctest
295
+ Local coframe (E|_M, (e^0,e^1))
296
+ """
297
+ desc = "Local coframe " + self._name
298
+ return desc
299
+
300
+ def at(self, point):
301
+ r"""
302
+ Return the value of ``self`` at a given point on the base space, this
303
+ value being a basis of the dual vector bundle at this point.
304
+
305
+ INPUT:
306
+
307
+ - ``point`` -- :class:`~sage.manifolds.point.ManifoldPoint`;
308
+ point `p` in the domain `U` of the coframe (denoted `f` hereafter)
309
+
310
+ OUTPUT:
311
+
312
+ - :class:`~sage.tensor.modules.free_module_basis.FreeModuleCoBasis`
313
+ representing the basis `f(p)` of the vector space `E^*_p`,
314
+ dual to the vector bundle fiber `E_p`
315
+
316
+ EXAMPLES:
317
+
318
+ Cobasis of a vector bundle fiber::
319
+
320
+ sage: M = Manifold(2, 'M', structure='top', start_index=1)
321
+ sage: X.<x,y> = M.chart()
322
+ sage: E = M.vector_bundle(2, 'E')
323
+ sage: e = E.local_frame('e')
324
+ sage: e_dual = e.coframe(); e_dual
325
+ Local coframe (E|_M, (e^1,e^2))
326
+ sage: p = M.point((-1,2), name='p')
327
+ sage: e_dual_p = e_dual.at(p) ; e_dual_p
328
+ Dual basis (e^1,e^2) on the Fiber of E at Point p on the
329
+ 2-dimensional topological manifold M
330
+ sage: type(e_dual_p)
331
+ <class 'sage.tensor.modules.free_module_basis.FreeModuleCoBasis_with_category'>
332
+ sage: e_dual_p[1]
333
+ Linear form e^1 on the Fiber of E at Point p on the 2-dimensional
334
+ topological manifold M
335
+ sage: e_dual_p[2]
336
+ Linear form e^2 on the Fiber of E at Point p on the 2-dimensional
337
+ topological manifold M
338
+ sage: e_dual_p is e.at(p).dual_basis()
339
+ True
340
+ """
341
+ return self._basis.at(point).dual_basis()
342
+
343
+ def set_name(self, symbol, latex_symbol=None, indices=None,
344
+ latex_indices=None, index_position='up',
345
+ include_domain=True):
346
+ r"""
347
+ Set (or change) the text name and LaTeX name of ``self``.
348
+
349
+ INPUT:
350
+
351
+ - ``symbol`` -- either a string, to be used as a common base for the
352
+ symbols of the linear forms constituting the coframe, or a list/tuple
353
+ of strings, representing the individual symbols of the linear forms
354
+ - ``latex_symbol`` -- (default: ``None``) either a string, to be used
355
+ as a common base for the LaTeX symbols of the linear forms
356
+ constituting the coframe, or a list/tuple of strings, representing the
357
+ individual LaTeX symbols of the linear forms; if ``None``, ``symbol``
358
+ is used in place of ``latex_symbol``
359
+ - ``indices`` -- (default: ``None``; used only if ``symbol`` is a
360
+ single string) tuple of strings representing the indices labelling
361
+ the linear forms of the coframe; if ``None``, the indices will be
362
+ generated as integers within the range declared on ``self``
363
+ - ``latex_indices`` -- (default: ``None``) tuple of strings
364
+ representing the indices for the LaTeX symbols of the linear forms;
365
+ if ``None``, ``indices`` is used instead
366
+ - ``index_position`` -- (default: ``'up'``) determines the position
367
+ of the indices labelling the linear forms of the coframe; can be
368
+ either ``'down'`` or ``'up'``
369
+ - ``include_domain`` -- boolean (default: ``True``); determining whether
370
+ the name of the domain is included in the beginning of the coframe
371
+ name
372
+
373
+ EXAMPLES::
374
+
375
+ sage: M = Manifold(3, 'M', structure='top')
376
+ sage: E = M.vector_bundle(2, 'E')
377
+ sage: e = E.local_frame('e').coframe(); e
378
+ Local coframe (E|_M, (e^0,e^1))
379
+ sage: e.set_name('f'); e
380
+ Local coframe (E|_M, (f^0,f^1))
381
+ sage: e.set_name('e', latex_symbol=r'\epsilon')
382
+ sage: latex(e)
383
+ \left(E|_{M}, \left(\epsilon^{0},\epsilon^{1}\right)\right)
384
+ sage: e.set_name('e', include_domain=False); e
385
+ Local coframe (e^0,e^1)
386
+ sage: e.set_name(['a', 'b'], latex_symbol=[r'\alpha', r'\beta']); e
387
+ Local coframe (E|_M, (a,b))
388
+ sage: latex(e)
389
+ \left(E|_{M}, \left(\alpha,\beta\right)\right)
390
+ sage: e.set_name('e', indices=['x','y'],
391
+ ....: latex_indices=[r'\xi', r'\zeta']); e
392
+ Local coframe (E|_M, (e^x,e^y))
393
+ sage: latex(e)
394
+ \left(E|_{M}, \left(e^{\xi},e^{\zeta}\right)\right)
395
+ """
396
+ super().set_name(symbol, latex_symbol=latex_symbol,
397
+ indices=indices,
398
+ latex_indices=latex_indices,
399
+ index_position=index_position)
400
+ if include_domain:
401
+ # Redefinition of the name and the LaTeX name to include the domain
402
+ self._name = "({}|_{}, {})".format(self._vbundle._name,
403
+ self._domain._name, self._name)
404
+ self._latex_name = r"\left({}|_{{{}}}, {}\right)".format(
405
+ self._vbundle._latex_name,
406
+ self._domain._latex_name,
407
+ self._latex_name)
408
+
409
+ #******************************************************************************
410
+
411
+
412
+ class LocalFrame(FreeModuleBasis):
413
+ r"""
414
+ Local frame on a vector bundle.
415
+
416
+ A *local frame* on a vector bundle `E \to M` of class `C^k` is a local
417
+ section `(e_1,\dots,e_n):U \to E^n` of class `C^k` defined on some subset `U`
418
+ of the base space `M`, such that `e(p)` is a basis of the fiber `E_p` for
419
+ any `p \in U`.
420
+
421
+ For each instantiation of a local frame, a local coframe is automatically
422
+ created, as an instance of the class :class:`LocalCoFrame`. It is returned
423
+ by the method :meth:`coframe`.
424
+
425
+ INPUT:
426
+
427
+ - ``section_module`` -- free module of local sections over `U` in the given
428
+ vector bundle `E \to M`
429
+ - ``symbol`` -- either a string, to be used as a common base for the
430
+ symbols of the local sections constituting the local frame, or a tuple
431
+ of strings, representing the individual symbols of the local sections
432
+ - ``latex_symbol`` -- (default: ``None``) either a string, to be used
433
+ as a common base for the LaTeX symbols of the local sections constituting
434
+ the local frame, or a tuple of strings, representing the individual
435
+ LaTeX symbols of the local sections; if ``None``, ``symbol`` is used in
436
+ place of ``latex_symbol``
437
+ - ``indices`` -- (default: ``None``; used only if ``symbol`` is a single
438
+ string) tuple of strings representing the indices labelling the local
439
+ sections of the frame; if ``None``, the indices will be generated as
440
+ integers within the range declared on the local frame's domain
441
+ - ``latex_indices`` -- (default: ``None``) tuple of strings representing
442
+ the indices for the LaTeX symbols of the local sections; if
443
+ ``None``, ``indices`` is used instead
444
+ - ``symbol_dual`` -- (default: ``None``) same as ``symbol`` but for the
445
+ dual coframe; if ``None``, ``symbol`` must be a string and is used
446
+ for the common base of the symbols of the elements of the dual coframe
447
+ - ``latex_symbol_dual`` -- (default: ``None``) same as ``latex_symbol``
448
+ but for the dual coframe
449
+
450
+ EXAMPLES:
451
+
452
+ Defining a local frame on a 3-dimensional vector bundle over a 3-dimensional
453
+ manifold::
454
+
455
+ sage: M = Manifold(3, 'M', start_index=1, structure='top')
456
+ sage: E = M.vector_bundle(3, 'E')
457
+ sage: e = E.local_frame('e'); e
458
+ Local frame (E|_M, (e_1,e_2,e_3))
459
+ sage: latex(e)
460
+ \left(E|_{M}, \left(e_{1},e_{2},e_{3}\right)\right)
461
+
462
+ The individual elements of the vector frame are accessed via square
463
+ brackets, with the possibility to invoke the slice operator '``:``' to
464
+ get more than a single element::
465
+
466
+ sage: e[2]
467
+ Section e_2 on the 3-dimensional topological manifold M with values in
468
+ the real vector bundle E of rank 3
469
+ sage: e[1:3]
470
+ (Section e_1 on the 3-dimensional topological manifold M with values in
471
+ the real vector bundle E of rank 3,
472
+ Section e_2 on the 3-dimensional topological manifold M with values in
473
+ the real vector bundle E of rank 3)
474
+ sage: e[:]
475
+ (Section e_1 on the 3-dimensional topological manifold M with values in
476
+ the real vector bundle E of rank 3,
477
+ Section e_2 on the 3-dimensional topological manifold M with values in
478
+ the real vector bundle E of rank 3,
479
+ Section e_3 on the 3-dimensional topological manifold M with values in
480
+ the real vector bundle E of rank 3)
481
+
482
+ The LaTeX symbol can be specified::
483
+
484
+ sage: eps = E.local_frame('eps', latex_symbol=r'\epsilon')
485
+ sage: latex(eps)
486
+ \left(E|_{M}, \left(\epsilon_{1},\epsilon_{2},\epsilon_{3}\right)\right)
487
+
488
+ By default, the elements of the local frame are labelled by integers
489
+ within the range specified at the manifold declaration. It is however
490
+ possible to fully customize the labels, via the argument ``indices``::
491
+
492
+ sage: u = E.local_frame('u', indices=('x', 'y', 'z')) ; u
493
+ Local frame (E|_M, (u_x,u_y,u_z))
494
+ sage: u[1]
495
+ Section u_x on the 3-dimensional topological manifold M with values in
496
+ the real vector bundle E of rank 3
497
+ sage: u.coframe()
498
+ Local coframe (E|_M, (u^x,u^y,u^z))
499
+
500
+ The LaTeX format of the indices can be adjusted::
501
+
502
+ sage: v = E.local_frame('v', indices=('a', 'b', 'c'),
503
+ ....: latex_indices=(r'\alpha', r'\beta', r'\gamma'))
504
+ sage: v
505
+ Local frame (E|_M, (v_a,v_b,v_c))
506
+ sage: latex(v)
507
+ \left(E|_{M}, \left(v_{\alpha},v_{\beta},v_{\gamma}\right)\right)
508
+ sage: latex(v.coframe())
509
+ \left(E|_{M}, \left(v^{\alpha},v^{\beta},v^{\gamma}\right)\right)
510
+
511
+ The symbol of each element of the local frame can also be freely chosen,
512
+ by providing a tuple of symbols as the first argument of ``local_frame``;
513
+ it is then mandatory to specify as well some symbols for the dual coframe::
514
+
515
+ sage: h = E.local_frame(('a', 'b', 'c'), symbol_dual=('A', 'B', 'C')); h
516
+ Local frame (E|_M, (a,b,c))
517
+ sage: h[1]
518
+ Section a on the 3-dimensional topological manifold M with values in the
519
+ real vector bundle E of rank 3
520
+ sage: h.coframe()
521
+ Local coframe (E|_M, (A,B,C))
522
+ sage: h.coframe()[1]
523
+ Linear form A on the Free module C^0(M;E) of sections on the
524
+ 3-dimensional topological manifold M with values in the real vector
525
+ bundle E of rank 3
526
+
527
+ Local frames are bases of free modules formed by local sections::
528
+
529
+ sage: N = Manifold(2, 'N', structure='top', start_index=1)
530
+ sage: X.<x,y> = N.chart()
531
+ sage: U = N.open_subset('U')
532
+ sage: F = N.vector_bundle(2, 'F')
533
+ sage: f = F.local_frame('f', domain=U)
534
+ sage: f.module()
535
+ Free module C^0(U;F) of sections on the Open subset U of the
536
+ 2-dimensional topological manifold N with values in the real vector
537
+ bundle F of rank 2
538
+ sage: f.module().base_ring()
539
+ Algebra of scalar fields on the Open subset U of the 2-dimensional
540
+ topological manifold N
541
+ sage: f.module() is F.section_module(domain=f.domain())
542
+ True
543
+ sage: f in F.section_module(domain=U).bases()
544
+ True
545
+
546
+ The value of the local frame at a given point is a basis of the
547
+ corresponding fiber::
548
+
549
+ sage: X_U = X.restrict(U) # We need coordinates on the subset
550
+ sage: p = N((0,1), name='p') ; p
551
+ Point p on the 2-dimensional topological manifold N
552
+ sage: f.at(p)
553
+ Basis (f_1,f_2) on the Fiber of F at Point p on the 2-dimensional
554
+ topological manifold N
555
+ """
556
+
557
+ # The following class attribute must be redefined by any derived class:
558
+ _cobasis_class = LocalCoFrame
559
+
560
+ @staticmethod
561
+ def __classcall_private__(cls, section_module, symbol,
562
+ latex_symbol=None, indices=None,
563
+ latex_indices=None, symbol_dual=None,
564
+ latex_symbol_dual=None):
565
+ """
566
+ Transform input lists into tuples for the unique representation of
567
+ LocalFrame.
568
+
569
+ TESTS::
570
+
571
+ sage: M = Manifold(3, 'M')
572
+ sage: E = M.vector_bundle(2, 'E')
573
+ sage: C0 = E.section_module(force_free=True)
574
+ sage: from sage.manifolds.local_frame import LocalFrame
575
+ sage: e = LocalFrame(C0, ['a', 'b'], symbol_dual=['A', 'B']); e
576
+ Local frame (E|_M, (a,b))
577
+ sage: e.dual_basis()
578
+ Local coframe (E|_M, (A,B))
579
+ sage: e is LocalFrame(C0, ('a', 'b'), symbol_dual=('A', 'B'))
580
+ True
581
+ """
582
+ if isinstance(symbol, list):
583
+ symbol = tuple(symbol)
584
+ if isinstance(latex_symbol, list):
585
+ latex_symbol = tuple(latex_symbol)
586
+ if isinstance(indices, list):
587
+ indices = tuple(indices)
588
+ if isinstance(latex_indices, list):
589
+ latex_indices = tuple(latex_indices)
590
+ if isinstance(symbol_dual, list):
591
+ symbol_dual = tuple(symbol_dual)
592
+ if isinstance(latex_symbol_dual, list):
593
+ latex_symbol_dual = tuple(latex_symbol_dual)
594
+ return super().__classcall__(cls, section_module,
595
+ symbol, latex_symbol=latex_symbol,
596
+ indices=indices,
597
+ latex_indices=latex_indices,
598
+ symbol_dual=symbol_dual,
599
+ latex_symbol_dual=latex_symbol_dual)
600
+
601
+ def __init__(self, section_module, symbol, latex_symbol=None, indices=None,
602
+ latex_indices=None, symbol_dual=None, latex_symbol_dual=None):
603
+ r"""
604
+ Construct a local frame on a vector bundle.
605
+
606
+ TESTS:
607
+
608
+ sage: M = Manifold(3, 'M')
609
+ sage: E = M.vector_bundle(2, 'E')
610
+ sage: C0 = E.section_module(force_free=True)
611
+ sage: from sage.manifolds.local_frame import LocalFrame
612
+ sage: e = LocalFrame(C0, 'e', latex_symbol=r'\epsilon'); e
613
+ Local frame (E|_M, (e_0,e_1))
614
+ sage: TestSuite(e).run()
615
+ """
616
+ ###
617
+ # Some sanity check:
618
+ if not isinstance(section_module, FiniteRankFreeModule):
619
+ raise ValueError("the {} has already been constructed as a "
620
+ "non-free module and therefore cannot have "
621
+ "a basis".format(section_module))
622
+ self._domain = section_module.domain()
623
+ self._base_space = section_module.base_space()
624
+ self._vbundle = section_module.vector_bundle()
625
+ FreeModuleBasis.__init__(self, section_module,
626
+ symbol, latex_symbol=latex_symbol,
627
+ indices=indices, latex_indices=latex_indices,
628
+ symbol_dual=symbol_dual,
629
+ latex_symbol_dual=latex_symbol_dual)
630
+ if self._vbundle._def_frame is None:
631
+ self._vbundle._def_frame = self
632
+ # The frame is added to the domain's modules of frames, as well as to
633
+ # all the superdomain's modules of frames; moreover the first defined
634
+ # frame is considered as the default one
635
+ for sd in self._domain._supersets:
636
+ if sd in self._vbundle._section_modules:
637
+ smodule = self._vbundle._section_modules[sd]
638
+ if smodule.default_frame() is None:
639
+ smodule.set_default_frame(self)
640
+ # Initialization of the zero element of the section module:
641
+ if not isinstance(smodule, FiniteRankFreeModule):
642
+ smodule(0)._add_comp_unsafe(self)
643
+ # (since new components are initialized to zero)
644
+ ###
645
+ # Add this frame to the list of frames of the overlying vector bundle:
646
+ self._vbundle._add_local_frame(self)
647
+
648
+ self._coframe = self.dual_basis() # Shortcut for self._dual_basis
649
+ ###
650
+ # Frame restrictions:
651
+ self._subframes = set([self]) # Set of frames which are just a
652
+ # restriction of self
653
+ self._superframes = set([self]) # Set of frames for which self is a
654
+ # restriction of
655
+ self._restrictions = {} # Key: subdomain of self._domain; value:
656
+ # restriction of self on this subdomain
657
+
658
+ ###### Methods that must be redefined by derived classes of ######
659
+ ###### FreeModuleBasis ######
660
+
661
+ def _repr_(self):
662
+ r"""
663
+ String representation of ``self``.
664
+
665
+ TESTS::
666
+
667
+ sage: M = Manifold(2, 'M', structure='top')
668
+ sage: E = M.vector_bundle(2, 'E')
669
+ sage: e = E.local_frame('e'); e
670
+ Local frame (E|_M, (e_0,e_1))
671
+ sage: repr(e) # indirect doctest
672
+ 'Local frame (E|_M, (e_0,e_1))'
673
+ sage: e # indirect doctest
674
+ Local frame (E|_M, (e_0,e_1))
675
+ """
676
+ desc = "Local frame " + self._name
677
+ return desc
678
+
679
+ def _new_instance(self, symbol, latex_symbol=None, indices=None,
680
+ latex_indices=None, symbol_dual=None,
681
+ latex_symbol_dual=None):
682
+ r"""
683
+ Construct a new local frame on the same section module as ``self``.
684
+
685
+ INPUT:
686
+
687
+ - ``symbol`` -- either a string, to be used as a common base for the
688
+ symbols of the sections constituting the local frame, or a
689
+ tuple of strings, representing the individual symbols of the local
690
+ sections
691
+ - ``latex_symbol`` -- (default: ``None``) either a string, to be used
692
+ as a common base for the LaTeX symbols of the local sections
693
+ constituting the local frame, or a tuple of strings, representing
694
+ the individual LaTeX symbols of the local sections; if ``None``,
695
+ ``symbol`` is used in place of ``latex_symbol``
696
+ - ``indices`` -- (default: ``None``; used only if ``symbol`` is a
697
+ single string) tuple of strings representing the indices labelling
698
+ the local sections of the frame; if ``None``, the indices will be
699
+ generated as integers within the range declared on the local frame's
700
+ domain
701
+ - ``latex_indices`` -- (default: ``None``) tuple of strings
702
+ representing the indices for the LaTeX symbols of the local sections;
703
+ if ``None``, ``indices`` is used instead
704
+ - ``symbol_dual`` -- (default: ``None``) same as ``symbol`` but for the
705
+ dual coframe; if ``None``, ``symbol`` must be a string and is used
706
+ for the common base of the symbols of the elements of the dual
707
+ coframe
708
+ - ``latex_symbol_dual`` -- (default: ``None``) same as ``latex_symbol``
709
+ but for the dual coframe
710
+
711
+ OUTPUT: instance of :class:`LocalFrame`
712
+
713
+ TESTS::
714
+
715
+ sage: M = Manifold(2, 'M', structure='top')
716
+ sage: E = M.vector_bundle(2, 'E')
717
+ sage: e = E.local_frame('e')
718
+ sage: e._new_instance('f')
719
+ Local frame (E|_M, (f_0,f_1))
720
+ """
721
+ return LocalFrame(self._fmodule, symbol, latex_symbol=latex_symbol,
722
+ indices=indices, latex_indices=latex_indices,
723
+ symbol_dual=symbol_dual,
724
+ latex_symbol_dual=latex_symbol_dual)
725
+
726
+ ###### End of methods to be redefined by derived classes ######
727
+
728
+ def domain(self):
729
+ r"""
730
+ Return the domain on which ``self`` is defined.
731
+
732
+ EXAMPLES::
733
+
734
+ sage: M = Manifold(3, 'M', structure='top')
735
+ sage: U = M.open_subset('U')
736
+ sage: E = M.vector_bundle(2, 'E')
737
+ sage: e = E.local_frame('e', domain=U); e
738
+ Local frame (E|_U, (e_0,e_1))
739
+ sage: e.domain()
740
+ Open subset U of the 3-dimensional topological manifold M
741
+ """
742
+ return self._domain
743
+
744
+ def base_space(self):
745
+ r"""
746
+ Return the base space on which the overlying vector bundle is defined.
747
+
748
+ EXAMPLES::
749
+
750
+ sage: M = Manifold(3, 'M', structure='top')
751
+ sage: U = M.open_subset('U')
752
+ sage: E = M.vector_bundle(2, 'E')
753
+ sage: e = E.local_frame('e', domain=U)
754
+ sage: e.base_space()
755
+ 3-dimensional topological manifold M
756
+ """
757
+ return self._base_space
758
+
759
+ def vector_bundle(self):
760
+ r"""
761
+ Return the vector bundle on which ``self`` is defined.
762
+
763
+ EXAMPLES::
764
+
765
+ sage: M = Manifold(3, 'M', structure='top')
766
+ sage: U = M.open_subset('U')
767
+ sage: E = M.vector_bundle(2, 'E')
768
+ sage: e = E.local_frame('e', domain=U)
769
+ sage: e.vector_bundle()
770
+ Topological real vector bundle E -> M of rank 2 over the base space
771
+ 3-dimensional topological manifold M
772
+ sage: e.vector_bundle() is E
773
+ True
774
+ """
775
+ return self._vbundle
776
+
777
+ def coframe(self):
778
+ r"""
779
+ Return the coframe of ``self``.
780
+
781
+ EXAMPLES::
782
+
783
+ sage: M = Manifold(2, 'M', structure='top')
784
+ sage: E = M.vector_bundle(2, 'E')
785
+ sage: e = E.local_frame('e'); e
786
+ Local frame (E|_M, (e_0,e_1))
787
+ sage: e.coframe()
788
+ Local coframe (E|_M, (e^0,e^1))
789
+ """
790
+ return self._coframe
791
+
792
+ def new_frame(self, change_of_frame, symbol, latex_symbol=None,
793
+ indices=None, latex_indices=None, symbol_dual=None,
794
+ latex_symbol_dual=None):
795
+ r"""
796
+ Define a new local frame from ``self``.
797
+
798
+ The new local frame is defined from vector bundle automorphisms; its
799
+ module is the same as that of the current frame.
800
+
801
+ INPUT:
802
+
803
+ - ``change_of_frame`` --
804
+ :class:`~sage.tensor.modules.free_module_automorphism.FreeModuleAutomorphism`;
805
+ vector bundle automorphisms `P` that relates
806
+ the current frame `(e_i)` to the new frame `(f_i)` according
807
+ to `f_i = P(e_i)`
808
+ - ``symbol`` -- either a string, to be used as a common base for the
809
+ symbols of the sections constituting the local frame, or a
810
+ list/tuple of strings, representing the individual symbols of the
811
+ sections
812
+ - ``latex_symbol`` -- (default: ``None``) either a string, to be used
813
+ as a common base for the LaTeX symbols of the sections
814
+ constituting the local frame, or a list/tuple of strings,
815
+ representing the individual LaTeX symbols of the sections;
816
+ if ``None``, ``symbol`` is used in place of ``latex_symbol``
817
+ - ``indices`` -- (default: ``None``; used only if ``symbol`` is a
818
+ single string) tuple of strings representing the indices labelling
819
+ the sections of the frame; if ``None``, the indices will be
820
+ generated as integers within the range declared on ``self``
821
+ - ``latex_indices`` -- (default: ``None``) tuple of strings
822
+ representing the indices for the LaTeX symbols of the sections;
823
+ if ``None``, ``indices`` is used instead
824
+ - ``symbol_dual`` -- (default: ``None``) same as ``symbol`` but for the
825
+ dual coframe; if ``None``, ``symbol`` must be a string and is used
826
+ for the common base of the symbols of the elements of the dual
827
+ coframe
828
+ - ``latex_symbol_dual`` -- (default: ``None``) same as ``latex_symbol``
829
+ but for the dual coframe
830
+
831
+ OUTPUT:
832
+
833
+ - the new frame `(f_i)`, as an instance of :class:`LocalFrame`
834
+
835
+ EXAMPLES:
836
+
837
+ Orthogonal transformation of a frame on the 2-dimensional trivial vector
838
+ bundle over the Euclidean plane::
839
+
840
+ sage: M = Manifold(2, 'R^2', structure='top', start_index=1)
841
+ sage: c_cart.<x,y> = M.chart()
842
+ sage: E = M.vector_bundle(2, 'E')
843
+ sage: e = E.local_frame('e'); e
844
+ Local frame (E|_R^2, (e_1,e_2))
845
+ sage: orth = E.section_module().automorphism()
846
+ sage: orth[:] = [[sqrt(3)/2, -1/2], [1/2, sqrt(3)/2]]
847
+ sage: f = e.new_frame(orth, 'f')
848
+ sage: f[1][:]
849
+ [1/2*sqrt(3), 1/2]
850
+ sage: f[2][:]
851
+ [-1/2, 1/2*sqrt(3)]
852
+ sage: a = E.change_of_frame(e,f)
853
+ sage: a[:]
854
+ [1/2*sqrt(3) -1/2]
855
+ [ 1/2 1/2*sqrt(3)]
856
+ sage: a == orth
857
+ True
858
+ sage: a is orth
859
+ False
860
+ sage: a._components # random (dictionary output)
861
+ {Local frame (E|_D_0, (e_1,e_2)): 2-indices components w.r.t.
862
+ Local frame (E|_D_0, (e_1,e_2)),
863
+ Local frame (E|_D_0, (f_1,f_2)): 2-indices components w.r.t.
864
+ Local frame (E|_D_0, (f_1,f_2))}
865
+ sage: a.comp(f)[:]
866
+ [1/2*sqrt(3) -1/2]
867
+ [ 1/2 1/2*sqrt(3)]
868
+ sage: a1 = E.change_of_frame(f,e)
869
+ sage: a1[:]
870
+ [1/2*sqrt(3) 1/2]
871
+ [ -1/2 1/2*sqrt(3)]
872
+ sage: a1 == orth.inverse()
873
+ True
874
+ sage: a1 is orth.inverse()
875
+ False
876
+ sage: e[1].comp(f)[:]
877
+ [1/2*sqrt(3), -1/2]
878
+ sage: e[2].comp(f)[:]
879
+ [1/2, 1/2*sqrt(3)]
880
+ """
881
+ the_new_frame = self.new_basis(change_of_frame, symbol,
882
+ latex_symbol=latex_symbol,
883
+ indices=indices,
884
+ latex_indices=latex_indices,
885
+ symbol_dual=symbol_dual,
886
+ latex_symbol_dual=latex_symbol_dual)
887
+ self._vbundle._frame_changes[(self, the_new_frame)] = \
888
+ self._fmodule._basis_changes[(self, the_new_frame)]
889
+ self._vbundle._frame_changes[(the_new_frame, self)] = \
890
+ self._fmodule._basis_changes[(the_new_frame, self)]
891
+ return the_new_frame
892
+
893
+ def restrict(self, subdomain):
894
+ r"""
895
+ Return the restriction of ``self`` to some open subset of its domain.
896
+
897
+ If the restriction has not been defined yet, it is constructed here.
898
+
899
+ INPUT:
900
+
901
+ - ``subdomain`` -- open subset `V` of the current frame domain `U`
902
+
903
+ OUTPUT: the restriction of the current frame to `V` as a :class:`LocalFrame`
904
+
905
+ EXAMPLES:
906
+
907
+ Restriction of a frame defined on `\RR^2` to the unit disk::
908
+
909
+ sage: M = Manifold(2, 'R^2', structure='top', start_index=1)
910
+ sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2
911
+ sage: E = M.vector_bundle(2, 'E')
912
+ sage: e = E.local_frame('e'); e
913
+ Local frame (E|_R^2, (e_1,e_2))
914
+ sage: a = E.section_module().automorphism()
915
+ sage: a[:] = [[1-y^2,0], [1+x^2, 2]]
916
+ sage: f = e.new_frame(a, 'f'); f
917
+ Local frame (E|_R^2, (f_1,f_2))
918
+ sage: U = M.open_subset('U', coord_def={c_cart: x^2+y^2<1})
919
+ sage: e_U = e.restrict(U); e_U
920
+ Local frame (E|_U, (e_1,e_2))
921
+ sage: f_U = f.restrict(U) ; f_U
922
+ Local frame (E|_U, (f_1,f_2))
923
+
924
+ The vectors of the restriction have the same symbols as those of the
925
+ original frame::
926
+
927
+ sage: f_U[1].display()
928
+ f_1 = (-y^2 + 1) e_1 + (x^2 + 1) e_2
929
+ sage: f_U[2].display()
930
+ f_2 = 2 e_2
931
+
932
+ Actually, the components are the restrictions of the original frame
933
+ vectors::
934
+
935
+ sage: f_U[1] is f[1].restrict(U)
936
+ True
937
+ sage: f_U[2] is f[2].restrict(U)
938
+ True
939
+ """
940
+ if subdomain == self._domain:
941
+ return self
942
+ if subdomain not in self._restrictions:
943
+ if not subdomain.is_subset(self._domain):
944
+ raise ValueError("the provided domain is not a subdomain of " +
945
+ "the current frame's domain")
946
+ # First one tries to get the restriction from a tighter domain:
947
+ for dom, rst in self._restrictions.items():
948
+ if subdomain.is_subset(dom) and subdomain in rst._restrictions:
949
+ res = rst._restrictions[subdomain]
950
+ self._restrictions[subdomain] = res
951
+ res._superframes.update(self._superframes)
952
+ for sframe2 in self._superframes:
953
+ sframe2._subframes.add(res)
954
+ return self._restrictions[subdomain]
955
+ # Secondly one tries to get the restriction from one previously
956
+ # defined on a larger domain:
957
+ for sframe in self._superframes:
958
+ if subdomain in sframe._restrictions:
959
+ res = sframe._restrictions[subdomain]
960
+ self._restrictions[subdomain] = res
961
+ res._superframes.update(self._superframes)
962
+ for sframe2 in self._superframes:
963
+ sframe2._subframes.add(res)
964
+ return self._restrictions[subdomain]
965
+ # If this point is reached, the restriction has to be created
966
+ # from scratch
967
+ resmodule = self._vbundle.section_module(domain=subdomain,
968
+ force_free=True)
969
+ res = LocalFrame(resmodule,
970
+ self._symbol, latex_symbol=self._latex_symbol,
971
+ indices=self._indices,
972
+ latex_indices=self._latex_indices,
973
+ symbol_dual=self._symbol_dual,
974
+ latex_symbol_dual=self._latex_symbol_dual)
975
+
976
+ new_vectors = list()
977
+ for i in self._fmodule.irange():
978
+ vrest = self[i].restrict(subdomain)
979
+ for j in self._fmodule.irange():
980
+ vrest.add_comp(res)[j] = 0
981
+ vrest.add_comp(res)[i] = 1
982
+ new_vectors.append(vrest)
983
+ res._vec = tuple(new_vectors)
984
+ # Update of superframes and subframes:
985
+ for sframe in self._subframes:
986
+ if subdomain.is_subset(sframe.domain()):
987
+ res._superframes.update(sframe._superframes)
988
+ for sframe in res._superframes:
989
+ sframe._subframes.add(res)
990
+ sframe._restrictions[subdomain] = res # includes sframe = self
991
+ for dom, rst in self._restrictions.items():
992
+ if dom.is_subset(subdomain):
993
+ res._restrictions.update(rst._restrictions)
994
+ res._subframes.update(rst._subframes)
995
+ rst._superframes.update(res._superframes)
996
+
997
+ return self._restrictions[subdomain]
998
+
999
+ def at(self, point):
1000
+ r"""
1001
+ Return the value of ``self`` at a given point, this value being
1002
+ a basis of the vector bundle fiber at the point.
1003
+
1004
+ INPUT:
1005
+
1006
+ - ``point`` -- :class:`~sage.manifolds.point.ManifoldPoint`; point
1007
+ `p` in the domain `U` of the local frame (denoted `e` hereafter)
1008
+
1009
+ OUTPUT:
1010
+
1011
+ - :class:`~sage.tensor.modules.free_module_basis.FreeModuleBasis`
1012
+ representing the basis `e(p)` of the vector bundle fiber
1013
+ `E_p`
1014
+
1015
+ EXAMPLES:
1016
+
1017
+ Basis of a fiber of a trivial vector bundle::
1018
+
1019
+ sage: M = Manifold(2, 'M', structure='top')
1020
+ sage: X.<x,y> = M.chart()
1021
+ sage: E = M.vector_bundle(2, 'E')
1022
+ sage: e = E.local_frame('e'); e
1023
+ Local frame (E|_M, (e_0,e_1))
1024
+ sage: p = M.point((-1,2), name='p')
1025
+ sage: ep = e.at(p) ; ep
1026
+ Basis (e_0,e_1) on the Fiber of E at Point p on the 2-dimensional
1027
+ topological manifold M
1028
+ sage: type(ep)
1029
+ <class 'sage.tensor.modules.free_module_basis.FreeModuleBasis_with_category'>
1030
+ sage: ep[0]
1031
+ Vector e_0 in the fiber of E at Point p on the 2-dimensional
1032
+ topological manifold M
1033
+ sage: ep[1]
1034
+ Vector e_1 in the fiber of E at Point p on the 2-dimensional
1035
+ topological manifold M
1036
+
1037
+ Note that the symbols used to denote the vectors are same as those
1038
+ for the vector fields of the frame. At this stage, ``ep`` is the unique
1039
+ basis on fiber at ``p``::
1040
+
1041
+ sage: Ep = E.fiber(p)
1042
+ sage: Ep.bases()
1043
+ [Basis (e_0,e_1) on the Fiber of E at Point p on the 2-dimensional
1044
+ topological manifold M]
1045
+
1046
+ Let us consider another local frame::
1047
+
1048
+ sage: aut = E.section_module().automorphism()
1049
+ sage: aut[:] = [[1+y^2, 0], [0, 2]]
1050
+ sage: f = e.new_frame(aut, 'f') ; f
1051
+ Local frame (E|_M, (f_0,f_1))
1052
+ sage: fp = f.at(p) ; fp
1053
+ Basis (f_0,f_1) on the Fiber of E at Point p on the 2-dimensional
1054
+ topological manifold M
1055
+
1056
+ There are now two bases on the fiber::
1057
+
1058
+ sage: Ep.bases()
1059
+ [Basis (e_0,e_1) on the Fiber of E at Point p on the 2-dimensional
1060
+ topological manifold M,
1061
+ Basis (f_0,f_1) on the Fiber of E at Point p on the 2-dimensional
1062
+ topological manifold M]
1063
+
1064
+ Moreover, the changes of bases in the tangent space have been
1065
+ computed from the known relation between the frames ``e`` and
1066
+ ``f`` (via the automorphism ``aut`` defined above)::
1067
+
1068
+ sage: Ep.change_of_basis(ep, fp)
1069
+ Automorphism of the Fiber of E at Point p on the 2-dimensional
1070
+ topological manifold M
1071
+ sage: Ep.change_of_basis(ep, fp).display()
1072
+ 5 e_0⊗e^0 + 2 e_1⊗e^1
1073
+ sage: Ep.change_of_basis(fp, ep)
1074
+ Automorphism of the Fiber of E at Point p on the 2-dimensional
1075
+ topological manifold M
1076
+ sage: Ep.change_of_basis(fp, ep).display()
1077
+ 1/5 e_0⊗e^0 + 1/2 e_1⊗e^1
1078
+
1079
+ The dual bases::
1080
+
1081
+ sage: e.coframe()
1082
+ Local coframe (E|_M, (e^0,e^1))
1083
+ sage: ep.dual_basis()
1084
+ Dual basis (e^0,e^1) on the Fiber of E at Point p on the
1085
+ 2-dimensional topological manifold M
1086
+ sage: ep.dual_basis() is e.coframe().at(p)
1087
+ True
1088
+ sage: f.coframe()
1089
+ Local coframe (E|_M, (f^0,f^1))
1090
+ sage: fp.dual_basis()
1091
+ Dual basis (f^0,f^1) on the Fiber of E at Point p on the
1092
+ 2-dimensional topological manifold M
1093
+ sage: fp.dual_basis() is f.coframe().at(p)
1094
+ True
1095
+ """
1096
+ # Determination of the vector bundle fiber:
1097
+ if point not in self._domain:
1098
+ raise ValueError("the {} is not a point in the ".format(point) +
1099
+ "domain of {}".format(self))
1100
+ vbf = self._vbundle.fiber(point)
1101
+ # If the basis has already been constructed, it is simply returned:
1102
+ vbf_frame_bases = vbf._frame_bases
1103
+ if self in vbf_frame_bases:
1104
+ return vbf_frame_bases[self]
1105
+ for frame in vbf_frame_bases:
1106
+ if self in frame._subframes or self in frame._superframes:
1107
+ return vbf_frame_bases[frame]
1108
+ # If this point is reached, the basis has to be constructed from
1109
+ # scratch.
1110
+ # The names of the basis vectors set to those of the frame sections:
1111
+ basis = vbf.basis(self._symbol, latex_symbol=self._latex_symbol,
1112
+ indices=self._indices,
1113
+ latex_indices=self._latex_indices,
1114
+ symbol_dual=self._symbol_dual,
1115
+ latex_symbol_dual=self._latex_symbol_dual)
1116
+ vbf_frame_bases[self] = basis
1117
+ # Update of the change of bases in the fiber:
1118
+ for frame_pair, automorph in self._vbundle._frame_changes.items():
1119
+ frame1 = frame_pair[0]
1120
+ frame2 = frame_pair[1]
1121
+ if frame1 is self:
1122
+ fr2 = None
1123
+ for frame in vbf_frame_bases:
1124
+ if frame2 in frame._subframes:
1125
+ fr2 = frame
1126
+ break
1127
+ if fr2 is not None:
1128
+ basis1 = basis
1129
+ basis2 = vbf_frame_bases[fr2]
1130
+ auto = vbf.automorphism()
1131
+ for frame, comp in automorph._components.items():
1132
+ bas = None
1133
+ if frame is frame1:
1134
+ bas = basis1
1135
+ if frame is frame2:
1136
+ bas = basis2
1137
+ if bas is not None:
1138
+ cauto = auto.add_comp(bas)
1139
+ for ind, val in comp._comp.items():
1140
+ cauto._comp[ind] = val(point)
1141
+ vbf._basis_changes[(basis1, basis2)] = auto
1142
+ if frame2 is self:
1143
+ fr1 = None
1144
+ for frame in vbf_frame_bases:
1145
+ if frame1 in frame._subframes:
1146
+ fr1 = frame
1147
+ break
1148
+ if fr1 is not None:
1149
+ basis1 = vbf_frame_bases[fr1]
1150
+ basis2 = basis
1151
+ auto = vbf.automorphism()
1152
+ for frame, comp in automorph._components.items():
1153
+ bas = None
1154
+ if frame is frame1:
1155
+ bas = basis1
1156
+ if frame is frame2:
1157
+ bas = basis2
1158
+ if bas is not None:
1159
+ cauto = auto.add_comp(bas)
1160
+ for ind, val in comp._comp.items():
1161
+ cauto._comp[ind] = val(point)
1162
+ vbf._basis_changes[(basis1, basis2)] = auto
1163
+ return basis
1164
+
1165
+ def set_name(self, symbol, latex_symbol=None, indices=None,
1166
+ latex_indices=None, index_position='down',
1167
+ include_domain=True):
1168
+ r"""
1169
+ Set (or change) the text name and LaTeX name of ``self``.
1170
+
1171
+ INPUT:
1172
+
1173
+ - ``symbol`` -- either a string, to be used as a common base for the
1174
+ symbols of the local sections constituting the local frame, or a
1175
+ list/tuple of strings, representing the individual symbols of the
1176
+ local sections
1177
+ - ``latex_symbol`` -- (default: ``None``) either a string, to be used
1178
+ as a common base for the LaTeX symbols of the local sections
1179
+ constituting the local frame, or a list/tuple of strings,
1180
+ representing the individual LaTeX symbols of the local sections;
1181
+ if ``None``, ``symbol`` is used in place of ``latex_symbol``
1182
+ - ``indices`` -- (default: ``None``; used only if ``symbol`` is a
1183
+ single string) tuple of strings representing the indices labelling
1184
+ the local sections of the frame; if ``None``, the indices will be
1185
+ generated as integers within the range declared on ``self``
1186
+ - ``latex_indices`` -- (default: ``None``) tuple of strings
1187
+ representing the indices for the LaTeX symbols of the local sections;
1188
+ if ``None``, ``indices`` is used instead
1189
+ - ``index_position`` -- (default: ``'down'``) determines the position
1190
+ of the indices labelling the local sections of the frame; can be
1191
+ either ``'down'`` or ``'up'``
1192
+ - ``include_domain`` -- boolean (default: ``True``); determining whether
1193
+ the name of the domain is included in the beginning of the vector
1194
+ frame name
1195
+
1196
+ EXAMPLES::
1197
+
1198
+ sage: M = Manifold(3, 'M', structure='top')
1199
+ sage: E = M.vector_bundle(2, 'E')
1200
+ sage: e = E.local_frame('e'); e
1201
+ Local frame (E|_M, (e_0,e_1))
1202
+ sage: e.set_name('f'); e
1203
+ Local frame (E|_M, (f_0,f_1))
1204
+ sage: e.set_name('e', include_domain=False); e
1205
+ Local frame (e_0,e_1)
1206
+ sage: e.set_name(['a', 'b']); e
1207
+ Local frame (E|_M, (a,b))
1208
+ sage: e.set_name('e', indices=['x', 'y']); e
1209
+ Local frame (E|_M, (e_x,e_y))
1210
+ sage: e.set_name('e', latex_symbol=r'\epsilon')
1211
+ sage: latex(e)
1212
+ \left(E|_{M}, \left(\epsilon_{0},\epsilon_{1}\right)\right)
1213
+ sage: e.set_name('e', latex_symbol=[r'\alpha', r'\beta'])
1214
+ sage: latex(e)
1215
+ \left(E|_{M}, \left(\alpha,\beta\right)\right)
1216
+ sage: e.set_name('e', latex_symbol='E',
1217
+ ....: latex_indices=[r'\alpha', r'\beta'])
1218
+ sage: latex(e)
1219
+ \left(E|_{M}, \left(E_{\alpha},E_{\beta}\right)\right)
1220
+ """
1221
+ super().set_name(symbol, latex_symbol=latex_symbol,
1222
+ indices=indices,
1223
+ latex_indices=latex_indices,
1224
+ index_position=index_position)
1225
+ if include_domain:
1226
+ # Redefinition of the name and the LaTeX name to include the domain
1227
+ self._name = "({}|_{}, {})".format(self._vbundle._name,
1228
+ self._domain._name, self._name)
1229
+ self._latex_name = r"\left({}|_{{{}}}, {}\right)".format(
1230
+ self._vbundle._latex_name,
1231
+ self._domain._latex_name,
1232
+ self._latex_name)
1233
+
1234
+ #******************************************************************************
1235
+
1236
+
1237
+ class TrivializationCoFrame(LocalCoFrame):
1238
+ r"""
1239
+ Trivialization coframe on a vector bundle.
1240
+
1241
+ A *trivialization coframe* is the coframe of the trivialization frame
1242
+ induced by a trivialization (see: :class:`~sage.manifolds.local_frame.TrivializationFrame`).
1243
+
1244
+ More precisely, a *trivialization frame* on a vector bundle `E \to M` of
1245
+ class `C^k` and rank `n` over the topological field `K` and over a
1246
+ topological manifold `M` is a local coframe induced by a local
1247
+ trivialization `\varphi:E|_U \to U \times K^n` of the domain `U \in M`.
1248
+ Namely, the local dual sections
1249
+
1250
+ .. MATH::
1251
+
1252
+ \varphi^*e^i := \varphi(\;\cdot\;, e^i)
1253
+
1254
+ on `U` induce a local frame `(\varphi^*e^1, \dots, \varphi^*e^n)`, where
1255
+ `(e^1, \dots, e^n)` is the dual of the standard basis of `K^n`.
1256
+
1257
+ INPUT:
1258
+
1259
+ - ``triv_frame`` -- trivialization frame dual to the trivialization coframe
1260
+ - ``symbol`` -- either a string, to be used as a common base for the
1261
+ symbols of the dual sections constituting the coframe, or a tuple of
1262
+ strings, representing the individual symbols of the dual sections
1263
+ - ``latex_symbol`` -- (default: ``None``) either a string, to be used
1264
+ as a common base for the LaTeX symbols of the dual sections constituting
1265
+ the coframe, or a tuple of strings, representing the individual LaTeX
1266
+ symbols of the dual sections; if ``None``, ``symbol`` is used in place of
1267
+ ``latex_symbol``
1268
+ - ``indices`` -- (default: ``None``; used only if ``symbol`` is a single
1269
+ string) tuple of strings representing the indices labelling the dual
1270
+ sections of the coframe; if ``None``, the indices will be generated as
1271
+ integers within the range declared on the local frame's domain
1272
+ - ``latex_indices`` -- (default: ``None``) tuple of strings representing
1273
+ the indices for the LaTeX symbols of the dual sections of the coframe; if
1274
+ ``None``, ``indices`` is used instead
1275
+
1276
+ EXAMPLES:
1277
+
1278
+ Trivialization coframe on a trivial vector bundle of rank 3::
1279
+
1280
+ sage: M = Manifold(3, 'M', start_index=1, structure='top')
1281
+ sage: X.<x,y,z> = M.chart()
1282
+ sage: E = M.vector_bundle(3, 'E')
1283
+ sage: phi = E.trivialization('phi'); phi
1284
+ Trivialization (phi, E|_M)
1285
+ sage: E.frames()
1286
+ [Trivialization frame (E|_M, ((phi^*e_1),(phi^*e_2),(phi^*e_3)))]
1287
+ sage: E.coframes()
1288
+ [Trivialization coframe (E|_M, ((phi^*e^1),(phi^*e^2),(phi^*e^3)))]
1289
+ sage: f = E.coframes()[0] ; f
1290
+ Trivialization coframe (E|_M, ((phi^*e^1),(phi^*e^2),(phi^*e^3)))
1291
+
1292
+ The linear forms composing the coframe are obtained via the operator
1293
+ ``[]``::
1294
+
1295
+ sage: f[1]
1296
+ Linear form (phi^*e^1) on the Free module C^0(M;E) of sections on the
1297
+ 3-dimensional topological manifold M with values in the real vector
1298
+ bundle E of rank 3
1299
+ sage: f[2]
1300
+ Linear form (phi^*e^2) on the Free module C^0(M;E) of sections on the
1301
+ 3-dimensional topological manifold M with values in the real vector
1302
+ bundle E of rank 3
1303
+ sage: f[3]
1304
+ Linear form (phi^*e^3) on the Free module C^0(M;E) of sections on the
1305
+ 3-dimensional topological manifold M with values in the real vector
1306
+ bundle E of rank 3
1307
+ sage: f[1][:]
1308
+ [1, 0, 0]
1309
+ sage: f[2][:]
1310
+ [0, 1, 0]
1311
+ sage: f[3][:]
1312
+ [0, 0, 1]
1313
+
1314
+ The coframe is the dual of the trivialization frame::
1315
+
1316
+ sage: e = phi.frame() ; e
1317
+ Trivialization frame (E|_M, ((phi^*e_1),(phi^*e_2),(phi^*e_3)))
1318
+ sage: f[1](e[1]).expr(), f[1](e[2]).expr(), f[1](e[3]).expr()
1319
+ (1, 0, 0)
1320
+ sage: f[2](e[1]).expr(), f[2](e[2]).expr(), f[2](e[3]).expr()
1321
+ (0, 1, 0)
1322
+ sage: f[3](e[1]).expr(), f[3](e[2]).expr(), f[3](e[3]).expr()
1323
+ (0, 0, 1)
1324
+ """
1325
+ def __init__(self, triv_frame, symbol, latex_symbol=None,
1326
+ indices=None, latex_indices=None):
1327
+ r"""
1328
+ Construct a local coframe from a local trivialization.
1329
+
1330
+ TESTS::
1331
+
1332
+ sage: M = Manifold(2, 'M', structure='top')
1333
+ sage: E = M.vector_bundle(2, 'E')
1334
+ sage: phi = E.trivialization('phi')
1335
+ sage: from sage.manifolds.local_frame import TrivializationCoFrame
1336
+ sage: f = TrivializationCoFrame(phi.frame(), 'omega'); f
1337
+ Trivialization coframe (E|_M, (omega^0,omega^1))
1338
+ sage: TestSuite(f).run()
1339
+ """
1340
+ if not isinstance(triv_frame, TrivializationFrame):
1341
+ raise TypeError("the first argument must be a local trivialization "
1342
+ "frame")
1343
+ LocalCoFrame.__init__(self, triv_frame, symbol,
1344
+ latex_symbol=latex_symbol, indices=indices,
1345
+ latex_indices=latex_indices)
1346
+ self._trivialization = triv_frame._trivialization
1347
+
1348
+ def _repr_(self):
1349
+ r"""
1350
+ String representation of ``self``.
1351
+
1352
+ TESTS::
1353
+
1354
+ sage: M = Manifold(3, 'M')
1355
+ sage: E = M.vector_bundle(2, 'E')
1356
+ sage: phi = E.trivialization('phi')
1357
+ sage: e = phi.frame().coframe()
1358
+ sage: e._repr_()
1359
+ 'Trivialization coframe (E|_M, ((phi^*e^1),(phi^*e^2)))'
1360
+ sage: repr(e) # indirect doctest
1361
+ 'Trivialization coframe (E|_M, ((phi^*e^1),(phi^*e^2)))'
1362
+ sage: e # indirect doctest
1363
+ Trivialization coframe (E|_M, ((phi^*e^1),(phi^*e^2)))
1364
+ """
1365
+ return "Trivialization coframe " + self._name
1366
+
1367
+ #******************************************************************************
1368
+
1369
+
1370
+ class TrivializationFrame(LocalFrame):
1371
+ r"""
1372
+ Trivialization frame on a topological vector bundle.
1373
+
1374
+ A *trivialization frame* on a topological vector bundle `E \to M` of rank
1375
+ `n` over the topological field `K` and over a topological manifold `M` is a
1376
+ local frame induced by a local trivialization `\varphi:E|_U \to U \times K^n`
1377
+ of the domain `U \in M`. More precisely, the local sections
1378
+
1379
+ .. MATH::
1380
+
1381
+ \varphi^*e_i := \varphi(\;\cdot\;, e_i)
1382
+
1383
+ on `U` induce a local frame `(\varphi^*e_1, \dots, \varphi^*e_n)`, where
1384
+ `(e_1, \dots, e_n)` is the standard basis of `K^n`.
1385
+
1386
+ INPUT:
1387
+
1388
+ - ``trivialization`` -- the trivialization defined on the vector bundle
1389
+
1390
+ EXAMPLES::
1391
+
1392
+ sage: M = Manifold(3, 'M')
1393
+ sage: U = M.open_subset('U')
1394
+ sage: E = M.vector_bundle(2, 'E')
1395
+ sage: phi_U = E.trivialization('phi_U', domain=U)
1396
+ sage: phi_U.frame()
1397
+ Trivialization frame (E|_U, ((phi_U^*e_1),(phi_U^*e_2)))
1398
+ sage: latex(phi_U.frame())
1399
+ \left(E|_{U}, \left(\left(phi_U^* e_{ 1 }\right),\left(phi_U^* e_{ 2 }\right)\right)\right)
1400
+ """
1401
+
1402
+ # The following class attribute must be redefined by any derived class:
1403
+ _cobasis_class = TrivializationCoFrame
1404
+
1405
+ def __init__(self, trivialization):
1406
+ r"""
1407
+ Construct a trivialization frame.
1408
+
1409
+ TESTS::
1410
+
1411
+ sage: M = Manifold(3, 'M')
1412
+ sage: E = M.vector_bundle(2, 'E')
1413
+ sage: phi = E.trivialization('phi')
1414
+ sage: e = phi.frame()
1415
+ sage: TestSuite(e).run()
1416
+ """
1417
+ from sage.manifolds.trivialization import Trivialization
1418
+ from sage.misc.latex import latex
1419
+ if not isinstance(trivialization, Trivialization):
1420
+ raise TypeError("the first argument must be a trivialization")
1421
+ ###
1422
+ # Some useful variables:
1423
+ triv = trivialization
1424
+ domain = triv.domain()
1425
+ vbundle = triv.vector_bundle()
1426
+ ###
1427
+ # Some sanity check:
1428
+ smodule = vbundle._section_modules.get(domain)
1429
+ if smodule and not isinstance(smodule, FiniteRankFreeModule):
1430
+ raise ValueError("the {} has already been constructed as a "
1431
+ "non-free module and therefore cannot have "
1432
+ "a basis".format(smodule))
1433
+ ###
1434
+ # Set trivialization:
1435
+ self._trivialization = triv
1436
+ ###
1437
+ # Define trivialization names
1438
+ rank = vbundle.rank()
1439
+ symbol = tuple("(" + triv._name + "^*" + "e_" + str(i) + ")"
1440
+ for i in range(1, rank + 1))
1441
+ symbol_dual = tuple("(" + triv._name + "^*" + "e^" + str(i) + ")"
1442
+ for i in range(1, rank + 1))
1443
+ latex_symbol = tuple(r'\left(' + triv._latex_name + r'^* e_{' +
1444
+ latex(i) + r'}\right)'
1445
+ for i in range(1, rank + 1))
1446
+ latex_symbol_dual = tuple(r'\left(' + triv._latex_name + r'^* e^{' +
1447
+ latex(i) + r'}\right)'
1448
+ for i in range(1, rank + 1))
1449
+ LocalFrame.__init__(self,
1450
+ vbundle.section_module(domain=domain, force_free=True),
1451
+ symbol=symbol, latex_symbol=latex_symbol,
1452
+ symbol_dual=symbol_dual,
1453
+ latex_symbol_dual=latex_symbol_dual)
1454
+
1455
+ def _repr_(self):
1456
+ r"""
1457
+ String representation of ``self``.
1458
+
1459
+ TESTS::
1460
+
1461
+ sage: M = Manifold(3, 'M')
1462
+ sage: E = M.vector_bundle(2, 'E')
1463
+ sage: phi = E.trivialization('phi')
1464
+ sage: e = phi.frame()
1465
+ sage: e._repr_()
1466
+ 'Trivialization frame (E|_M, ((phi^*e_1),(phi^*e_2)))'
1467
+ sage: repr(e) # indirect doctest
1468
+ 'Trivialization frame (E|_M, ((phi^*e_1),(phi^*e_2)))'
1469
+ sage: e # indirect doctest
1470
+ Trivialization frame (E|_M, ((phi^*e_1),(phi^*e_2)))
1471
+ """
1472
+ return "Trivialization frame " + self._name
1473
+
1474
+ def trivialization(self):
1475
+ r"""
1476
+ Return the underlying trivialization of ``self``.
1477
+
1478
+ EXAMPLES::
1479
+
1480
+ sage: M = Manifold(3, 'M')
1481
+ sage: U = M.open_subset('U')
1482
+ sage: E = M.vector_bundle(2, 'E')
1483
+ sage: phi_U = E.trivialization('phi_U', domain=U)
1484
+ sage: e = phi_U.frame()
1485
+ sage: e.trivialization()
1486
+ Trivialization (phi_U, E|_U)
1487
+ sage: e.trivialization() is phi_U
1488
+ True
1489
+ """
1490
+ return self._trivialization