passagemath-symbolics 10.6.40__cp314-cp314t-macosx_13_0_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 (172) hide show
  1. passagemath_symbolics/.dylibs/libgmp.10.dylib +0 -0
  2. passagemath_symbolics/__init__.py +3 -0
  3. passagemath_symbolics-10.6.40.dist-info/METADATA +187 -0
  4. passagemath_symbolics-10.6.40.dist-info/RECORD +172 -0
  5. passagemath_symbolics-10.6.40.dist-info/WHEEL +6 -0
  6. passagemath_symbolics-10.6.40.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,755 @@
1
+ # sage_setup: distribution = sagemath-symbolics
2
+ r"""
3
+ Pseudo-Riemannian Manifolds
4
+
5
+ A *pseudo-Riemannian manifold* is a pair `(M,g)` where `M` is a real
6
+ differentiable manifold `M` (see
7
+ :class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`)
8
+ and `g` is a field of non-degenerate symmetric bilinear forms on `M`, which is
9
+ called the *metric tensor*, or simply the *metric* (see
10
+ :class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric`).
11
+
12
+ Two important subcases are
13
+
14
+ - *Riemannian manifold*: the metric `g` is positive definite, i.e. its
15
+ signature is `n = \dim M`;
16
+ - *Lorentzian manifold*: the metric `g` has signature `n-2` (positive
17
+ convention) or `2-n` (negative convention).
18
+
19
+ On a pseudo-Riemannian manifold, one may use various standard
20
+ :mod:`~sage.manifolds.operators` acting on scalar and tensor
21
+ fields, like :func:`~sage.manifolds.operators.grad` or
22
+ :func:`~sage.manifolds.operators.div`.
23
+
24
+ All pseudo-Riemannian manifolds, whatever the metric signature, are implemented
25
+ via the class :class:`PseudoRiemannianManifold`.
26
+
27
+ .. RUBRIC:: Example 1: the sphere as a Riemannian manifold of dimension 2
28
+
29
+ We start by declaring `S^2` as a 2-dimensional Riemannian manifold::
30
+
31
+ sage: M = Manifold(2, 'S^2', structure='Riemannian')
32
+ sage: M
33
+ 2-dimensional Riemannian manifold S^2
34
+
35
+ We then cover `S^2` by two stereographic charts, from the North pole and from
36
+ the South pole respectively::
37
+
38
+ sage: U = M.open_subset('U')
39
+ sage: stereoN.<x,y> = U.chart()
40
+ sage: V = M.open_subset('V')
41
+ sage: stereoS.<u,v> = V.chart()
42
+ sage: M.declare_union(U,V)
43
+ sage: stereoN_to_S = stereoN.transition_map(stereoS,
44
+ ....: [x/(x^2+y^2), y/(x^2+y^2)], intersection_name='W',
45
+ ....: restrictions1= x^2+y^2!=0, restrictions2= u^2+v^2!=0)
46
+ sage: W = U.intersection(V)
47
+ sage: stereoN_to_S
48
+ Change of coordinates from Chart (W, (x, y)) to Chart (W, (u, v))
49
+ sage: stereoN_to_S.display()
50
+ u = x/(x^2 + y^2)
51
+ v = y/(x^2 + y^2)
52
+ sage: stereoN_to_S.inverse().display()
53
+ x = u/(u^2 + v^2)
54
+ y = v/(u^2 + v^2)
55
+
56
+ We get the metric defining the Riemannian structure by::
57
+
58
+ sage: g = M.metric()
59
+ sage: g
60
+ Riemannian metric g on the 2-dimensional Riemannian manifold S^2
61
+
62
+ At this stage, the metric `g` is defined as a Python object but there remains to
63
+ initialize it by setting its components with respect to the vector frames
64
+ associated with the stereographic coordinates. Let us begin with the frame
65
+ of chart ``stereoN``::
66
+
67
+ sage: eU = stereoN.frame()
68
+ sage: g[eU, 0, 0] = 4/(1 + x^2 + y^2)^2
69
+ sage: g[eU, 1, 1] = 4/(1 + x^2 + y^2)^2
70
+
71
+ The metric components in the frame of chart ``stereoS`` are obtained by
72
+ continuation of the expressions found in `W = U\cap V` from the known
73
+ change-of-coordinate formulas::
74
+
75
+ sage: eV = stereoS.frame()
76
+ sage: g.add_comp_by_continuation(eV, W)
77
+
78
+ At this stage, the metric `g` is well defined in all `S^2`::
79
+
80
+ sage: g.display(eU)
81
+ g = 4/(x^2 + y^2 + 1)^2 dx⊗dx + 4/(x^2 + y^2 + 1)^2 dy⊗dy
82
+ sage: g.display(eV)
83
+ g = 4/(u^4 + v^4 + 2*(u^2 + 1)*v^2 + 2*u^2 + 1) du⊗du
84
+ + 4/(u^4 + v^4 + 2*(u^2 + 1)*v^2 + 2*u^2 + 1) dv⊗dv
85
+
86
+ The expression in frame ``eV`` can be given a shape similar to that in frame
87
+ ``eU``, by factorizing the components::
88
+
89
+ sage: g[eV, 0, 0].factor()
90
+ 4/(u^2 + v^2 + 1)^2
91
+ sage: g[eV, 1, 1].factor()
92
+ 4/(u^2 + v^2 + 1)^2
93
+ sage: g.display(eV)
94
+ g = 4/(u^2 + v^2 + 1)^2 du⊗du + 4/(u^2 + v^2 + 1)^2 dv⊗dv
95
+
96
+ Let us consider a scalar field `f` on `S^2`::
97
+
98
+ sage: f = M.scalar_field({stereoN: 1/(1+x^2+y^2)}, name='f')
99
+ sage: f.add_expr_by_continuation(stereoS, W)
100
+ sage: f.display()
101
+ f: S^2 → ℝ
102
+ on U: (x, y) ↦ 1/(x^2 + y^2 + 1)
103
+ on V: (u, v) ↦ (u^2 + v^2)/(u^2 + v^2 + 1)
104
+
105
+ The gradient of `f` (with respect to the metric `g`) is::
106
+
107
+ sage: gradf = f.gradient()
108
+ sage: gradf
109
+ Vector field grad(f) on the 2-dimensional Riemannian manifold S^2
110
+ sage: gradf.display(eU)
111
+ grad(f) = -1/2*x ∂/∂x - 1/2*y ∂/∂y
112
+ sage: gradf.display(eV)
113
+ grad(f) = 1/2*u ∂/∂u + 1/2*v ∂/∂v
114
+
115
+ It is possible to write ``grad(f)`` instead of ``f.gradient()``, by importing
116
+ the standard differential operators of vector calculus::
117
+
118
+ sage: from sage.manifolds.operators import *
119
+ sage: grad(f) == gradf
120
+ True
121
+
122
+ The Laplacian of `f` (with respect to the metric `g`) is obtained either
123
+ as ``f.laplacian()`` or, thanks to the above import, as ``laplacian(f)``::
124
+
125
+ sage: Df = laplacian(f)
126
+ sage: Df
127
+ Scalar field Delta(f) on the 2-dimensional Riemannian manifold S^2
128
+ sage: Df.display()
129
+ Delta(f): S^2 → ℝ
130
+ on U: (x, y) ↦ (x^2 + y^2 - 1)/(x^2 + y^2 + 1)
131
+ on V: (u, v) ↦ -(u^2 + v^2 - 1)/(u^2 + v^2 + 1)
132
+
133
+ Let us check the standard formula
134
+ `\Delta f = \mathrm{div}( \mathrm{grad}\, f )`::
135
+
136
+ sage: Df == div(gradf)
137
+ True
138
+
139
+ Since each open subset of `S^2` inherits the structure of a Riemannian
140
+ manifold, we can get the metric on it via the method ``metric()``::
141
+
142
+ sage: gU = U.metric()
143
+ sage: gU
144
+ Riemannian metric g on the Open subset U of the 2-dimensional Riemannian
145
+ manifold S^2
146
+ sage: gU.display()
147
+ g = 4/(x^2 + y^2 + 1)^2 dx⊗dx + 4/(x^2 + y^2 + 1)^2 dy⊗dy
148
+
149
+ Of course, ``gU`` is nothing but the restriction of `g` to `U`::
150
+
151
+ sage: gU is g.restrict(U)
152
+ True
153
+
154
+ .. RUBRIC:: Example 2: Minkowski spacetime as a Lorentzian manifold of
155
+ dimension 4
156
+
157
+ We start by declaring a 4-dimensional Lorentzian manifold `M`::
158
+
159
+ sage: M = Manifold(4, 'M', structure='Lorentzian')
160
+ sage: M
161
+ 4-dimensional Lorentzian manifold M
162
+
163
+ We define Minkowskian coordinates on `M`::
164
+
165
+ sage: X.<t,x,y,z> = M.chart()
166
+
167
+ We construct the metric tensor by::
168
+
169
+ sage: g = M.metric()
170
+ sage: g
171
+ Lorentzian metric g on the 4-dimensional Lorentzian manifold M
172
+
173
+ and initialize it to the Minkowskian value::
174
+
175
+ sage: g[0,0], g[1,1], g[2,2], g[3,3] = -1, 1, 1, 1
176
+ sage: g.display()
177
+ g = -dt⊗dt + dx⊗dx + dy⊗dy + dz⊗dz
178
+ sage: g[:]
179
+ [-1 0 0 0]
180
+ [ 0 1 0 0]
181
+ [ 0 0 1 0]
182
+ [ 0 0 0 1]
183
+
184
+ We may check that the metric is flat, i.e. has a vanishing Riemann curvature
185
+ tensor::
186
+
187
+ sage: g.riemann().display()
188
+ Riem(g) = 0
189
+
190
+ A vector field on `M`::
191
+
192
+ sage: u = M.vector_field(name='u')
193
+ sage: u[0] = cosh(t)
194
+ sage: u[1] = sinh(t)
195
+ sage: u.display()
196
+ u = cosh(t) ∂/∂t + sinh(t) ∂/∂x
197
+
198
+ The scalar square of `u` is::
199
+
200
+ sage: s = u.dot(u); s
201
+ Scalar field u.u on the 4-dimensional Lorentzian manifold M
202
+
203
+ Scalar products are taken with respect to the metric tensor::
204
+
205
+ sage: u.dot(u) == g(u,u)
206
+ True
207
+
208
+ `u` is a unit timelike vector, i.e. its scalar square is identically `-1`::
209
+
210
+ sage: s.display()
211
+ u.u: M → ℝ
212
+ (t, x, y, z) ↦ -1
213
+ sage: s.expr()
214
+ -1
215
+
216
+ Let us consider a unit spacelike vector::
217
+
218
+ sage: v = M.vector_field(name='v')
219
+ sage: v[0] = sinh(t)
220
+ sage: v[1] = cosh(t)
221
+ sage: v.display()
222
+ v = sinh(t) ∂/∂t + cosh(t) ∂/∂x
223
+ sage: v.dot(v).display()
224
+ v.v: M → ℝ
225
+ (t, x, y, z) ↦ 1
226
+ sage: v.dot(v).expr()
227
+ 1
228
+
229
+ `u` and `v` are orthogonal vectors with respect to Minkowski metric::
230
+
231
+ sage: u.dot(v).display()
232
+ u.v: M → ℝ
233
+ (t, x, y, z) ↦ 0
234
+ sage: u.dot(v).expr()
235
+ 0
236
+
237
+ The divergence of `u` is::
238
+
239
+ sage: s = u.div(); s
240
+ Scalar field div(u) on the 4-dimensional Lorentzian manifold M
241
+ sage: s.display()
242
+ div(u): M → ℝ
243
+ (t, x, y, z) ↦ sinh(t)
244
+
245
+ while its d'Alembertian is::
246
+
247
+ sage: Du = u.dalembertian(); Du
248
+ Vector field Box(u) on the 4-dimensional Lorentzian manifold M
249
+ sage: Du.display()
250
+ Box(u) = -cosh(t) ∂/∂t - sinh(t) ∂/∂x
251
+
252
+ AUTHORS:
253
+
254
+ - Eric Gourgoulhon (2018): initial version
255
+
256
+ REFERENCES:
257
+
258
+ - \B. O'Neill : *Semi-Riemannian Geometry* [ONe1983]_
259
+ - \J. M. Lee : *Riemannian Manifolds* [Lee1997]_
260
+ """
261
+
262
+ #*****************************************************************************
263
+ # Copyright (C) 2018 Eric Gourgoulhon <eric.gourgoulhon@obspm.fr>
264
+ #
265
+ # Distributed under the terms of the GNU General Public License (GPL)
266
+ # as published by the Free Software Foundation; either version 2 of
267
+ # the License, or (at your option) any later version.
268
+ # http://www.gnu.org/licenses/
269
+ #*****************************************************************************
270
+
271
+ from sage.manifolds.differentiable.manifold import DifferentiableManifold
272
+ from sage.manifolds.structure import (
273
+ LorentzianStructure,
274
+ PseudoRiemannianStructure,
275
+ RiemannianStructure,
276
+ )
277
+ from sage.rings.infinity import infinity
278
+
279
+ ###############################################################################
280
+
281
+
282
+ class PseudoRiemannianManifold(DifferentiableManifold):
283
+ r"""
284
+ PseudoRiemannian manifold.
285
+
286
+ A *pseudo-Riemannian manifold* is a pair `(M,g)` where `M` is a real
287
+ differentiable manifold `M` (see
288
+ :class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`)
289
+ and `g` is a field of non-degenerate symmetric bilinear forms on `M`, which
290
+ is called the *metric tensor*, or simply the *metric* (see
291
+ :class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric`).
292
+
293
+ Two important subcases are
294
+
295
+ - *Riemannian manifold*: the metric `g` is positive definite, i.e. its
296
+ signature is `n = \dim M`;
297
+ - *Lorentzian manifold*: the metric `g` has signature `n-2` (positive
298
+ convention) or `2-n` (negative convention).
299
+
300
+ INPUT:
301
+
302
+ - ``n`` -- positive integer; dimension of the manifold
303
+ - ``name`` -- string; name (symbol) given to the manifold
304
+ - ``metric_name`` -- (default: ``None``) string; name (symbol) given to the
305
+ metric; if ``None``, ``'g'`` is used
306
+ - ``signature`` -- (default: ``None``) signature `S` of the metric as a
307
+ single integer: `S = n_+ - n_-`, where `n_+` (resp. `n_-`) is the
308
+ number of positive terms (resp. number of negative terms) in any
309
+ diagonal writing of the metric components; if ``signature`` is not
310
+ provided, `S` is set to the manifold's dimension (Riemannian
311
+ signature)
312
+ - ``base_manifold`` -- (default: ``None``) if not ``None``, must be a
313
+ differentiable manifold; the created object is then an open subset of
314
+ ``base_manifold``
315
+ - ``diff_degree`` -- (default: ``infinity``) degree `k` of
316
+ differentiability
317
+ - ``latex_name`` -- (default: ``None``) string; LaTeX symbol to
318
+ denote the manifold; if none is provided, it is set to ``name``
319
+ - ``metric_latex_name`` -- (default: ``None``) string; LaTeX symbol to
320
+ denote the metric; if none is provided, it is set to ``metric_name``
321
+ - ``start_index`` -- (default: 0) integer; lower value of the range of
322
+ indices used for "indexed objects" on the manifold, e.g. coordinates
323
+ in a chart
324
+ - ``category`` -- (default: ``None``) to specify the category; if ``None``,
325
+ ``Manifolds(RR).Differentiable()`` (or ``Manifolds(RR).Smooth()``
326
+ if ``diff_degree`` = ``infinity``) is assumed (see the category
327
+ :class:`~sage.categories.manifolds.Manifolds`)
328
+ - ``unique_tag`` -- (default: ``None``) tag used to force the construction
329
+ of a new object when all the other arguments have been used previously
330
+ (without ``unique_tag``, the
331
+ :class:`~sage.structure.unique_representation.UniqueRepresentation`
332
+ behavior inherited from
333
+ :class:`~sage.manifolds.subset.ManifoldSubset`, via
334
+ :class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`
335
+ and :class:`~sage.manifolds.manifold.TopologicalManifold`,
336
+ would return the previously constructed object corresponding to these
337
+ arguments).
338
+
339
+ EXAMPLES:
340
+
341
+ Pseudo-Riemannian manifolds are constructed via the generic function
342
+ :func:`~sage.manifolds.manifold.Manifold`, using the keyword
343
+ ``structure``::
344
+
345
+ sage: M = Manifold(4, 'M', structure='pseudo-Riemannian', signature=0)
346
+ sage: M
347
+ 4-dimensional pseudo-Riemannian manifold M
348
+ sage: M.category()
349
+ Category of smooth manifolds over Real Field with 53 bits of precision
350
+
351
+ The metric associated with ``M`` is::
352
+
353
+ sage: M.metric()
354
+ Pseudo-Riemannian metric g on the 4-dimensional pseudo-Riemannian
355
+ manifold M
356
+ sage: M.metric().signature()
357
+ 0
358
+ sage: M.metric().tensor_type()
359
+ (0, 2)
360
+
361
+ Its value has to be initialized either by setting its components in various
362
+ vector frames (see the above examples regarding the 2-sphere and Minkowski
363
+ spacetime) or by making it equal to a given field of symmetric bilinear
364
+ forms (see the method
365
+ :meth:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric.set`
366
+ of the metric class). Both methods are also covered in the
367
+ documentation of method :meth:`metric` below.
368
+
369
+ The metric object belongs to the class
370
+ :class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric`::
371
+
372
+ sage: isinstance(M.metric(), sage.manifolds.differentiable.metric.
373
+ ....: PseudoRiemannianMetric)
374
+ True
375
+
376
+ See the documentation of this class for all operations available on
377
+ metrics.
378
+
379
+ The default name of the metric is ``g``; it can be customized::
380
+
381
+ sage: M = Manifold(4, 'M', structure='pseudo-Riemannian',
382
+ ....: metric_name='gam', metric_latex_name=r'\gamma')
383
+ sage: M.metric()
384
+ Riemannian metric gam on the 4-dimensional Riemannian manifold M
385
+ sage: latex(M.metric())
386
+ \gamma
387
+
388
+ A Riemannian manifold is constructed by the proper setting of the keyword
389
+ ``structure``::
390
+
391
+ sage: M = Manifold(4, 'M', structure='Riemannian'); M
392
+ 4-dimensional Riemannian manifold M
393
+ sage: M.metric()
394
+ Riemannian metric g on the 4-dimensional Riemannian manifold M
395
+ sage: M.metric().signature()
396
+ 4
397
+
398
+ Similarly, a Lorentzian manifold is obtained by::
399
+
400
+ sage: M = Manifold(4, 'M', structure='Lorentzian'); M
401
+ 4-dimensional Lorentzian manifold M
402
+ sage: M.metric()
403
+ Lorentzian metric g on the 4-dimensional Lorentzian manifold M
404
+
405
+ The default Lorentzian signature is taken to be positive::
406
+
407
+ sage: M.metric().signature()
408
+ 2
409
+
410
+ but one can opt for the negative convention via the keyword ``signature``::
411
+
412
+ sage: M = Manifold(4, 'M', structure='Lorentzian', signature='negative')
413
+ sage: M.metric()
414
+ Lorentzian metric g on the 4-dimensional Lorentzian manifold M
415
+ sage: M.metric().signature()
416
+ -2
417
+ """
418
+ def __init__(self, n, name, metric_name=None, signature=None,
419
+ base_manifold=None, diff_degree=infinity, latex_name=None,
420
+ metric_latex_name=None, start_index=0, category=None,
421
+ unique_tag=None):
422
+ r"""
423
+ Construct a pseudo-Riemannian manifold.
424
+
425
+ TESTS::
426
+
427
+ sage: M = Manifold(4, 'M', structure='pseudo-Riemannian',
428
+ ....: signature=0)
429
+ sage: M
430
+ 4-dimensional pseudo-Riemannian manifold M
431
+ sage: type(M)
432
+ <class 'sage.manifolds.differentiable.pseudo_riemannian.PseudoRiemannianManifold_with_category'>
433
+ sage: X.<w,x,y,z> = M.chart()
434
+ sage: M.metric()
435
+ Pseudo-Riemannian metric g on the 4-dimensional pseudo-Riemannian manifold M
436
+ sage: TestSuite(M).run()
437
+ """
438
+ if base_manifold and not isinstance(base_manifold, PseudoRiemannianManifold):
439
+ raise TypeError("the argument 'base_manifold' must be a " +
440
+ "pseudo-Riemannian manifold")
441
+ if signature is None or signature == n:
442
+ structure = RiemannianStructure()
443
+ elif signature == n-2 or signature == 2-n:
444
+ structure = LorentzianStructure()
445
+ else:
446
+ structure = PseudoRiemannianStructure()
447
+ DifferentiableManifold.__init__(self, n, name, 'real', structure,
448
+ base_manifold=base_manifold,
449
+ diff_degree=diff_degree,
450
+ latex_name=latex_name,
451
+ start_index=start_index,
452
+ category=category)
453
+ self._metric = None # to be initialized by metric()
454
+ self._metric_signature = signature
455
+ if metric_name is None:
456
+ metric_name = 'g'
457
+ elif not isinstance(metric_name, str):
458
+ raise TypeError("{} is not a string".format(metric_name))
459
+ self._metric_name = metric_name
460
+ if metric_latex_name is None:
461
+ self._metric_latex_name = self._metric_name
462
+ else:
463
+ if not isinstance(metric_latex_name, str):
464
+ raise TypeError("{} is not a string".format(metric_latex_name))
465
+ self._metric_latex_name = metric_latex_name
466
+
467
+ def metric(self, name=None, signature=None, latex_name=None,
468
+ dest_map=None):
469
+ r"""
470
+ Return the metric giving the pseudo-Riemannian structure to the
471
+ manifold, or define a new metric tensor on the manifold.
472
+
473
+ INPUT:
474
+
475
+ - ``name`` -- (default: ``None``) name given to the metric; if
476
+ ``name`` is ``None`` or matches the name of the metric defining the
477
+ pseudo-Riemannian structure of ``self``, the latter metric is
478
+ returned
479
+ - ``signature`` -- (default: ``None``; ignored if ``name`` is ``None``)
480
+ signature `S` of the metric as a single integer: `S = n_+ - n_-`,
481
+ where `n_+` (resp. `n_-`) is the number of positive terms (resp.
482
+ number of negative terms) in any diagonal writing of the metric
483
+ components; if ``signature`` is not provided, `S` is set to the
484
+ manifold's dimension (Riemannian signature)
485
+ - ``latex_name`` -- (default: ``None``; ignored if ``name`` is ``None``)
486
+ LaTeX symbol to denote the metric; if ``None``, it is formed from
487
+ ``name``
488
+ - ``dest_map`` -- (default: ``None``; ignored if ``name`` is ``None``)
489
+ instance of
490
+ class :class:`~sage.manifolds.differentiable.diff_map.DiffMap`
491
+ representing the destination map `\Phi:\ U \rightarrow M`, where `U`
492
+ is the current manifold; if ``None``, the identity map is assumed
493
+ (case of a metric tensor field *on* `U`)
494
+
495
+ OUTPUT:
496
+
497
+ - instance of
498
+ :class:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric`
499
+
500
+ EXAMPLES:
501
+
502
+ Metric of a 3-dimensional Riemannian manifold::
503
+
504
+ sage: M = Manifold(3, 'M', structure='Riemannian', start_index=1)
505
+ sage: X.<x,y,z> = M.chart()
506
+ sage: g = M.metric(); g
507
+ Riemannian metric g on the 3-dimensional Riemannian manifold M
508
+
509
+ The metric remains to be initialized, for instance by setting its
510
+ components in the coordinate frame associated to the chart ``X``::
511
+
512
+ sage: g[1,1], g[2,2], g[3,3] = 1, 1, 1
513
+ sage: g.display()
514
+ g = dx⊗dx + dy⊗dy + dz⊗dz
515
+
516
+ Alternatively, the metric can be initialized from a given field of
517
+ nondegenerate symmetric bilinear forms; we may create the former
518
+ object by::
519
+
520
+ sage: X.coframe()
521
+ Coordinate coframe (M, (dx,dy,dz))
522
+ sage: dx, dy, dz = X.coframe()[1], X.coframe()[2], X.coframe()[3]
523
+ sage: b = dx*dx + dy*dy + dz*dz
524
+ sage: b
525
+ Field of symmetric bilinear forms dx⊗dx+dy⊗dy+dz⊗dz on the
526
+ 3-dimensional Riemannian manifold M
527
+
528
+ We then use the metric method
529
+ :meth:`~sage.manifolds.differentiable.metric.PseudoRiemannianMetric.set`
530
+ to make ``g`` being equal to ``b`` as a symmetric tensor field of
531
+ type ``(0,2)``::
532
+
533
+ sage: g.set(b)
534
+ sage: g.display()
535
+ g = dx⊗dx + dy⊗dy + dz⊗dz
536
+
537
+ Another metric can be defined on ``M`` by specifying a metric name
538
+ distinct from that chosen at the creation of the manifold (which
539
+ is ``g`` by default, but can be changed thanks to the keyword
540
+ ``metric_name`` in :func:`~sage.manifolds.manifold.Manifold`)::
541
+
542
+ sage: h = M.metric('h'); h
543
+ Riemannian metric h on the 3-dimensional Riemannian manifold M
544
+ sage: h[1,1], h[2,2], h[3,3] = 1+y^2, 1+z^2, 1+x^2
545
+ sage: h.display()
546
+ h = (y^2 + 1) dx⊗dx + (z^2 + 1) dy⊗dy + (x^2 + 1) dz⊗dz
547
+
548
+ The metric tensor ``h`` is distinct from the metric entering in the
549
+ definition of the Riemannian manifold ``M``::
550
+
551
+ sage: h is M.metric()
552
+ False
553
+
554
+ while we have of course::
555
+
556
+ sage: g is M.metric()
557
+ True
558
+
559
+ Providing the same name as the manifold's default metric returns the
560
+ latter::
561
+
562
+ sage: M.metric('g') is M.metric()
563
+ True
564
+
565
+ In the present case (``M`` is diffeomorphic to `\RR^3`), we can even
566
+ create a Lorentzian metric on ``M``::
567
+
568
+ sage: h = M.metric('h', signature=1); h
569
+ Lorentzian metric h on the 3-dimensional Riemannian manifold M
570
+ """
571
+ if name is None or name == self._metric_name:
572
+ # Default metric associated with the manifold
573
+ if self._metric is None:
574
+ if self._manifold is not self and self._manifold._metric is not None:
575
+ # case of an open subset with a metric already defined on
576
+ # the ambient manifold:
577
+ self._metric = self._manifold._metric.restrict(self)
578
+ else:
579
+ # creation from scratch:
580
+ self._metric = DifferentiableManifold.metric(self,
581
+ self._metric_name,
582
+ signature=self._metric_signature,
583
+ latex_name=self._metric_latex_name)
584
+ return self._metric
585
+ # Metric distinct from the default one: it is created by the method
586
+ # metric of the superclass for generic differentiable manifolds:
587
+ return DifferentiableManifold.metric(self, name, signature=signature,
588
+ latex_name=latex_name,
589
+ dest_map=dest_map)
590
+
591
+ def volume_form(self, contra=0):
592
+ r"""
593
+ Volume form (Levi-Civita tensor) `\epsilon` associated with ``self``.
594
+
595
+ This assumes that ``self`` is an orientable manifold, with a
596
+ preferred orientation; see
597
+ :meth:`~sage.manifolds.differentiable.manifold.DifferentiableManifold.orientation`
598
+ for details.
599
+
600
+ The volume form `\epsilon` is a `n`-form (`n` being the manifold's
601
+ dimension) such that, for any vector frame `(e_i)` that is orthonormal
602
+ with respect to the metric of the pseudo-Riemannian manifold ``self``,
603
+
604
+ .. MATH::
605
+
606
+ \epsilon(e_1,\ldots,e_n) = \pm 1
607
+
608
+ There are only two such `n`-forms, which are opposite of each other.
609
+ The volume form `\epsilon` is selected as the one that returns `+1` for
610
+ any right-handed vector frame with respect to the chosen orientation of
611
+ ``self``.
612
+
613
+ INPUT:
614
+
615
+ - ``contra`` -- (default: 0) number of contravariant indices of the
616
+ returned tensor
617
+
618
+ OUTPUT:
619
+
620
+ - if ``contra = 0`` (default value): the volume `n`-form `\epsilon`, as
621
+ an instance of
622
+ :class:`~sage.manifolds.differentiable.diff_form.DiffForm`
623
+ - if ``contra = k``, with `1\leq k \leq n`, the tensor field of type
624
+ (k,n-k) formed from `\epsilon` by raising the first k indices with
625
+ the metric (see method
626
+ :meth:`~sage.manifolds.differentiable.tensorfield.TensorField.up`);
627
+ the output is then an instance of
628
+ :class:`~sage.manifolds.differentiable.tensorfield.TensorField`, with
629
+ the appropriate antisymmetries, or of the subclass
630
+ :class:`~sage.manifolds.differentiable.multivectorfield.MultivectorField`
631
+ if `k=n`
632
+
633
+ EXAMPLES:
634
+
635
+ Volume form of the Euclidean 3-space::
636
+
637
+ sage: M = Manifold(3, 'M', structure='Riemannian', start_index=1)
638
+ sage: X.<x,y,z> = M.chart()
639
+ sage: g = M.metric()
640
+ sage: g[1,1], g[2,2], g[3,3] = 1, 1, 1
641
+ sage: eps = M.volume_form(); eps
642
+ 3-form eps_g on the 3-dimensional Riemannian manifold M
643
+ sage: eps.display()
644
+ eps_g = dx∧dy∧dz
645
+
646
+ Raising the first index::
647
+
648
+ sage: eps1 = M.volume_form(1); eps1
649
+ Tensor field of type (1,2) on the 3-dimensional Riemannian
650
+ manifold M
651
+ sage: eps1.display()
652
+ ∂/∂x⊗dy⊗dz - ∂/∂x⊗dz⊗dy - ∂/∂y⊗dx⊗dz + ∂/∂y⊗dz⊗dx + ∂/∂z⊗dx⊗dy
653
+ - ∂/∂z⊗dy⊗dx
654
+ sage: eps1.symmetries()
655
+ no symmetry; antisymmetry: (1, 2)
656
+
657
+ Raising the first and second indices::
658
+
659
+ sage: eps2 = M.volume_form(2); eps2
660
+ Tensor field of type (2,1) on the 3-dimensional Riemannian
661
+ manifold M
662
+ sage: eps2.display()
663
+ ∂/∂x⊗∂/∂y⊗dz - ∂/∂x⊗∂/∂z⊗dy - ∂/∂y⊗∂/∂x⊗dz + ∂/∂y⊗∂/∂z⊗dx
664
+ + ∂/∂z⊗∂/∂x⊗dy - ∂/∂z⊗∂/∂y⊗dx
665
+ sage: eps2.symmetries()
666
+ no symmetry; antisymmetry: (0, 1)
667
+
668
+ Fully contravariant version::
669
+
670
+ sage: eps3 = M.volume_form(3); eps3
671
+ 3-vector field on the 3-dimensional Riemannian manifold M
672
+ sage: eps3.display()
673
+ ∂/∂x∧∂/∂y∧∂/∂z
674
+ """
675
+ return self.metric().volume_form(contra=contra)
676
+
677
+ def open_subset(self, name, latex_name=None, coord_def={}, supersets=None):
678
+ r"""
679
+ Create an open subset of ``self``.
680
+
681
+ An open subset is a set that is (i) included in the manifold and (ii)
682
+ open with respect to the manifold's topology. It is a differentiable
683
+ manifold by itself. Moreover, equipped with the restriction of the
684
+ manifold metric to itself, it is a pseudo-Riemannian manifold. Hence
685
+ the returned object is an instance of
686
+ :class:`PseudoRiemannianManifold`.
687
+
688
+ INPUT:
689
+
690
+ - ``name`` -- name given to the open subset
691
+ - ``latex_name`` -- (default: ``None``) LaTeX symbol to denote the
692
+ subset; if none is provided, it is set to ``name``
693
+ - ``coord_def`` -- (default: {}) definition of the subset in
694
+ terms of coordinates; ``coord_def`` must a be dictionary with keys
695
+ charts in the manifold's atlas and values the symbolic expressions
696
+ formed by the coordinates to define the subset.
697
+ - ``supersets`` -- (default: only ``self``) list of sets that the
698
+ new open subset is a subset of
699
+
700
+ OUTPUT:
701
+
702
+ - instance of :class:`PseudoRiemannianManifold` representing the
703
+ created open subset
704
+
705
+ EXAMPLES:
706
+
707
+ Open subset of a 2-dimensional Riemannian manifold::
708
+
709
+ sage: M = Manifold(2, 'M', structure='Riemannian')
710
+ sage: X.<x,y> = M.chart()
711
+ sage: U = M.open_subset('U', coord_def={X: x>0}); U
712
+ Open subset U of the 2-dimensional Riemannian manifold M
713
+ sage: type(U)
714
+ <class 'sage.manifolds.differentiable.pseudo_riemannian.PseudoRiemannianManifold_with_category'>
715
+
716
+ We initialize the metric of ``M``::
717
+
718
+ sage: g = M.metric()
719
+ sage: g[0,0], g[1,1] = 1, 1
720
+
721
+ Then the metric on ``U`` is determined as the restriction of ``g`` to
722
+ ``U``::
723
+
724
+ sage: gU = U.metric(); gU
725
+ Riemannian metric g on the Open subset U of the 2-dimensional Riemannian manifold M
726
+ sage: gU.display()
727
+ g = dx⊗dx + dy⊗dy
728
+ sage: gU is g.restrict(U)
729
+ True
730
+
731
+ TESTS:
732
+
733
+ Open subset created after the initialization of the metric::
734
+
735
+ sage: V = M.open_subset('V', coord_def={X: x<0}); V
736
+ Open subset V of the 2-dimensional Riemannian manifold M
737
+ sage: gV = V.metric()
738
+ sage: gV.display()
739
+ g = dx⊗dx + dy⊗dy
740
+ sage: gV is g.restrict(V)
741
+ True
742
+ """
743
+ resu = PseudoRiemannianManifold(self._dim, name,
744
+ metric_name=self._metric_name,
745
+ signature=self._metric_signature,
746
+ base_manifold=self._manifold,
747
+ diff_degree=self._diff_degree,
748
+ latex_name=latex_name,
749
+ metric_latex_name=self._metric_latex_name,
750
+ start_index=self._sindex)
751
+ if supersets is None:
752
+ supersets = [self]
753
+ for superset in supersets:
754
+ superset._init_open_subset(resu, coord_def=coord_def)
755
+ return resu