passagemath-symbolics 10.8.1a1__cp314-cp314t-musllinux_1_2_aarch64.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.
Files changed (181) hide show
  1. passagemath_symbolics/__init__.py +3 -0
  2. passagemath_symbolics-10.8.1a1.dist-info/METADATA +186 -0
  3. passagemath_symbolics-10.8.1a1.dist-info/RECORD +181 -0
  4. passagemath_symbolics-10.8.1a1.dist-info/WHEEL +5 -0
  5. passagemath_symbolics-10.8.1a1.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 +2838 -0
  9. sage/calculus/desolvers.py +1864 -0
  10. sage/calculus/predefined.py +51 -0
  11. sage/calculus/tests.py +225 -0
  12. sage/calculus/var.cpython-314t-aarch64-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-aarch64-linux-musl.so +0 -0
  18. sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +1034 -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 +755 -0
  33. sage/geometry/hyperbolic_space/hyperbolic_constants.py +5 -0
  34. sage/geometry/hyperbolic_space/hyperbolic_geodesic.py +2419 -0
  35. sage/geometry/hyperbolic_space/hyperbolic_interface.py +206 -0
  36. sage/geometry/hyperbolic_space/hyperbolic_isometry.py +1083 -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 +2991 -0
  44. sage/interfaces/magma_free.py +90 -0
  45. sage/interfaces/maple.py +1402 -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 +553 -0
  54. sage/manifolds/catalog.py +437 -0
  55. sage/manifolds/chart.py +4010 -0
  56. sage/manifolds/chart_func.py +3416 -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 +1668 -0
  70. sage/manifolds/differentiable/diff_form.py +1660 -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 +1522 -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 +912 -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 +1725 -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 +2721 -0
  118. sage/manifolds/subsets/all.py +1 -0
  119. sage/manifolds/subsets/closure.py +131 -0
  120. sage/manifolds/subsets/pullback.py +883 -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 +1347 -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-aarch64-linux-musl.so +0 -0
  129. sage/matrix/matrix_symbolic_dense.pxd +6 -0
  130. sage/matrix/matrix_symbolic_dense.pyx +1030 -0
  131. sage/matrix/matrix_symbolic_sparse.cpython-314t-aarch64-linux-musl.so +0 -0
  132. sage/matrix/matrix_symbolic_sparse.pxd +6 -0
  133. sage/matrix/matrix_symbolic_sparse.pyx +1038 -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 +4106 -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 +5205 -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 +987 -0
  150. sage/symbolic/benchmark.py +93 -0
  151. sage/symbolic/callable.py +456 -0
  152. sage/symbolic/callable.pyi +66 -0
  153. sage/symbolic/comparison_impl.pyi +38 -0
  154. sage/symbolic/complexity_measures.py +35 -0
  155. sage/symbolic/constants.py +1286 -0
  156. sage/symbolic/constants_c_impl.pyi +10 -0
  157. sage/symbolic/expression_conversion_algebraic.py +310 -0
  158. sage/symbolic/expression_conversion_sympy.py +317 -0
  159. sage/symbolic/expression_conversions.py +1727 -0
  160. sage/symbolic/function_factory.py +355 -0
  161. sage/symbolic/function_factory.pyi +41 -0
  162. sage/symbolic/getitem_impl.pyi +24 -0
  163. sage/symbolic/integration/all.py +1 -0
  164. sage/symbolic/integration/external.py +271 -0
  165. sage/symbolic/integration/integral.py +1075 -0
  166. sage/symbolic/maxima_wrapper.py +162 -0
  167. sage/symbolic/operators.py +267 -0
  168. sage/symbolic/operators.pyi +61 -0
  169. sage/symbolic/pynac_constant_impl.pyi +13 -0
  170. sage/symbolic/pynac_function_impl.pyi +8 -0
  171. sage/symbolic/random_tests.py +461 -0
  172. sage/symbolic/relation.py +2062 -0
  173. sage/symbolic/ring.cpython-314t-aarch64-linux-musl.so +0 -0
  174. sage/symbolic/ring.pxd +5 -0
  175. sage/symbolic/ring.pyi +110 -0
  176. sage/symbolic/ring.pyx +1393 -0
  177. sage/symbolic/series_impl.pyi +10 -0
  178. sage/symbolic/subring.py +1025 -0
  179. sage/symbolic/symengine.py +19 -0
  180. sage/symbolic/tests.py +40 -0
  181. sage/symbolic/units.py +1468 -0
@@ -0,0 +1,800 @@
1
+ # sage_setup: distribution = sagemath-symbolics
2
+ r"""
3
+ Multivector Field Modules
4
+
5
+ The set `A^p(U, \Phi)` of `p`-vector fields along a differentiable
6
+ manifold `U` with values on a differentiable manifold `M` via a
7
+ differentiable map `\Phi:\ U \rightarrow M` (possibly `U = M` and
8
+ `\Phi = \mathrm{Id}_M`) is a module over the algebra `C^k(U)` of
9
+ differentiable scalar fields on `U`. It is a free module if and only if
10
+ `M` is parallelizable. Accordingly, two classes implement
11
+ `A^p(U,\Phi)`:
12
+
13
+ - :class:`MultivectorModule` for `p`-vector fields with values on a
14
+ generic (in practice, not parallelizable) differentiable manifold `M`
15
+ - :class:`MultivectorFreeModule` for `p`-vector fields with values on a
16
+ parallelizable manifold `M`
17
+
18
+ AUTHORS:
19
+
20
+ - Eric Gourgoulhon (2017): initial version
21
+
22
+ REFERENCES:
23
+
24
+ - \R. L. Bishop and S. L. Goldberg (1980) [BG1980]_
25
+ - \C.-M. Marle (1997) [Mar1997]_
26
+ """
27
+ #******************************************************************************
28
+ # Copyright (C) 2017 Eric Gourgoulhon <eric.gourgoulhon@obspm.fr>
29
+ #
30
+ # Distributed under the terms of the GNU General Public License (GPL)
31
+ # as published by the Free Software Foundation; either version 2 of
32
+ # the License, or (at your option) any later version.
33
+ # http://www.gnu.org/licenses/
34
+ #******************************************************************************
35
+
36
+ from sage.categories.modules import Modules
37
+ from sage.manifolds.differentiable.multivectorfield import (
38
+ MultivectorField,
39
+ MultivectorFieldParal,
40
+ )
41
+ from sage.misc.cachefunc import cached_method
42
+ from sage.structure.parent import Parent
43
+ from sage.structure.unique_representation import UniqueRepresentation
44
+ from sage.tensor.modules.ext_pow_free_module import ExtPowerFreeModule
45
+
46
+
47
+ class MultivectorModule(UniqueRepresentation, Parent):
48
+ r"""
49
+ Module of multivector fields of a given degree `p` (`p`-vector
50
+ fields) along a differentiable manifold `U` with values on a
51
+ differentiable manifold `M`.
52
+
53
+ Given a differentiable manifold `U` and a differentiable map
54
+ `\Phi: U \rightarrow M` to a differentiable manifold `M`, the set
55
+ `A^p(U, \Phi)` of `p`-vector fields (i.e. alternating tensor fields
56
+ of type `(p,0)`) along `U` with values on `M` is a module over
57
+ `C^k(U)`, the commutative algebra of differentiable scalar fields on
58
+ `U` (see
59
+ :class:`~sage.manifolds.differentiable.scalarfield_algebra.DiffScalarFieldAlgebra`).
60
+ The standard case of `p`-vector fields *on* a differentiable
61
+ manifold `M` corresponds to `U = M` and `\Phi = \mathrm{Id}_M`.
62
+ Other common cases are `\Phi` being an immersion and `\Phi` being a
63
+ curve in `M` (`U` is then an open interval of `\RR`).
64
+
65
+ .. NOTE::
66
+
67
+ This class implements `A^p(U,\Phi)` in the case where `M` is
68
+ not assumed to be parallelizable; the module `A^p(U, \Phi)`
69
+ is then not necessarily free. If `M` is parallelizable, the
70
+ class :class:`MultivectorFreeModule` must be used instead.
71
+
72
+ INPUT:
73
+
74
+ - ``vector_field_module`` -- module `\mathfrak{X}(U, \Phi)` of vector
75
+ fields along `U` with values on `M` via the map
76
+ `\Phi: U \rightarrow M`
77
+ - ``degree`` -- positive integer; the degree `p` of the multivector
78
+ fields
79
+
80
+ EXAMPLES:
81
+
82
+ Module of 2-vector fields on a non-parallelizable 2-dimensional
83
+ manifold::
84
+
85
+ sage: M = Manifold(2, 'M')
86
+ sage: U = M.open_subset('U') ; V = M.open_subset('V')
87
+ sage: M.declare_union(U,V) # M is the union of U and V
88
+ sage: c_xy.<x,y> = U.chart() ; c_uv.<u,v> = V.chart()
89
+ sage: transf = c_xy.transition_map(c_uv, (x+y, x-y),
90
+ ....: intersection_name='W', restrictions1= x>0,
91
+ ....: restrictions2= u+v>0)
92
+ sage: inv = transf.inverse()
93
+ sage: W = U.intersection(V)
94
+ sage: eU = c_xy.frame() ; eV = c_uv.frame()
95
+ sage: XM = M.vector_field_module() ; XM
96
+ Module X(M) of vector fields on the 2-dimensional differentiable
97
+ manifold M
98
+ sage: A = M.multivector_module(2) ; A
99
+ Module A^2(M) of 2-vector fields on the 2-dimensional
100
+ differentiable manifold M
101
+ sage: latex(A)
102
+ A^{2}\left(M\right)
103
+
104
+ ``A`` is nothing but the second exterior power of ``XM``, i.e.
105
+ we have `A^{2}(M) = \Lambda^2(\mathfrak{X}(M))`::
106
+
107
+ sage: A is XM.exterior_power(2)
108
+ True
109
+
110
+ Modules of multivector fields are unique::
111
+
112
+ sage: A is M.multivector_module(2)
113
+ True
114
+
115
+ `A^2(M)` is a module over the algebra `C^k(M)` of (differentiable)
116
+ scalar fields on `M`::
117
+
118
+ sage: A.category()
119
+ Category of modules over Algebra of differentiable scalar fields
120
+ on the 2-dimensional differentiable manifold M
121
+ sage: CM = M.scalar_field_algebra() ; CM
122
+ Algebra of differentiable scalar fields on the 2-dimensional
123
+ differentiable manifold M
124
+ sage: A in Modules(CM)
125
+ True
126
+ sage: A.base_ring() is CM
127
+ True
128
+ sage: A.base_module()
129
+ Module X(M) of vector fields on the 2-dimensional differentiable
130
+ manifold M
131
+ sage: A.base_module() is XM
132
+ True
133
+
134
+ Elements can be constructed from ``A()``. In particular, ``0``
135
+ yields the zero element of ``A``::
136
+
137
+ sage: z = A(0) ; z
138
+ 2-vector field zero on the 2-dimensional differentiable
139
+ manifold M
140
+ sage: z.display(eU)
141
+ zero = 0
142
+ sage: z.display(eV)
143
+ zero = 0
144
+ sage: z is A.zero()
145
+ True
146
+
147
+ while nonzero elements are constructed by providing their
148
+ components in a given vector frame::
149
+
150
+ sage: a = A([[0,3*x],[-3*x,0]], frame=eU, name='a') ; a
151
+ 2-vector field a on the 2-dimensional differentiable manifold M
152
+ sage: a.add_comp_by_continuation(eV, W, c_uv) # finishes initializ. of a
153
+ sage: a.display(eU)
154
+ a = 3*x ∂/∂x∧∂/∂y
155
+ sage: a.display(eV)
156
+ a = (-3*u - 3*v) ∂/∂u∧∂/∂v
157
+
158
+ An alternative is to construct the 2-vector field from an empty list
159
+ of components and to set the nonzero nonredundant components
160
+ afterwards::
161
+
162
+ sage: a = A([], name='a')
163
+ sage: a[eU,0,1] = 3*x
164
+ sage: a.add_comp_by_continuation(eV, W, c_uv)
165
+ sage: a.display(eU)
166
+ a = 3*x ∂/∂x∧∂/∂y
167
+ sage: a.display(eV)
168
+ a = (-3*u - 3*v) ∂/∂u∧∂/∂v
169
+
170
+ The module `A^1(M)` is nothing but the dual of `\mathfrak{X}(M)`
171
+ (the module of vector fields on `M`)::
172
+
173
+ sage: A1 = M.multivector_module(1) ; A1
174
+ Module X(M) of vector fields on the 2-dimensional differentiable
175
+ manifold M
176
+ sage: A1 is XM
177
+ True
178
+
179
+ There is a coercion map `A^p(M)\rightarrow T^{(p,0)}(M)`::
180
+
181
+ sage: T20 = M.tensor_field_module((2,0)) ; T20
182
+ Module T^(2,0)(M) of type-(2,0) tensors fields on the
183
+ 2-dimensional differentiable manifold M
184
+ sage: T20.has_coerce_map_from(A)
185
+ True
186
+
187
+ but of course not in the reverse direction, since not all contravariant
188
+ tensor field is alternating::
189
+
190
+ sage: A.has_coerce_map_from(T20)
191
+ False
192
+
193
+ The coercion map `A^2(M) \rightarrow T^{(2,0)}(M)` in action::
194
+
195
+ sage: ta = T20(a) ; ta
196
+ Tensor field a of type (2,0) on the 2-dimensional differentiable
197
+ manifold M
198
+ sage: ta.display(eU)
199
+ a = 3*x ∂/∂x⊗∂/∂y - 3*x ∂/∂y⊗∂/∂x
200
+ sage: a.display(eU)
201
+ a = 3*x ∂/∂x∧∂/∂y
202
+ sage: ta.display(eV)
203
+ a = (-3*u - 3*v) ∂/∂u⊗∂/∂v + (3*u + 3*v) ∂/∂v⊗∂/∂u
204
+ sage: a.display(eV)
205
+ a = (-3*u - 3*v) ∂/∂u∧∂/∂v
206
+
207
+ There is also coercion to subdomains, which is nothing but the
208
+ restriction of the multivector field to some subset of its domain::
209
+
210
+ sage: A2U = U.multivector_module(2) ; A2U
211
+ Free module A^2(U) of 2-vector fields on the Open subset U of
212
+ the 2-dimensional differentiable manifold M
213
+ sage: A2U.has_coerce_map_from(A)
214
+ True
215
+ sage: a_U = A2U(a) ; a_U
216
+ 2-vector field a on the Open subset U of the 2-dimensional
217
+ differentiable manifold M
218
+ sage: a_U.display(eU)
219
+ a = 3*x ∂/∂x∧∂/∂y
220
+ """
221
+ Element = MultivectorField
222
+
223
+ def __init__(self, vector_field_module, degree):
224
+ r"""
225
+ Construction a module of multivector fields.
226
+
227
+ TESTS:
228
+
229
+ Module of 2-vector fields on a non-parallelizable 2-dimensional
230
+ manifold::
231
+
232
+ sage: M = Manifold(2, 'M')
233
+ sage: U = M.open_subset('U') ; V = M.open_subset('V')
234
+ sage: M.declare_union(U,V) # M is the union of U and V
235
+ sage: c_xy.<x,y> = U.chart() ; c_uv.<u,v> = V.chart()
236
+ sage: transf = c_xy.transition_map(c_uv, (x+y, x-y),
237
+ ....: intersection_name='W', restrictions1= x>0,
238
+ ....: restrictions2= u+v>0)
239
+ sage: inv = transf.inverse()
240
+ sage: from sage.manifolds.differentiable.multivector_module import \
241
+ ....: MultivectorModule
242
+ sage: A = MultivectorModule(M.vector_field_module(), 2) ; A
243
+ Module A^2(M) of 2-vector fields on the 2-dimensional
244
+ differentiable manifold M
245
+ sage: TestSuite(A).run(skip='_test_elements')
246
+
247
+ In the above test suite, ``_test_elements`` is skipped because
248
+ of the ``_test_pickling`` error of the elements (to be fixed in
249
+ :class:`sage.manifolds.differentiable.tensorfield.TensorField`)
250
+ """
251
+ domain = vector_field_module._domain
252
+ dest_map = vector_field_module._dest_map
253
+ name = "A^{}(".format(degree) + domain._name
254
+ latex_name = r"A^{{{}}}\left({}".format(degree,
255
+ domain._latex_name)
256
+ if dest_map is not domain.identity_map():
257
+ dm_name = dest_map._name
258
+ dm_latex_name = dest_map._latex_name
259
+ if dm_name is None:
260
+ dm_name = "unnamed map"
261
+ if dm_latex_name is None:
262
+ dm_latex_name = r"\mathrm{unnamed\; map}"
263
+ name += "," + dm_name
264
+ latex_name += "," + dm_latex_name
265
+ self._name = name + ")"
266
+ self._latex_name = latex_name + r"\right)"
267
+ self._vmodule = vector_field_module
268
+ self._degree = degree
269
+ # the member self._ring is created for efficiency (to avoid
270
+ # calls to self.base_ring()):
271
+ self._ring = domain.scalar_field_algebra()
272
+ Parent.__init__(self, base=self._ring,
273
+ category=Modules(self._ring))
274
+ self._domain = domain
275
+ self._dest_map = dest_map
276
+ self._ambient_domain = vector_field_module._ambient_domain
277
+ # NB: self._zero_element is not constructed here, since no
278
+ # element can be constructed here, to avoid some infinite
279
+ # recursion.
280
+
281
+ #### Parent methods
282
+
283
+ def _element_constructor_(self, comp=[], frame=None, name=None,
284
+ latex_name=None):
285
+ r"""
286
+ Construct a multivector field.
287
+
288
+ TESTS::
289
+
290
+ sage: M = Manifold(2, 'M')
291
+ sage: U = M.open_subset('U'); V = M.open_subset('V')
292
+ sage: c_xy.<x,y> = U.chart(); c_uv.<u,v> = V.chart()
293
+ sage: M.declare_union(U,V)
294
+ sage: A = M.multivector_module(2)
295
+ sage: a = A([[0, x*y], [-x*y, 0]], name='a'); a
296
+ 2-vector field a on the 2-dimensional differentiable
297
+ manifold M
298
+ sage: a.display(c_xy.frame())
299
+ a = x*y ∂/∂x∧∂/∂y
300
+ sage: A(0) is A.zero()
301
+ True
302
+ """
303
+ try:
304
+ if comp.is_trivial_zero():
305
+ return self.zero()
306
+ except AttributeError:
307
+ if comp == 0:
308
+ return self.zero()
309
+ if isinstance(comp, (MultivectorField, MultivectorFieldParal)):
310
+ # coercion by domain restriction
311
+ if (self._degree == comp._tensor_type[0]
312
+ and self._domain.is_subset(comp._domain)
313
+ and self._ambient_domain.is_subset(
314
+ comp._ambient_domain)):
315
+ return comp.restrict(self._domain)
316
+ else:
317
+ raise TypeError("cannot convert the {} ".format(comp) +
318
+ "to an element of {}".format(self))
319
+ if not isinstance(comp, (list, tuple)):
320
+ raise TypeError("cannot convert the {} ".format(comp) +
321
+ "to an element of {}".format(self))
322
+ # standard construction
323
+ resu = self.element_class(self._vmodule, self._degree,
324
+ name=name, latex_name=latex_name)
325
+ if comp:
326
+ resu.set_comp(frame)[:] = comp
327
+ return resu
328
+
329
+ def _an_element_(self):
330
+ r"""
331
+ Construct some (unnamed) multivector field.
332
+
333
+ TESTS::
334
+
335
+ sage: M = Manifold(2, 'M')
336
+ sage: U = M.open_subset('U'); V = M.open_subset('V')
337
+ sage: c_xy.<x,y> = U.chart(); c_uv.<u,v> = V.chart()
338
+ sage: M.declare_union(U,V)
339
+ sage: A = M.multivector_module(2)
340
+ sage: A._an_element_()
341
+ 2-vector field on the 2-dimensional differentiable
342
+ manifold M
343
+ """
344
+ resu = self.element_class(self._vmodule, self._degree)
345
+ for oc in self._domain.open_covers(trivial=False):
346
+ # the first non-trivial open cover is selected
347
+ for dom in oc:
348
+ vmodule_dom = dom.vector_field_module(
349
+ dest_map=self._dest_map.restrict(dom))
350
+ dmodule_dom = vmodule_dom.exterior_power(self._degree)
351
+ resu.set_restriction(dmodule_dom._an_element_())
352
+ return resu
353
+ return resu
354
+
355
+ def _coerce_map_from_(self, other):
356
+ r"""
357
+ Determine whether coercion to ``self`` exists from other parent.
358
+
359
+ TESTS::
360
+
361
+ sage: M = Manifold(3, 'M')
362
+ sage: A2 = M.multivector_module(2)
363
+ sage: A2._coerce_map_from_(M.tensor_field_module((2,0)))
364
+ False
365
+ sage: U = M.open_subset('U')
366
+ sage: A2U = U.multivector_module(2)
367
+ sage: A2U._coerce_map_from_(A2)
368
+ True
369
+ sage: A2._coerce_map_from_(A2U)
370
+ False
371
+ """
372
+ if isinstance(other, (MultivectorModule, MultivectorFreeModule)):
373
+ # coercion by domain restriction
374
+ return (self._degree == other._degree
375
+ and self._domain.is_subset(other._domain)
376
+ and self._ambient_domain.is_subset(
377
+ other._ambient_domain))
378
+ return False
379
+
380
+ @cached_method
381
+ def zero(self):
382
+ """
383
+ Return the zero of ``self``.
384
+
385
+ EXAMPLES::
386
+
387
+ sage: M = Manifold(3, 'M')
388
+ sage: A2 = M.multivector_module(2)
389
+ sage: A2.zero()
390
+ 2-vector field zero on the 3-dimensional differentiable
391
+ manifold M
392
+ """
393
+ zero = self._element_constructor_(name='zero', latex_name='0')
394
+ for frame in self._domain._frames:
395
+ if self._dest_map.restrict(frame._domain) == frame._dest_map:
396
+ zero.add_comp(frame)
397
+ # (since new components are initialized to zero)
398
+ zero._is_zero = True # This element is certainly zero
399
+ zero.set_immutable()
400
+ return zero
401
+
402
+ #### End of Parent methods
403
+
404
+ def _repr_(self):
405
+ r"""
406
+ Return a string representation of the object.
407
+
408
+ TESTS::
409
+
410
+ sage: M = Manifold(3, 'M')
411
+ sage: A2 = M.multivector_module(2)
412
+ sage: A2
413
+ Module A^2(M) of 2-vector fields on the 3-dimensional
414
+ differentiable manifold M
415
+ """
416
+ description = "Module "
417
+ if self._name is not None:
418
+ description += self._name + " "
419
+ description += "of {}-vector fields ".format(self._degree)
420
+ if self._dest_map is self._domain.identity_map():
421
+ description += "on the {}".format(self._domain)
422
+ else:
423
+ description += "along the {} mapped into the {}".format(
424
+ self._domain, self._ambient_domain)
425
+ return description
426
+
427
+ def _latex_(self):
428
+ r"""
429
+ Return a LaTeX representation of the object.
430
+
431
+ TESTS::
432
+
433
+ sage: M = Manifold(3, 'M', latex_name=r'\mathcal{M}')
434
+ sage: A2 = M.multivector_module(2)
435
+ sage: A2._latex_()
436
+ 'A^{2}\\left(\\mathcal{M}\\right)'
437
+ sage: latex(A2) # indirect doctest
438
+ A^{2}\left(\mathcal{M}\right)
439
+ """
440
+ if self._latex_name is None:
441
+ return r'\text{' + str(self) + r'}'
442
+ else:
443
+ return self._latex_name
444
+
445
+ def base_module(self):
446
+ r"""
447
+ Return the vector field module on which the multivector field
448
+ module ``self`` is constructed.
449
+
450
+ OUTPUT:
451
+
452
+ - a
453
+ :class:`~sage.manifolds.differentiable.vectorfield_module.VectorFieldModule`
454
+ representing the module on which ``self`` is defined
455
+
456
+ EXAMPLES::
457
+
458
+ sage: M = Manifold(3, 'M')
459
+ sage: A2 = M.multivector_module(2) ; A2
460
+ Module A^2(M) of 2-vector fields on the 3-dimensional
461
+ differentiable manifold M
462
+ sage: A2.base_module()
463
+ Module X(M) of vector fields on the 3-dimensional
464
+ differentiable manifold M
465
+ sage: A2.base_module() is M.vector_field_module()
466
+ True
467
+ sage: U = M.open_subset('U')
468
+ sage: A2U = U.multivector_module(2) ; A2U
469
+ Module A^2(U) of 2-vector fields on the Open subset U of the
470
+ 3-dimensional differentiable manifold M
471
+ sage: A2U.base_module()
472
+ Module X(U) of vector fields on the Open subset U of the
473
+ 3-dimensional differentiable manifold M
474
+ """
475
+ return self._vmodule
476
+
477
+ def degree(self):
478
+ r"""
479
+ Return the degree of the multivector fields in ``self``.
480
+
481
+ OUTPUT: integer `p` such that ``self`` is a set of `p`-vector fields
482
+
483
+ EXAMPLES::
484
+
485
+ sage: M = Manifold(3, 'M')
486
+ sage: M.multivector_module(2).degree()
487
+ 2
488
+ sage: M.multivector_module(3).degree()
489
+ 3
490
+ """
491
+ return self._degree
492
+
493
+ #***********************************************************************
494
+
495
+
496
+ class MultivectorFreeModule(ExtPowerFreeModule):
497
+ r"""
498
+ Free module of multivector fields of a given degree `p` (`p`-vector
499
+ fields) along a differentiable manifold `U` with values on a
500
+ parallelizable manifold `M`.
501
+
502
+ Given a differentiable manifold `U` and a differentiable map
503
+ `\Phi:\; U \rightarrow M` to a parallelizable manifold `M` of dimension
504
+ `n`, the set `A^p(U, \Phi)` of `p`-vector fields (i.e. alternating tensor
505
+ fields of type `(p,0)`) along `U` with values on `M` is a free module
506
+ of rank `\binom{n}{p}` over `C^k(U)`, the commutative algebra of
507
+ differentiable scalar fields on `U` (see
508
+ :class:`~sage.manifolds.differentiable.scalarfield_algebra.DiffScalarFieldAlgebra`).
509
+ The standard case of `p`-vector fields *on* a differentiable
510
+ manifold `M` corresponds to `U = M` and `\Phi = \mathrm{Id}_M`.
511
+ Other common cases are `\Phi` being an immersion and `\Phi` being a
512
+ curve in `M` (`U` is then an open interval of `\RR`).
513
+
514
+ .. NOTE::
515
+
516
+ This class implements `A^p(U, \Phi)` in the case where `M` is
517
+ parallelizable; `A^p(U, \Phi)` is then a *free* module. If `M`
518
+ is not parallelizable, the class :class:`MultivectorModule` must
519
+ be used instead.
520
+
521
+ INPUT:
522
+
523
+ - ``vector_field_module`` -- free module `\mathfrak{X}(U,\Phi)` of
524
+ vector fields along `U` associated with the map
525
+ `\Phi: U \rightarrow V`
526
+ - ``degree`` -- positive integer; the degree `p` of the multivector
527
+ fields
528
+
529
+ EXAMPLES:
530
+
531
+ Free module of 2-vector fields on a parallelizable 3-dimensional
532
+ manifold::
533
+
534
+ sage: M = Manifold(3, 'M')
535
+ sage: X.<x,y,z> = M.chart()
536
+ sage: XM = M.vector_field_module() ; XM
537
+ Free module X(M) of vector fields on the 3-dimensional
538
+ differentiable manifold M
539
+ sage: A = M.multivector_module(2) ; A
540
+ Free module A^2(M) of 2-vector fields on the 3-dimensional
541
+ differentiable manifold M
542
+ sage: latex(A)
543
+ A^{2}\left(M\right)
544
+
545
+ ``A`` is nothing but the second exterior power of ``XM``, i.e. we
546
+ have `A^{2}(M) = \Lambda^2(\mathfrak{X}(M))` (see
547
+ :class:`~sage.tensor.modules.ext_pow_free_module.ExtPowerFreeModule`)::
548
+
549
+ sage: A is XM.exterior_power(2)
550
+ True
551
+
552
+ `A^{2}(M)` is a module over the algebra `C^k(M)` of (differentiable)
553
+ scalar fields on `M`::
554
+
555
+ sage: A.category()
556
+ Category of finite dimensional modules over Algebra of
557
+ differentiable scalar fields on the 3-dimensional
558
+ differentiable manifold M
559
+ sage: CM = M.scalar_field_algebra() ; CM
560
+ Algebra of differentiable scalar fields on the 3-dimensional
561
+ differentiable manifold M
562
+ sage: A in Modules(CM)
563
+ True
564
+ sage: A.base_ring()
565
+ Algebra of differentiable scalar fields on
566
+ the 3-dimensional differentiable manifold M
567
+ sage: A.base_module()
568
+ Free module X(M) of vector fields on
569
+ the 3-dimensional differentiable manifold M
570
+ sage: A.base_module() is XM
571
+ True
572
+ sage: A.rank()
573
+ 3
574
+
575
+ Elements can be constructed from `A`. In particular, ``0`` yields
576
+ the zero element of `A`::
577
+
578
+ sage: A(0)
579
+ 2-vector field zero on the 3-dimensional differentiable
580
+ manifold M
581
+ sage: A(0) is A.zero()
582
+ True
583
+
584
+ while nonzero elements are constructed by providing their
585
+ components in a given vector frame::
586
+
587
+ sage: comp = [[0,3*x,-z],[-3*x,0,4],[z,-4,0]]
588
+ sage: a = A(comp, frame=X.frame(), name='a') ; a
589
+ 2-vector field a on the 3-dimensional differentiable manifold M
590
+ sage: a.display()
591
+ a = 3*x ∂/∂x∧∂/∂y - z ∂/∂x∧∂/∂z + 4 ∂/∂y∧∂/∂z
592
+
593
+ An alternative is to construct the 2-vector field from an empty list
594
+ of components and to set the nonzero nonredundant components
595
+ afterwards::
596
+
597
+ sage: a = A([], name='a')
598
+ sage: a[0,1] = 3*x # component in the manifold's default frame
599
+ sage: a[0,2] = -z
600
+ sage: a[1,2] = 4
601
+ sage: a.display()
602
+ a = 3*x ∂/∂x∧∂/∂y - z ∂/∂x∧∂/∂z + 4 ∂/∂y∧∂/∂z
603
+
604
+ The module `A^1(M)` is nothing but `\mathfrak{X}(M)` (the free module
605
+ of vector fields on `M`)::
606
+
607
+ sage: A1 = M.multivector_module(1) ; A1
608
+ Free module X(M) of vector fields on the 3-dimensional
609
+ differentiable manifold M
610
+ sage: A1 is XM
611
+ True
612
+
613
+ There is a coercion map `A^p(M) \rightarrow T^{(p,0)}(M)`::
614
+
615
+ sage: T20 = M.tensor_field_module((2,0)); T20
616
+ Free module T^(2,0)(M) of type-(2,0) tensors fields on the
617
+ 3-dimensional differentiable manifold M
618
+ sage: T20.has_coerce_map_from(A)
619
+ True
620
+
621
+ but of course not in the reverse direction, since not all contravariant
622
+ tensor field is alternating::
623
+
624
+ sage: A.has_coerce_map_from(T20)
625
+ False
626
+
627
+ The coercion map `A^2(M) \rightarrow T^{(2,0)}(M)` in action::
628
+
629
+ sage: T20 = M.tensor_field_module((2,0)) ; T20
630
+ Free module T^(2,0)(M) of type-(2,0) tensors fields on the
631
+ 3-dimensional differentiable manifold M
632
+ sage: ta = T20(a) ; ta
633
+ Tensor field a of type (2,0) on the 3-dimensional differentiable
634
+ manifold M
635
+ sage: ta.display()
636
+ a = 3*x ∂/∂x⊗∂/∂y - z ∂/∂x⊗∂/∂z - 3*x ∂/∂y⊗∂/∂x + 4 ∂/∂y⊗∂/∂z
637
+ + z ∂/∂z⊗∂/∂x - 4 ∂/∂z⊗∂/∂y
638
+ sage: a.display()
639
+ a = 3*x ∂/∂x∧∂/∂y - z ∂/∂x∧∂/∂z + 4 ∂/∂y∧∂/∂z
640
+ sage: ta.symmetries() # the antisymmetry is preserved
641
+ no symmetry; antisymmetry: (0, 1)
642
+
643
+ There is also coercion to subdomains, which is nothing but the
644
+ restriction of the multivector field to some subset of its domain::
645
+
646
+ sage: U = M.open_subset('U', coord_def={X: x^2+y^2<1})
647
+ sage: B = U.multivector_module(2) ; B
648
+ Free module A^2(U) of 2-vector fields on the Open subset U of the
649
+ 3-dimensional differentiable manifold M
650
+ sage: B.has_coerce_map_from(A)
651
+ True
652
+ sage: a_U = B(a) ; a_U
653
+ 2-vector field a on the Open subset U of the 3-dimensional
654
+ differentiable manifold M
655
+ sage: a_U.display()
656
+ a = 3*x ∂/∂x∧∂/∂y - z ∂/∂x∧∂/∂z + 4 ∂/∂y∧∂/∂z
657
+ """
658
+
659
+ Element = MultivectorFieldParal
660
+
661
+ def __init__(self, vector_field_module, degree):
662
+ r"""
663
+ Construct a free module of multivector fields.
664
+
665
+ TESTS::
666
+
667
+ sage: M = Manifold(3, 'M')
668
+ sage: X.<x,y,z> = M.chart()
669
+ sage: from sage.manifolds.differentiable.multivector_module \
670
+ ....: import MultivectorFreeModule
671
+ sage: A = MultivectorFreeModule(M.vector_field_module(), 2)
672
+ sage: A
673
+ Free module A^2(M) of 2-vector fields on the 3-dimensional
674
+ differentiable manifold M
675
+ sage: TestSuite(A).run()
676
+ """
677
+ domain = vector_field_module._domain
678
+ dest_map = vector_field_module._dest_map
679
+ name = "A^{}(".format(degree) + domain._name
680
+ latex_name = r"A^{{{}}}\left({}".format(degree,
681
+ domain._latex_name)
682
+ if dest_map is not domain.identity_map():
683
+ dm_name = dest_map._name
684
+ dm_latex_name = dest_map._latex_name
685
+ if dm_name is None:
686
+ dm_name = "unnamed map"
687
+ if dm_latex_name is None:
688
+ dm_latex_name = r"\mathrm{unnamed\; map}"
689
+ name += "," + dm_name
690
+ latex_name += "," + dm_latex_name
691
+ name += ")"
692
+ latex_name += r"\right)"
693
+ ExtPowerFreeModule.__init__(self, vector_field_module, degree,
694
+ name=name, latex_name=latex_name)
695
+ self._domain = domain
696
+ self._dest_map = dest_map
697
+ self._ambient_domain = vector_field_module._ambient_domain
698
+
699
+ #### Parent methods
700
+
701
+ def _element_constructor_(self, comp=[], frame=None, name=None,
702
+ latex_name=None):
703
+ r"""
704
+ Construct a multivector field.
705
+
706
+ TESTS::
707
+
708
+ sage: M = Manifold(2, 'M')
709
+ sage: X.<x,y> = M.chart() # makes M parallelizable
710
+ sage: A = M.multivector_module(2)
711
+ sage: a = A([[0, x], [-x, 0]], name='a'); a
712
+ 2-vector field a on the 2-dimensional differentiable
713
+ manifold M
714
+ sage: a.display()
715
+ a = x ∂/∂x∧∂/∂y
716
+ sage: A(0) is A.zero()
717
+ True
718
+ """
719
+ try:
720
+ if comp.is_trivial_zero():
721
+ return self.zero()
722
+ except AttributeError:
723
+ if comp == 0:
724
+ return self.zero()
725
+ if isinstance(comp, (MultivectorField, MultivectorFieldParal)):
726
+ # coercion by domain restriction
727
+ if (self._degree == comp._tensor_type[0]
728
+ and self._domain.is_subset(comp._domain)
729
+ and self._ambient_domain.is_subset(
730
+ comp._ambient_domain)):
731
+ return comp.restrict(self._domain)
732
+ else:
733
+ raise TypeError("cannot convert the {} ".format(comp) +
734
+ "to a multivector field in {}".format(self))
735
+ if not isinstance(comp, (list, tuple)):
736
+ raise TypeError("cannot convert the {} ".format(comp) +
737
+ "to an element of {}".format(self))
738
+ # standard construction
739
+ resu = self.element_class(self._fmodule, self._degree, name=name,
740
+ latex_name=latex_name)
741
+ if comp:
742
+ resu.set_comp(frame)[:] = comp
743
+ return resu
744
+
745
+ # Rem: _an_element_ is declared in the superclass ExtPowerFreeModule
746
+
747
+ def _coerce_map_from_(self, other):
748
+ r"""
749
+ Determine whether coercion to ``self`` exists from other parent.
750
+
751
+ TESTS::
752
+
753
+ sage: M = Manifold(3, 'M')
754
+ sage: X.<x,y,z> = M.chart()
755
+ sage: A2 = M.multivector_module(2)
756
+ sage: U = M.open_subset('U', coord_def = {X: z<0})
757
+ sage: A2U = U.multivector_module(2)
758
+ sage: A2U._coerce_map_from_(A2)
759
+ True
760
+ sage: A2._coerce_map_from_(A2U)
761
+ False
762
+ sage: A1 = M.multivector_module(1)
763
+ sage: A2U._coerce_map_from_(A1)
764
+ False
765
+ sage: A2._coerce_map_from_(M.tensor_field_module((2,0)))
766
+ False
767
+ """
768
+ if isinstance(other, (MultivectorModule, MultivectorFreeModule)):
769
+ # coercion by domain restriction
770
+ return (self._degree == other._degree
771
+ and self._domain.is_subset(other._domain)
772
+ and self._ambient_domain.is_subset(
773
+ other._ambient_domain))
774
+ return False
775
+
776
+ #### End of Parent methods
777
+
778
+ def _repr_(self):
779
+ r"""
780
+ Return a string representation of ``self``.
781
+
782
+ TESTS::
783
+
784
+ sage: M = Manifold(3, 'M')
785
+ sage: X.<x,y,z> = M.chart()
786
+ sage: A = M.multivector_module(2)
787
+ sage: A
788
+ Free module A^2(M) of 2-vector fields on
789
+ the 3-dimensional differentiable manifold M
790
+ """
791
+ description = "Free module "
792
+ if self._name is not None:
793
+ description += self._name + " "
794
+ description += "of {}-vector fields ".format(self._degree)
795
+ if self._dest_map is self._domain.identity_map():
796
+ description += "on the {}".format(self._domain)
797
+ else:
798
+ description += "along the {} mapped into the {}".format(
799
+ self._domain, self._ambient_domain)
800
+ return description