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,559 @@
1
+ # sage_setup: distribution = sagemath-symbolics
2
+ r"""
3
+ Graded Algebra of Mixed Differential Forms
4
+
5
+ Let `M` and `N` be differentiable manifolds and `\varphi: M \to N` a
6
+ differentiable map. The space of *mixed differential forms along* `\varphi`,
7
+ denoted by `\Omega^*(M,\varphi)`, is given by the direct sum
8
+ `\bigoplus^n_{j=0} \Omega^j(M,\varphi)` of differential form modules, where
9
+ `n=\dim(N)`. With the wedge product, `\Omega^*(M,\varphi)` inherits the
10
+ structure of a graded algebra. See :class:`MixedFormAlgebra` for details.
11
+
12
+ This algebra is endowed with a natural chain complex structure induced by the
13
+ exterior derivative. The corresponding homology is called *de Rham cohomology*.
14
+ See
15
+ :class:`~sage.manifolds.differentiable.de_rham_cohomology.DeRhamCohomologyRing`
16
+ for details.
17
+
18
+ AUTHORS:
19
+
20
+ - Michael Jung (2019) : initial version
21
+ """
22
+
23
+ #******************************************************************************
24
+ # Copyright (C) 2019-2021 Michael Jung <m.jung@vu.nl>
25
+ #
26
+ # Distributed under the terms of the GNU General Public License (GPL)
27
+ # as published by the Free Software Foundation; either version 2 of
28
+ # the License, or (at your option) any later version.
29
+ # https://www.gnu.org/licenses/
30
+ #******************************************************************************
31
+
32
+ from sage.categories.chain_complexes import ChainComplexes
33
+ from sage.categories.graded_algebras import GradedAlgebras
34
+ from sage.categories.morphism import SetMorphism
35
+ from sage.manifolds.differentiable.mixed_form import MixedForm
36
+ from sage.misc.cachefunc import cached_method
37
+ from sage.structure.parent import Parent
38
+ from sage.structure.unique_representation import UniqueRepresentation
39
+ from sage.symbolic.ring import SR
40
+
41
+
42
+ class MixedFormAlgebra(Parent, UniqueRepresentation):
43
+ r"""
44
+ An instance of this class represents the graded algebra of mixed forms.
45
+ That is, if `\varphi: M \to N` is a differentiable map between two
46
+ differentiable manifolds `M` and `N`, the *graded algebra of mixed forms*
47
+ `\Omega^*(M,\varphi)` *along* `\varphi` is defined via the direct sum
48
+ `\bigoplus^{n}_{j=0} \Omega^j(M,\varphi)` consisting of differential form
49
+ modules
50
+ (cf. :class:`~sage.manifolds.differentiable.diff_form_module.DiffFormModule`),
51
+ where `n` is the dimension of `N`. Hence, `\Omega^*(M,\varphi)` is a module
52
+ over `C^k(M)` and a vector space over `\RR` or `\CC`. Furthermore notice,
53
+ that
54
+
55
+ .. MATH::
56
+
57
+ \Omega^*(M,\varphi) \cong C^k \left( \bigoplus^n_{j=0} \Lambda^j(\varphi^*T^*N) \right),
58
+
59
+ where `C^k` denotes the global section functor for differentiable sections
60
+ of order `k` here.
61
+
62
+ The wedge product induces a multiplication on `\Omega^*(M,\varphi)` and
63
+ gives it the structure of a graded algebra since
64
+
65
+ .. MATH::
66
+
67
+ \Omega^k(M,\varphi) \wedge \Omega^l(M,\varphi) \subset \Omega^{k+l}(M,\varphi).
68
+
69
+ Moreover, `\Omega^*(M,\varphi)` inherits the structure of a chain complex,
70
+ called *de Rham complex*, with the exterior derivative as boundary map,
71
+ that is
72
+
73
+ .. MATH::
74
+
75
+ 0 \rightarrow \Omega^0(M,\varphi) \xrightarrow{\mathrm{d}_0}
76
+ \Omega^1(M,\varphi) \xrightarrow{\mathrm{d}_1} \dots
77
+ \xrightarrow{\mathrm{d}_{n-1}} \Omega^n(M,\varphi)
78
+ \xrightarrow{\mathrm{d}_{n}} 0.
79
+
80
+ The induced cohomology is called *de Rham cohomology*, see
81
+ :meth:`cohomology` or
82
+ :class:`~sage.manifolds.differentiable.de_rham_cohomology.DeRhamCohomologyRing`
83
+ respectively.
84
+
85
+ INPUT:
86
+
87
+ - ``vector_field_module`` -- module `\mathfrak{X}(M,\varphi)` of vector
88
+ fields along `M` associated with the map `\varphi: M \rightarrow N`
89
+
90
+ EXAMPLES:
91
+
92
+ Graded algebra of mixed forms on a 3-dimensional manifold::
93
+
94
+ sage: M = Manifold(3, 'M')
95
+ sage: X.<x,y,z> = M.chart()
96
+ sage: Omega = M.mixed_form_algebra(); Omega
97
+ Graded algebra Omega^*(M) of mixed differential forms on the
98
+ 3-dimensional differentiable manifold M
99
+ sage: Omega.category()
100
+ Join of Category of graded algebras over Symbolic Ring and Category of
101
+ chain complexes over Symbolic Ring
102
+ sage: Omega.base_ring()
103
+ Symbolic Ring
104
+ sage: Omega.vector_field_module()
105
+ Free module X(M) of vector fields on the 3-dimensional differentiable
106
+ manifold M
107
+
108
+ Elements can be created from scratch::
109
+
110
+ sage: A = Omega(0); A
111
+ Mixed differential form zero on the 3-dimensional differentiable
112
+ manifold M
113
+ sage: A is Omega.zero()
114
+ True
115
+ sage: B = Omega(1); B
116
+ Mixed differential form one on the 3-dimensional differentiable
117
+ manifold M
118
+ sage: B is Omega.one()
119
+ True
120
+ sage: C = Omega([2,0,0,0]); C
121
+ Mixed differential form on the 3-dimensional differentiable manifold M
122
+
123
+ There are some important coercions implemented::
124
+
125
+ sage: Omega0 = M.scalar_field_algebra(); Omega0
126
+ Algebra of differentiable scalar fields on the 3-dimensional
127
+ differentiable manifold M
128
+ sage: Omega.has_coerce_map_from(Omega0)
129
+ True
130
+ sage: Omega2 = M.diff_form_module(2); Omega2
131
+ Free module Omega^2(M) of 2-forms on the 3-dimensional differentiable
132
+ manifold M
133
+ sage: Omega.has_coerce_map_from(Omega2)
134
+ True
135
+
136
+ Restrictions induce coercions as well::
137
+
138
+ sage: U = M.open_subset('U'); U
139
+ Open subset U of the 3-dimensional differentiable manifold M
140
+ sage: OmegaU = U.mixed_form_algebra(); OmegaU
141
+ Graded algebra Omega^*(U) of mixed differential forms on the Open
142
+ subset U of the 3-dimensional differentiable manifold M
143
+ sage: OmegaU.has_coerce_map_from(Omega)
144
+ True
145
+ """
146
+ Element = MixedForm
147
+
148
+ def __init__(self, vector_field_module):
149
+ r"""
150
+ Construct a graded algebra of mixed forms.
151
+
152
+ TESTS:
153
+
154
+ Graded algebra of mixed forms on a non-parallelizable 2-dimensional
155
+ manifold::
156
+
157
+ sage: M = Manifold(2, 'M')
158
+ sage: U = M.open_subset('U') ; V = M.open_subset('V')
159
+ sage: M.declare_union(U,V) # M is the union of U and V
160
+ sage: c_xy.<x,y> = U.chart() ; c_uv.<u,v> = V.chart()
161
+ sage: transf = c_xy.transition_map(c_uv, (x+y, x-y),
162
+ ....: intersection_name='W', restrictions1= x>0,
163
+ ....: restrictions2= u+v>0)
164
+ sage: inv = transf.inverse()
165
+ sage: from sage.manifolds.differentiable.mixed_form_algebra \
166
+ ....: import MixedFormAlgebra
167
+ sage: A = MixedFormAlgebra(M.vector_field_module())
168
+ sage: TestSuite(A).run()
169
+ """
170
+ if vector_field_module is None:
171
+ raise ValueError("underlying vector field module must be provided")
172
+ domain = vector_field_module._domain
173
+ dest_map = vector_field_module._dest_map
174
+ # Set name and latex_name:
175
+ name = "Omega^*(" + domain._name
176
+ latex_name = r"\Omega^*\left(" + domain._latex_name
177
+ if dest_map is not domain.identity_map():
178
+ dm_name = dest_map._name
179
+ dm_latex_name = dest_map._latex_name
180
+ if dm_name is None:
181
+ dm_name = "unnamed map"
182
+ if dm_latex_name is None:
183
+ dm_latex_name = r"\mathrm{unnamed\; map}"
184
+ name += "," + dm_name
185
+ latex_name += "," + dm_latex_name
186
+ self._name = name + ")"
187
+ self._latex_name = latex_name + r"\right)"
188
+ # Add this algebra to the category of graded algebras:
189
+ base_field = domain.base_field()
190
+ if domain.base_field_type() in ['real', 'complex']:
191
+ base_field = SR
192
+ category = GradedAlgebras(base_field) & ChainComplexes(base_field)
193
+ Parent.__init__(self, base=base_field, category=category)
194
+ # Define attributes:
195
+ self._domain = domain
196
+ self._ambient_domain = vector_field_module._ambient_domain
197
+ self._dest_map = dest_map
198
+ self._vmodule = vector_field_module
199
+ self._max_deg = vector_field_module._ambient_domain.dim()
200
+
201
+ def _element_constructor_(self, comp, name=None, latex_name=None):
202
+ r"""
203
+ Construct a mixed form.
204
+
205
+ TESTS::
206
+
207
+ sage: M = Manifold(2, 'M')
208
+ sage: U = M.open_subset('U'); V = M.open_subset('V')
209
+ sage: c_xy.<x,y> = U.chart(); c_uv.<u,v> = V.chart()
210
+ sage: M.declare_union(U,V)
211
+ sage: A = M.mixed_form_algebra()
212
+ sage: a = A([x,0,0], name='a'); a
213
+ Mixed differential form a on the 2-dimensional differentiable
214
+ manifold M
215
+ """
216
+ try:
217
+ if comp.is_trivial_zero():
218
+ return self.zero()
219
+ elif (comp - 1).is_trivial_zero():
220
+ return self.one()
221
+ except AttributeError:
222
+ if comp == 0:
223
+ return self.zero()
224
+ if comp == 1:
225
+ return self.one()
226
+ res = self.element_class(self, name=name, latex_name=latex_name)
227
+ if isinstance(comp, (tuple, list)):
228
+ if len(comp) != self._max_deg + 1:
229
+ raise IndexError("input list must have "
230
+ "length {}".format(self._max_deg + 1))
231
+ if isinstance(comp, tuple):
232
+ comp = list(comp)
233
+ res[:] = comp[:]
234
+ else:
235
+ for d in self.irange():
236
+ dom = self._domain
237
+ dmodule = dom.diff_form_module(d, dest_map=self._dest_map)
238
+ if dmodule.has_coerce_map_from(comp.parent()):
239
+ deg = d
240
+ break
241
+ else:
242
+ raise TypeError("cannot convert {} into an element of "
243
+ "the {}".format(comp, self))
244
+ # fill up with zeroes:
245
+ res[:] = [0] * (self._max_deg + 1)
246
+ # set comp where it belongs:
247
+ res[deg] = comp # coercion is performed here
248
+ # In case, no other name is given, use name of comp:
249
+ if name is None:
250
+ if hasattr(comp, '_name'):
251
+ res._name = comp._name
252
+ if latex_name is None:
253
+ if hasattr(comp, '_latex_name'):
254
+ res._latex_name = comp._latex_name
255
+ return res
256
+
257
+ def _an_element_(self):
258
+ r"""
259
+ Construct some (unnamed) mixed form.
260
+
261
+ TESTS::
262
+
263
+ sage: M = Manifold(2, 'M')
264
+ sage: U = M.open_subset('U'); V = M.open_subset('V')
265
+ sage: c_xy.<x,y> = U.chart(); c_uv.<u,v> = V.chart()
266
+ sage: M.declare_union(U,V)
267
+ sage: A = M.mixed_form_algebra()
268
+ sage: A._an_element_()
269
+ Mixed differential form on the 2-dimensional differentiable
270
+ manifold M
271
+ """
272
+ res = self.element_class(self)
273
+ dom = self._domain
274
+ res._comp = [dom.diff_form_module(j, self._dest_map)._an_element_()
275
+ for j in self.irange()]
276
+ return res
277
+
278
+ def _coerce_map_from_(self, S):
279
+ r"""
280
+ Determine whether coercion to ``self`` exists from other parent.
281
+
282
+ TESTS::
283
+
284
+ sage: M = Manifold(3, 'M')
285
+ sage: A = M.mixed_form_algebra()
286
+ sage: A._coerce_map_from_(M.diff_form_module(0))
287
+ True
288
+ sage: A._coerce_map_from_(M.diff_form_module(1))
289
+ True
290
+ sage: A._coerce_map_from_(M.diff_form_module(2))
291
+ True
292
+ sage: A._coerce_map_from_(M.diff_form_module(3))
293
+ True
294
+ sage: A._coerce_map_from_(M.tensor_field_module((0,1)))
295
+ True
296
+ sage: U = M.open_subset('U')
297
+ sage: AU = U.mixed_form_algebra()
298
+ sage: AU._coerce_map_from_(A)
299
+ True
300
+ sage: A._coerce_map_from_(AU)
301
+ False
302
+ """
303
+ if isinstance(S, type(self)):
304
+ # coercion by domain restriction
305
+ if (self._domain.is_subset(S._domain) and
306
+ self._ambient_domain.is_subset(S._ambient_domain)):
307
+ return True
308
+ # Still, there could be a coerce map
309
+ if self.irange() != S.irange():
310
+ return False
311
+ # Check coercions on each degree:
312
+ for deg in self.irange():
313
+ dmodule1 = self._domain.diff_form_module(deg, self._dest_map)
314
+ dmodule2 = S._domain.diff_form_module(deg, S._dest_map)
315
+ if not dmodule1.has_coerce_map_from(dmodule2):
316
+ return False
317
+ # Each degree is coercible so there must be a coerce map:
318
+ return True
319
+ # Let us check for each degree consecutively:
320
+ dom = self._domain
321
+ return any(dom.diff_form_module(deg, self._dest_map).has_coerce_map_from(S)
322
+ for deg in self.irange())
323
+
324
+ @cached_method
325
+ def zero(self):
326
+ r"""
327
+ Return the zero of ``self``.
328
+
329
+ EXAMPLES::
330
+
331
+ sage: M = Manifold(3, 'M')
332
+ sage: A = M.mixed_form_algebra()
333
+ sage: A.zero()
334
+ Mixed differential form zero on the 3-dimensional differentiable
335
+ manifold M
336
+ """
337
+ res = self.element_class(self, name='zero', latex_name='0')
338
+ res._comp = [self._domain.diff_form_module(j, dest_map=self._dest_map).zero()
339
+ for j in self.irange()]
340
+ res._is_zero = True # This element is certainly zero
341
+ res.set_immutable()
342
+ return res
343
+
344
+ @cached_method
345
+ def one(self):
346
+ r"""
347
+ Return the one of ``self``.
348
+
349
+ EXAMPLES::
350
+
351
+ sage: M = Manifold(3, 'M')
352
+ sage: A = M.mixed_form_algebra()
353
+ sage: A.one()
354
+ Mixed differential form one on the 3-dimensional differentiable
355
+ manifold M
356
+ """
357
+ res = self.element_class(self, name='one', latex_name='1')
358
+ res._comp = [self._domain.one_scalar_field(),
359
+ *(self._domain.diff_form_module(j, dest_map=self._dest_map).zero()
360
+ for j in self.irange(1))]
361
+ res.set_immutable()
362
+ return res
363
+
364
+ def vector_field_module(self):
365
+ r"""
366
+ Return the underlying vector field module.
367
+
368
+ EXAMPLES::
369
+
370
+ sage: M = Manifold(2, 'M')
371
+ sage: N = Manifold(3, 'N')
372
+ sage: Phi = M.diff_map(N, name='Phi'); Phi
373
+ Differentiable map Phi from the 2-dimensional differentiable
374
+ manifold M to the 3-dimensional differentiable manifold N
375
+ sage: A = M.mixed_form_algebra(Phi); A
376
+ Graded algebra Omega^*(M,Phi) of mixed differential forms along the
377
+ 2-dimensional differentiable manifold M mapped into the
378
+ 3-dimensional differentiable manifold N via Phi
379
+ sage: A.vector_field_module()
380
+ Module X(M,Phi) of vector fields along the 2-dimensional
381
+ differentiable manifold M mapped into the 3-dimensional
382
+ differentiable manifold N
383
+ """
384
+ return self._vmodule
385
+
386
+ def _repr_(self):
387
+ r"""
388
+ Return a string representation of the object.
389
+
390
+ TESTS::
391
+
392
+ sage: M = Manifold(3, 'M')
393
+ sage: A = M.mixed_form_algebra(); A
394
+ Graded algebra Omega^*(M) of mixed differential forms on the
395
+ 3-dimensional differentiable manifold M
396
+ """
397
+ desc = "Graded algebra " + self._name
398
+ desc += " of mixed differential forms "
399
+ if self._dest_map is self._domain.identity_map():
400
+ desc += "on the {}".format(self._domain)
401
+ else:
402
+ desc += "along the {} mapped ".format(self._domain)
403
+ desc += "into the {} ".format(self._ambient_domain)
404
+ if self._dest_map._name is None:
405
+ dm_name = "unnamed map"
406
+ else:
407
+ dm_name = self._dest_map._name
408
+ desc += "via " + dm_name
409
+ return desc
410
+
411
+ def _latex_(self):
412
+ r"""
413
+ Return a LaTeX representation of the object.
414
+
415
+ TESTS::
416
+
417
+ sage: M = Manifold(3, 'M', latex_name=r'\mathcal{M}')
418
+ sage: A = M.mixed_form_algebra()
419
+ sage: A._latex_()
420
+ '\\Omega^*\\left(\\mathcal{M}\\right)'
421
+ sage: latex(A) # indirect doctest
422
+ \Omega^*\left(\mathcal{M}\right)
423
+ """
424
+ return self._latex_name
425
+
426
+ def differential(self, degree=None):
427
+ r"""
428
+ Return the differential of the de Rham complex ``self`` given by the
429
+ exterior derivative.
430
+
431
+ INPUT:
432
+
433
+ - ``degree`` -- (default: ``None``) degree of the differential
434
+ operator; if none is provided, the differential operator on
435
+ ``self`` is returned.
436
+
437
+ EXAMPLES::
438
+
439
+ sage: M = Manifold(2, 'M')
440
+ sage: X.<x,y> = M.chart()
441
+ sage: C = M.de_rham_complex()
442
+ sage: d = C.differential(); d
443
+ Generic endomorphism of Graded algebra Omega^*(M) of mixed
444
+ differential forms on the 2-dimensional differentiable manifold M
445
+ sage: d0 = C.differential(0); d0
446
+ Generic morphism:
447
+ From: Algebra of differentiable scalar fields on the
448
+ 2-dimensional differentiable manifold M
449
+ To: Free module Omega^1(M) of 1-forms on the 2-dimensional
450
+ differentiable manifold M
451
+ sage: f = M.scalar_field(x, name='f'); f.display()
452
+ f: M → ℝ
453
+ (x, y) ↦ x
454
+ sage: d0(f).display()
455
+ df = dx
456
+ """
457
+ if degree is None:
458
+ domain = codomain = self
459
+ else:
460
+ domain = self._domain.diff_form_module(degree)
461
+ codomain = self._domain.diff_form_module(degree + 1)
462
+ return SetMorphism(domain.Hom(codomain), lambda x: x.derivative())
463
+
464
+ def cohomology(self, *args, **kwargs):
465
+ r"""
466
+ Return the de Rham cohomology of the de Rham complex ``self``.
467
+
468
+ The `k`-th de Rham cohomology is given by
469
+
470
+ .. MATH::
471
+
472
+ H^k_{\mathrm{dR}}(M, \varphi) =
473
+ \left. \mathrm{ker}(\mathrm{d}_k) \middle/
474
+ \mathrm{im}(\mathrm{d}_{k-1}) \right. .
475
+
476
+ The corresponding ring is given by
477
+
478
+ .. MATH::
479
+
480
+ H^*_{\mathrm{dR}}(M, \varphi) = \bigoplus^n_{k=0} H^k_{\mathrm{dR}}(M, \varphi),
481
+
482
+ endowed with the cup product as multiplication induced by the wedge
483
+ product.
484
+
485
+ .. SEEALSO::
486
+
487
+ See :class:`~sage.manifolds.differentiable.de_rham_cohomology.DeRhamCohomologyRing`
488
+ for details.
489
+
490
+ EXAMPLES::
491
+
492
+ sage: M = Manifold(3, 'M', latex_name=r'\mathcal{M}')
493
+ sage: A = M.mixed_form_algebra()
494
+ sage: A.cohomology()
495
+ De Rham cohomology ring on the 3-dimensional differentiable
496
+ manifold M
497
+ """
498
+ from sage.manifolds.differentiable.de_rham_cohomology import (
499
+ DeRhamCohomologyRing,
500
+ )
501
+ return DeRhamCohomologyRing(self)
502
+
503
+ homology = cohomology
504
+
505
+ def irange(self, start=None):
506
+ r"""
507
+ Single index generator.
508
+
509
+ INPUT:
510
+
511
+ - ``start`` -- (default: ``None``) initial value `i_0` of the index
512
+ between 0 and `n`, where `n` is the manifold's dimension; if none is
513
+ provided, the value 0 is assumed
514
+
515
+ OUTPUT:
516
+
517
+ - an iterable index, starting from `i_0` and ending at
518
+ `n`, where `n` is the manifold's dimension
519
+
520
+ EXAMPLES::
521
+
522
+ sage: M = Manifold(3, 'M')
523
+ sage: A = M.mixed_form_algebra()
524
+ sage: list(A.irange())
525
+ [0, 1, 2, 3]
526
+ sage: list(A.irange(2))
527
+ [2, 3]
528
+ """
529
+ imax = self._max_deg + 1
530
+ if start is None:
531
+ i = 0
532
+ elif start < 0 or start > imax:
533
+ raise ValueError("start index must be between 0 and " + str(imax))
534
+ else:
535
+ i = start
536
+ while i < imax:
537
+ yield i
538
+ i += 1
539
+
540
+ def lift_from_homology(self, x):
541
+ r"""
542
+ Lift a cohomology class to the algebra of mixed differential forms.
543
+
544
+ EXAMPLES::
545
+
546
+ sage: M = Manifold(2, 'M')
547
+ sage: X.<x,y> = M.chart()
548
+ sage: C = M.de_rham_complex()
549
+ sage: H = C.cohomology()
550
+ sage: alpha = M.diff_form(1, [1,1], name='alpha')
551
+ sage: alpha.display()
552
+ alpha = dx + dy
553
+ sage: a = H(alpha); a
554
+ [alpha]
555
+ sage: C.lift_from_homology(a)
556
+ Mixed differential form alpha on the 2-dimensional differentiable
557
+ manifold M
558
+ """
559
+ return x.lift()