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.
- passagemath_symbolics/.dylibs/libgmp.10.dylib +0 -0
- passagemath_symbolics/__init__.py +3 -0
- passagemath_symbolics-10.6.37.dist-info/METADATA +187 -0
- passagemath_symbolics-10.6.37.dist-info/RECORD +172 -0
- passagemath_symbolics-10.6.37.dist-info/WHEEL +6 -0
- passagemath_symbolics-10.6.37.dist-info/top_level.txt +3 -0
- sage/all__sagemath_symbolics.py +17 -0
- sage/calculus/all.py +14 -0
- sage/calculus/calculus.py +2826 -0
- sage/calculus/desolvers.py +1866 -0
- sage/calculus/predefined.py +51 -0
- sage/calculus/tests.py +225 -0
- sage/calculus/var.cpython-314t-darwin.so +0 -0
- sage/calculus/var.pyx +401 -0
- sage/dynamics/all__sagemath_symbolics.py +6 -0
- sage/dynamics/complex_dynamics/all.py +5 -0
- sage/dynamics/complex_dynamics/mandel_julia.py +765 -0
- sage/dynamics/complex_dynamics/mandel_julia_helper.cpython-314t-darwin.so +0 -0
- sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +1035 -0
- sage/ext/all__sagemath_symbolics.py +1 -0
- sage/ext_data/kenzo/CP2.txt +45 -0
- sage/ext_data/kenzo/CP3.txt +349 -0
- sage/ext_data/kenzo/CP4.txt +4774 -0
- sage/ext_data/kenzo/README.txt +49 -0
- sage/ext_data/kenzo/S4.txt +20 -0
- sage/ext_data/magma/latex/latex.m +1021 -0
- sage/ext_data/magma/latex/latex.spec +1 -0
- sage/ext_data/magma/sage/basic.m +356 -0
- sage/ext_data/magma/sage/sage.spec +1 -0
- sage/ext_data/magma/spec +9 -0
- sage/geometry/all__sagemath_symbolics.py +8 -0
- sage/geometry/hyperbolic_space/all.py +5 -0
- sage/geometry/hyperbolic_space/hyperbolic_coercion.py +743 -0
- sage/geometry/hyperbolic_space/hyperbolic_constants.py +5 -0
- sage/geometry/hyperbolic_space/hyperbolic_geodesic.py +2409 -0
- sage/geometry/hyperbolic_space/hyperbolic_interface.py +206 -0
- sage/geometry/hyperbolic_space/hyperbolic_isometry.py +1082 -0
- sage/geometry/hyperbolic_space/hyperbolic_model.py +1502 -0
- sage/geometry/hyperbolic_space/hyperbolic_point.py +621 -0
- sage/geometry/riemannian_manifolds/all.py +7 -0
- sage/geometry/riemannian_manifolds/parametrized_surface3d.py +1632 -0
- sage/geometry/riemannian_manifolds/surface3d_generators.py +461 -0
- sage/interfaces/all__sagemath_symbolics.py +1 -0
- sage/interfaces/magma.py +3017 -0
- sage/interfaces/magma_free.py +92 -0
- sage/interfaces/maple.py +1397 -0
- sage/interfaces/mathematica.py +1345 -0
- sage/interfaces/mathics.py +1312 -0
- sage/interfaces/sympy.py +1398 -0
- sage/interfaces/sympy_wrapper.py +197 -0
- sage/interfaces/tides.py +938 -0
- sage/libs/all__sagemath_symbolics.py +6 -0
- sage/manifolds/all.py +7 -0
- sage/manifolds/calculus_method.py +555 -0
- sage/manifolds/catalog.py +437 -0
- sage/manifolds/chart.py +4019 -0
- sage/manifolds/chart_func.py +3419 -0
- sage/manifolds/continuous_map.py +2183 -0
- sage/manifolds/continuous_map_image.py +155 -0
- sage/manifolds/differentiable/affine_connection.py +2475 -0
- sage/manifolds/differentiable/all.py +1 -0
- sage/manifolds/differentiable/automorphismfield.py +1383 -0
- sage/manifolds/differentiable/automorphismfield_group.py +604 -0
- sage/manifolds/differentiable/bundle_connection.py +1445 -0
- sage/manifolds/differentiable/characteristic_cohomology_class.py +1840 -0
- sage/manifolds/differentiable/chart.py +1241 -0
- sage/manifolds/differentiable/curve.py +1028 -0
- sage/manifolds/differentiable/de_rham_cohomology.py +541 -0
- sage/manifolds/differentiable/degenerate.py +559 -0
- sage/manifolds/differentiable/degenerate_submanifold.py +1671 -0
- sage/manifolds/differentiable/diff_form.py +1658 -0
- sage/manifolds/differentiable/diff_form_module.py +1062 -0
- sage/manifolds/differentiable/diff_map.py +1315 -0
- sage/manifolds/differentiable/differentiable_submanifold.py +291 -0
- sage/manifolds/differentiable/examples/all.py +1 -0
- sage/manifolds/differentiable/examples/euclidean.py +2517 -0
- sage/manifolds/differentiable/examples/real_line.py +897 -0
- sage/manifolds/differentiable/examples/sphere.py +1186 -0
- sage/manifolds/differentiable/examples/symplectic_space.py +187 -0
- sage/manifolds/differentiable/examples/symplectic_space_test.py +40 -0
- sage/manifolds/differentiable/integrated_curve.py +4035 -0
- sage/manifolds/differentiable/levi_civita_connection.py +841 -0
- sage/manifolds/differentiable/manifold.py +4254 -0
- sage/manifolds/differentiable/manifold_homset.py +1826 -0
- sage/manifolds/differentiable/metric.py +3032 -0
- sage/manifolds/differentiable/mixed_form.py +1507 -0
- sage/manifolds/differentiable/mixed_form_algebra.py +559 -0
- sage/manifolds/differentiable/multivector_module.py +800 -0
- sage/manifolds/differentiable/multivectorfield.py +1520 -0
- sage/manifolds/differentiable/poisson_tensor.py +268 -0
- sage/manifolds/differentiable/pseudo_riemannian.py +755 -0
- sage/manifolds/differentiable/pseudo_riemannian_submanifold.py +1839 -0
- sage/manifolds/differentiable/scalarfield.py +1343 -0
- sage/manifolds/differentiable/scalarfield_algebra.py +472 -0
- sage/manifolds/differentiable/symplectic_form.py +910 -0
- sage/manifolds/differentiable/symplectic_form_test.py +220 -0
- sage/manifolds/differentiable/tangent_space.py +412 -0
- sage/manifolds/differentiable/tangent_vector.py +616 -0
- sage/manifolds/differentiable/tensorfield.py +4665 -0
- sage/manifolds/differentiable/tensorfield_module.py +963 -0
- sage/manifolds/differentiable/tensorfield_paral.py +2450 -0
- sage/manifolds/differentiable/tensorfield_paral_test.py +16 -0
- sage/manifolds/differentiable/vector_bundle.py +1728 -0
- sage/manifolds/differentiable/vectorfield.py +1717 -0
- sage/manifolds/differentiable/vectorfield_module.py +2445 -0
- sage/manifolds/differentiable/vectorframe.py +1832 -0
- sage/manifolds/family.py +270 -0
- sage/manifolds/local_frame.py +1490 -0
- sage/manifolds/manifold.py +3090 -0
- sage/manifolds/manifold_homset.py +452 -0
- sage/manifolds/operators.py +359 -0
- sage/manifolds/point.py +994 -0
- sage/manifolds/scalarfield.py +3718 -0
- sage/manifolds/scalarfield_algebra.py +629 -0
- sage/manifolds/section.py +3111 -0
- sage/manifolds/section_module.py +831 -0
- sage/manifolds/structure.py +229 -0
- sage/manifolds/subset.py +2764 -0
- sage/manifolds/subsets/all.py +1 -0
- sage/manifolds/subsets/closure.py +131 -0
- sage/manifolds/subsets/pullback.py +885 -0
- sage/manifolds/topological_submanifold.py +891 -0
- sage/manifolds/trivialization.py +733 -0
- sage/manifolds/utilities.py +1348 -0
- sage/manifolds/vector_bundle.py +1342 -0
- sage/manifolds/vector_bundle_fiber.py +332 -0
- sage/manifolds/vector_bundle_fiber_element.py +111 -0
- sage/matrix/all__sagemath_symbolics.py +1 -0
- sage/matrix/matrix_symbolic_dense.cpython-314t-darwin.so +0 -0
- sage/matrix/matrix_symbolic_dense.pxd +6 -0
- sage/matrix/matrix_symbolic_dense.pyx +1022 -0
- sage/matrix/matrix_symbolic_sparse.cpython-314t-darwin.so +0 -0
- sage/matrix/matrix_symbolic_sparse.pxd +6 -0
- sage/matrix/matrix_symbolic_sparse.pyx +1029 -0
- sage/modules/all__sagemath_symbolics.py +1 -0
- sage/modules/vector_callable_symbolic_dense.py +105 -0
- sage/modules/vector_symbolic_dense.py +116 -0
- sage/modules/vector_symbolic_sparse.py +118 -0
- sage/rings/all__sagemath_symbolics.py +4 -0
- sage/rings/asymptotic/all.py +6 -0
- sage/rings/asymptotic/asymptotic_expansion_generators.py +1485 -0
- sage/rings/asymptotic/asymptotic_ring.py +4858 -0
- sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py +4153 -0
- sage/rings/asymptotic/growth_group.py +5373 -0
- sage/rings/asymptotic/growth_group_cartesian.py +1400 -0
- sage/rings/asymptotic/term_monoid.py +5237 -0
- sage/rings/function_field/all__sagemath_symbolics.py +2 -0
- sage/rings/polynomial/all__sagemath_symbolics.py +1 -0
- sage/symbolic/all.py +15 -0
- sage/symbolic/assumptions.py +985 -0
- sage/symbolic/benchmark.py +93 -0
- sage/symbolic/callable.py +459 -0
- sage/symbolic/complexity_measures.py +35 -0
- sage/symbolic/constants.py +1287 -0
- sage/symbolic/expression_conversion_algebraic.py +310 -0
- sage/symbolic/expression_conversion_sympy.py +317 -0
- sage/symbolic/expression_conversions.py +1713 -0
- sage/symbolic/function_factory.py +355 -0
- sage/symbolic/integration/all.py +1 -0
- sage/symbolic/integration/external.py +270 -0
- sage/symbolic/integration/integral.py +1115 -0
- sage/symbolic/maxima_wrapper.py +162 -0
- sage/symbolic/operators.py +267 -0
- sage/symbolic/random_tests.py +462 -0
- sage/symbolic/relation.py +1907 -0
- sage/symbolic/ring.cpython-314t-darwin.so +0 -0
- sage/symbolic/ring.pxd +5 -0
- sage/symbolic/ring.pyx +1396 -0
- sage/symbolic/subring.py +1025 -0
- sage/symbolic/symengine.py +19 -0
- sage/symbolic/tests.py +40 -0
- sage/symbolic/units.py +1470 -0
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-symbolics
|
|
2
|
+
r"""
|
|
3
|
+
Manifolds Catalog
|
|
4
|
+
|
|
5
|
+
A catalog of manifolds to rapidly create various simple manifolds.
|
|
6
|
+
|
|
7
|
+
The current entries to the catalog are obtained by typing
|
|
8
|
+
``manifolds.<tab>``, where ``<tab>`` indicates pressing the :kbd:`Tab` key.
|
|
9
|
+
They are:
|
|
10
|
+
|
|
11
|
+
- :class:`~sage.manifolds.differentiable.examples.euclidean.EuclideanSpace`: Euclidean space
|
|
12
|
+
- :class:`~sage.manifolds.differentiable.examples.real_line.RealLine`: real line
|
|
13
|
+
- :class:`~sage.manifolds.differentiable.examples.real_line.OpenInterval`: open interval on the real line
|
|
14
|
+
- :class:`~sage.manifolds.differentiable.examples.sphere.Sphere`: sphere embedded in Euclidean space
|
|
15
|
+
- :func:`Torus`: torus embedded in Euclidean space
|
|
16
|
+
- :func:`Minkowski`: 4-dimensional Minkowski space
|
|
17
|
+
- :func:`Kerr`: Kerr spacetime
|
|
18
|
+
- :func:`RealProjectiveSpace`: `n`-dimensional real projective space
|
|
19
|
+
|
|
20
|
+
AUTHORS:
|
|
21
|
+
|
|
22
|
+
- Florentin Jaffredo (2018) : initial version
|
|
23
|
+
- Trevor K. Karn (2022) : projective space
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
# *****************************************************************************
|
|
27
|
+
# Copyright (C) 2018 Florentin Jaffredo <florentin.jaffredo@polytechnique.edu>
|
|
28
|
+
#
|
|
29
|
+
# This program is free software: you can redistribute it and/or modify
|
|
30
|
+
# it under the terms of the GNU General Public License as published by
|
|
31
|
+
# the Free Software Foundation, either version 2 of the License, or
|
|
32
|
+
# (at your option) any later version.
|
|
33
|
+
# https://www.gnu.org/licenses/
|
|
34
|
+
# *****************************************************************************
|
|
35
|
+
|
|
36
|
+
# Lazy import from examples folders:
|
|
37
|
+
from sage.misc.lazy_import import lazy_import as _lazy_import
|
|
38
|
+
|
|
39
|
+
_lazy_import('sage.manifolds.differentiable.examples.real_line', 'OpenInterval')
|
|
40
|
+
_lazy_import('sage.manifolds.differentiable.examples.real_line', 'RealLine')
|
|
41
|
+
_lazy_import('sage.manifolds.differentiable.examples.euclidean', 'EuclideanSpace')
|
|
42
|
+
_lazy_import('sage.manifolds.differentiable.examples.sphere', 'Sphere')
|
|
43
|
+
_lazy_import(
|
|
44
|
+
"sage.manifolds.differentiable.examples.symplectic_space", "StandardSymplecticSpace"
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def Minkowski(positive_spacelike=True, names=None):
|
|
49
|
+
"""
|
|
50
|
+
Generate a Minkowski space of dimension 4.
|
|
51
|
+
|
|
52
|
+
By default the signature is set to `(- + + +)`, but can be changed to
|
|
53
|
+
`(+ - - -)` by setting the optional argument ``positive_spacelike`` to
|
|
54
|
+
``False``. The shortcut operator ``.<,>`` can be used to
|
|
55
|
+
specify the coordinates.
|
|
56
|
+
|
|
57
|
+
INPUT:
|
|
58
|
+
|
|
59
|
+
- ``positive_spacelike`` -- boolean (default: ``True``); if ``False``, then
|
|
60
|
+
the spacelike vectors yield a negative sign (i.e., the signature
|
|
61
|
+
is `(+ - - - )`)
|
|
62
|
+
- ``names`` -- (default: ``None``) name of the coordinates,
|
|
63
|
+
automatically set by the shortcut operator
|
|
64
|
+
|
|
65
|
+
OUTPUT:
|
|
66
|
+
|
|
67
|
+
- Lorentzian manifold of dimension 4 with (flat) Minkowskian metric
|
|
68
|
+
|
|
69
|
+
EXAMPLES::
|
|
70
|
+
|
|
71
|
+
sage: M.<t, x, y, z> = manifolds.Minkowski()
|
|
72
|
+
sage: M.metric()[:]
|
|
73
|
+
[-1 0 0 0]
|
|
74
|
+
[ 0 1 0 0]
|
|
75
|
+
[ 0 0 1 0]
|
|
76
|
+
[ 0 0 0 1]
|
|
77
|
+
|
|
78
|
+
sage: M.<t, x, y, z> = manifolds.Minkowski(False)
|
|
79
|
+
sage: M.metric()[:]
|
|
80
|
+
[ 1 0 0 0]
|
|
81
|
+
[ 0 -1 0 0]
|
|
82
|
+
[ 0 0 -1 0]
|
|
83
|
+
[ 0 0 0 -1]
|
|
84
|
+
"""
|
|
85
|
+
from sage.manifolds.manifold import Manifold
|
|
86
|
+
|
|
87
|
+
M = Manifold(4, 'M', structure='Lorentzian')
|
|
88
|
+
if names is None:
|
|
89
|
+
names = ("t", "x", "y", "z")
|
|
90
|
+
C = M.chart(names=names)
|
|
91
|
+
M._first_ngens = C._first_ngens
|
|
92
|
+
|
|
93
|
+
g = M.metric('g')
|
|
94
|
+
sgn = 1 if positive_spacelike else -1
|
|
95
|
+
g[0, 0] = -sgn
|
|
96
|
+
g[1, 1], g[2, 2], g[3, 3] = sgn, sgn, sgn
|
|
97
|
+
return M
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def Kerr(m=1, a=0, coordinates='BL', names=None):
|
|
101
|
+
"""
|
|
102
|
+
Generate a Kerr spacetime.
|
|
103
|
+
|
|
104
|
+
A Kerr spacetime is a 4 dimensional manifold describing a rotating black
|
|
105
|
+
hole. Two coordinate systems are implemented: Boyer-Lindquist and Kerr
|
|
106
|
+
(3+1 version).
|
|
107
|
+
|
|
108
|
+
The shortcut operator ``.<,>`` can be used to specify the coordinates.
|
|
109
|
+
|
|
110
|
+
INPUT:
|
|
111
|
+
|
|
112
|
+
- ``m`` -- (default: ``1``) mass of the black hole in natural units
|
|
113
|
+
(`c=1`, `G=1`)
|
|
114
|
+
- ``a`` -- (default: ``0``) angular momentum in natural units; if set to
|
|
115
|
+
``0``, the resulting spacetime corresponds to a Schwarzschild black hole
|
|
116
|
+
- ``coordinates`` -- (default: ``'BL'``) either ``'BL'`` for
|
|
117
|
+
Boyer-Lindquist coordinates or ``'Kerr'`` for Kerr coordinates (3+1
|
|
118
|
+
version)
|
|
119
|
+
- ``names`` -- (default: ``None``) name of the coordinates,
|
|
120
|
+
automatically set by the shortcut operator
|
|
121
|
+
|
|
122
|
+
OUTPUT: Lorentzian manifold
|
|
123
|
+
|
|
124
|
+
EXAMPLES::
|
|
125
|
+
|
|
126
|
+
sage: m, a = var('m, a')
|
|
127
|
+
sage: K = manifolds.Kerr(m, a)
|
|
128
|
+
sage: K
|
|
129
|
+
4-dimensional Lorentzian manifold M
|
|
130
|
+
sage: K.atlas()
|
|
131
|
+
[Chart (M, (t, r, th, ph))]
|
|
132
|
+
|
|
133
|
+
The Kerr metric in Boyer-Lindquist coordinates (cf. :wikipedia:`Kerr_metric`)::
|
|
134
|
+
|
|
135
|
+
sage: K.metric().display()
|
|
136
|
+
g = (2*m*r/(a^2*cos(th)^2 + r^2) - 1) dt⊗dt
|
|
137
|
+
- 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dt⊗dph
|
|
138
|
+
+ (a^2*cos(th)^2 + r^2)/(a^2 - 2*m*r + r^2) dr⊗dr
|
|
139
|
+
+ (a^2*cos(th)^2 + r^2) dth⊗dth
|
|
140
|
+
- 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dph⊗dt
|
|
141
|
+
+ (2*a^2*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) + a^2 + r^2)*sin(th)^2 dph⊗dph
|
|
142
|
+
|
|
143
|
+
The Schwarzschild spacetime with the mass parameter set to 1::
|
|
144
|
+
|
|
145
|
+
sage: K.<t, r, th, ph> = manifolds.Kerr()
|
|
146
|
+
sage: K
|
|
147
|
+
4-dimensional Lorentzian manifold M
|
|
148
|
+
sage: K.metric().display()
|
|
149
|
+
g = (2/r - 1) dt⊗dt + r^2/(r^2 - 2*r) dr⊗dr
|
|
150
|
+
+ r^2 dth⊗dth + r^2*sin(th)^2 dph⊗dph
|
|
151
|
+
sage: K.default_chart().coord_range()
|
|
152
|
+
t: (-oo, +oo); r: (0, +oo); th: (0, pi); ph: [-pi, pi] (periodic)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
The Kerr spacetime in Kerr coordinates::
|
|
156
|
+
|
|
157
|
+
sage: m, a = var('m, a')
|
|
158
|
+
sage: K.<t, r, th, ph> = manifolds.Kerr(m, a, coordinates='Kerr')
|
|
159
|
+
sage: K
|
|
160
|
+
4-dimensional Lorentzian manifold M
|
|
161
|
+
sage: K.atlas()
|
|
162
|
+
[Chart (M, (t, r, th, ph))]
|
|
163
|
+
sage: K.metric().display()
|
|
164
|
+
g = (2*m*r/(a^2*cos(th)^2 + r^2) - 1) dt⊗dt
|
|
165
|
+
+ 2*m*r/(a^2*cos(th)^2 + r^2) dt⊗dr
|
|
166
|
+
- 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dt⊗dph
|
|
167
|
+
+ 2*m*r/(a^2*cos(th)^2 + r^2) dr⊗dt
|
|
168
|
+
+ (2*m*r/(a^2*cos(th)^2 + r^2) + 1) dr⊗dr
|
|
169
|
+
- a*(2*m*r/(a^2*cos(th)^2 + r^2) + 1)*sin(th)^2 dr⊗dph
|
|
170
|
+
+ (a^2*cos(th)^2 + r^2) dth⊗dth
|
|
171
|
+
- 2*a*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2) dph⊗dt
|
|
172
|
+
- a*(2*m*r/(a^2*cos(th)^2 + r^2) + 1)*sin(th)^2 dph⊗dr
|
|
173
|
+
+ (2*a^2*m*r*sin(th)^2/(a^2*cos(th)^2 + r^2)
|
|
174
|
+
+ a^2 + r^2)*sin(th)^2 dph⊗dph
|
|
175
|
+
sage: K.default_chart().coord_range()
|
|
176
|
+
t: (-oo, +oo); r: (0, +oo); th: (0, pi); ph: [-pi, pi] (periodic)
|
|
177
|
+
"""
|
|
178
|
+
from sage.functions.trig import cos, sin
|
|
179
|
+
from sage.manifolds.manifold import Manifold
|
|
180
|
+
from sage.misc.functional import sqrt
|
|
181
|
+
|
|
182
|
+
M = Manifold(4, 'M', structure='Lorentzian')
|
|
183
|
+
if coordinates == "Kerr":
|
|
184
|
+
if names is None:
|
|
185
|
+
names = (
|
|
186
|
+
r't:(-oo,+oo)',
|
|
187
|
+
r'r:(0,+oo)',
|
|
188
|
+
r'th:(0,pi):\theta',
|
|
189
|
+
r'ph:(-pi,pi):periodic:\phi',
|
|
190
|
+
)
|
|
191
|
+
else:
|
|
192
|
+
names = (
|
|
193
|
+
names[0] + r':(-oo,+oo)',
|
|
194
|
+
names[1] + r':(0,+oo)',
|
|
195
|
+
names[2] + r':(0,pi):\theta',
|
|
196
|
+
names[3] + r':(-pi,pi):periodic:\phi',
|
|
197
|
+
)
|
|
198
|
+
C = M.chart(names=names)
|
|
199
|
+
M._first_ngens = C._first_ngens
|
|
200
|
+
g = M.metric('g')
|
|
201
|
+
t, r, th, ph = C[:]
|
|
202
|
+
rho = sqrt(r**2 + a**2 * cos(th)**2)
|
|
203
|
+
g[0, 0], g[1, 1], g[2, 2], g[3, 3] = (
|
|
204
|
+
-(1 - 2 * m * r / rho**2),
|
|
205
|
+
1 + 2 * m * r / rho**2,
|
|
206
|
+
rho**2,
|
|
207
|
+
(r**2 + a**2 + 2 * a**2 * m * r * sin(th)**2 / rho**2) * sin(th)**2,
|
|
208
|
+
)
|
|
209
|
+
g[0, 1] = 2 * m * r / rho**2
|
|
210
|
+
g[0, 3] = -2 * a * m * r / rho**2 * sin(th)**2
|
|
211
|
+
g[1, 3] = -a * sin(th)**2 * (1 + 2 * m * r / rho**2)
|
|
212
|
+
return M
|
|
213
|
+
|
|
214
|
+
if coordinates == "BL":
|
|
215
|
+
if names is None:
|
|
216
|
+
names = (
|
|
217
|
+
r't:(-oo,+oo)',
|
|
218
|
+
r'r:(0,+oo)',
|
|
219
|
+
r'th:(0,pi):\theta',
|
|
220
|
+
r'ph:(-pi,pi):periodic:\phi',
|
|
221
|
+
)
|
|
222
|
+
else:
|
|
223
|
+
names = (
|
|
224
|
+
names[0] + r':(-oo,+oo)',
|
|
225
|
+
names[1] + r':(0,+oo)',
|
|
226
|
+
names[2] + r':(0,pi):\theta',
|
|
227
|
+
names[3] + r':(-pi,pi):periodic:\phi',
|
|
228
|
+
)
|
|
229
|
+
C = M.chart(names=names)
|
|
230
|
+
M._first_ngens = C._first_ngens
|
|
231
|
+
g = M.metric('g')
|
|
232
|
+
t, r, th, ph = C[:]
|
|
233
|
+
rho = sqrt(r**2 + a**2 * cos(th)**2)
|
|
234
|
+
g[0, 0], g[1, 1], g[2, 2], g[3, 3] = (
|
|
235
|
+
-(1 - 2 * m * r / rho**2),
|
|
236
|
+
rho**2 / (r**2 - 2 * m * r + a**2),
|
|
237
|
+
rho**2,
|
|
238
|
+
(r**2 + a**2 + 2 * m * r * a**2 / rho**2 * sin(th)**2) * sin(th)**2,
|
|
239
|
+
)
|
|
240
|
+
g[0, 3] = -2 * m * r * a * sin(th)**2 / rho**2
|
|
241
|
+
return M
|
|
242
|
+
|
|
243
|
+
raise NotImplementedError(
|
|
244
|
+
"coordinates system not implemented, see help for details"
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def Torus(R=2, r=1, names=None):
|
|
249
|
+
"""
|
|
250
|
+
Generate a 2-dimensional torus embedded in Euclidean space.
|
|
251
|
+
|
|
252
|
+
The shortcut operator ``.<,>`` can be used to specify the coordinates.
|
|
253
|
+
|
|
254
|
+
INPUT:
|
|
255
|
+
|
|
256
|
+
- ``R`` -- (default: ``2``) distance form the center to the
|
|
257
|
+
center of the tube
|
|
258
|
+
- ``r`` -- (default: ``1``) radius of the tube
|
|
259
|
+
- ``names`` -- (default: ``None``) name of the coordinates,
|
|
260
|
+
automatically set by the shortcut operator
|
|
261
|
+
|
|
262
|
+
OUTPUT: Riemannian manifold
|
|
263
|
+
|
|
264
|
+
EXAMPLES::
|
|
265
|
+
|
|
266
|
+
sage: T.<theta, phi> = manifolds.Torus(3, 1)
|
|
267
|
+
sage: T
|
|
268
|
+
2-dimensional Riemannian submanifold T embedded in the Euclidean
|
|
269
|
+
space E^3
|
|
270
|
+
sage: T.atlas()
|
|
271
|
+
[Chart (T, (theta, phi))]
|
|
272
|
+
sage: T.embedding().display()
|
|
273
|
+
T → E^3
|
|
274
|
+
(theta, phi) ↦ (X, Y, Z) = ((cos(theta) + 3)*cos(phi),
|
|
275
|
+
(cos(theta) + 3)*sin(phi),
|
|
276
|
+
sin(theta))
|
|
277
|
+
sage: T.metric().display()
|
|
278
|
+
gamma = dtheta⊗dtheta + (cos(theta)^2 + 6*cos(theta) + 9) dphi⊗dphi
|
|
279
|
+
"""
|
|
280
|
+
from sage.functions.trig import cos, sin
|
|
281
|
+
from sage.manifolds.differentiable.examples.euclidean import EuclideanSpace
|
|
282
|
+
from sage.manifolds.manifold import Manifold
|
|
283
|
+
|
|
284
|
+
E = EuclideanSpace(3, symbols='X Y Z')
|
|
285
|
+
M = Manifold(2, 'T', ambient=E, structure='Riemannian')
|
|
286
|
+
if names is None:
|
|
287
|
+
names = ("th", "ph")
|
|
288
|
+
names = tuple([names[i] + ":(-pi,pi):periodic" for i in range(2)])
|
|
289
|
+
C = M.chart(names=names)
|
|
290
|
+
M._first_ngens = C._first_ngens
|
|
291
|
+
th, ph = C[:]
|
|
292
|
+
coordfunc = [(R + r * cos(th)) * cos(ph), (R + r * cos(th)) * sin(ph), r * sin(th)]
|
|
293
|
+
imm = M.diff_map(E, coordfunc)
|
|
294
|
+
M.set_embedding(imm)
|
|
295
|
+
M.induced_metric()
|
|
296
|
+
return M
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
def RealProjectiveSpace(dim=2):
|
|
300
|
+
r"""
|
|
301
|
+
Generate projective space of dimension ``dim`` over the reals.
|
|
302
|
+
|
|
303
|
+
This is the topological space of lines through the origin in
|
|
304
|
+
`\RR^{d+1}`. The standard atlas consists of `d+2` charts, which sends
|
|
305
|
+
the set `U_i = \{[x_1, x_2, \ldots, x_{d+1}] : x_i \neq 0 \}` to
|
|
306
|
+
`k^{d}` by dividing by `x_i` and omitting the `i`-th coordinate
|
|
307
|
+
`x_i/x_i = 1`.
|
|
308
|
+
|
|
309
|
+
INPUT:
|
|
310
|
+
|
|
311
|
+
- ``dim`` -- (default: ``2``) the dimension of projective space
|
|
312
|
+
|
|
313
|
+
OUTPUT: ``P`` -- the projective space `\Bold{RP}^d` where `d =` ``dim``
|
|
314
|
+
|
|
315
|
+
EXAMPLES::
|
|
316
|
+
|
|
317
|
+
sage: RP2 = manifolds.RealProjectiveSpace(); RP2
|
|
318
|
+
2-dimensional topological manifold RP2
|
|
319
|
+
sage: latex(RP2)
|
|
320
|
+
\mathbb{RP}^{2}
|
|
321
|
+
|
|
322
|
+
sage: C0, C1, C2 = RP2.top_charts()
|
|
323
|
+
sage: p = RP2.point((2,0), chart = C0)
|
|
324
|
+
sage: q = RP2.point((0,3), chart = C0)
|
|
325
|
+
sage: p in C0.domain()
|
|
326
|
+
True
|
|
327
|
+
sage: p in C1.domain()
|
|
328
|
+
True
|
|
329
|
+
sage: C1(p)
|
|
330
|
+
(1/2, 0)
|
|
331
|
+
sage: p in C2.domain()
|
|
332
|
+
False
|
|
333
|
+
sage: q in C0.domain()
|
|
334
|
+
True
|
|
335
|
+
sage: q in C1.domain()
|
|
336
|
+
False
|
|
337
|
+
sage: q in C2.domain()
|
|
338
|
+
True
|
|
339
|
+
sage: C2(q)
|
|
340
|
+
(1/3, 0)
|
|
341
|
+
|
|
342
|
+
sage: r = RP2.point((2,3))
|
|
343
|
+
sage: r in C0.domain() and r in C1.domain() and r in C2.domain()
|
|
344
|
+
True
|
|
345
|
+
sage: C0(r)
|
|
346
|
+
(2, 3)
|
|
347
|
+
sage: C1(r)
|
|
348
|
+
(1/2, 3/2)
|
|
349
|
+
sage: C2(r)
|
|
350
|
+
(1/3, 2/3)
|
|
351
|
+
|
|
352
|
+
sage: p = RP2.point((2,3), chart = C1)
|
|
353
|
+
sage: p in C0.domain() and p in C1.domain() and p in C2.domain()
|
|
354
|
+
True
|
|
355
|
+
sage: C0(p)
|
|
356
|
+
(1/2, 3/2)
|
|
357
|
+
sage: C2(p)
|
|
358
|
+
(2/3, 1/3)
|
|
359
|
+
|
|
360
|
+
sage: RP1 = manifolds.RealProjectiveSpace(1); RP1
|
|
361
|
+
1-dimensional topological manifold RP1
|
|
362
|
+
sage: C0, C1 = RP1.top_charts()
|
|
363
|
+
sage: p, q = RP1.point((2,)), RP1.point((0,))
|
|
364
|
+
sage: p in C0.domain()
|
|
365
|
+
True
|
|
366
|
+
sage: p in C1.domain()
|
|
367
|
+
True
|
|
368
|
+
sage: q in C0.domain()
|
|
369
|
+
True
|
|
370
|
+
sage: q in C1.domain()
|
|
371
|
+
False
|
|
372
|
+
sage: C1(p)
|
|
373
|
+
(1/2,)
|
|
374
|
+
|
|
375
|
+
sage: p, q = RP1.point((3,), chart = C1), RP1.point((0,), chart = C1)
|
|
376
|
+
sage: p in C0.domain()
|
|
377
|
+
True
|
|
378
|
+
sage: q in C0.domain()
|
|
379
|
+
False
|
|
380
|
+
sage: C0(p)
|
|
381
|
+
(1/3,)
|
|
382
|
+
"""
|
|
383
|
+
|
|
384
|
+
from sage.manifolds.manifold import Manifold
|
|
385
|
+
|
|
386
|
+
P = Manifold(
|
|
387
|
+
dim,
|
|
388
|
+
f"RP{dim}",
|
|
389
|
+
structure='topological',
|
|
390
|
+
latex_name=r"\mathbb{{RP}}^{{{}}}".format(dim),
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
# the trailing whitespace in the string is intentional for defining charts
|
|
394
|
+
names = [f'x_{i} ' for i in range(dim + 1)]
|
|
395
|
+
|
|
396
|
+
U0 = P.open_subset(name='U0', latex_name='U_0')
|
|
397
|
+
|
|
398
|
+
charts = {0: U0.chart(''.join(names[1:]))}
|
|
399
|
+
|
|
400
|
+
# create the charts
|
|
401
|
+
for j in range(1, dim + 1):
|
|
402
|
+
U = P.open_subset(name=f'U{j}', latex_name=f'U_{j}')
|
|
403
|
+
|
|
404
|
+
# The chart where we assert that x_i == 1
|
|
405
|
+
Cj = U.chart(''.join(names[:j] + names[j + 1 :]))
|
|
406
|
+
gj = Cj[:]
|
|
407
|
+
|
|
408
|
+
charts[j] = Cj
|
|
409
|
+
|
|
410
|
+
for i in range(j):
|
|
411
|
+
Ci = charts[i]
|
|
412
|
+
gi = Ci[:]
|
|
413
|
+
|
|
414
|
+
xi = gj[i]
|
|
415
|
+
xj = gi[j - 1] # use index j - 1 because i < j and xi is omitted in gi
|
|
416
|
+
|
|
417
|
+
# the corresponding coordinates in R^{dim+1}
|
|
418
|
+
d_plus_one_coords = (
|
|
419
|
+
[g / xj for g in gi[:i]] + [1 / xj] + [g / xj for g in gi[i:]]
|
|
420
|
+
)
|
|
421
|
+
cj_new_coords = d_plus_one_coords[:j] + d_plus_one_coords[j + 1 :]
|
|
422
|
+
|
|
423
|
+
Ci_to_Cj = Ci.transition_map(
|
|
424
|
+
Cj, cj_new_coords, restrictions1=xj != 0, restrictions2=xi != 0
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
d_plus_one_coords = (
|
|
428
|
+
[g / xi for g in gj[:j]] + [1 / xi] + [g / xi for g in gj[j:]]
|
|
429
|
+
)
|
|
430
|
+
ci_new_coords = d_plus_one_coords[:i] + d_plus_one_coords[i + 1 :]
|
|
431
|
+
|
|
432
|
+
Cj_to_Ci = Ci_to_Cj.set_inverse(*ci_new_coords, check=False)
|
|
433
|
+
|
|
434
|
+
# this atlas is a global atlas
|
|
435
|
+
P.declare_union(P.subsets())
|
|
436
|
+
|
|
437
|
+
return P
|