passagemath-symbolics 10.8.1a1__cp311-cp311-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.8.1a1.dist-info/METADATA +186 -0
- passagemath_symbolics-10.8.1a1.dist-info/RECORD +182 -0
- passagemath_symbolics-10.8.1a1.dist-info/WHEEL +6 -0
- passagemath_symbolics-10.8.1a1.dist-info/top_level.txt +3 -0
- sage/all__sagemath_symbolics.py +17 -0
- sage/calculus/all.py +14 -0
- sage/calculus/calculus.py +2838 -0
- sage/calculus/desolvers.py +1864 -0
- sage/calculus/predefined.py +51 -0
- sage/calculus/tests.py +225 -0
- sage/calculus/var.cpython-311-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-311-darwin.so +0 -0
- sage/dynamics/complex_dynamics/mandel_julia_helper.pyx +1034 -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 +755 -0
- sage/geometry/hyperbolic_space/hyperbolic_constants.py +5 -0
- sage/geometry/hyperbolic_space/hyperbolic_geodesic.py +2419 -0
- sage/geometry/hyperbolic_space/hyperbolic_interface.py +206 -0
- sage/geometry/hyperbolic_space/hyperbolic_isometry.py +1083 -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 +2991 -0
- sage/interfaces/magma_free.py +90 -0
- sage/interfaces/maple.py +1402 -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 +553 -0
- sage/manifolds/catalog.py +437 -0
- sage/manifolds/chart.py +4010 -0
- sage/manifolds/chart_func.py +3416 -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 +1668 -0
- sage/manifolds/differentiable/diff_form.py +1660 -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 +1522 -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 +912 -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 +1725 -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 +2721 -0
- sage/manifolds/subsets/all.py +1 -0
- sage/manifolds/subsets/closure.py +131 -0
- sage/manifolds/subsets/pullback.py +883 -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 +1347 -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-311-darwin.so +0 -0
- sage/matrix/matrix_symbolic_dense.pxd +6 -0
- sage/matrix/matrix_symbolic_dense.pyx +1030 -0
- sage/matrix/matrix_symbolic_sparse.cpython-311-darwin.so +0 -0
- sage/matrix/matrix_symbolic_sparse.pxd +6 -0
- sage/matrix/matrix_symbolic_sparse.pyx +1038 -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 +4106 -0
- sage/rings/asymptotic/growth_group.py +5373 -0
- sage/rings/asymptotic/growth_group_cartesian.py +1400 -0
- sage/rings/asymptotic/term_monoid.py +5205 -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 +987 -0
- sage/symbolic/benchmark.py +93 -0
- sage/symbolic/callable.py +456 -0
- sage/symbolic/callable.pyi +66 -0
- sage/symbolic/comparison_impl.pyi +38 -0
- sage/symbolic/complexity_measures.py +35 -0
- sage/symbolic/constants.py +1286 -0
- sage/symbolic/constants_c_impl.pyi +10 -0
- sage/symbolic/expression_conversion_algebraic.py +310 -0
- sage/symbolic/expression_conversion_sympy.py +317 -0
- sage/symbolic/expression_conversions.py +1727 -0
- sage/symbolic/function_factory.py +355 -0
- sage/symbolic/function_factory.pyi +41 -0
- sage/symbolic/getitem_impl.pyi +24 -0
- sage/symbolic/integration/all.py +1 -0
- sage/symbolic/integration/external.py +271 -0
- sage/symbolic/integration/integral.py +1075 -0
- sage/symbolic/maxima_wrapper.py +162 -0
- sage/symbolic/operators.py +267 -0
- sage/symbolic/operators.pyi +61 -0
- sage/symbolic/pynac_constant_impl.pyi +13 -0
- sage/symbolic/pynac_function_impl.pyi +8 -0
- sage/symbolic/random_tests.py +461 -0
- sage/symbolic/relation.py +2062 -0
- sage/symbolic/ring.cpython-311-darwin.so +0 -0
- sage/symbolic/ring.pxd +5 -0
- sage/symbolic/ring.pyi +110 -0
- sage/symbolic/ring.pyx +1393 -0
- sage/symbolic/series_impl.pyi +10 -0
- sage/symbolic/subring.py +1025 -0
- sage/symbolic/symengine.py +19 -0
- sage/symbolic/tests.py +40 -0
- sage/symbolic/units.py +1468 -0
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-symbolics
|
|
2
|
+
r"""
|
|
3
|
+
Algebra of Differentiable Scalar Fields
|
|
4
|
+
|
|
5
|
+
The class :class:`DiffScalarFieldAlgebra` implements the commutative algebra
|
|
6
|
+
`C^k(M)` of differentiable scalar fields on a differentiable manifold `M` of
|
|
7
|
+
class `C^k` over a topological field `K` (in
|
|
8
|
+
most applications, `K = \RR` or `K = \CC`). By *differentiable scalar field*,
|
|
9
|
+
it is meant a function `M\rightarrow K` that is `k`-times continuously
|
|
10
|
+
differentiable. `C^k(M)` is an algebra over `K`, whose ring product is the
|
|
11
|
+
pointwise multiplication of `K`-valued functions, which is clearly commutative.
|
|
12
|
+
|
|
13
|
+
AUTHORS:
|
|
14
|
+
|
|
15
|
+
- Eric Gourgoulhon, Michal Bejger (2014-2015): initial version
|
|
16
|
+
|
|
17
|
+
REFERENCES:
|
|
18
|
+
|
|
19
|
+
- [KN1963]_
|
|
20
|
+
- [Lee2013]_
|
|
21
|
+
- [ONe1983]_
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
#******************************************************************************
|
|
25
|
+
# Copyright (C) 2015 Eric Gourgoulhon <eric.gourgoulhon@obspm.fr>
|
|
26
|
+
# Copyright (C) 2015 Michal Bejger <bejger@camk.edu.pl>
|
|
27
|
+
#
|
|
28
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
29
|
+
# as published by the Free Software Foundation; either version 2 of
|
|
30
|
+
# the License, or (at your option) any later version.
|
|
31
|
+
# http://www.gnu.org/licenses/
|
|
32
|
+
#******************************************************************************
|
|
33
|
+
|
|
34
|
+
from sage.manifolds.differentiable.scalarfield import DiffScalarField
|
|
35
|
+
from sage.manifolds.scalarfield_algebra import ScalarFieldAlgebra
|
|
36
|
+
from sage.rings.infinity import infinity
|
|
37
|
+
from sage.symbolic.ring import SymbolicRing
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class DiffScalarFieldAlgebra(ScalarFieldAlgebra):
|
|
41
|
+
r"""
|
|
42
|
+
Commutative algebra of differentiable scalar fields on a differentiable
|
|
43
|
+
manifold.
|
|
44
|
+
|
|
45
|
+
If `M` is a differentiable manifold of class `C^k` over a topological
|
|
46
|
+
field `K`, the *commutative algebra of scalar fields on* `M` is the set
|
|
47
|
+
`C^k(M)` of all `k`-times continuously differentiable maps `M\rightarrow K`.
|
|
48
|
+
The set `C^k(M)` is an algebra over `K`, whose ring product is the
|
|
49
|
+
pointwise multiplication of `K`-valued functions, which is clearly
|
|
50
|
+
commutative.
|
|
51
|
+
|
|
52
|
+
If `K = \RR` or `K = \CC`, the field `K` over which the
|
|
53
|
+
algebra `C^k(M)` is constructed is represented by Sage's Symbolic Ring
|
|
54
|
+
``SR``, since there is no exact representation of `\RR` nor `\CC` in Sage.
|
|
55
|
+
|
|
56
|
+
Via its base class
|
|
57
|
+
:class:`~sage.manifolds.scalarfield_algebra.ScalarFieldAlgebra`,
|
|
58
|
+
the class :class:`DiffScalarFieldAlgebra` inherits from
|
|
59
|
+
:class:`~sage.structure.parent.Parent`, with the category set to
|
|
60
|
+
:class:`~sage.categories.commutative_algebras.CommutativeAlgebras`.
|
|
61
|
+
The corresponding *element* class is
|
|
62
|
+
:class:`~sage.manifolds.differentiable.scalarfield.DiffScalarField`.
|
|
63
|
+
|
|
64
|
+
INPUT:
|
|
65
|
+
|
|
66
|
+
- ``domain`` -- the differentiable manifold `M` on which the scalar fields
|
|
67
|
+
are defined (must be an instance of class
|
|
68
|
+
:class:`~sage.manifolds.differentiable.manifold.DifferentiableManifold`)
|
|
69
|
+
|
|
70
|
+
EXAMPLES:
|
|
71
|
+
|
|
72
|
+
Algebras of scalar fields on the sphere `S^2` and on some open subset of
|
|
73
|
+
it::
|
|
74
|
+
|
|
75
|
+
sage: M = Manifold(2, 'M') # the 2-dimensional sphere S^2
|
|
76
|
+
sage: U = M.open_subset('U') # complement of the North pole
|
|
77
|
+
sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole
|
|
78
|
+
sage: V = M.open_subset('V') # complement of the South pole
|
|
79
|
+
sage: c_uv.<u,v> = V.chart() # stereographic coordinates from the South pole
|
|
80
|
+
sage: M.declare_union(U,V) # S^2 is the union of U and V
|
|
81
|
+
sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)),
|
|
82
|
+
....: intersection_name='W', restrictions1= x^2+y^2!=0,
|
|
83
|
+
....: restrictions2= u^2+v^2!=0)
|
|
84
|
+
sage: uv_to_xy = xy_to_uv.inverse()
|
|
85
|
+
sage: CM = M.scalar_field_algebra() ; CM
|
|
86
|
+
Algebra of differentiable scalar fields on the 2-dimensional
|
|
87
|
+
differentiable manifold M
|
|
88
|
+
sage: W = U.intersection(V) # S^2 minus the two poles
|
|
89
|
+
sage: CW = W.scalar_field_algebra() ; CW
|
|
90
|
+
Algebra of differentiable scalar fields on the Open subset W of the
|
|
91
|
+
2-dimensional differentiable manifold M
|
|
92
|
+
|
|
93
|
+
`C^k(M)` and `C^k(W)` belong to the category of commutative
|
|
94
|
+
algebras over `\RR` (represented here by Sage's Symbolic Ring)::
|
|
95
|
+
|
|
96
|
+
sage: CM.category()
|
|
97
|
+
Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces
|
|
98
|
+
sage: CM.base_ring()
|
|
99
|
+
Symbolic Ring
|
|
100
|
+
sage: CW.category()
|
|
101
|
+
Join of Category of commutative algebras over Symbolic Ring and Category of homsets of topological spaces
|
|
102
|
+
sage: CW.base_ring()
|
|
103
|
+
Symbolic Ring
|
|
104
|
+
|
|
105
|
+
The elements of `C^k(M)` are scalar fields on `M`::
|
|
106
|
+
|
|
107
|
+
sage: CM.an_element()
|
|
108
|
+
Scalar field on the 2-dimensional differentiable manifold M
|
|
109
|
+
sage: CM.an_element().display() # this sample element is a constant field
|
|
110
|
+
M → ℝ
|
|
111
|
+
on U: (x, y) ↦ 2
|
|
112
|
+
on V: (u, v) ↦ 2
|
|
113
|
+
|
|
114
|
+
Those of `C^k(W)` are scalar fields on `W`::
|
|
115
|
+
|
|
116
|
+
sage: CW.an_element()
|
|
117
|
+
Scalar field on the Open subset W of the 2-dimensional differentiable
|
|
118
|
+
manifold M
|
|
119
|
+
sage: CW.an_element().display() # this sample element is a constant field
|
|
120
|
+
W → ℝ
|
|
121
|
+
(x, y) ↦ 2
|
|
122
|
+
(u, v) ↦ 2
|
|
123
|
+
|
|
124
|
+
The zero element::
|
|
125
|
+
|
|
126
|
+
sage: CM.zero()
|
|
127
|
+
Scalar field zero on the 2-dimensional differentiable manifold M
|
|
128
|
+
sage: CM.zero().display()
|
|
129
|
+
zero: M → ℝ
|
|
130
|
+
on U: (x, y) ↦ 0
|
|
131
|
+
on V: (u, v) ↦ 0
|
|
132
|
+
|
|
133
|
+
::
|
|
134
|
+
|
|
135
|
+
sage: CW.zero()
|
|
136
|
+
Scalar field zero on the Open subset W of the 2-dimensional
|
|
137
|
+
differentiable manifold M
|
|
138
|
+
sage: CW.zero().display()
|
|
139
|
+
zero: W → ℝ
|
|
140
|
+
(x, y) ↦ 0
|
|
141
|
+
(u, v) ↦ 0
|
|
142
|
+
|
|
143
|
+
The unit element::
|
|
144
|
+
|
|
145
|
+
sage: CM.one()
|
|
146
|
+
Scalar field 1 on the 2-dimensional differentiable manifold M
|
|
147
|
+
sage: CM.one().display()
|
|
148
|
+
1: M → ℝ
|
|
149
|
+
on U: (x, y) ↦ 1
|
|
150
|
+
on V: (u, v) ↦ 1
|
|
151
|
+
|
|
152
|
+
::
|
|
153
|
+
|
|
154
|
+
sage: CW.one()
|
|
155
|
+
Scalar field 1 on the Open subset W of the 2-dimensional differentiable
|
|
156
|
+
manifold M
|
|
157
|
+
sage: CW.one().display()
|
|
158
|
+
1: W → ℝ
|
|
159
|
+
(x, y) ↦ 1
|
|
160
|
+
(u, v) ↦ 1
|
|
161
|
+
|
|
162
|
+
A generic element can be constructed as for any parent in Sage, namely
|
|
163
|
+
by means of the ``__call__`` operator on the parent (here with the
|
|
164
|
+
dictionary of the coordinate expressions defining the scalar field)::
|
|
165
|
+
|
|
166
|
+
sage: f = CM({c_xy: atan(x^2+y^2), c_uv: pi/2 - atan(u^2+v^2)}); f
|
|
167
|
+
Scalar field on the 2-dimensional differentiable manifold M
|
|
168
|
+
sage: f.display()
|
|
169
|
+
M → ℝ
|
|
170
|
+
on U: (x, y) ↦ arctan(x^2 + y^2)
|
|
171
|
+
on V: (u, v) ↦ 1/2*pi - arctan(u^2 + v^2)
|
|
172
|
+
sage: f.parent()
|
|
173
|
+
Algebra of differentiable scalar fields on the 2-dimensional
|
|
174
|
+
differentiable manifold M
|
|
175
|
+
|
|
176
|
+
Specific elements can also be constructed in this way::
|
|
177
|
+
|
|
178
|
+
sage: CM(0) == CM.zero()
|
|
179
|
+
True
|
|
180
|
+
sage: CM(1) == CM.one()
|
|
181
|
+
True
|
|
182
|
+
|
|
183
|
+
Note that the zero scalar field is cached::
|
|
184
|
+
|
|
185
|
+
sage: CM(0) is CM.zero()
|
|
186
|
+
True
|
|
187
|
+
|
|
188
|
+
Elements can also be constructed by means of the method
|
|
189
|
+
:meth:`~sage.manifolds.manifold.TopologicalManifold.scalar_field` acting on
|
|
190
|
+
the domain (this allows one to set the name of the scalar field at the
|
|
191
|
+
construction)::
|
|
192
|
+
|
|
193
|
+
sage: f1 = M.scalar_field({c_xy: atan(x^2+y^2), c_uv: pi/2 - atan(u^2+v^2)},
|
|
194
|
+
....: name='f')
|
|
195
|
+
sage: f1.parent()
|
|
196
|
+
Algebra of differentiable scalar fields on the 2-dimensional
|
|
197
|
+
differentiable manifold M
|
|
198
|
+
sage: f1 == f
|
|
199
|
+
True
|
|
200
|
+
sage: M.scalar_field(0, chart='all') == CM.zero()
|
|
201
|
+
True
|
|
202
|
+
|
|
203
|
+
The algebra `C^k(M)` coerces to `C^k(W)` since `W` is an open
|
|
204
|
+
subset of `M`::
|
|
205
|
+
|
|
206
|
+
sage: CW.has_coerce_map_from(CM)
|
|
207
|
+
True
|
|
208
|
+
|
|
209
|
+
The reverse is of course false::
|
|
210
|
+
|
|
211
|
+
sage: CM.has_coerce_map_from(CW)
|
|
212
|
+
False
|
|
213
|
+
|
|
214
|
+
The coercion map is nothing but the restriction to `W` of scalar fields
|
|
215
|
+
on `M`::
|
|
216
|
+
|
|
217
|
+
sage: fW = CW(f) ; fW
|
|
218
|
+
Scalar field on the Open subset W of the 2-dimensional differentiable
|
|
219
|
+
manifold M
|
|
220
|
+
sage: fW.display()
|
|
221
|
+
W → ℝ
|
|
222
|
+
(x, y) ↦ arctan(x^2 + y^2)
|
|
223
|
+
(u, v) ↦ 1/2*pi - arctan(u^2 + v^2)
|
|
224
|
+
|
|
225
|
+
::
|
|
226
|
+
|
|
227
|
+
sage: CW(CM.one()) == CW.one()
|
|
228
|
+
True
|
|
229
|
+
|
|
230
|
+
The coercion map allows for the addition of elements of `C^k(W)`
|
|
231
|
+
with elements of `C^k(M)`, the result being an element of
|
|
232
|
+
`C^k(W)`::
|
|
233
|
+
|
|
234
|
+
sage: s = fW + f
|
|
235
|
+
sage: s.parent()
|
|
236
|
+
Algebra of differentiable scalar fields on the Open subset W of the
|
|
237
|
+
2-dimensional differentiable manifold M
|
|
238
|
+
sage: s.display()
|
|
239
|
+
W → ℝ
|
|
240
|
+
(x, y) ↦ 2*arctan(x^2 + y^2)
|
|
241
|
+
(u, v) ↦ pi - 2*arctan(u^2 + v^2)
|
|
242
|
+
|
|
243
|
+
Another coercion is that from the Symbolic Ring, the parent of all
|
|
244
|
+
symbolic expressions (cf. :class:`~sage.symbolic.ring.SymbolicRing`).
|
|
245
|
+
Since the Symbolic Ring is the base ring for the algebra ``CM``, the
|
|
246
|
+
coercion of a symbolic expression ``s`` is performed by the operation
|
|
247
|
+
``s*CM.one()``, which invokes the reflected multiplication operator
|
|
248
|
+
:meth:`sage.manifolds.scalarfield.ScalarField._rmul_`. If the symbolic
|
|
249
|
+
expression does not involve any chart coordinate, the outcome is a
|
|
250
|
+
constant scalar field::
|
|
251
|
+
|
|
252
|
+
sage: h = CM(pi*sqrt(2)) ; h
|
|
253
|
+
Scalar field on the 2-dimensional differentiable manifold M
|
|
254
|
+
sage: h.display()
|
|
255
|
+
M → ℝ
|
|
256
|
+
on U: (x, y) ↦ sqrt(2)*pi
|
|
257
|
+
on V: (u, v) ↦ sqrt(2)*pi
|
|
258
|
+
sage: a = var('a')
|
|
259
|
+
sage: h = CM(a); h.display()
|
|
260
|
+
M → ℝ
|
|
261
|
+
on U: (x, y) ↦ a
|
|
262
|
+
on V: (u, v) ↦ a
|
|
263
|
+
|
|
264
|
+
If the symbolic expression involves some coordinate of one of the
|
|
265
|
+
manifold's charts, the outcome is initialized only on the chart domain::
|
|
266
|
+
|
|
267
|
+
sage: h = CM(a+x); h.display()
|
|
268
|
+
M → ℝ
|
|
269
|
+
on U: (x, y) ↦ a + x
|
|
270
|
+
on W: (u, v) ↦ (a*u^2 + a*v^2 + u)/(u^2 + v^2)
|
|
271
|
+
sage: h = CM(a+u); h.display()
|
|
272
|
+
M → ℝ
|
|
273
|
+
on W: (x, y) ↦ (a*x^2 + a*y^2 + x)/(x^2 + y^2)
|
|
274
|
+
on V: (u, v) ↦ a + u
|
|
275
|
+
|
|
276
|
+
If the symbolic expression involves coordinates of different charts,
|
|
277
|
+
the scalar field is created as a Python object, but is not initialized,
|
|
278
|
+
in order to avoid any ambiguity::
|
|
279
|
+
|
|
280
|
+
sage: h = CM(x+u); h.display()
|
|
281
|
+
M → ℝ
|
|
282
|
+
|
|
283
|
+
.. RUBRIC:: TESTS OF THE ALGEBRA LAWS:
|
|
284
|
+
|
|
285
|
+
Ring laws::
|
|
286
|
+
|
|
287
|
+
sage: h = CM(pi*sqrt(2))
|
|
288
|
+
sage: s = f + h ; s
|
|
289
|
+
Scalar field on the 2-dimensional differentiable manifold M
|
|
290
|
+
sage: s.display()
|
|
291
|
+
M → ℝ
|
|
292
|
+
on U: (x, y) ↦ sqrt(2)*pi + arctan(x^2 + y^2)
|
|
293
|
+
on V: (u, v) ↦ 1/2*pi*(2*sqrt(2) + 1) - arctan(u^2 + v^2)
|
|
294
|
+
|
|
295
|
+
::
|
|
296
|
+
|
|
297
|
+
sage: s = f - h ; s
|
|
298
|
+
Scalar field on the 2-dimensional differentiable manifold M
|
|
299
|
+
sage: s.display()
|
|
300
|
+
M → ℝ
|
|
301
|
+
on U: (x, y) ↦ -sqrt(2)*pi + arctan(x^2 + y^2)
|
|
302
|
+
on V: (u, v) ↦ -1/2*pi*(2*sqrt(2) - 1) - arctan(u^2 + v^2)
|
|
303
|
+
|
|
304
|
+
::
|
|
305
|
+
|
|
306
|
+
sage: s = f*h ; s
|
|
307
|
+
Scalar field on the 2-dimensional differentiable manifold M
|
|
308
|
+
sage: s.display()
|
|
309
|
+
M → ℝ
|
|
310
|
+
on U: (x, y) ↦ sqrt(2)*pi*arctan(x^2 + y^2)
|
|
311
|
+
on V: (u, v) ↦ 1/2*sqrt(2)*(pi^2 - 2*pi*arctan(u^2 + v^2))
|
|
312
|
+
|
|
313
|
+
::
|
|
314
|
+
|
|
315
|
+
sage: s = f/h ; s
|
|
316
|
+
Scalar field on the 2-dimensional differentiable manifold M
|
|
317
|
+
sage: s.display()
|
|
318
|
+
M → ℝ
|
|
319
|
+
on U: (x, y) ↦ 1/2*sqrt(2)*arctan(x^2 + y^2)/pi
|
|
320
|
+
on V: (u, v) ↦ 1/4*sqrt(2)*(pi - 2*arctan(u^2 + v^2))/pi
|
|
321
|
+
|
|
322
|
+
::
|
|
323
|
+
|
|
324
|
+
sage: f*(h+f) == f*h + f*f
|
|
325
|
+
True
|
|
326
|
+
|
|
327
|
+
Ring laws with coercion::
|
|
328
|
+
|
|
329
|
+
sage: f - fW == CW.zero()
|
|
330
|
+
True
|
|
331
|
+
sage: f/fW == CW.one()
|
|
332
|
+
True
|
|
333
|
+
sage: s = f*fW ; s
|
|
334
|
+
Scalar field on the Open subset W of the 2-dimensional differentiable
|
|
335
|
+
manifold M
|
|
336
|
+
sage: s.display()
|
|
337
|
+
W → ℝ
|
|
338
|
+
(x, y) ↦ arctan(x^2 + y^2)^2
|
|
339
|
+
(u, v) ↦ 1/4*pi^2 - pi*arctan(u^2 + v^2) + arctan(u^2 + v^2)^2
|
|
340
|
+
sage: s/f == fW
|
|
341
|
+
True
|
|
342
|
+
|
|
343
|
+
Multiplication by a number::
|
|
344
|
+
|
|
345
|
+
sage: s = 2*f ; s
|
|
346
|
+
Scalar field on the 2-dimensional differentiable manifold M
|
|
347
|
+
sage: s.display()
|
|
348
|
+
M → ℝ
|
|
349
|
+
on U: (x, y) ↦ 2*arctan(x^2 + y^2)
|
|
350
|
+
on V: (u, v) ↦ pi - 2*arctan(u^2 + v^2)
|
|
351
|
+
|
|
352
|
+
::
|
|
353
|
+
|
|
354
|
+
sage: 0*f == CM.zero()
|
|
355
|
+
True
|
|
356
|
+
sage: 1*f == f
|
|
357
|
+
True
|
|
358
|
+
sage: 2*(f/2) == f
|
|
359
|
+
True
|
|
360
|
+
sage: (f+2*f)/3 == f
|
|
361
|
+
True
|
|
362
|
+
sage: 1/3*(f+2*f) == f
|
|
363
|
+
True
|
|
364
|
+
|
|
365
|
+
The Sage test suite for algebras is passed::
|
|
366
|
+
|
|
367
|
+
sage: TestSuite(CM).run()
|
|
368
|
+
|
|
369
|
+
It is passed also for `C^k(W)`::
|
|
370
|
+
|
|
371
|
+
sage: TestSuite(CW).run()
|
|
372
|
+
"""
|
|
373
|
+
|
|
374
|
+
Element = DiffScalarField
|
|
375
|
+
|
|
376
|
+
def __init__(self, domain):
|
|
377
|
+
r"""
|
|
378
|
+
Construct an algebra of differentiable scalar fields.
|
|
379
|
+
|
|
380
|
+
TESTS::
|
|
381
|
+
|
|
382
|
+
sage: M = Manifold(2, 'M')
|
|
383
|
+
sage: X.<x,y> = M.chart()
|
|
384
|
+
sage: CM = M.scalar_field_algebra(); CM
|
|
385
|
+
Algebra of differentiable scalar fields on the 2-dimensional
|
|
386
|
+
differentiable manifold M
|
|
387
|
+
sage: type(CM)
|
|
388
|
+
<class 'sage.manifolds.differentiable.scalarfield_algebra.DiffScalarFieldAlgebra_with_category'>
|
|
389
|
+
sage: type(CM).__base__
|
|
390
|
+
<class 'sage.manifolds.differentiable.scalarfield_algebra.DiffScalarFieldAlgebra'>
|
|
391
|
+
sage: TestSuite(CM).run()
|
|
392
|
+
"""
|
|
393
|
+
ScalarFieldAlgebra.__init__(self, domain)
|
|
394
|
+
|
|
395
|
+
#### Methods required for any Parent
|
|
396
|
+
|
|
397
|
+
def _coerce_map_from_(self, other):
|
|
398
|
+
r"""
|
|
399
|
+
Determine whether coercion to ``self`` exists from other parent.
|
|
400
|
+
|
|
401
|
+
TESTS::
|
|
402
|
+
|
|
403
|
+
sage: M = Manifold(2, 'M')
|
|
404
|
+
sage: X.<x,y> = M.chart()
|
|
405
|
+
sage: CM = M.scalar_field_algebra()
|
|
406
|
+
sage: CM._coerce_map_from_(SR)
|
|
407
|
+
True
|
|
408
|
+
sage: SCR = SR.subring(no_variables=True); SCR
|
|
409
|
+
Symbolic Constants Subring
|
|
410
|
+
sage: CM._coerce_map_from_(SCR)
|
|
411
|
+
True
|
|
412
|
+
sage: CM._coerce_map_from_(X.function_ring())
|
|
413
|
+
True
|
|
414
|
+
sage: U = M.open_subset('U', coord_def={X: x>0})
|
|
415
|
+
sage: CU = U.scalar_field_algebra()
|
|
416
|
+
sage: CM._coerce_map_from_(CU)
|
|
417
|
+
False
|
|
418
|
+
sage: CU._coerce_map_from_(CM)
|
|
419
|
+
True
|
|
420
|
+
"""
|
|
421
|
+
from sage.manifolds.chart_func import ChartFunctionRing
|
|
422
|
+
|
|
423
|
+
if isinstance(other, SymbolicRing):
|
|
424
|
+
return True # coercion from the base ring (multiplication by the
|
|
425
|
+
# algebra unit, i.e. self.one())
|
|
426
|
+
# cf. ScalarField._lmul_() for the implementation of
|
|
427
|
+
# the coercion map
|
|
428
|
+
elif isinstance(other, DiffScalarFieldAlgebra):
|
|
429
|
+
return self._domain.is_subset(other._domain)
|
|
430
|
+
elif isinstance(other, ChartFunctionRing):
|
|
431
|
+
return self._domain.is_subset(other._chart.domain())
|
|
432
|
+
else:
|
|
433
|
+
return False
|
|
434
|
+
|
|
435
|
+
#### End of methods required for any Parent
|
|
436
|
+
|
|
437
|
+
def _repr_(self):
|
|
438
|
+
r"""
|
|
439
|
+
String representation of the object.
|
|
440
|
+
|
|
441
|
+
TESTS::
|
|
442
|
+
|
|
443
|
+
sage: M = Manifold(2, 'M')
|
|
444
|
+
sage: CM = M.scalar_field_algebra()
|
|
445
|
+
sage: CM._repr_()
|
|
446
|
+
'Algebra of differentiable scalar fields on the 2-dimensional differentiable manifold M'
|
|
447
|
+
sage: repr(CM) # indirect doctest
|
|
448
|
+
'Algebra of differentiable scalar fields on the 2-dimensional differentiable manifold M'
|
|
449
|
+
"""
|
|
450
|
+
return "Algebra of differentiable scalar fields on " + \
|
|
451
|
+
"the {}".format(self._domain)
|
|
452
|
+
|
|
453
|
+
def _latex_(self):
|
|
454
|
+
r"""
|
|
455
|
+
LaTeX representation of the object.
|
|
456
|
+
|
|
457
|
+
TESTS::
|
|
458
|
+
|
|
459
|
+
sage: M = Manifold(2, 'M')
|
|
460
|
+
sage: CM = M.scalar_field_algebra()
|
|
461
|
+
sage: CM._latex_()
|
|
462
|
+
'C^{\\infty}\\left(M\\right)'
|
|
463
|
+
sage: latex(CM) # indirect doctest
|
|
464
|
+
C^{\infty}\left(M\right)
|
|
465
|
+
"""
|
|
466
|
+
degree = self._domain.diff_degree()
|
|
467
|
+
if degree == infinity:
|
|
468
|
+
latex_degree = r"\infty" # to skip the "+" in latex(infinity)
|
|
469
|
+
else:
|
|
470
|
+
latex_degree = "{}".format(degree)
|
|
471
|
+
return r"C^{" + latex_degree + r"}\left(" + self._domain._latex_() + \
|
|
472
|
+
r"\right)"
|