passagemath-symbolics 10.6.43__cp314-cp314t-musllinux_1_2_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-symbolics might be problematic. Click here for more details.
- passagemath_symbolics/__init__.py +3 -0
- passagemath_symbolics-10.6.43.dist-info/METADATA +187 -0
- passagemath_symbolics-10.6.43.dist-info/RECORD +171 -0
- passagemath_symbolics-10.6.43.dist-info/WHEEL +5 -0
- passagemath_symbolics-10.6.43.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-x86_64-linux-musl.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-x86_64-linux-musl.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-x86_64-linux-musl.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-x86_64-linux-musl.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-x86_64-linux-musl.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,621 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-symbolics
|
|
2
|
+
r"""
|
|
3
|
+
Hyperbolic Points
|
|
4
|
+
|
|
5
|
+
This module implements points in hyperbolic space of arbitrary dimension.
|
|
6
|
+
It also contains the implementations for specific models of
|
|
7
|
+
hyperbolic geometry.
|
|
8
|
+
|
|
9
|
+
This module also implements ideal points in hyperbolic space of arbitrary
|
|
10
|
+
dimension. It also contains the implementations for specific models
|
|
11
|
+
of hyperbolic geometry.
|
|
12
|
+
|
|
13
|
+
Note that not all models of hyperbolic space are bounded, meaning that
|
|
14
|
+
the ideal boundary is not the topological boundary of the set underlying
|
|
15
|
+
tho model. For example, the unit disk model is bounded with boundary
|
|
16
|
+
given by the unit sphere. The hyperboloid model is not bounded.
|
|
17
|
+
|
|
18
|
+
AUTHORS:
|
|
19
|
+
|
|
20
|
+
- Greg Laun (2013): initial version
|
|
21
|
+
|
|
22
|
+
EXAMPLES:
|
|
23
|
+
|
|
24
|
+
We can construct points in the upper half plane model, abbreviated
|
|
25
|
+
UHP for convenience::
|
|
26
|
+
|
|
27
|
+
sage: UHP = HyperbolicPlane().UHP()
|
|
28
|
+
sage: UHP.get_point(2 + I)
|
|
29
|
+
Point in UHP I + 2
|
|
30
|
+
sage: g = UHP.get_point(3 + I)
|
|
31
|
+
sage: g.dist(UHP.get_point(I))
|
|
32
|
+
arccosh(11/2)
|
|
33
|
+
|
|
34
|
+
We can also construct boundary points in the upper half plane model::
|
|
35
|
+
|
|
36
|
+
sage: UHP.get_point(3)
|
|
37
|
+
Boundary point in UHP 3
|
|
38
|
+
|
|
39
|
+
Some more examples::
|
|
40
|
+
|
|
41
|
+
sage: HyperbolicPlane().UHP().get_point(0)
|
|
42
|
+
Boundary point in UHP 0
|
|
43
|
+
|
|
44
|
+
sage: HyperbolicPlane().PD().get_point(I/2)
|
|
45
|
+
Point in PD 1/2*I
|
|
46
|
+
|
|
47
|
+
sage: HyperbolicPlane().KM().get_point((0,1))
|
|
48
|
+
Boundary point in KM (0, 1)
|
|
49
|
+
|
|
50
|
+
sage: HyperbolicPlane().HM().get_point((0,0,1))
|
|
51
|
+
Point in HM (0, 0, 1)
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
#***********************************************************************
|
|
55
|
+
# Copyright (C) 2013 Greg Laun <glaun@math.umd.edu>
|
|
56
|
+
#
|
|
57
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
58
|
+
# as published by the Free Software Foundation; either version 2 of
|
|
59
|
+
# the License, or (at your option) any later version.
|
|
60
|
+
# http://www.gnu.org/licenses/
|
|
61
|
+
#***********************************************************************
|
|
62
|
+
|
|
63
|
+
from collections.abc import Iterable
|
|
64
|
+
from sage.structure.element import Element
|
|
65
|
+
from sage.structure.richcmp import richcmp, op_NE
|
|
66
|
+
from sage.symbolic.constants import I
|
|
67
|
+
from sage.misc.latex import latex
|
|
68
|
+
from sage.structure.element import Matrix
|
|
69
|
+
from sage.matrix.constructor import matrix
|
|
70
|
+
from sage.modules.free_module_element import vector
|
|
71
|
+
from sage.rings.infinity import infinity
|
|
72
|
+
from sage.rings.cc import CC
|
|
73
|
+
from sage.rings.real_mpfr import RR
|
|
74
|
+
from sage.functions.other import real, imag
|
|
75
|
+
|
|
76
|
+
from sage.geometry.hyperbolic_space.hyperbolic_isometry import HyperbolicIsometry
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class HyperbolicPoint(Element):
|
|
80
|
+
r"""
|
|
81
|
+
Abstract base class for hyperbolic points. This class should never
|
|
82
|
+
be instantiated.
|
|
83
|
+
|
|
84
|
+
INPUT:
|
|
85
|
+
|
|
86
|
+
- ``model`` -- the model of the hyperbolic space
|
|
87
|
+
- ``coordinates`` -- the coordinates of a hyperbolic point in the
|
|
88
|
+
appropriate model
|
|
89
|
+
- ``is_boundary`` -- whether the point is a boundary point
|
|
90
|
+
- ``check`` -- boolean (default: ``True``); if ``True``, then check to make sure
|
|
91
|
+
the coordinates give a valid point in the model
|
|
92
|
+
|
|
93
|
+
EXAMPLES:
|
|
94
|
+
|
|
95
|
+
Comparison between different models is performed via coercion::
|
|
96
|
+
|
|
97
|
+
sage: UHP = HyperbolicPlane().UHP()
|
|
98
|
+
sage: p = UHP.get_point(.2 + .3*I); p
|
|
99
|
+
Point in UHP 0.200000000000000 + 0.300000000000000*I
|
|
100
|
+
|
|
101
|
+
sage: PD = HyperbolicPlane().PD()
|
|
102
|
+
sage: q = PD.get_point(0.2 + 0.3*I); q
|
|
103
|
+
Point in PD 0.200000000000000 + 0.300000000000000*I
|
|
104
|
+
|
|
105
|
+
sage: p == q
|
|
106
|
+
False
|
|
107
|
+
sage: PD(p)
|
|
108
|
+
Point in PD 0.231213872832370 - 0.502890173410405*I
|
|
109
|
+
|
|
110
|
+
sage: bool(p.coordinates() == q.coordinates())
|
|
111
|
+
True
|
|
112
|
+
|
|
113
|
+
Similarly for boundary points::
|
|
114
|
+
|
|
115
|
+
sage: p = UHP.get_point(-1); p
|
|
116
|
+
Boundary point in UHP -1
|
|
117
|
+
|
|
118
|
+
sage: q = PD.get_point(-1); q
|
|
119
|
+
Boundary point in PD -1
|
|
120
|
+
|
|
121
|
+
sage: p == q
|
|
122
|
+
True
|
|
123
|
+
sage: PD(p)
|
|
124
|
+
Boundary point in PD -1
|
|
125
|
+
|
|
126
|
+
It is an error to specify a point that does not lie in the
|
|
127
|
+
appropriate model::
|
|
128
|
+
|
|
129
|
+
sage: HyperbolicPlane().UHP().get_point(0.2 - 0.3*I)
|
|
130
|
+
Traceback (most recent call last):
|
|
131
|
+
...
|
|
132
|
+
ValueError: 0.200000000000000 - 0.300000000000000*I is not a valid point in the UHP model
|
|
133
|
+
|
|
134
|
+
sage: HyperbolicPlane().PD().get_point(1.2)
|
|
135
|
+
Traceback (most recent call last):
|
|
136
|
+
...
|
|
137
|
+
ValueError: 1.20000000000000 is not a valid point in the PD model
|
|
138
|
+
|
|
139
|
+
sage: HyperbolicPlane().KM().get_point((1,1))
|
|
140
|
+
Traceback (most recent call last):
|
|
141
|
+
...
|
|
142
|
+
ValueError: (1, 1) is not a valid point in the KM model
|
|
143
|
+
|
|
144
|
+
sage: HyperbolicPlane().HM().get_point((1, 1, 1))
|
|
145
|
+
Traceback (most recent call last):
|
|
146
|
+
...
|
|
147
|
+
ValueError: (1, 1, 1) is not a valid point in the HM model
|
|
148
|
+
|
|
149
|
+
It is an error to specify an interior point of hyperbolic space as a
|
|
150
|
+
boundary point::
|
|
151
|
+
|
|
152
|
+
sage: HyperbolicPlane().UHP().get_point(0.2 + 0.3*I, is_boundary=True)
|
|
153
|
+
Traceback (most recent call last):
|
|
154
|
+
...
|
|
155
|
+
ValueError: 0.200000000000000 + 0.300000000000000*I is not a valid boundary point in the UHP model
|
|
156
|
+
|
|
157
|
+
TESTS:
|
|
158
|
+
|
|
159
|
+
In the PD model, the coordinates of a point are in the unit disk
|
|
160
|
+
in the complex plane `\CC`::
|
|
161
|
+
|
|
162
|
+
sage: HyperbolicPlane().PD().get_point(0)
|
|
163
|
+
Point in PD 0
|
|
164
|
+
sage: HyperbolicPlane().PD().get_point(1)
|
|
165
|
+
Boundary point in PD 1
|
|
166
|
+
|
|
167
|
+
In the KM model, the coordinates of a point are in the unit disk
|
|
168
|
+
in the real plane `\RR^2`::
|
|
169
|
+
|
|
170
|
+
sage: HyperbolicPlane().KM().get_point((0,0))
|
|
171
|
+
Point in KM (0, 0)
|
|
172
|
+
sage: HyperbolicPlane().KM().get_point((1,0))
|
|
173
|
+
Boundary point in KM (1, 0)
|
|
174
|
+
|
|
175
|
+
In the HM model, the coordinates of a point are on the
|
|
176
|
+
hyperboloid given by `x^2 + y^2 - z^2 = -1`::
|
|
177
|
+
|
|
178
|
+
sage: HyperbolicPlane().HM().get_point((0,0,1))
|
|
179
|
+
Point in HM (0, 0, 1)
|
|
180
|
+
sage: HyperbolicPlane().HM().get_point((0,0,2))
|
|
181
|
+
Traceback (most recent call last):
|
|
182
|
+
...
|
|
183
|
+
ValueError: (0, 0, 2) is not a valid point in the HM model
|
|
184
|
+
sage: HyperbolicPlane().HM().get_point((1,0,0), is_boundary=True)
|
|
185
|
+
Traceback (most recent call last):
|
|
186
|
+
...
|
|
187
|
+
NotImplementedError: boundary points are not implemented in the HM model
|
|
188
|
+
"""
|
|
189
|
+
def __init__(self, model, coordinates, is_boundary, check=True, **graphics_options):
|
|
190
|
+
r"""
|
|
191
|
+
See ``HyperbolicPoint`` for full documentation.
|
|
192
|
+
|
|
193
|
+
EXAMPLES::
|
|
194
|
+
|
|
195
|
+
sage: p = HyperbolicPlane().UHP().get_point(I)
|
|
196
|
+
sage: TestSuite(p).run()
|
|
197
|
+
sage: p1 = HyperbolicPlane().KM().get_point((0,0))
|
|
198
|
+
sage: p2 = HyperbolicPlane().KM().get_point([0,0])
|
|
199
|
+
sage: p1 == p2
|
|
200
|
+
True
|
|
201
|
+
"""
|
|
202
|
+
if is_boundary:
|
|
203
|
+
if not model.is_bounded():
|
|
204
|
+
raise NotImplementedError("boundary points are not implemented in the {0} model".format(model.short_name()))
|
|
205
|
+
if check and not model.boundary_point_in_model(coordinates):
|
|
206
|
+
raise ValueError(
|
|
207
|
+
"{0} is not a valid".format(coordinates) +
|
|
208
|
+
" boundary point in the {0} model".format(model.short_name()))
|
|
209
|
+
elif check and not model.point_in_model(coordinates):
|
|
210
|
+
raise ValueError(
|
|
211
|
+
"{0} is not a valid".format(coordinates) +
|
|
212
|
+
" point in the {0} model".format(model.short_name()))
|
|
213
|
+
|
|
214
|
+
if isinstance(coordinates, Iterable):
|
|
215
|
+
coordinates = vector(coordinates)
|
|
216
|
+
self._coordinates = coordinates
|
|
217
|
+
self._bdry = is_boundary
|
|
218
|
+
self._graphics_options = graphics_options
|
|
219
|
+
|
|
220
|
+
Element.__init__(self, model)
|
|
221
|
+
|
|
222
|
+
#####################
|
|
223
|
+
# "Private" Methods #
|
|
224
|
+
#####################
|
|
225
|
+
|
|
226
|
+
def _repr_(self):
|
|
227
|
+
r"""
|
|
228
|
+
Return a string representation of ``self``.
|
|
229
|
+
|
|
230
|
+
EXAMPLES::
|
|
231
|
+
|
|
232
|
+
sage: HyperbolicPlane().UHP().get_point(3 + 4*I)
|
|
233
|
+
Point in UHP 4*I + 3
|
|
234
|
+
|
|
235
|
+
sage: HyperbolicPlane().PD().get_point(1/2 + I/2)
|
|
236
|
+
Point in PD 1/2*I + 1/2
|
|
237
|
+
|
|
238
|
+
sage: HyperbolicPlane().KM().get_point((1/2, 1/2))
|
|
239
|
+
Point in KM (1/2, 1/2)
|
|
240
|
+
|
|
241
|
+
sage: HyperbolicPlane().HM().get_point((0,0,1))
|
|
242
|
+
Point in HM (0, 0, 1)
|
|
243
|
+
|
|
244
|
+
sage: HyperbolicPlane().UHP().get_point(infinity)
|
|
245
|
+
Boundary point in UHP +Infinity
|
|
246
|
+
|
|
247
|
+
sage: HyperbolicPlane().PD().get_point(-1)
|
|
248
|
+
Boundary point in PD -1
|
|
249
|
+
|
|
250
|
+
sage: HyperbolicPlane().KM().get_point((0, -1))
|
|
251
|
+
Boundary point in KM (0, -1)
|
|
252
|
+
"""
|
|
253
|
+
if self._bdry:
|
|
254
|
+
base = "Boundary point"
|
|
255
|
+
else:
|
|
256
|
+
base = "Point"
|
|
257
|
+
return base + " in {0} {1}".format(self.parent().short_name(), self._coordinates)
|
|
258
|
+
|
|
259
|
+
def _latex_(self):
|
|
260
|
+
r"""
|
|
261
|
+
EXAMPLES::
|
|
262
|
+
|
|
263
|
+
sage: from sage.geometry.hyperbolic_space.hyperbolic_point import *
|
|
264
|
+
sage: p = HyperbolicPlane().UHP().get_point(0)
|
|
265
|
+
sage: latex(p)
|
|
266
|
+
0
|
|
267
|
+
sage: q = HyperbolicPlane().HM().get_point((0,0,1))
|
|
268
|
+
sage: latex(q)
|
|
269
|
+
\left(0,\,0,\,1\right)
|
|
270
|
+
"""
|
|
271
|
+
return latex(self._coordinates)
|
|
272
|
+
|
|
273
|
+
def _richcmp_(self, other, op):
|
|
274
|
+
r"""
|
|
275
|
+
Comparison of ``self`` and ``other``.
|
|
276
|
+
|
|
277
|
+
EXAMPLES::
|
|
278
|
+
|
|
279
|
+
sage: p1 = HyperbolicPlane().UHP().get_point(1 + I)
|
|
280
|
+
sage: p2 = HyperbolicPlane().UHP().get_point(2 + I)
|
|
281
|
+
sage: p1 == p2
|
|
282
|
+
False
|
|
283
|
+
sage: p1 == p1
|
|
284
|
+
True
|
|
285
|
+
|
|
286
|
+
sage: p1 = HyperbolicPlane().PD().get_point(0)
|
|
287
|
+
sage: p2 = HyperbolicPlane().PD().get_point(1/2 + 2*I/3)
|
|
288
|
+
sage: p1 == p2
|
|
289
|
+
False
|
|
290
|
+
sage: p1 == p1
|
|
291
|
+
True
|
|
292
|
+
|
|
293
|
+
sage: p1 = HyperbolicPlane().KM().get_point((0,0))
|
|
294
|
+
sage: p2 = HyperbolicPlane().KM().get_point((0, 1/2))
|
|
295
|
+
sage: p1 == p2
|
|
296
|
+
False
|
|
297
|
+
|
|
298
|
+
sage: p1 = HyperbolicPlane().HM().get_point((0,0,1))
|
|
299
|
+
sage: p2 = HyperbolicPlane().HM().get_point((0,0,1/1))
|
|
300
|
+
sage: p1 == p2
|
|
301
|
+
True
|
|
302
|
+
"""
|
|
303
|
+
if not (isinstance(other, HyperbolicPoint)
|
|
304
|
+
or self.parent() is other.parent()):
|
|
305
|
+
return op == op_NE
|
|
306
|
+
# bool is required to convert symbolic (in)equalities
|
|
307
|
+
return bool(richcmp(self._coordinates, other._coordinates, op))
|
|
308
|
+
|
|
309
|
+
def __rmul__(self, other):
|
|
310
|
+
r"""
|
|
311
|
+
Implement the action of matrices on points of hyperbolic space.
|
|
312
|
+
|
|
313
|
+
EXAMPLES::
|
|
314
|
+
|
|
315
|
+
sage: A = matrix(2, [0, 1, 1, 0])
|
|
316
|
+
sage: A = HyperbolicPlane().UHP().get_isometry(A)
|
|
317
|
+
sage: A * HyperbolicPlane().UHP().get_point(2 + I)
|
|
318
|
+
Point in UHP 1/5*I + 2/5
|
|
319
|
+
|
|
320
|
+
We also lift matrices into isometries::
|
|
321
|
+
|
|
322
|
+
sage: B = diagonal_matrix([-1, -1, 1])
|
|
323
|
+
sage: B = HyperbolicPlane().HM().get_isometry(B) # needs scipy
|
|
324
|
+
sage: B * HyperbolicPlane().HM().get_point((0, 1, sqrt(2))) # needs scipy
|
|
325
|
+
Point in HM (0, -1, sqrt(2))
|
|
326
|
+
"""
|
|
327
|
+
if isinstance(other, HyperbolicIsometry):
|
|
328
|
+
return other(self)
|
|
329
|
+
elif isinstance(other, Matrix):
|
|
330
|
+
# TODO: Currently the __mul__ from the matrices gets called first
|
|
331
|
+
# and returns an error instead of calling this method
|
|
332
|
+
A = self.parent().get_isometry(other)
|
|
333
|
+
return A(self)
|
|
334
|
+
else:
|
|
335
|
+
raise TypeError("unsupported operand type(s) for *:"
|
|
336
|
+
"{0} and {1}".format(self, other))
|
|
337
|
+
|
|
338
|
+
#######################
|
|
339
|
+
# Setters and Getters #
|
|
340
|
+
#######################
|
|
341
|
+
|
|
342
|
+
def coordinates(self):
|
|
343
|
+
r"""
|
|
344
|
+
Return the coordinates of the point.
|
|
345
|
+
|
|
346
|
+
EXAMPLES::
|
|
347
|
+
|
|
348
|
+
sage: HyperbolicPlane().UHP().get_point(2 + I).coordinates()
|
|
349
|
+
I + 2
|
|
350
|
+
|
|
351
|
+
sage: HyperbolicPlane().PD().get_point(1/2 + 1/2*I).coordinates()
|
|
352
|
+
1/2*I + 1/2
|
|
353
|
+
|
|
354
|
+
sage: HyperbolicPlane().KM().get_point((1/3, 1/4)).coordinates()
|
|
355
|
+
(1/3, 1/4)
|
|
356
|
+
|
|
357
|
+
sage: HyperbolicPlane().HM().get_point((0,0,1)).coordinates()
|
|
358
|
+
(0, 0, 1)
|
|
359
|
+
"""
|
|
360
|
+
return self._coordinates
|
|
361
|
+
|
|
362
|
+
def model(self):
|
|
363
|
+
r"""
|
|
364
|
+
Return the model to which the :class:`HyperbolicPoint` belongs.
|
|
365
|
+
|
|
366
|
+
EXAMPLES::
|
|
367
|
+
|
|
368
|
+
sage: HyperbolicPlane().UHP().get_point(I).model()
|
|
369
|
+
Hyperbolic plane in the Upper Half Plane Model
|
|
370
|
+
|
|
371
|
+
sage: HyperbolicPlane().PD().get_point(0).model()
|
|
372
|
+
Hyperbolic plane in the Poincare Disk Model
|
|
373
|
+
|
|
374
|
+
sage: HyperbolicPlane().KM().get_point((0,0)).model()
|
|
375
|
+
Hyperbolic plane in the Klein Disk Model
|
|
376
|
+
|
|
377
|
+
sage: HyperbolicPlane().HM().get_point((0,0,1)).model()
|
|
378
|
+
Hyperbolic plane in the Hyperboloid Model
|
|
379
|
+
"""
|
|
380
|
+
return self.parent()
|
|
381
|
+
|
|
382
|
+
def to_model(self, model):
|
|
383
|
+
"""
|
|
384
|
+
Convert ``self`` to the ``model``.
|
|
385
|
+
|
|
386
|
+
INPUT:
|
|
387
|
+
|
|
388
|
+
- ``other`` -- (a string representing) the image model
|
|
389
|
+
|
|
390
|
+
EXAMPLES::
|
|
391
|
+
|
|
392
|
+
sage: UHP = HyperbolicPlane().UHP()
|
|
393
|
+
sage: PD = HyperbolicPlane().PD()
|
|
394
|
+
sage: PD.get_point(1/2+I/2).to_model(UHP)
|
|
395
|
+
Point in UHP I + 2
|
|
396
|
+
sage: PD.get_point(1/2+I/2).to_model('UHP')
|
|
397
|
+
Point in UHP I + 2
|
|
398
|
+
"""
|
|
399
|
+
if isinstance(model, str):
|
|
400
|
+
model = getattr(self.parent().realization_of(), model)()
|
|
401
|
+
return model(self)
|
|
402
|
+
|
|
403
|
+
def is_boundary(self):
|
|
404
|
+
"""
|
|
405
|
+
Return ``True`` if ``self`` is a boundary point.
|
|
406
|
+
|
|
407
|
+
EXAMPLES::
|
|
408
|
+
|
|
409
|
+
sage: PD = HyperbolicPlane().PD()
|
|
410
|
+
sage: p = PD.get_point(0.5+.2*I)
|
|
411
|
+
sage: p.is_boundary()
|
|
412
|
+
False
|
|
413
|
+
sage: p = PD.get_point(I)
|
|
414
|
+
sage: p.is_boundary()
|
|
415
|
+
True
|
|
416
|
+
"""
|
|
417
|
+
return self._bdry
|
|
418
|
+
|
|
419
|
+
def update_graphics(self, update=False, **options):
|
|
420
|
+
r"""
|
|
421
|
+
Update the graphics options of a :class:`HyperbolicPoint`.
|
|
422
|
+
If ``update`` is ``True``, update rather than overwrite.
|
|
423
|
+
|
|
424
|
+
EXAMPLES::
|
|
425
|
+
|
|
426
|
+
sage: p = HyperbolicPlane().UHP().get_point(I); p.graphics_options()
|
|
427
|
+
{}
|
|
428
|
+
|
|
429
|
+
sage: p.update_graphics(color = "red"); p.graphics_options()
|
|
430
|
+
{'color': 'red'}
|
|
431
|
+
|
|
432
|
+
sage: p.update_graphics(color = "blue"); p.graphics_options()
|
|
433
|
+
{'color': 'blue'}
|
|
434
|
+
|
|
435
|
+
sage: p.update_graphics(True, size = 20); p.graphics_options()
|
|
436
|
+
{'color': 'blue', 'size': 20}
|
|
437
|
+
"""
|
|
438
|
+
if not update:
|
|
439
|
+
self._graphics_options = {}
|
|
440
|
+
self._graphics_options.update(**options)
|
|
441
|
+
|
|
442
|
+
def graphics_options(self):
|
|
443
|
+
r"""
|
|
444
|
+
Return the graphics options of the current point.
|
|
445
|
+
|
|
446
|
+
EXAMPLES::
|
|
447
|
+
|
|
448
|
+
sage: p = HyperbolicPlane().UHP().get_point(2 + I, color='red')
|
|
449
|
+
sage: p.graphics_options()
|
|
450
|
+
{'color': 'red'}
|
|
451
|
+
"""
|
|
452
|
+
return self._graphics_options
|
|
453
|
+
|
|
454
|
+
def symmetry_involution(self):
|
|
455
|
+
r"""
|
|
456
|
+
Return the involutory isometry fixing the given point.
|
|
457
|
+
|
|
458
|
+
EXAMPLES::
|
|
459
|
+
|
|
460
|
+
sage: z = HyperbolicPlane().UHP().get_point(3 + 2*I)
|
|
461
|
+
sage: z.symmetry_involution()
|
|
462
|
+
Isometry in UHP
|
|
463
|
+
[ 3/2 -13/2]
|
|
464
|
+
[ 1/2 -3/2]
|
|
465
|
+
|
|
466
|
+
sage: HyperbolicPlane().UHP().get_point(I).symmetry_involution()
|
|
467
|
+
Isometry in UHP
|
|
468
|
+
[ 0 -1]
|
|
469
|
+
[ 1 0]
|
|
470
|
+
|
|
471
|
+
sage: HyperbolicPlane().PD().get_point(0).symmetry_involution()
|
|
472
|
+
Isometry in PD
|
|
473
|
+
[-I 0]
|
|
474
|
+
[ 0 I]
|
|
475
|
+
|
|
476
|
+
sage: HyperbolicPlane().KM().get_point((0, 0)).symmetry_involution()
|
|
477
|
+
Isometry in KM
|
|
478
|
+
[-1 0 0]
|
|
479
|
+
[ 0 -1 0]
|
|
480
|
+
[ 0 0 1]
|
|
481
|
+
|
|
482
|
+
sage: HyperbolicPlane().HM().get_point((0,0,1)).symmetry_involution()
|
|
483
|
+
Isometry in HM
|
|
484
|
+
[-1 0 0]
|
|
485
|
+
[ 0 -1 0]
|
|
486
|
+
[ 0 0 1]
|
|
487
|
+
|
|
488
|
+
sage: p = HyperbolicPlane().UHP().random_element()
|
|
489
|
+
sage: A = p.symmetry_involution()
|
|
490
|
+
sage: p.dist(A*p) # abs tol 1e-10
|
|
491
|
+
0
|
|
492
|
+
|
|
493
|
+
sage: A.preserves_orientation()
|
|
494
|
+
True
|
|
495
|
+
|
|
496
|
+
sage: A*A == HyperbolicPlane().UHP().get_isometry(identity_matrix(2)) # needs scipy
|
|
497
|
+
True
|
|
498
|
+
"""
|
|
499
|
+
R = self.parent().realization_of().a_realization()
|
|
500
|
+
A = R(self).symmetry_involution()
|
|
501
|
+
return self.parent().get_isometry(A)
|
|
502
|
+
|
|
503
|
+
###########
|
|
504
|
+
# Display #
|
|
505
|
+
###########
|
|
506
|
+
|
|
507
|
+
def show(self, boundary=True, **options):
|
|
508
|
+
r"""
|
|
509
|
+
Plot ``self``.
|
|
510
|
+
|
|
511
|
+
EXAMPLES::
|
|
512
|
+
|
|
513
|
+
sage: HyperbolicPlane().PD().get_point(0).show() # needs sage.plot
|
|
514
|
+
Graphics object consisting of 2 graphics primitives
|
|
515
|
+
sage: HyperbolicPlane().KM().get_point((0,0)).show() # needs sage.plot
|
|
516
|
+
Graphics object consisting of 2 graphics primitives
|
|
517
|
+
sage: HyperbolicPlane().HM().get_point((0,0,1)).show() # needs sage.plot
|
|
518
|
+
Graphics3d Object
|
|
519
|
+
"""
|
|
520
|
+
p = self.coordinates()
|
|
521
|
+
if p == infinity:
|
|
522
|
+
raise NotImplementedError("can't draw the point infinity")
|
|
523
|
+
|
|
524
|
+
opts = {'axes': False, 'aspect_ratio': 1}
|
|
525
|
+
opts.update(self.graphics_options())
|
|
526
|
+
opts.update(options)
|
|
527
|
+
|
|
528
|
+
from sage.plot.point import point
|
|
529
|
+
from sage.misc.functional import numerical_approx
|
|
530
|
+
|
|
531
|
+
if self._bdry: # It is a boundary point
|
|
532
|
+
p = numerical_approx(p)
|
|
533
|
+
pic = point((p, 0), **opts)
|
|
534
|
+
if boundary:
|
|
535
|
+
bd_pic = self._model.get_background_graphic(bd_min=p - 1,
|
|
536
|
+
bd_max=p + 1)
|
|
537
|
+
pic = bd_pic + pic
|
|
538
|
+
else: # It is an interior point
|
|
539
|
+
if p in RR:
|
|
540
|
+
p = CC(p)
|
|
541
|
+
else:
|
|
542
|
+
p = numerical_approx(p)
|
|
543
|
+
pic = point(p, **opts)
|
|
544
|
+
if boundary:
|
|
545
|
+
bd_pic = self.parent().get_background_graphic()
|
|
546
|
+
pic = bd_pic + pic
|
|
547
|
+
return pic
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
class HyperbolicPointUHP(HyperbolicPoint):
|
|
551
|
+
r"""
|
|
552
|
+
A point in the UHP model.
|
|
553
|
+
|
|
554
|
+
INPUT:
|
|
555
|
+
|
|
556
|
+
- the coordinates of a point in the unit disk in the complex plane `\CC`
|
|
557
|
+
|
|
558
|
+
EXAMPLES::
|
|
559
|
+
|
|
560
|
+
sage: HyperbolicPlane().UHP().get_point(2*I)
|
|
561
|
+
Point in UHP 2*I
|
|
562
|
+
|
|
563
|
+
sage: HyperbolicPlane().UHP().get_point(1)
|
|
564
|
+
Boundary point in UHP 1
|
|
565
|
+
"""
|
|
566
|
+
def symmetry_involution(self):
|
|
567
|
+
r"""
|
|
568
|
+
Return the involutory isometry fixing the given point.
|
|
569
|
+
|
|
570
|
+
EXAMPLES::
|
|
571
|
+
|
|
572
|
+
sage: HyperbolicPlane().UHP().get_point(3 + 2*I).symmetry_involution()
|
|
573
|
+
Isometry in UHP
|
|
574
|
+
[ 3/2 -13/2]
|
|
575
|
+
[ 1/2 -3/2]
|
|
576
|
+
"""
|
|
577
|
+
p = self._coordinates
|
|
578
|
+
x, y = real(p), imag(p)
|
|
579
|
+
if y > 0:
|
|
580
|
+
M = matrix([[x/y, -(x**2/y) - y], [1/y, -(x/y)]])
|
|
581
|
+
return self.parent().get_isometry(M)
|
|
582
|
+
raise ValueError("cannot determine the isometry of a boundary point")
|
|
583
|
+
|
|
584
|
+
def show(self, boundary=True, **options):
|
|
585
|
+
r"""
|
|
586
|
+
Plot ``self``.
|
|
587
|
+
|
|
588
|
+
EXAMPLES::
|
|
589
|
+
|
|
590
|
+
sage: HyperbolicPlane().UHP().get_point(I).show() # needs sage.plot
|
|
591
|
+
Graphics object consisting of 2 graphics primitives
|
|
592
|
+
sage: HyperbolicPlane().UHP().get_point(0).show() # needs sage.plot
|
|
593
|
+
Graphics object consisting of 2 graphics primitives
|
|
594
|
+
sage: HyperbolicPlane().UHP().get_point(infinity).show()
|
|
595
|
+
Traceback (most recent call last):
|
|
596
|
+
...
|
|
597
|
+
NotImplementedError: can...t draw the point infinity
|
|
598
|
+
"""
|
|
599
|
+
p = self.coordinates()
|
|
600
|
+
if p == infinity:
|
|
601
|
+
raise NotImplementedError("can't draw the point infinity")
|
|
602
|
+
opts = {'axes': False, 'aspect_ratio': 1}
|
|
603
|
+
opts.update(self.graphics_options())
|
|
604
|
+
opts.update(options)
|
|
605
|
+
from sage.misc.functional import numerical_approx
|
|
606
|
+
p = numerical_approx(p + 0 * I)
|
|
607
|
+
from sage.plot.point import point
|
|
608
|
+
if self._bdry:
|
|
609
|
+
pic = point((p, 0), **opts)
|
|
610
|
+
if boundary:
|
|
611
|
+
bd_pic = self.parent().get_background_graphic(bd_min=p - 1,
|
|
612
|
+
bd_max=p + 1)
|
|
613
|
+
pic = bd_pic + pic
|
|
614
|
+
else:
|
|
615
|
+
pic = point(p, **opts)
|
|
616
|
+
if boundary:
|
|
617
|
+
cent = real(p)
|
|
618
|
+
bd_pic = self.parent().get_background_graphic(bd_min=cent - 1,
|
|
619
|
+
bd_max=cent + 1)
|
|
620
|
+
pic = bd_pic + pic
|
|
621
|
+
return pic
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-symbolics
|
|
2
|
+
from sage.misc.lazy_import import lazy_import
|
|
3
|
+
lazy_import('sage.geometry.riemannian_manifolds.parametrized_surface3d',
|
|
4
|
+
'ParametrizedSurface3D')
|
|
5
|
+
lazy_import('sage.geometry.riemannian_manifolds.surface3d_generators',
|
|
6
|
+
'surfaces')
|
|
7
|
+
del lazy_import
|