passagemath-symbolics 10.6.37__cp314-cp314t-macosx_13_0_arm64.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 (172) hide show
  1. passagemath_symbolics/.dylibs/libgmp.10.dylib +0 -0
  2. passagemath_symbolics/__init__.py +3 -0
  3. passagemath_symbolics-10.6.37.dist-info/METADATA +187 -0
  4. passagemath_symbolics-10.6.37.dist-info/RECORD +172 -0
  5. passagemath_symbolics-10.6.37.dist-info/WHEEL +6 -0
  6. passagemath_symbolics-10.6.37.dist-info/top_level.txt +3 -0
  7. sage/all__sagemath_symbolics.py +17 -0
  8. sage/calculus/all.py +14 -0
  9. sage/calculus/calculus.py +2826 -0
  10. sage/calculus/desolvers.py +1866 -0
  11. sage/calculus/predefined.py +51 -0
  12. sage/calculus/tests.py +225 -0
  13. sage/calculus/var.cpython-314t-darwin.so +0 -0
  14. sage/calculus/var.pyx +401 -0
  15. sage/dynamics/all__sagemath_symbolics.py +6 -0
  16. sage/dynamics/complex_dynamics/all.py +5 -0
  17. sage/dynamics/complex_dynamics/mandel_julia.py +765 -0
  18. sage/dynamics/complex_dynamics/mandel_julia_helper.cpython-314t-darwin.so +0 -0
  19. sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +1035 -0
  20. sage/ext/all__sagemath_symbolics.py +1 -0
  21. sage/ext_data/kenzo/CP2.txt +45 -0
  22. sage/ext_data/kenzo/CP3.txt +349 -0
  23. sage/ext_data/kenzo/CP4.txt +4774 -0
  24. sage/ext_data/kenzo/README.txt +49 -0
  25. sage/ext_data/kenzo/S4.txt +20 -0
  26. sage/ext_data/magma/latex/latex.m +1021 -0
  27. sage/ext_data/magma/latex/latex.spec +1 -0
  28. sage/ext_data/magma/sage/basic.m +356 -0
  29. sage/ext_data/magma/sage/sage.spec +1 -0
  30. sage/ext_data/magma/spec +9 -0
  31. sage/geometry/all__sagemath_symbolics.py +8 -0
  32. sage/geometry/hyperbolic_space/all.py +5 -0
  33. sage/geometry/hyperbolic_space/hyperbolic_coercion.py +743 -0
  34. sage/geometry/hyperbolic_space/hyperbolic_constants.py +5 -0
  35. sage/geometry/hyperbolic_space/hyperbolic_geodesic.py +2409 -0
  36. sage/geometry/hyperbolic_space/hyperbolic_interface.py +206 -0
  37. sage/geometry/hyperbolic_space/hyperbolic_isometry.py +1082 -0
  38. sage/geometry/hyperbolic_space/hyperbolic_model.py +1502 -0
  39. sage/geometry/hyperbolic_space/hyperbolic_point.py +621 -0
  40. sage/geometry/riemannian_manifolds/all.py +7 -0
  41. sage/geometry/riemannian_manifolds/parametrized_surface3d.py +1632 -0
  42. sage/geometry/riemannian_manifolds/surface3d_generators.py +461 -0
  43. sage/interfaces/all__sagemath_symbolics.py +1 -0
  44. sage/interfaces/magma.py +3017 -0
  45. sage/interfaces/magma_free.py +92 -0
  46. sage/interfaces/maple.py +1397 -0
  47. sage/interfaces/mathematica.py +1345 -0
  48. sage/interfaces/mathics.py +1312 -0
  49. sage/interfaces/sympy.py +1398 -0
  50. sage/interfaces/sympy_wrapper.py +197 -0
  51. sage/interfaces/tides.py +938 -0
  52. sage/libs/all__sagemath_symbolics.py +6 -0
  53. sage/manifolds/all.py +7 -0
  54. sage/manifolds/calculus_method.py +555 -0
  55. sage/manifolds/catalog.py +437 -0
  56. sage/manifolds/chart.py +4019 -0
  57. sage/manifolds/chart_func.py +3419 -0
  58. sage/manifolds/continuous_map.py +2183 -0
  59. sage/manifolds/continuous_map_image.py +155 -0
  60. sage/manifolds/differentiable/affine_connection.py +2475 -0
  61. sage/manifolds/differentiable/all.py +1 -0
  62. sage/manifolds/differentiable/automorphismfield.py +1383 -0
  63. sage/manifolds/differentiable/automorphismfield_group.py +604 -0
  64. sage/manifolds/differentiable/bundle_connection.py +1445 -0
  65. sage/manifolds/differentiable/characteristic_cohomology_class.py +1840 -0
  66. sage/manifolds/differentiable/chart.py +1241 -0
  67. sage/manifolds/differentiable/curve.py +1028 -0
  68. sage/manifolds/differentiable/de_rham_cohomology.py +541 -0
  69. sage/manifolds/differentiable/degenerate.py +559 -0
  70. sage/manifolds/differentiable/degenerate_submanifold.py +1671 -0
  71. sage/manifolds/differentiable/diff_form.py +1658 -0
  72. sage/manifolds/differentiable/diff_form_module.py +1062 -0
  73. sage/manifolds/differentiable/diff_map.py +1315 -0
  74. sage/manifolds/differentiable/differentiable_submanifold.py +291 -0
  75. sage/manifolds/differentiable/examples/all.py +1 -0
  76. sage/manifolds/differentiable/examples/euclidean.py +2517 -0
  77. sage/manifolds/differentiable/examples/real_line.py +897 -0
  78. sage/manifolds/differentiable/examples/sphere.py +1186 -0
  79. sage/manifolds/differentiable/examples/symplectic_space.py +187 -0
  80. sage/manifolds/differentiable/examples/symplectic_space_test.py +40 -0
  81. sage/manifolds/differentiable/integrated_curve.py +4035 -0
  82. sage/manifolds/differentiable/levi_civita_connection.py +841 -0
  83. sage/manifolds/differentiable/manifold.py +4254 -0
  84. sage/manifolds/differentiable/manifold_homset.py +1826 -0
  85. sage/manifolds/differentiable/metric.py +3032 -0
  86. sage/manifolds/differentiable/mixed_form.py +1507 -0
  87. sage/manifolds/differentiable/mixed_form_algebra.py +559 -0
  88. sage/manifolds/differentiable/multivector_module.py +800 -0
  89. sage/manifolds/differentiable/multivectorfield.py +1520 -0
  90. sage/manifolds/differentiable/poisson_tensor.py +268 -0
  91. sage/manifolds/differentiable/pseudo_riemannian.py +755 -0
  92. sage/manifolds/differentiable/pseudo_riemannian_submanifold.py +1839 -0
  93. sage/manifolds/differentiable/scalarfield.py +1343 -0
  94. sage/manifolds/differentiable/scalarfield_algebra.py +472 -0
  95. sage/manifolds/differentiable/symplectic_form.py +910 -0
  96. sage/manifolds/differentiable/symplectic_form_test.py +220 -0
  97. sage/manifolds/differentiable/tangent_space.py +412 -0
  98. sage/manifolds/differentiable/tangent_vector.py +616 -0
  99. sage/manifolds/differentiable/tensorfield.py +4665 -0
  100. sage/manifolds/differentiable/tensorfield_module.py +963 -0
  101. sage/manifolds/differentiable/tensorfield_paral.py +2450 -0
  102. sage/manifolds/differentiable/tensorfield_paral_test.py +16 -0
  103. sage/manifolds/differentiable/vector_bundle.py +1728 -0
  104. sage/manifolds/differentiable/vectorfield.py +1717 -0
  105. sage/manifolds/differentiable/vectorfield_module.py +2445 -0
  106. sage/manifolds/differentiable/vectorframe.py +1832 -0
  107. sage/manifolds/family.py +270 -0
  108. sage/manifolds/local_frame.py +1490 -0
  109. sage/manifolds/manifold.py +3090 -0
  110. sage/manifolds/manifold_homset.py +452 -0
  111. sage/manifolds/operators.py +359 -0
  112. sage/manifolds/point.py +994 -0
  113. sage/manifolds/scalarfield.py +3718 -0
  114. sage/manifolds/scalarfield_algebra.py +629 -0
  115. sage/manifolds/section.py +3111 -0
  116. sage/manifolds/section_module.py +831 -0
  117. sage/manifolds/structure.py +229 -0
  118. sage/manifolds/subset.py +2764 -0
  119. sage/manifolds/subsets/all.py +1 -0
  120. sage/manifolds/subsets/closure.py +131 -0
  121. sage/manifolds/subsets/pullback.py +885 -0
  122. sage/manifolds/topological_submanifold.py +891 -0
  123. sage/manifolds/trivialization.py +733 -0
  124. sage/manifolds/utilities.py +1348 -0
  125. sage/manifolds/vector_bundle.py +1342 -0
  126. sage/manifolds/vector_bundle_fiber.py +332 -0
  127. sage/manifolds/vector_bundle_fiber_element.py +111 -0
  128. sage/matrix/all__sagemath_symbolics.py +1 -0
  129. sage/matrix/matrix_symbolic_dense.cpython-314t-darwin.so +0 -0
  130. sage/matrix/matrix_symbolic_dense.pxd +6 -0
  131. sage/matrix/matrix_symbolic_dense.pyx +1022 -0
  132. sage/matrix/matrix_symbolic_sparse.cpython-314t-darwin.so +0 -0
  133. sage/matrix/matrix_symbolic_sparse.pxd +6 -0
  134. sage/matrix/matrix_symbolic_sparse.pyx +1029 -0
  135. sage/modules/all__sagemath_symbolics.py +1 -0
  136. sage/modules/vector_callable_symbolic_dense.py +105 -0
  137. sage/modules/vector_symbolic_dense.py +116 -0
  138. sage/modules/vector_symbolic_sparse.py +118 -0
  139. sage/rings/all__sagemath_symbolics.py +4 -0
  140. sage/rings/asymptotic/all.py +6 -0
  141. sage/rings/asymptotic/asymptotic_expansion_generators.py +1485 -0
  142. sage/rings/asymptotic/asymptotic_ring.py +4858 -0
  143. sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py +4153 -0
  144. sage/rings/asymptotic/growth_group.py +5373 -0
  145. sage/rings/asymptotic/growth_group_cartesian.py +1400 -0
  146. sage/rings/asymptotic/term_monoid.py +5237 -0
  147. sage/rings/function_field/all__sagemath_symbolics.py +2 -0
  148. sage/rings/polynomial/all__sagemath_symbolics.py +1 -0
  149. sage/symbolic/all.py +15 -0
  150. sage/symbolic/assumptions.py +985 -0
  151. sage/symbolic/benchmark.py +93 -0
  152. sage/symbolic/callable.py +459 -0
  153. sage/symbolic/complexity_measures.py +35 -0
  154. sage/symbolic/constants.py +1287 -0
  155. sage/symbolic/expression_conversion_algebraic.py +310 -0
  156. sage/symbolic/expression_conversion_sympy.py +317 -0
  157. sage/symbolic/expression_conversions.py +1713 -0
  158. sage/symbolic/function_factory.py +355 -0
  159. sage/symbolic/integration/all.py +1 -0
  160. sage/symbolic/integration/external.py +270 -0
  161. sage/symbolic/integration/integral.py +1115 -0
  162. sage/symbolic/maxima_wrapper.py +162 -0
  163. sage/symbolic/operators.py +267 -0
  164. sage/symbolic/random_tests.py +462 -0
  165. sage/symbolic/relation.py +1907 -0
  166. sage/symbolic/ring.cpython-314t-darwin.so +0 -0
  167. sage/symbolic/ring.pxd +5 -0
  168. sage/symbolic/ring.pyx +1396 -0
  169. sage/symbolic/subring.py +1025 -0
  170. sage/symbolic/symengine.py +19 -0
  171. sage/symbolic/tests.py +40 -0
  172. sage/symbolic/units.py +1470 -0
@@ -0,0 +1,897 @@
1
+ # sage_setup: distribution = sagemath-symbolics
2
+ r"""
3
+ The Real Line and Open Intervals
4
+
5
+ The class :class:`OpenInterval` implement open intervals as 1-dimensional
6
+ differentiable manifolds over `\RR`. The derived class :class:`RealLine` is
7
+ devoted to `\RR` itself, as the open interval `(-\infty, +\infty)`.
8
+
9
+ AUTHORS:
10
+
11
+ - Eric Gourgoulhon (2015): initial version
12
+ - Travis Scrimshaw (2016): review tweaks
13
+
14
+ REFERENCES:
15
+
16
+ - [Lee2013]_
17
+ """
18
+ #*****************************************************************************
19
+ # Copyright (C) 2015 Eric Gourgoulhon <eric.gourgoulhon@obspm.fr>
20
+ # Copyright (C) 2015 Michal Bejger <bejger@camk.edu.pl>
21
+ #
22
+ # Distributed under the terms of the GNU General Public License (GPL)
23
+ # as published by the Free Software Foundation; either version 2 of
24
+ # the License, or (at your option) any later version.
25
+ # http://www.gnu.org/licenses/
26
+ #*****************************************************************************
27
+
28
+ from sage.categories.manifolds import Manifolds
29
+ from sage.manifolds.differentiable.manifold import DifferentiableManifold
30
+ from sage.manifolds.structure import RealDifferentialStructure
31
+ from sage.misc.latex import latex
32
+ from sage.rings.infinity import infinity, minus_infinity
33
+ from sage.rings.real_mpfr import RR
34
+ from sage.symbolic.ring import SR
35
+ from sage.typeset.unicode_characters import unicode_mathbbR
36
+
37
+
38
+ class OpenInterval(DifferentiableManifold):
39
+ r"""
40
+ Open interval as a 1-dimensional differentiable manifold over `\RR`.
41
+
42
+ INPUT:
43
+
44
+ - ``lower`` -- lower bound of the interval (possibly ``-Infinity``)
45
+ - ``upper`` -- upper bound of the interval (possibly ``+Infinity``)
46
+ - ``ambient_interval`` -- (default: ``None``) another open interval,
47
+ to which the constructed interval is a subset of
48
+ - ``name`` -- (default: ``None``) string; name (symbol) given to
49
+ the interval; if ``None``, the name is constructed from ``lower``
50
+ and ``upper``
51
+ - ``latex_name`` -- (default: ``None``) string; LaTeX symbol to denote the
52
+ interval; if ``None``, the LaTeX symbol is constructed from ``lower``
53
+ and ``upper`` if ``name`` is ``None``, otherwise, it is set to ``name``
54
+ - ``coordinate`` -- (default: ``None``) string defining the symbol of the
55
+ canonical coordinate set on the interval; if none is provided and
56
+ ``names`` is ``None``, the symbol 't' is used
57
+ - ``names`` -- (default: ``None``) used only when ``coordinate`` is
58
+ ``None``: it must be a single-element tuple containing the canonical
59
+ coordinate symbol (this is guaranteed if the shortcut ``<names>`` is
60
+ used, see examples below)
61
+ - ``start_index`` -- (default: 0) unique value of the index for vectors
62
+ and forms on the interval manifold
63
+
64
+ EXAMPLES:
65
+
66
+ The interval `(0,\pi)`::
67
+
68
+ sage: I = manifolds.OpenInterval(0, pi); I
69
+ Real interval (0, pi)
70
+ sage: latex(I)
71
+ \left(0, \pi\right)
72
+
73
+ ``I`` is a 1-dimensional smooth manifold over `\RR`::
74
+
75
+ sage: I.category()
76
+ Category of smooth connected manifolds over Real Field with 53 bits of
77
+ precision
78
+ sage: I.base_field()
79
+ Real Field with 53 bits of precision
80
+ sage: dim(I)
81
+ 1
82
+
83
+ It is infinitely differentiable (smooth manifold)::
84
+
85
+ sage: I.diff_degree()
86
+ +Infinity
87
+
88
+ The instance is unique (as long as the constructor arguments
89
+ are the same)::
90
+
91
+ sage: I is manifolds.OpenInterval(0, pi)
92
+ True
93
+ sage: I is manifolds.OpenInterval(0, pi, name='I')
94
+ False
95
+
96
+ The display of the interval can be customized::
97
+
98
+ sage: I # default display
99
+ Real interval (0, pi)
100
+ sage: latex(I) # default LaTeX display
101
+ \left(0, \pi\right)
102
+ sage: I1 = manifolds.OpenInterval(0, pi, name='I'); I1
103
+ Real interval I
104
+ sage: latex(I1)
105
+ I
106
+ sage: I2 = manifolds.OpenInterval(0, pi, name='I', latex_name=r'\mathcal{I}'); I2
107
+ Real interval I
108
+ sage: latex(I2)
109
+ \mathcal{I}
110
+
111
+ ``I`` is endowed with a canonical chart::
112
+
113
+ sage: I.canonical_chart()
114
+ Chart ((0, pi), (t,))
115
+ sage: I.canonical_chart() is I.default_chart()
116
+ True
117
+ sage: I.atlas()
118
+ [Chart ((0, pi), (t,))]
119
+
120
+ The canonical coordinate is returned by the method
121
+ :meth:`canonical_coordinate`::
122
+
123
+ sage: I.canonical_coordinate()
124
+ t
125
+ sage: t = I.canonical_coordinate()
126
+ sage: type(t)
127
+ <class 'sage.symbolic.expression.Expression'>
128
+
129
+ However, it can be obtained in the same step as the interval construction
130
+ by means of the shortcut ``I.<names>``::
131
+
132
+ sage: I.<t> = manifolds.OpenInterval(0, pi)
133
+ sage: t
134
+ t
135
+ sage: type(t)
136
+ <class 'sage.symbolic.expression.Expression'>
137
+
138
+ The trick is performed by the Sage preparser::
139
+
140
+ sage: preparse("I.<t> = manifolds.OpenInterval(0, pi)")
141
+ "I = manifolds.OpenInterval(Integer(0), pi, names=('t',)); (t,) = I._first_ngens(1)"
142
+
143
+ In particular the shortcut can be used to set a canonical
144
+ coordinate symbol different from ``'t'``::
145
+
146
+ sage: J.<x> = manifolds.OpenInterval(0, pi)
147
+ sage: J.canonical_chart()
148
+ Chart ((0, pi), (x,))
149
+ sage: J.canonical_coordinate()
150
+ x
151
+
152
+ The LaTeX symbol of the canonical coordinate can be adjusted via
153
+ the same syntax as a chart declaration (see
154
+ :class:`~sage.manifolds.chart.RealChart`)::
155
+
156
+ sage: J.<x> = manifolds.OpenInterval(0, pi, coordinate=r'x:\xi')
157
+ sage: latex(x)
158
+ {\xi}
159
+ sage: latex(J.canonical_chart())
160
+ \left(\left(0, \pi\right),({\xi})\right)
161
+
162
+ An element of the open interval ``I``::
163
+
164
+ sage: x = I.an_element(); x
165
+ Point on the Real interval (0, pi)
166
+ sage: x.coord() # coordinates in the default chart = canonical chart
167
+ (1/2*pi,)
168
+
169
+ As for any manifold subset, a specific element of ``I`` can be created
170
+ by providing a tuple containing its coordinate(s) in a given chart::
171
+
172
+ sage: x = I((2,)) # (2,) = tuple of coordinates in the canonical chart
173
+ sage: x
174
+ Point on the Real interval (0, pi)
175
+
176
+ But for convenience, it can also be created directly from the coordinate::
177
+
178
+ sage: x = I(2); x
179
+ Point on the Real interval (0, pi)
180
+ sage: x.coord()
181
+ (2,)
182
+ sage: I(2) == I((2,))
183
+ True
184
+
185
+ By default, the coordinates passed for the element ``x`` are those
186
+ relative to the canonical chart::
187
+
188
+ sage: I(2) == I((2,), chart=I.canonical_chart())
189
+ True
190
+
191
+ The lower and upper bounds of the interval ``I``::
192
+
193
+ sage: I.lower_bound()
194
+ 0
195
+ sage: I.upper_bound()
196
+ pi
197
+
198
+ One of the endpoint can be infinite::
199
+
200
+ sage: J = manifolds.OpenInterval(1, +oo); J
201
+ Real interval (1, +Infinity)
202
+ sage: J.an_element().coord()
203
+ (2,)
204
+
205
+ The construction of a subinterval can be performed via the argument
206
+ ``ambient_interval`` of ``OpenInterval``::
207
+
208
+ sage: J = manifolds.OpenInterval(0, 1, ambient_interval=I); J
209
+ Real interval (0, 1)
210
+
211
+ However, it is recommended to use the method :meth:`open_interval`
212
+ instead::
213
+
214
+ sage: J = I.open_interval(0, 1); J
215
+ Real interval (0, 1)
216
+ sage: J.is_subset(I)
217
+ True
218
+ sage: J.manifold() is I
219
+ True
220
+
221
+ A subinterval of a subinterval::
222
+
223
+ sage: K = J.open_interval(1/2, 1); K
224
+ Real interval (1/2, 1)
225
+ sage: K.is_subset(J)
226
+ True
227
+ sage: K.is_subset(I)
228
+ True
229
+ sage: K.manifold() is I
230
+ True
231
+
232
+ We have::
233
+
234
+ sage: list(I.subset_family())
235
+ [Real interval (0, 1), Real interval (0, pi), Real interval (1/2, 1)]
236
+ sage: list(J.subset_family())
237
+ [Real interval (0, 1), Real interval (1/2, 1)]
238
+ sage: list(K.subset_family())
239
+ [Real interval (1/2, 1)]
240
+
241
+ As any open subset of a manifold, open subintervals are created in a
242
+ category of subobjects of smooth manifolds::
243
+
244
+ sage: J.category()
245
+ Join of Category of subobjects of sets and Category of smooth manifolds
246
+ over Real Field with 53 bits of precision and Category of connected
247
+ manifolds over Real Field with 53 bits of precision
248
+ sage: K.category()
249
+ Join of Category of subobjects of sets and Category of smooth manifolds
250
+ over Real Field with 53 bits of precision and Category of connected
251
+ manifolds over Real Field with 53 bits of precision
252
+
253
+ On the contrary, ``I``, which has not been created as a subinterval,
254
+ is in the category of smooth manifolds (see
255
+ :class:`~sage.categories.manifolds.Manifolds`)::
256
+
257
+ sage: I.category()
258
+ Category of smooth connected manifolds over Real Field with 53 bits of
259
+ precision
260
+
261
+ and we have::
262
+
263
+ sage: J.category() is I.category().Subobjects()
264
+ True
265
+
266
+ All intervals are parents::
267
+
268
+ sage: x = J(1/2); x
269
+ Point on the Real interval (0, pi)
270
+ sage: x.parent() is J
271
+ True
272
+ sage: y = K(3/4); y
273
+ Point on the Real interval (0, pi)
274
+ sage: y.parent() is K
275
+ True
276
+
277
+ We have::
278
+
279
+ sage: x in I, x in J, x in K
280
+ (True, True, False)
281
+ sage: y in I, y in J, y in K
282
+ (True, True, True)
283
+
284
+ The canonical chart of subintervals is inherited from the canonical chart
285
+ of the parent interval::
286
+
287
+ sage: XI = I.canonical_chart(); XI
288
+ Chart ((0, pi), (t,))
289
+ sage: XI.coord_range()
290
+ t: (0, pi)
291
+ sage: XJ = J.canonical_chart(); XJ
292
+ Chart ((0, 1), (t,))
293
+ sage: XJ.coord_range()
294
+ t: (0, 1)
295
+ sage: XK = K.canonical_chart(); XK
296
+ Chart ((1/2, 1), (t,))
297
+ sage: XK.coord_range()
298
+ t: (1/2, 1)
299
+ """
300
+ @staticmethod
301
+ def __classcall_private__(cls, lower, upper, ambient_interval=None,
302
+ name=None, latex_name=None, coordinate=None,
303
+ names=None, start_index=0):
304
+ r"""
305
+ Determine the correct interval to return based upon the input.
306
+
307
+ TESTS:
308
+
309
+ Check whether :issue:`30830` is fixed::
310
+
311
+ sage: I = manifolds.OpenInterval(0,2)
312
+ sage: J = manifolds.OpenInterval(0,1, ambient_interval=I, coordinate='t')
313
+ sage: I.open_interval(0,1)
314
+ Real interval (0, 1)
315
+ """
316
+ if ambient_interval:
317
+ # cope the UniqueRepresentation framework for subintervals and
318
+ # reset irrelevant information only:
319
+ coordinate = None
320
+ names = None
321
+ start_index = 0
322
+ return super().__classcall__(cls, lower, upper,
323
+ ambient_interval=ambient_interval, name=name,
324
+ latex_name=latex_name, coordinate=coordinate,
325
+ names=names, start_index=start_index)
326
+
327
+ def __init__(self, lower, upper, ambient_interval=None,
328
+ name=None, latex_name=None,
329
+ coordinate=None, names=None, start_index=0):
330
+ r"""
331
+ Construct an open interval.
332
+
333
+ TESTS::
334
+
335
+ sage: I = manifolds.OpenInterval(-1,1); I
336
+ Real interval (-1, 1)
337
+ sage: TestSuite(I).run(skip='_test_elements') # pickling of elements fails
338
+ sage: J = manifolds.OpenInterval(-oo, 2); J
339
+ Real interval (-Infinity, 2)
340
+ sage: TestSuite(J).run(skip='_test_elements') # pickling of elements fails
341
+ """
342
+ if latex_name is None:
343
+ if name is None:
344
+ latex_name = r"\left({}, {}\right)".format(latex(lower), latex(upper))
345
+ else:
346
+ latex_name = name
347
+ if name is None:
348
+ name = "({}, {})".format(lower, upper)
349
+ if ambient_interval is None:
350
+ ambient_manifold = None
351
+ else:
352
+ if not isinstance(ambient_interval, OpenInterval):
353
+ raise TypeError("the argument ambient_interval must be an open interval")
354
+ ambient_manifold = ambient_interval.manifold()
355
+ field = 'real'
356
+ structure = RealDifferentialStructure()
357
+ category = Manifolds(RR).Smooth().Connected()
358
+ DifferentiableManifold.__init__(self, 1, name, field, structure,
359
+ base_manifold=ambient_manifold,
360
+ latex_name=latex_name,
361
+ start_index=start_index,
362
+ category=category)
363
+ if ambient_interval is None:
364
+ if coordinate is None:
365
+ if names is None:
366
+ coordinate = 't'
367
+ else:
368
+ coordinate = names[0]
369
+ else:
370
+ if lower < ambient_interval.lower_bound():
371
+ raise ValueError("the lower bound is smaller than that of "
372
+ + "the containing interval")
373
+ if upper > ambient_interval.upper_bound():
374
+ raise ValueError("the upper bound is larger than that of "
375
+ + "the containing interval")
376
+ self.declare_subset(ambient_interval)
377
+ ambient_interval._top_subsets.add(self)
378
+ if lower != minus_infinity:
379
+ if upper != infinity:
380
+ restrictions = lambda t: [t > lower, t < upper]
381
+ else:
382
+ restrictions = lambda t: t > lower
383
+ else:
384
+ if upper != infinity:
385
+ restrictions = lambda t: t < upper
386
+ else:
387
+ restrictions = None
388
+ if ambient_interval is None:
389
+ self._canon_chart = self.chart(coordinates=coordinate,
390
+ coord_restrictions=restrictions)
391
+ else:
392
+ self._canon_chart = ambient_interval.canonical_chart().restrict(self,
393
+ restrictions=restrictions)
394
+ self._lower = lower
395
+ self._upper = upper
396
+
397
+ def _repr_(self):
398
+ r"""
399
+ String representation of ``self``.
400
+
401
+ TESTS::
402
+
403
+ sage: I = manifolds.OpenInterval(-1, pi)
404
+ sage: I
405
+ Real interval (-1, pi)
406
+ sage: I = manifolds.OpenInterval(-1, +oo)
407
+ sage: I
408
+ Real interval (-1, +Infinity)
409
+ sage: I = manifolds.OpenInterval(-oo,0)
410
+ sage: I
411
+ Real interval (-Infinity, 0)
412
+ """
413
+ return "Real interval " + self._name
414
+
415
+ def _first_ngens(self, n):
416
+ r"""
417
+ Return the coordinate of the canonical chart.
418
+
419
+ This is useful only for the use of Sage preparser.
420
+
421
+ INPUT:
422
+
423
+ - ``n`` -- the number of coordinates: must be 1
424
+
425
+ TESTS::
426
+
427
+ sage: I = manifolds.OpenInterval(-1, 1)
428
+ sage: I._first_ngens(1)
429
+ (t,)
430
+ sage: I = manifolds.OpenInterval(-1, 1, coordinate='x')
431
+ sage: I._first_ngens(1)
432
+ (x,)
433
+ sage: I = manifolds.OpenInterval(-1, 1, names=('x',))
434
+ sage: I._first_ngens(1)
435
+ (x,)
436
+ """
437
+ return self._canon_chart[:]
438
+
439
+ def _element_constructor_(self, coords=None, chart=None, name=None,
440
+ latex_name=None, check_coords=True):
441
+ r"""
442
+ Construct an element of ``self``.
443
+
444
+ This is a redefinition of
445
+ :meth:`sage.manifolds.differentiable.DifferentiableManifold._element_constructor_`
446
+ to allow for construction from a number (considered as the canonical
447
+ coordinate).
448
+
449
+ INPUT:
450
+
451
+ - ``coords`` -- (default: ``None``) either (i) the point coordinates
452
+ (as a single-element tuple or list) in the chart ``chart``, (ii) the
453
+ value of the point coordinate in the chart ``chart``, or (iii)
454
+ another point in the interval
455
+ - ``chart`` -- (default: ``None``) chart in which the coordinates are
456
+ given; if none is provided, the coordinates are assumed to refer to
457
+ the interval's default chart
458
+ - ``name`` -- (default: ``None``) name given to the point
459
+ - ``latex_name`` -- (default: ``None``) LaTeX symbol to denote the
460
+ point; if none is provided, the LaTeX symbol is set to ``name``
461
+ - ``check_coords`` -- boolean (default: ``True``); determines whether
462
+ ``coords`` are valid coordinates for the chart ``chart``. For symbolic
463
+ coordinates, it is recommended to set ``check_coords`` to ``False``.
464
+
465
+ OUTPUT: :class:`~sage.manifolds.point.TopologicalManifoldPoint`
466
+ representing a point in the current interval
467
+
468
+ EXAMPLES::
469
+
470
+ sage: I = manifolds.OpenInterval(-1, 4)
471
+ sage: I((2,)) # standard used of TopologicalManifoldSubset._element_constructor_
472
+ Point on the Real interval (-1, 4)
473
+ sage: I(2) # specific use with a single coordinate
474
+ Point on the Real interval (-1, 4)
475
+ sage: I(2).coord()
476
+ (2,)
477
+ sage: I(2) == I((2,))
478
+ True
479
+ sage: I(pi)
480
+ Point on the Real interval (-1, 4)
481
+ sage: I(pi).coord()
482
+ (pi,)
483
+ sage: I(8)
484
+ Traceback (most recent call last):
485
+ ...
486
+ ValueError: the coordinates (8,) are not valid on the Chart
487
+ ((-1, 4), (t,))
488
+ """
489
+ if coords in SR:
490
+ coords = (coords,)
491
+ return super()._element_constructor_(coords=coords,
492
+ chart=chart, name=name, latex_name=latex_name,
493
+ check_coords=check_coords)
494
+
495
+ def _Hom_(self, other, category=None):
496
+ r"""
497
+ Construct the set of curves in ``other`` with parameter in ``self``.
498
+
499
+ INPUT:
500
+
501
+ - ``other`` -- a differentiable manifold `M`
502
+ - ``category`` -- (default: ``None``) not used here (to ensure
503
+ compatibility with generic hook ``_Hom_``)
504
+
505
+ OUTPUT: the set of curves `I \to M`, where `I` is ``self``
506
+
507
+ .. SEEALSO::
508
+
509
+ :class:`~sage.manifolds.differentiable.manifold_homset.DifferentiableCurveSet`
510
+ for more documentation.
511
+
512
+ TESTS::
513
+
514
+ sage: I = manifolds.OpenInterval(-1,1)
515
+ sage: M = Manifold(3, 'M')
516
+ sage: H = I._Hom_(M); H
517
+ Set of Morphisms from Real interval (-1, 1) to 3-dimensional
518
+ differentiable manifold M in Category of smooth manifolds over Real
519
+ Field with 53 bits of precision
520
+ sage: H is Hom(I, M)
521
+ True
522
+ """
523
+ from sage.manifolds.differentiable.manifold_homset import DifferentiableCurveSet
524
+ return DifferentiableCurveSet(self, other)
525
+
526
+ def canonical_chart(self):
527
+ r"""
528
+ Return the canonical chart defined on ``self``.
529
+
530
+ OUTPUT: :class:`~sage.manifolds.differentiable.chart.RealDiffChart`
531
+
532
+ EXAMPLES:
533
+
534
+ Canonical chart on the interval `(0, \pi)`::
535
+
536
+ sage: I = manifolds.OpenInterval(0, pi)
537
+ sage: I.canonical_chart()
538
+ Chart ((0, pi), (t,))
539
+ sage: I.canonical_chart().coord_range()
540
+ t: (0, pi)
541
+
542
+ The symbol used for the coordinate of the canonical chart is that
543
+ defined during the construction of the interval::
544
+
545
+ sage: I.<x> = manifolds.OpenInterval(0, pi)
546
+ sage: I.canonical_chart()
547
+ Chart ((0, pi), (x,))
548
+ """
549
+ return self._canon_chart
550
+
551
+ def canonical_coordinate(self):
552
+ r"""
553
+ Return the canonical coordinate defined on the interval.
554
+
555
+ OUTPUT: the symbolic variable representing the canonical coordinate
556
+
557
+ EXAMPLES:
558
+
559
+ Canonical coordinate on the interval `(0, \pi)`::
560
+
561
+ sage: I = manifolds.OpenInterval(0, pi)
562
+ sage: I.canonical_coordinate()
563
+ t
564
+ sage: type(I.canonical_coordinate())
565
+ <class 'sage.symbolic.expression.Expression'>
566
+ sage: I.canonical_coordinate().is_real()
567
+ True
568
+
569
+ The canonical coordinate is the first (unique) coordinate of the
570
+ canonical chart::
571
+
572
+ sage: I.canonical_coordinate() is I.canonical_chart()[0]
573
+ True
574
+
575
+ Its default symbol is `t`; but it can be customized during the
576
+ creation of the interval::
577
+
578
+ sage: I = manifolds.OpenInterval(0, pi, coordinate='x')
579
+ sage: I.canonical_coordinate()
580
+ x
581
+ sage: I.<x> = manifolds.OpenInterval(0, pi)
582
+ sage: I.canonical_coordinate()
583
+ x
584
+ """
585
+ return self._canon_chart._xx[0]
586
+
587
+ def lower_bound(self):
588
+ r"""
589
+ Return the lower bound (infimum) of the interval.
590
+
591
+ EXAMPLES::
592
+
593
+ sage: I = manifolds.OpenInterval(1/4, 3)
594
+ sage: I.lower_bound()
595
+ 1/4
596
+ sage: J = manifolds.OpenInterval(-oo, 2)
597
+ sage: J.lower_bound()
598
+ -Infinity
599
+
600
+ An alias of :meth:`lower_bound` is :meth:`inf`::
601
+
602
+ sage: I.inf()
603
+ 1/4
604
+ sage: J.inf()
605
+ -Infinity
606
+ """
607
+ return self._lower
608
+
609
+ inf = lower_bound
610
+
611
+ def upper_bound(self):
612
+ r"""
613
+ Return the upper bound (supremum) of the interval.
614
+
615
+ EXAMPLES::
616
+
617
+ sage: I = manifolds.OpenInterval(1/4, 3)
618
+ sage: I.upper_bound()
619
+ 3
620
+ sage: J = manifolds.OpenInterval(1, +oo)
621
+ sage: J.upper_bound()
622
+ +Infinity
623
+
624
+ An alias of :meth:`upper_bound` is :meth:`sup`::
625
+
626
+ sage: I.sup()
627
+ 3
628
+ sage: J.sup()
629
+ +Infinity
630
+ """
631
+ return self._upper
632
+
633
+ sup = upper_bound
634
+
635
+ def open_interval(self, lower, upper, name=None, latex_name=None):
636
+ r"""
637
+ Define an open subinterval of ``self``.
638
+
639
+ INPUT:
640
+
641
+ - ``lower`` -- lower bound of the subinterval (possibly ``-Infinity``)
642
+ - ``upper`` -- upper bound of the subinterval (possibly ``+Infinity``)
643
+ - ``name`` -- (default: ``None``) string; name (symbol) given to the
644
+ subinterval; if ``None``, the name is constructed from ``lower`` and
645
+ ``upper``
646
+ - ``latex_name`` -- (default: ``None``) string; LaTeX symbol to denote
647
+ the subinterval; if ``None``, the LaTeX symbol is constructed from
648
+ ``lower`` and ``upper`` if ``name`` is ``None``, otherwise, it is set
649
+ to ``name``
650
+
651
+ OUTPUT:
652
+
653
+ - :class:`~sage.manifolds.differentiable.examples.real_line.OpenInterval`
654
+ representing the open interval (``lower``, ``upper``)
655
+
656
+ EXAMPLES:
657
+
658
+ The interval `(0, \pi)` as a subinterval of `(-4, 4)`::
659
+
660
+ sage: I = manifolds.OpenInterval(-4, 4)
661
+ sage: J = I.open_interval(0, pi); J
662
+ Real interval (0, pi)
663
+ sage: J.is_subset(I)
664
+ True
665
+ sage: list(I.subset_family())
666
+ [Real interval (-4, 4), Real interval (0, pi)]
667
+
668
+ ``J`` is considered as an open submanifold of ``I``::
669
+
670
+ sage: J.manifold() is I
671
+ True
672
+
673
+ The subinterval `(-4, 4)` is ``I`` itself::
674
+
675
+ sage: I.open_interval(-4, 4) is I
676
+ True
677
+ """
678
+ if lower == self._lower and upper == self._upper:
679
+ return self
680
+ # To cope with the unique representation framework, we have to
681
+ # distinguish several cases, instead of performing a mere
682
+ # return OpenInterval(lower, upper, ambient_interval=self, name=name,
683
+ # latex_name=latex_name)
684
+ if name is None:
685
+ if latex_name is None:
686
+ return OpenInterval(lower, upper, ambient_interval=self)
687
+ return OpenInterval(lower, upper, ambient_interval=self,
688
+ latex_name=latex_name)
689
+ if latex_name is None:
690
+ return OpenInterval(lower, upper, ambient_interval=self, name=name)
691
+ return OpenInterval(lower, upper, ambient_interval=self, name=name,
692
+ latex_name=latex_name)
693
+
694
+
695
+ #******************************************************************************
696
+
697
+ class RealLine(OpenInterval):
698
+ r"""
699
+ Field of real numbers, as a differentiable manifold of dimension 1 (real
700
+ line) with a canonical coordinate chart.
701
+
702
+ INPUT:
703
+
704
+ - ``name`` -- (default: ``'R'``) string; name (symbol) given to
705
+ the real line
706
+ - ``latex_name`` -- (default: ``r'\Bold{R}'``) string; LaTeX symbol to
707
+ denote the real line
708
+ - ``coordinate`` -- (default: ``None``) string defining the symbol of the
709
+ canonical coordinate set on the real line; if none is provided and
710
+ ``names`` is ``None``, the symbol 't' is used
711
+ - ``names`` -- (default: ``None``) used only when ``coordinate`` is
712
+ ``None``: it must be a single-element tuple containing the canonical
713
+ coordinate symbol (this is guaranteed if the shortcut ``<names>`` is
714
+ used, see examples below)
715
+ - ``start_index`` -- (default: 0) unique value of the index for vectors
716
+ and forms on the real line manifold
717
+
718
+ EXAMPLES:
719
+
720
+ Constructing the real line without any argument::
721
+
722
+ sage: R = manifolds.RealLine() ; R
723
+ Real number line ℝ
724
+ sage: latex(R)
725
+ \Bold{R}
726
+
727
+ ``R`` is a 1-dimensional real smooth manifold::
728
+
729
+ sage: R.category()
730
+ Category of smooth connected manifolds over Real Field with 53 bits of
731
+ precision
732
+ sage: isinstance(R, sage.manifolds.differentiable.manifold.DifferentiableManifold)
733
+ True
734
+ sage: dim(R)
735
+ 1
736
+
737
+ It is endowed with a canonical chart::
738
+
739
+ sage: R.canonical_chart()
740
+ Chart (ℝ, (t,))
741
+ sage: R.canonical_chart() is R.default_chart()
742
+ True
743
+ sage: R.atlas()
744
+ [Chart (ℝ, (t,))]
745
+
746
+ The instance is unique (as long as the constructor arguments are the
747
+ same)::
748
+
749
+ sage: R is manifolds.RealLine()
750
+ True
751
+ sage: R is manifolds.RealLine(latex_name='R')
752
+ False
753
+
754
+ The canonical coordinate is returned by the method
755
+ :meth:`~sage.manifolds.differentiable.examples.real_line.OpenInterval.canonical_coordinate`::
756
+
757
+ sage: R.canonical_coordinate()
758
+ t
759
+ sage: t = R.canonical_coordinate()
760
+ sage: type(t)
761
+ <class 'sage.symbolic.expression.Expression'>
762
+
763
+ However, it can be obtained in the same step as the real line construction
764
+ by means of the shortcut ``R.<names>``::
765
+
766
+ sage: R.<t> = manifolds.RealLine()
767
+ sage: t
768
+ t
769
+ sage: type(t)
770
+ <class 'sage.symbolic.expression.Expression'>
771
+
772
+ The trick is performed by Sage preparser::
773
+
774
+ sage: preparse("R.<t> = manifolds.RealLine()")
775
+ "R = manifolds.RealLine(names=('t',)); (t,) = R._first_ngens(1)"
776
+
777
+ In particular the shortcut is to be used to set a canonical
778
+ coordinate symbol different from 't'::
779
+
780
+ sage: R.<x> = manifolds.RealLine()
781
+ sage: R.canonical_chart()
782
+ Chart (ℝ, (x,))
783
+ sage: R.atlas()
784
+ [Chart (ℝ, (x,))]
785
+ sage: R.canonical_coordinate()
786
+ x
787
+
788
+ The LaTeX symbol of the canonical coordinate can be adjusted via the same
789
+ syntax as a chart declaration (see
790
+ :class:`~sage.manifolds.chart.RealChart`)::
791
+
792
+ sage: R.<x> = manifolds.RealLine(coordinate=r'x:\xi')
793
+ sage: latex(x)
794
+ {\xi}
795
+ sage: latex(R.canonical_chart())
796
+ \left(\Bold{R},({\xi})\right)
797
+
798
+ The LaTeX symbol of the real line itself can also be customized::
799
+
800
+ sage: R.<x> = manifolds.RealLine(latex_name=r'\mathbb{R}')
801
+ sage: latex(R)
802
+ \mathbb{R}
803
+
804
+ Elements of the real line can be constructed directly from a number::
805
+
806
+ sage: p = R(2) ; p
807
+ Point on the Real number line ℝ
808
+ sage: p.coord()
809
+ (2,)
810
+ sage: p = R(1.742) ; p
811
+ Point on the Real number line ℝ
812
+ sage: p.coord()
813
+ (1.74200000000000,)
814
+
815
+ Symbolic variables can also be used::
816
+
817
+ sage: p = R(pi, name='pi') ; p
818
+ Point pi on the Real number line ℝ
819
+ sage: p.coord()
820
+ (pi,)
821
+ sage: a = var('a')
822
+ sage: p = R(a) ; p
823
+ Point on the Real number line ℝ
824
+ sage: p.coord()
825
+ (a,)
826
+
827
+ The real line is considered as the open interval `(-\infty, +\infty)`::
828
+
829
+ sage: isinstance(R, sage.manifolds.differentiable.examples.real_line.OpenInterval)
830
+ True
831
+ sage: R.lower_bound()
832
+ -Infinity
833
+ sage: R.upper_bound()
834
+ +Infinity
835
+
836
+ A real interval can be created from ``R`` means of the method
837
+ :meth:`~sage.manifolds.differentiable.examples.real_line.OpenInterval.open_interval`::
838
+
839
+ sage: I = R.open_interval(0, 1); I
840
+ Real interval (0, 1)
841
+ sage: I.manifold()
842
+ Real number line ℝ
843
+ sage: list(R.subset_family())
844
+ [Real interval (0, 1), Real number line ℝ]
845
+ """
846
+ @staticmethod
847
+ def __classcall__(cls, name=unicode_mathbbR, latex_name=r'\Bold{R}',
848
+ coordinate=None, names=None, start_index=0):
849
+ r"""
850
+ Determine the correct interval to return based upon the input.
851
+
852
+ TESTS::
853
+
854
+ sage: R = manifolds.RealLine(); R
855
+ Real number line ℝ
856
+ sage: R1 = manifolds.RealLine('ℝ'); R1
857
+ Real number line ℝ
858
+ sage: R is R1
859
+ True
860
+ """
861
+ return super().__classcall__(cls, name=name,
862
+ latex_name=latex_name,
863
+ coordinate=coordinate,
864
+ names=names, start_index=start_index)
865
+
866
+ def __init__(self, name=unicode_mathbbR, latex_name=r'\Bold{R}',
867
+ coordinate=None, names=None, start_index=0):
868
+ r"""
869
+ Construct the real line manifold.
870
+
871
+ TESTS::
872
+
873
+ sage: R = manifolds.RealLine() ; R
874
+ Real number line ℝ
875
+ sage: R.category()
876
+ Category of smooth connected manifolds over Real Field with 53 bits
877
+ of precision
878
+ sage: TestSuite(R).run(skip='_test_elements') # pickling of elements fails
879
+ """
880
+ OpenInterval.__init__(self, minus_infinity, infinity, name=name,
881
+ latex_name=latex_name, coordinate=coordinate,
882
+ names=names, start_index=start_index)
883
+
884
+ def _repr_(self):
885
+ r"""
886
+ String representation of ``self``.
887
+
888
+ TESTS::
889
+
890
+ sage: R = manifolds.RealLine()
891
+ sage: R._repr_()
892
+ 'Real number line ℝ'
893
+ sage: R = manifolds.RealLine(name='r')
894
+ sage: R._repr_()
895
+ 'Real number line r'
896
+ """
897
+ return "Real number line " + self._name