passagemath-symbolics 10.6.37__cp310-cp310-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.
Files changed (171) hide show
  1. passagemath_symbolics/__init__.py +3 -0
  2. passagemath_symbolics-10.6.37.dist-info/METADATA +187 -0
  3. passagemath_symbolics-10.6.37.dist-info/RECORD +171 -0
  4. passagemath_symbolics-10.6.37.dist-info/WHEEL +5 -0
  5. passagemath_symbolics-10.6.37.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-310-x86_64-linux-gnu.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-310-x86_64-linux-gnu.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-310-x86_64-linux-gnu.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-310-x86_64-linux-gnu.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-310-x86_64-linux-gnu.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,452 @@
1
+ # sage_setup: distribution = sagemath-symbolics
2
+ r"""
3
+ Set of Morphisms between Topological Manifolds
4
+
5
+ The class :class:`TopologicalManifoldHomset` implements sets of
6
+ morphisms between two topological manifolds over the same topological
7
+ field `K`, a morphism being a *continuous map* for the category of
8
+ topological manifolds.
9
+
10
+ AUTHORS:
11
+
12
+ - Eric Gourgoulhon (2015): initial version
13
+ - Travis Scrimshaw (2016): review tweaks
14
+
15
+ REFERENCES:
16
+
17
+ - [Lee2011]_
18
+ - [KN1963]_
19
+ """
20
+ # ******************************************************************************
21
+ # Copyright (C) 2015 Eric Gourgoulhon <eric.gourgoulhon@obspm.fr>
22
+ # Copyright (C) 2016 Travis Scrimshaw <tscrimsh@umn.edu>
23
+ #
24
+ # This program is free software: you can redistribute it and/or modify
25
+ # it under the terms of the GNU General Public License as published by
26
+ # the Free Software Foundation, either version 2 of the License, or
27
+ # (at your option) any later version.
28
+ # http://www.gnu.org/licenses/
29
+ # *****************************************************************************
30
+
31
+ from sage.categories.homset import Homset
32
+ from sage.manifolds.continuous_map import ContinuousMap
33
+ from sage.misc.cachefunc import cached_method
34
+ from sage.structure.parent import Parent
35
+ from sage.structure.unique_representation import UniqueRepresentation
36
+
37
+
38
+ class TopologicalManifoldHomset(UniqueRepresentation, Homset):
39
+ r"""
40
+ Set of continuous maps between two topological manifolds.
41
+
42
+ Given two topological manifolds `M` and `N` over a topological field `K`,
43
+ the class :class:`TopologicalManifoldHomset` implements the set
44
+ `\mathrm{Hom}(M, N)` of morphisms (i.e. continuous maps) `M \to N`.
45
+
46
+ This is a Sage *parent* class, whose *element* class is
47
+ :class:`~sage.manifolds.continuous_map.ContinuousMap`.
48
+
49
+ INPUT:
50
+
51
+ - ``domain`` -- :class:`~sage.manifolds.manifold.TopologicalManifold`;
52
+ the domain topological manifold `M` of the morphisms
53
+ - ``codomain`` -- :class:`~sage.manifolds.manifold.TopologicalManifold`;
54
+ the codomain topological manifold `N` of the morphisms
55
+ - ``name`` -- (default: ``None``) string; the name of ``self``;
56
+ if ``None``, ``Hom(M,N)`` will be used
57
+ - ``latex_name`` -- (default: ``None``) string; LaTeX symbol to denote
58
+ ``self``; if ``None``, `\mathrm{Hom}(M,N)` will be used
59
+
60
+ EXAMPLES:
61
+
62
+ Set of continuous maps between a 2-dimensional manifold and a
63
+ 3-dimensional one::
64
+
65
+ sage: M = Manifold(2, 'M', structure='topological')
66
+ sage: X.<x,y> = M.chart()
67
+ sage: N = Manifold(3, 'N', structure='topological')
68
+ sage: Y.<u,v,w> = N.chart()
69
+ sage: H = Hom(M, N) ; H
70
+ Set of Morphisms from 2-dimensional topological manifold M to
71
+ 3-dimensional topological manifold N in Category of manifolds over
72
+ Real Field with 53 bits of precision
73
+ sage: type(H)
74
+ <class 'sage.manifolds.manifold_homset.TopologicalManifoldHomset_with_category'>
75
+ sage: H.category()
76
+ Category of homsets of topological spaces
77
+ sage: latex(H)
78
+ \mathrm{Hom}\left(M,N\right)
79
+ sage: H.domain()
80
+ 2-dimensional topological manifold M
81
+ sage: H.codomain()
82
+ 3-dimensional topological manifold N
83
+
84
+ An element of ``H`` is a continuous map from ``M`` to ``N``::
85
+
86
+ sage: H.Element
87
+ <class 'sage.manifolds.continuous_map.ContinuousMap'>
88
+ sage: f = H.an_element() ; f
89
+ Continuous map from the 2-dimensional topological manifold M to the
90
+ 3-dimensional topological manifold N
91
+ sage: f.display()
92
+ M → N
93
+ (x, y) ↦ (u, v, w) = (0, 0, 0)
94
+
95
+ The test suite is passed::
96
+
97
+ sage: TestSuite(H).run()
98
+
99
+ When the codomain coincides with the domain, the homset is a set of
100
+ *endomorphisms* in the category of topological manifolds::
101
+
102
+ sage: E = Hom(M, M) ; E
103
+ Set of Morphisms from 2-dimensional topological manifold M to
104
+ 2-dimensional topological manifold M in Category of manifolds over
105
+ Real Field with 53 bits of precision
106
+ sage: E.category()
107
+ Category of endsets of topological spaces
108
+ sage: E.is_endomorphism_set()
109
+ True
110
+ sage: E is End(M)
111
+ True
112
+
113
+ In this case, the homset is a monoid for the law of morphism composition::
114
+
115
+ sage: E in Monoids()
116
+ True
117
+
118
+ This was of course not the case of ``H = Hom(M, N)``::
119
+
120
+ sage: H in Monoids()
121
+ False
122
+
123
+ The identity element of the monoid is of course the identity map of ``M``::
124
+
125
+ sage: E.one()
126
+ Identity map Id_M of the 2-dimensional topological manifold M
127
+ sage: E.one() is M.identity_map()
128
+ True
129
+ sage: E.one().display()
130
+ Id_M: M → M
131
+ (x, y) ↦ (x, y)
132
+
133
+ The test suite is passed by ``E``::
134
+
135
+ sage: TestSuite(E).run()
136
+
137
+ This test suite includes more tests than in the case of ``H``, since ``E``
138
+ has some extra structure (monoid).
139
+ """
140
+
141
+ Element = ContinuousMap
142
+
143
+ def __init__(self, domain, codomain, name=None, latex_name=None):
144
+ r"""
145
+ Initialize ``self``.
146
+
147
+ TESTS::
148
+
149
+ sage: M = Manifold(2, 'M', structure='topological')
150
+ sage: X.<x,y> = M.chart()
151
+ sage: N = Manifold(3, 'N', structure='topological')
152
+ sage: Y.<u,v,w> = N.chart()
153
+ sage: H = Hom(M, N) ; H
154
+ Set of Morphisms from 2-dimensional topological manifold M to
155
+ 3-dimensional topological manifold N in Category of manifolds
156
+ over Real Field with 53 bits of precision
157
+ sage: TestSuite(H).run()
158
+
159
+ Test for an endomorphism set::
160
+
161
+ sage: E = Hom(M, M) ; E
162
+ Set of Morphisms from 2-dimensional topological manifold M to
163
+ 2-dimensional topological manifold M in Category of manifolds over
164
+ Real Field with 53 bits of precision
165
+ sage: TestSuite(E).run()
166
+
167
+ Check whether :issue:`31233` is solved::
168
+
169
+ sage: S1 = manifolds.Sphere(1)
170
+ sage: iota = S1.embedding()
171
+ sage: phi = S1.identity_map()
172
+ sage: iota * phi
173
+ Differentiable map iota from the 1-sphere S^1 of radius 1 smoothly
174
+ embedded in the Euclidean plane E^2 to the Euclidean plane E^2
175
+ """
176
+ from sage.manifolds.manifold import TopologicalManifold
177
+
178
+ if not isinstance(domain, TopologicalManifold):
179
+ raise TypeError(
180
+ "domain = {} is not an ".format(domain)
181
+ + "instance of TopologicalManifold"
182
+ )
183
+ if not isinstance(codomain, TopologicalManifold):
184
+ raise TypeError(
185
+ "codomain = {} is not an ".format(codomain)
186
+ + "instance of TopologicalManifold"
187
+ )
188
+ common_cat = domain.category()._meet_(codomain.category())
189
+ Homset.__init__(self, domain, codomain, category=common_cat)
190
+ if name is None:
191
+ self._name = "Hom({},{})".format(domain._name, codomain._name)
192
+ else:
193
+ self._name = name
194
+ if latex_name is None:
195
+ self._latex_name = r"\mathrm{{Hom}}\left({},{}\right)".format(
196
+ domain._latex_name, codomain._latex_name
197
+ )
198
+ else:
199
+ self._latex_name = latex_name
200
+
201
+ def _latex_(self):
202
+ r"""
203
+ LaTeX representation of ``self``.
204
+
205
+ EXAMPLES::
206
+
207
+ sage: M = Manifold(2, 'M', structure='topological')
208
+ sage: X.<x,y> = M.chart()
209
+ sage: N = Manifold(3, 'N', structure='topological')
210
+ sage: H = Hom(M, N)
211
+ sage: latex(H)
212
+ \mathrm{Hom}\left(M,N\right)
213
+ """
214
+ if self._latex_name is None:
215
+ return r'\text{' + str(self) + r'}'
216
+ else:
217
+ return self._latex_name
218
+
219
+ #### Parent methods ####
220
+
221
+ def _element_constructor_(
222
+ self,
223
+ coord_functions,
224
+ name=None,
225
+ latex_name=None,
226
+ is_isomorphism=False,
227
+ is_identity=False,
228
+ ):
229
+ r"""
230
+ Construct an element of the homset, i.e. a continuous map `M \to N`,
231
+ where `M` is the domain of the homset and `N` its codomain.
232
+
233
+ INPUT:
234
+
235
+ - ``coord_functions`` -- dictionary of the coordinate expressions
236
+ (as lists or tuples of the coordinates of the image expressed in
237
+ terms of the coordinates of the considered point) with the pairs
238
+ of charts ``(chart1, chart2)`` as keys (``chart1`` being a chart
239
+ on `M` and ``chart2`` a chart on `N`); if the dimension of the
240
+ arrival manifold is 1, a single coordinate expression can be
241
+ passed instead of a tuple with a single element
242
+ - ``name`` -- (default: ``None``) name given to the continuous map
243
+ - ``latex_name`` -- (default: ``None``) LaTeX symbol to denote the
244
+ continuous map; if ``None``, the LaTeX symbol is set to ``name``
245
+ - ``is_isomorphism`` -- boolean (default: ``False``); determines whether the
246
+ constructed object is a isomorphism (i.e. a homeomorphism); if set to
247
+ ``True``, then the manifolds `M` and `N` must have the same dimension
248
+ - ``is_identity`` -- boolean (default: ``False``); determines whether the
249
+ constructed object is the identity map; if set to ``True``,
250
+ then `N` must be `M` and the entry ``coord_functions`` is not used
251
+
252
+ .. NOTE::
253
+
254
+ If the information passed by means of the argument
255
+ ``coord_functions`` is not sufficient to fully specify the
256
+ continuous map, further coordinate expressions, in other charts,
257
+ can be subsequently added by means of the method :meth:`add_expr`
258
+
259
+ OUTPUT: a :class:`~sage.manifolds.continuous_map.ContinuousMap`
260
+
261
+ EXAMPLES::
262
+
263
+ sage: M = Manifold(2, 'M', structure='topological')
264
+ sage: X.<x,y> = M.chart()
265
+ sage: N = Manifold(3, 'N', structure='topological')
266
+ sage: Y.<u,v,w> = N.chart()
267
+ sage: H = Hom(M, N)
268
+ sage: f = H({(X, Y): [x+y, x-y, x*y]}, name='f'); f
269
+ Continuous map f from the 2-dimensional topological manifold M to
270
+ the 3-dimensional topological manifold N
271
+ sage: f.display()
272
+ f: M → N
273
+ (x, y) ↦ (u, v, w) = (x + y, x - y, x*y)
274
+ sage: id = Hom(M, M)({}, is_identity=True)
275
+ sage: id
276
+ Identity map Id_M of the 2-dimensional topological manifold M
277
+ sage: id.display()
278
+ Id_M: M → M
279
+ (x, y) ↦ (x, y)
280
+ """
281
+ # Standard construction
282
+ return self.element_class(
283
+ self,
284
+ coord_functions=coord_functions,
285
+ name=name,
286
+ latex_name=latex_name,
287
+ is_isomorphism=is_isomorphism,
288
+ is_identity=is_identity,
289
+ )
290
+
291
+ def _an_element_(self):
292
+ r"""
293
+ Construct some element of ``self``.
294
+
295
+ OUTPUT: a :class:`~sage.manifolds.continuous_map.ContinuousMap`
296
+
297
+ EXAMPLES::
298
+
299
+ sage: M = Manifold(2, 'M', structure='topological')
300
+ sage: X.<x,y> = M.chart()
301
+ sage: N = Manifold(3, 'N', structure='topological')
302
+ sage: Y.<u,v,w> = N.chart()
303
+ sage: H = Hom(M,N)
304
+ sage: f = H._an_element_() ; f
305
+ Continuous map from the 2-dimensional topological manifold M to the
306
+ 3-dimensional topological manifold N
307
+ sage: f.display()
308
+ M → N
309
+ (x, y) ↦ (u, v, w) = (0, 0, 0)
310
+ sage: p = M((-2,3)) ; p
311
+ Point on the 2-dimensional topological manifold M
312
+ sage: f(p)
313
+ Point on the 3-dimensional topological manifold N
314
+ sage: f(p).coord(Y)
315
+ (0, 0, 0)
316
+ sage: TestSuite(f).run()
317
+ """
318
+ dom = self.domain()
319
+ codom = self.codomain()
320
+ # A constant map is constructed:
321
+ chart2 = codom.default_chart()
322
+ target_point = chart2.domain().an_element()
323
+ target_coord = target_point.coord(chart2)
324
+ coord_functions = {}
325
+ for chart in dom.atlas():
326
+ coord_functions[(chart, chart2)] = target_coord
327
+ return self.element_class(self, coord_functions=coord_functions)
328
+
329
+ def _coerce_map_from_(self, other):
330
+ r"""
331
+ Determine whether coercion to ``self`` exists from parent ``other``.
332
+
333
+ EXAMPLES::
334
+
335
+ sage: M = Manifold(2, 'M', structure='topological')
336
+ sage: X.<x,y> = M.chart()
337
+ sage: N = Manifold(3, 'N', structure='topological')
338
+ sage: Y.<u,v,w> = N.chart()
339
+ sage: H = Hom(M,N)
340
+ sage: H._coerce_map_from_(ZZ)
341
+ False
342
+ sage: H._coerce_map_from_(M)
343
+ False
344
+ sage: H._coerce_map_from_(N)
345
+ False
346
+ sage: H._coerce_map_from_(H)
347
+ True
348
+ """
349
+ if isinstance(other, TopologicalManifoldHomset):
350
+ return other.domain().has_coerce_map_from(
351
+ self.domain()
352
+ ) and self.codomain().has_coerce_map_from(other.codomain())
353
+ return False
354
+
355
+ #!# check
356
+ def __call__(self, *args, **kwds):
357
+ r"""
358
+ Construct an element of ``self`` from the input.
359
+
360
+ EXAMPLES::
361
+
362
+ sage: M = Manifold(2, 'M', structure='topological')
363
+ sage: X.<x,y> = M.chart()
364
+ sage: N = Manifold(3, 'N', structure='topological')
365
+ sage: Y.<u,v,w> = N.chart()
366
+ sage: H = Hom(M,N)
367
+ sage: f = H.__call__({(X, Y): [x+y, x-y, x*y]}, name='f') ; f
368
+ Continuous map f from the 2-dimensional topological manifold M to
369
+ the 3-dimensional topological manifold N
370
+ sage: f.display()
371
+ f: M → N
372
+ (x, y) ↦ (u, v, w) = (x + y, x - y, x*y)
373
+
374
+ There is also the following shortcut for :meth:`one`::
375
+
376
+ sage: M = Manifold(2, 'M', structure='topological')
377
+ sage: H = Hom(M, M)
378
+ sage: H(1)
379
+ Identity map Id_M of the 2-dimensional topological manifold M
380
+ """
381
+ if len(args) == 1:
382
+ if self.domain() == self.codomain() and args[0] == 1:
383
+ return self.one()
384
+ if isinstance(args[0], ContinuousMap):
385
+ return Homset.__call__(self, args[0])
386
+ return Parent.__call__(self, *args, **kwds)
387
+
388
+ #### End of parent methods ####
389
+
390
+ #### Monoid methods (case of an endomorphism set) ####
391
+
392
+ @cached_method
393
+ def one(self):
394
+ r"""
395
+ Return the identity element of ``self`` considered as a monoid
396
+ (case of a set of endomorphisms).
397
+
398
+ This applies only when the codomain of the homset is equal to its
399
+ domain, i.e. when the homset is of the type `\mathrm{Hom}(M,M)`.
400
+ Indeed, `\mathrm{Hom}(M,M)` equipped with the law of morphisms
401
+ composition is a monoid, whose identity element is nothing but the
402
+ identity map of `M`.
403
+
404
+ OUTPUT:
405
+
406
+ - the identity map of `M`, as an instance of
407
+ :class:`~sage.manifolds.continuous_map.ContinuousMap`
408
+
409
+ EXAMPLES:
410
+
411
+ The identity map of a 2-dimensional manifold::
412
+
413
+ sage: M = Manifold(2, 'M', structure='topological')
414
+ sage: X.<x,y> = M.chart()
415
+ sage: H = Hom(M, M) ; H
416
+ Set of Morphisms from 2-dimensional topological manifold M to
417
+ 2-dimensional topological manifold M in Category of manifolds over
418
+ Real Field with 53 bits of precision
419
+ sage: H in Monoids()
420
+ True
421
+ sage: H.one()
422
+ Identity map Id_M of the 2-dimensional topological manifold M
423
+ sage: H.one().parent() is H
424
+ True
425
+ sage: H.one().display()
426
+ Id_M: M → M
427
+ (x, y) ↦ (x, y)
428
+
429
+ The identity map is cached::
430
+
431
+ sage: H.one() is H.one()
432
+ True
433
+
434
+ If the homset is not a set of endomorphisms, the identity element is
435
+ meaningless::
436
+
437
+ sage: N = Manifold(3, 'N', structure='topological')
438
+ sage: Y.<u,v,w> = N.chart()
439
+ sage: Hom(M, N).one()
440
+ Traceback (most recent call last):
441
+ ...
442
+ TypeError: Set of Morphisms
443
+ from 2-dimensional topological manifold M
444
+ to 3-dimensional topological manifold N
445
+ in Category of manifolds over Real Field with 53 bits of precision
446
+ is not a monoid
447
+ """
448
+ if self.codomain() != self.domain():
449
+ raise TypeError("{} is not a monoid".format(self))
450
+ return self.element_class(self, is_identity=True)
451
+
452
+ #### End of monoid methods ####