summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-10-14 16:11:37 +0200
committerEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-10-14 16:11:37 +0200
commit2f231b66a3245337301370a33be8d56c76013cdb (patch)
tree06945bf58609662f3646bede352260db31bec5ee
parentImprovement in simplify_sqrt_real(); minor modif. in documentation (diff)
Major improvements in the documentation of diff. manifolds (basic part)
-rw-r--r--src/doc/en/reference/manifolds/chart.rst11
-rw-r--r--src/doc/en/reference/manifolds/continuous_map.rst9
-rw-r--r--src/doc/en/reference/manifolds/diff_manifold.rst9
-rw-r--r--src/doc/en/reference/manifolds/diff_map.rst9
-rw-r--r--src/doc/en/reference/manifolds/diff_scalarfield.rst9
-rw-r--r--src/doc/en/reference/manifolds/index.rst4
-rw-r--r--src/doc/en/reference/manifolds/manifold.rst15
-rw-r--r--src/doc/en/reference/manifolds/scalarfield.rst9
-rw-r--r--src/sage/manifolds/all.py3
-rw-r--r--src/sage/manifolds/chart.py101
-rw-r--r--src/sage/manifolds/continuous_map.py230
-rw-r--r--src/sage/manifolds/coord_func.py4
-rw-r--r--src/sage/manifolds/coord_func_symb.py2
-rw-r--r--src/sage/manifolds/differentiable/chart.py6
-rw-r--r--src/sage/manifolds/differentiable/diff_map.py86
-rw-r--r--src/sage/manifolds/differentiable/manifold.py123
-rw-r--r--src/sage/manifolds/differentiable/manifold_homset.py18
-rw-r--r--src/sage/manifolds/differentiable/scalarfield.py74
-rw-r--r--src/sage/manifolds/differentiable/scalarfield_algebra.py82
-rw-r--r--src/sage/manifolds/manifold.py133
-rw-r--r--src/sage/manifolds/manifold_homset.py60
-rw-r--r--src/sage/manifolds/point.py60
-rw-r--r--src/sage/manifolds/scalarfield.py243
-rw-r--r--src/sage/manifolds/scalarfield_algebra.py126
-rw-r--r--src/sage/manifolds/subset.py147
-rw-r--r--src/sage/manifolds/utilities.py50
26 files changed, 981 insertions, 642 deletions
diff --git a/src/doc/en/reference/manifolds/chart.rst b/src/doc/en/reference/manifolds/chart.rst
new file mode 100644
index 00000000..352828f
--- /dev/null
+++ b/src/doc/en/reference/manifolds/chart.rst
@@ -0,0 +1,11 @@
+Coordinate charts
+=================
+
+.. toctree::
+ :maxdepth: 2
+
+ sage/manifolds/chart
+
+ sage/manifolds/coord_func
+
+ sage/manifolds/coord_func_symb
diff --git a/src/doc/en/reference/manifolds/continuous_map.rst b/src/doc/en/reference/manifolds/continuous_map.rst
new file mode 100644
index 00000000..4b67487
--- /dev/null
+++ b/src/doc/en/reference/manifolds/continuous_map.rst
@@ -0,0 +1,9 @@
+Continuous maps
+===============
+
+.. toctree::
+ :maxdepth: 2
+
+ sage/manifolds/manifold_homset
+
+ sage/manifolds/continuous_map
diff --git a/src/doc/en/reference/manifolds/diff_manifold.rst b/src/doc/en/reference/manifolds/diff_manifold.rst
index 1dc6059..a49fda2 100644
--- a/src/doc/en/reference/manifolds/diff_manifold.rst
+++ b/src/doc/en/reference/manifolds/diff_manifold.rst
@@ -8,11 +8,6 @@ Differentiable manifolds
sage/manifolds/differentiable/chart
- sage/manifolds/differentiable/scalarfield_algebra
-
- sage/manifolds/differentiable/scalarfield
-
- sage/manifolds/differentiable/manifold_homset
-
- sage/manifolds/differentiable/diff_map
+ diff_scalarfield
+ diff_map
diff --git a/src/doc/en/reference/manifolds/diff_map.rst b/src/doc/en/reference/manifolds/diff_map.rst
new file mode 100644
index 00000000..51162b4
--- /dev/null
+++ b/src/doc/en/reference/manifolds/diff_map.rst
@@ -0,0 +1,9 @@
+Differentiable maps
+===================
+
+.. toctree::
+ :maxdepth: 2
+
+ sage/manifolds/differentiable/manifold_homset
+
+ sage/manifolds/differentiable/diff_map
diff --git a/src/doc/en/reference/manifolds/diff_scalarfield.rst b/src/doc/en/reference/manifolds/diff_scalarfield.rst
new file mode 100644
index 00000000..2991cd9
--- /dev/null
+++ b/src/doc/en/reference/manifolds/diff_scalarfield.rst
@@ -0,0 +1,9 @@
+Scalar fields
+=============
+
+.. toctree::
+ :maxdepth: 2
+
+ sage/manifolds/differentiable/scalarfield_algebra
+
+ sage/manifolds/differentiable/scalarfield
diff --git a/src/doc/en/reference/manifolds/index.rst b/src/doc/en/reference/manifolds/index.rst
index eac1337..dd546af 100644
--- a/src/doc/en/reference/manifolds/index.rst
+++ b/src/doc/en/reference/manifolds/index.rst
@@ -11,7 +11,7 @@ More documentation (in particular example worksheets) can be found
`here <http://sagemanifolds.obspm.fr/documentation.html>`_.
.. toctree::
- :maxdepth: 2
+ :maxdepth: 3
manifold
@@ -20,5 +20,3 @@ More documentation (in particular example worksheets) can be found
sage/manifolds/utilities
.. include:: ../footer.txt
-
-
diff --git a/src/doc/en/reference/manifolds/manifold.rst b/src/doc/en/reference/manifolds/manifold.rst
index 4a3d76c..0466d72 100644
--- a/src/doc/en/reference/manifolds/manifold.rst
+++ b/src/doc/en/reference/manifolds/manifold.rst
@@ -10,17 +10,8 @@ Topological manifolds
sage/manifolds/subset
- sage/manifolds/chart
+ chart
- sage/manifolds/coord_func
-
- sage/manifolds/coord_func_symb
-
- sage/manifolds/scalarfield_algebra
-
- sage/manifolds/scalarfield
-
- sage/manifolds/manifold_homset
-
- sage/manifolds/continuous_map
+ scalarfield
+ continuous_map
diff --git a/src/doc/en/reference/manifolds/scalarfield.rst b/src/doc/en/reference/manifolds/scalarfield.rst
new file mode 100644
index 00000000..99989a0
--- /dev/null
+++ b/src/doc/en/reference/manifolds/scalarfield.rst
@@ -0,0 +1,9 @@
+Scalar fields
+=============
+
+.. toctree::
+ :maxdepth: 2
+
+ sage/manifolds/scalarfield_algebra
+
+ sage/manifolds/scalarfield
diff --git a/src/sage/manifolds/all.py b/src/sage/manifolds/all.py
index 9724ef2..9918902 100644
--- a/src/sage/manifolds/all.py
+++ b/src/sage/manifolds/all.py
@@ -1,3 +1,4 @@
from manifold import TopManifold
from differentiable.manifold import DiffManifold
-from utilities import nice_derivatives, omit_function_args
+from utilities import nice_derivatives, omit_function_args, set_axes_labels
+from utilities import Manifold # deprecated
diff --git a/src/sage/manifolds/chart.py b/src/sage/manifolds/chart.py
index 927b73b..cde5f4f 100644
--- a/src/sage/manifolds/chart.py
+++ b/src/sage/manifolds/chart.py
@@ -47,9 +47,9 @@ class Chart(UniqueRepresentation, SageObject):
Chart on a topological manifold.
Given a topological manifold `M` of dimension `n` over a topological field
- `K`, a *chart* is a pair `(U,\varphi)`, where `U` is an open subset of `M`
- and `\varphi: U \rightarrow V \subset K^n` is a homeomorphism from `U` to
- an open subset `V` of `K^n`.
+ `K`, a *chart* on `M` is a pair `(U,\varphi)`, where `U` is an open subset
+ of `M` and `\varphi: U \rightarrow V \subset K^n` is a homeomorphism from
+ `U` to an open subset `V` of `K^n`.
The components `(x^1,\ldots,x^n)` of `\varphi`, defined by
`\varphi(p) = (x^1(p),\ldots,x^n(p))\in K^n` for any point `p\in U`,
@@ -57,7 +57,8 @@ class Chart(UniqueRepresentation, SageObject):
INPUT:
- - ``domain`` -- open subset `U` on which the chart is defined
+ - ``domain`` -- open subset `U` on which the chart is defined (must be
+ an instance of :class:`~sage.manifolds.manifold.TopManifold`)
- ``coordinates`` -- (default: '' (empty string)) single string defining
the coordinate symbols, with ' ' (whitespace) as a separator; each item
has at most two fields, separated by ':':
@@ -74,7 +75,7 @@ class Chart(UniqueRepresentation, SageObject):
used via Sage preparser (see examples below)
- ``names`` -- (default: ``None``) unused argument, except if
``coordinates`` is not provided; it must then be a tuple containing
- the coordinate symbols (this is guaranted if the shortcut operator
+ the coordinate symbols (this is guaranteed if the shortcut operator
``<,>`` is used).
EXAMPLES:
@@ -549,21 +550,22 @@ class Chart(UniqueRepresentation, SageObject):
def restrict(self, subset, restrictions=None):
r"""
- Return the restriction of ``self`` to some subset.
+ Return the restriction of the chart to some open subset of its domain.
- If ``self`` is the chart `(U,\varphi)`, a restriction (or subchart)
+ If the current chart is `(U,\varphi)`, a *restriction* (or *subchart*)
is a chart `(V,\psi)` such that `V\subset U` and `\psi = \varphi |_V`.
If such subchart has not been defined yet, it is constructed here.
The coordinates of the subchart bare the same names as the coordinates
- of the mother chart.
+ of the current chart.
INPUT:
- - ``subset`` -- open subset `V` of the chart domain `U`
- - ``restrictions`` -- (default: ``None``) list of coordinate restrictions
- defining the subset `V`.
+ - ``subset`` -- open subset `V` of the chart domain `U` (must be an
+ instance of :class:`~sage.manifolds.manifold.TopManifold`)
+ - ``restrictions`` -- (default: ``None``) list of coordinate
+ restrictions defining the subset `V`.
A restriction can be any symbolic equality or
inequality involving the coordinates, such as x>y or x^2+y^2 != 0.
The items of the list ``restrictions`` are combined with the ``and``
@@ -597,8 +599,8 @@ class Chart(UniqueRepresentation, SageObject):
return self
if subset not in self._dom_restrict:
if not subset.is_subset(self._domain):
- raise ValueError("The specified subset is not a subset " +
- "of the domain of definition of the chart.")
+ raise ValueError("the specified subset is not a subset " +
+ "of the domain of definition of the chart")
coordinates = ""
for coord in self._xx:
coordinates += repr(coord) + ' '
@@ -1047,8 +1049,8 @@ class RealChart(Chart):
r"""
Chart on a topological manifold over `\RR`.
- Given a topological manifold `M` of dimension `n` over `\RR`, a *chart* is
- a pair `(U,\varphi)`, where `U` is an open subset of `M` and
+ Given a topological manifold `M` of dimension `n` over `\RR`, a *chart*
+ on `M` is a pair `(U,\varphi)`, where `U` is an open subset of `M` and
`\varphi: U \rightarrow V \subset \RR^n` is a homeomorphism from `U` to
an open subset `V` of `\RR^n`.
@@ -1085,7 +1087,7 @@ class RealChart(Chart):
shortcut operator ``<,>`` is used via Sage preparser (see examples below)
- ``names`` -- (default: ``None``) unused argument, except if
``coordinates`` is not provided; it must then be a tuple containing
- the coordinate symbols (this is guaranted if the shortcut operator
+ the coordinate symbols (this is guaranteed if the shortcut operator
``<,>`` is used).
EXAMPLES:
@@ -1446,8 +1448,8 @@ class RealChart(Chart):
INPUT:
- ``xx`` -- (default: ``None``) symbolic expression corresponding to a
- coordinate of ``self``; if ``None``, the ranges of all coordinates
- are displayed.
+ coordinate of the current chart; if ``None``, the ranges of all
+ coordinates are displayed.
EXAMPLES:
@@ -1633,21 +1635,22 @@ class RealChart(Chart):
def restrict(self, subset, restrictions=None):
r"""
- Return the restriction of ``self`` to some subset.
+ Return the restriction of the chart to some open subset of its domain.
- If ``self`` is the chart `(U,\varphi)`, a restriction (or subchart)
+ If the current chart is `(U,\varphi)`, a *restriction* (or *subchart*)
is a chart `(V,\psi)` such that `V\subset U` and `\psi = \varphi |_V`.
If such subchart has not been defined yet, it is constructed here.
The coordinates of the subchart bare the same names as the coordinates
- of the mother chart.
+ of the current chart.
INPUT:
- - ``subset`` -- open subset `V` of the chart domain `U`
- - ``restrictions`` -- (default: ``None``) list of coordinate restrictions
- defining the subset `V`.
+ - ``subset`` -- open subset `V` of the chart domain `U` (must be an
+ instance of :class:`~sage.manifolds.manifold.TopManifold`)
+ - ``restrictions`` -- (default: ``None``) list of coordinate
+ restrictions defining the subset `V`.
A restriction can be any symbolic equality or
inequality involving the coordinates, such as x>y or x^2+y^2 != 0.
The items of the list ``restrictions`` are combined with the ``and``
@@ -1663,7 +1666,7 @@ class RealChart(Chart):
OUTPUT:
- - chart `(V,\psi)`, as an instance of :class:`Chart`.
+ - chart `(V,\psi)`, as an instance of :class:`RealChart`.
EXAMPLES:
@@ -1696,8 +1699,8 @@ class RealChart(Chart):
return self
if subset not in self._dom_restrict:
if not subset.is_subset(self._domain):
- raise ValueError("The specified subset is not a subset " +
- "of the domain of definition of the chart.")
+ raise ValueError("the specified subset is not a subset " +
+ "of the domain of definition of the chart")
coordinates = ""
for coord in self._xx:
coordinates += repr(coord) + ' '
@@ -2155,12 +2158,12 @@ class RealChart(Chart):
if coord not in ambient_coords:
fixed_coords[coord] = 0
else:
- transf = None # to be the MultiFunctionChart relating self to
- # the ambient chart
+ transf = None # to be the MultiCoordFunction object relating self
+ # to the ambient chart
if mapping is None:
if not self._domain.is_subset(chart._domain):
- raise TypeError("the domain of {} is not ".format(self) +
- "included in that of {}".format(chart))
+ raise ValueError("the domain of {} is not ".format(self) +
+ "included in that of {}".format(chart))
coord_changes = chart._domain._coord_changes
for chart_pair in coord_changes:
if chart_pair == (self, chart):
@@ -2177,11 +2180,11 @@ class RealChart(Chart):
raise TypeError("the argument 'mapping' must be a " +
"continuous manifold map")
if not self._domain.is_subset(mapping._domain):
- raise TypeError("the domain of {} is not ".format(self) +
- "included in that of {}".format(mapping))
+ raise ValueError("the domain of {} is not ".format(self) +
+ "included in that of {}".format(mapping))
if not chart._domain.is_subset(mapping._codomain):
- raise TypeError("the domain of {} is not ".format(chart) +
- "included in the codomain of {}".format(
+ raise ValueError("the domain of {} is not ".format(chart) +
+ "included in the codomain of {}".format(
mapping))
try:
transf = mapping.coord_functions(chart1=self, chart2=chart)
@@ -2208,7 +2211,7 @@ class RealChart(Chart):
ambient_coords = tuple(ambient_coords)
nca = len(ambient_coords)
if nca != 2 and nca !=3:
- raise TypeError("bad number of ambient coordinates: {}".format(nca))
+ raise ValueError("bad number of ambient coordinates: {}".format(nca))
if ranges is None:
ranges = {}
ranges0 = {}
@@ -2277,7 +2280,7 @@ class RealChart(Chart):
xx0 = [0] * nc
if fixed_coords is not None:
if len(fixed_coords) != nc - len(coords):
- raise ValueError("Bad number of fixed coordinates.")
+ raise ValueError("bad number of fixed coordinates")
for fc, val in fixed_coords.iteritems():
xx0[self._xx.index(fc)] = val
ind_a = [chart._xx.index(ac) for ac in ambient_coords]
@@ -2518,7 +2521,7 @@ class CoordChange(SageObject):
OUTPUT:
- an instance of :class:`CoordChange` representing the inverse of
- ``self``.
+ the current coordinate transformation.
EXAMPLES:
@@ -2555,9 +2558,9 @@ class CoordChange(SageObject):
n1 = self._n1
n2 = self._n2
if n1 != n2:
- raise TypeError("the change of coordinates is not invertible " +
- "(different number of coordinates in the two " +
- "charts)")
+ raise ValueError("the change of coordinates is not invertible " +
+ "(different number of coordinates in the two " +
+ "charts)")
# New symbolic variables (different from x2 to allow for a
# correct solution even when chart2 = chart1):
if self._chart1.domain().base_field() == 'real':
@@ -2627,7 +2630,7 @@ class CoordChange(SageObject):
r"""
Sets the inverse of the coordinate transformation.
- This is usefull when the automatic computation via :meth:`inverse()`
+ This is useful when the automatic computation via :meth:`inverse()`
fails.
INPUT:
@@ -2636,7 +2639,7 @@ class CoordChange(SageObject):
list of the expressions of the "old" coordinates in terms of the
"new" ones
- ``kwds`` -- keyword arguments: only ``check=True`` (default) or
- ``check=False`` are meaningfull; it determines whether the provided
+ ``check=False`` are meaningful; it determines whether the provided
transformations are checked to be indeed the inverse coordinate
transformations.
@@ -2678,7 +2681,7 @@ class CoordChange(SageObject):
else:
check = True
self._inverse = self.__class__(self._chart2, self._chart1,
- *transformations)
+ *transformations)
if check:
print "Check of the inverse coordinate transformation:"
x1 = self._chart1._xx
@@ -2755,9 +2758,18 @@ class CoordChange(SageObject):
u = x + y
v = x - y
+ The result is cached::
+
+ sage: X_to_Y.restrict(U) is X_to_Y_U
+ True
+
"""
if dom2 is None:
dom2 = dom1
+ ch1 = self._chart1.restrict(dom1)
+ ch2 = self._chart2.restrict(dom2)
+ if (ch1, ch2) in dom1.coord_changes():
+ return dom1.coord_changes()[(ch1,ch2)]
return self.__class__(self._chart1.restrict(dom1),
self._chart2.restrict(dom2), *(self._transf.expr()))
@@ -2813,4 +2825,3 @@ class CoordChange(SageObject):
return FormattedExpansion(rtxt, rlatex)
disp = display
-
diff --git a/src/sage/manifolds/continuous_map.py b/src/sage/manifolds/continuous_map.py
index c258496..e956f35 100644
--- a/src/sage/manifolds/continuous_map.py
+++ b/src/sage/manifolds/continuous_map.py
@@ -1,14 +1,9 @@
r"""
Continuous maps between topological manifolds
-The class :class:`ContinuousMap` implements continuous maps from an open
-subset `U` of a topological manifold `M` to some topological
-manifold `N` over the same topological field `K` as `M`:
-
-.. MATH::
-
- \Phi: U\subset M \longrightarrow N
-
+The class :class:`ContinuousMap` implements continuous maps from a topological
+manifold `M` to some topological manifold `N` over the same topological field
+`K` as `M`.
AUTHORS:
@@ -18,9 +13,8 @@ REFERENCES:
- Chap. 1 of S. Kobayashi & K. Nomizu : *Foundations of Differential Geometry*,
vol. 1, Interscience Publishers (New York) (1963)
-- Chaps. 2 and 3 of J.M. Lee : *Introduction to Smooth Manifolds*, 2nd ed.,
- Springer (New York) (2013)
-
+- J.M. Lee : *Introduction to Topological Manifolds*, 2nd ed., Springer (New
+ York) (2011)
"""
@@ -45,40 +39,39 @@ class ContinuousMap(Morphism):
.. MATH::
- \Phi: U\subset M \longrightarrow V\subset N
+ \Phi: M \longrightarrow N
where `M` and `N` are topological manifolds over the same topological
- field `K`, `U` is an open subset of `M` and `V` is an open subset of `N`.
+ field `K`.
- Continuous maps are the *morphisms* of the *category* of
- topological manifolds. The set of all continuous maps from
- `U` to `V` is therefore the homset between `U` and `V` and is denoted
- by `\mathrm{Hom}(U,V)`.
+ Continuous maps are the *morphisms* of the *category* of topological
+ manifolds. The set of all continuous maps from `M` to `N` is therefore the
+ homset between `M` and `N`, which is denoted by `\mathrm{Hom}(M,N)`.
The class :class:`ContinuousMap` is a Sage *element* class, whose *parent*
class is :class:`~sage.manifolds.manifold_homset.TopManifoldHomset`.
INPUT:
- - ``parent`` -- homset `\mathrm{Hom}(U,V)` to which the continuous
+ - ``parent`` -- homset `\mathrm{Hom}(M,N)` to which the continuous
map belongs
- ``coord_functions`` -- (default: ``None``) if not ``None``, must be
a dictionary of the coordinate expressions (as lists (or tuples) of the
coordinates of the image expressed in terms of the coordinates of
the considered point) with the pairs of charts (chart1, chart2)
- as keys (chart1 being a chart on `U` and chart2 a chart on `V`).
+ as keys (chart1 being a chart on `M` and chart2 a chart on `N`).
If the dimension of the map's codomain is 1, a single coordinate
expression can be passed instead of a tuple with a single element
- ``name`` -- (default: ``None``) name given to the continuous map
- ``latex_name`` -- (default: ``None``) LaTeX symbol to denote the
- continuous map; if none is provided, the LaTeX symbol is set to
+ continuous map; if ``None``, the LaTeX symbol is set to
``name``
- ``is_isomorphism`` -- (default: ``False``) determines whether the
constructed object is a isomorphism (i.e. a homeomorphism); if set to
``True``, then the manifolds `M` and `N` must have the same dimension.
- ``is_identity`` -- (default: ``False``) determines whether the
constructed object is the identity map; if set to ``True``,
- then `V` must be `U` and the entry ``coord_functions`` is not used.
+ then `N` must be `M` and the entry ``coord_functions`` is not used.
.. NOTE::
@@ -97,15 +90,15 @@ class ContinuousMap(Morphism):
sage: V = M.open_subset('V') # complement of the South pole
sage: c_uv.<u,v> = V.chart() # stereographic coordinates from the South pole
sage: M.declare_union(U,V) # S^2 is the union of U and V
- sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)), \
- intersection_name='W', restrictions1= x^2+y^2!=0, \
- restrictions2= u^2+v^2!=0)
+ sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)),
+ ....: intersection_name='W', restrictions1= x^2+y^2!=0,
+ ....: restrictions2= u^2+v^2!=0)
sage: uv_to_xy = xy_to_uv.inverse()
sage: N = TopManifold(3, 'R^3', r'\RR^3') # R^3
sage: c_cart.<X,Y,Z> = N.chart() # Cartesian coordinates on R^3
- sage: Phi = M.continuous_map(N, \
- ....: {(c_xy, c_cart): [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)], \
- ....: (c_uv, c_cart): [2*u/(1+u^2+v^2), 2*v/(1+u^2+v^2), (1-u^2-v^2)/(1+u^2+v^2)]}, \
+ sage: Phi = M.continuous_map(N,
+ ....: {(c_xy, c_cart): [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)],
+ ....: (c_uv, c_cart): [2*u/(1+u^2+v^2), 2*v/(1+u^2+v^2), (1-u^2-v^2)/(1+u^2+v^2)]},
....: name='Phi', latex_name=r'\Phi')
sage: Phi
Continuous map Phi from the 2-dimensional topological manifold S^2 to
@@ -132,8 +125,9 @@ class ContinuousMap(Morphism):
sage: Phi1 = M.continuous_map(N, [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)], \
....: chart1=c_xy, chart2=c_cart, name='Phi', latex_name=r'\Phi')
- Since c_xy and c_cart are the default charts on respectively M and N, they
- can be omitted, so that the above declaration is equivalent to::
+ Since c_xy and c_cart are the default charts on respectively ``M`` and
+ ``N``, they can be omitted, so that the above declaration is equivalent
+ to::
sage: Phi1 = M.continuous_map(N, [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)], \
....: name='Phi', latex_name=r'\Phi')
@@ -153,7 +147,7 @@ class ContinuousMap(Morphism):
on U: (x, y) |--> (X, Y, Z) = (2*x/(x^2 + y^2 + 1), 2*y/(x^2 + y^2 + 1), (x^2 + y^2 - 1)/(x^2 + y^2 + 1))
on V: (u, v) |--> (X, Y, Z) = (2*u/(u^2 + v^2 + 1), 2*v/(u^2 + v^2 + 1), -(u^2 + v^2 - 1)/(u^2 + v^2 + 1))
- At this stage, Phi1 and Phi are fully equivalent::
+ At this stage, ``Phi1`` and ``Phi`` are fully equivalent::
sage: Phi1 == Phi
True
@@ -243,7 +237,7 @@ class ContinuousMap(Morphism):
sage: D = R2.open_subset('D', coord_def={c_xy: x^2+y^2<1}) # the open unit disk
sage: Phi = D.homeomorphism(R2, [x/sqrt(1-x^2-y^2), y/sqrt(1-x^2-y^2)],
- ....: name='Phi', latex_name=r'\Phi')
+ ....: name='Phi', latex_name=r'\Phi')
sage: Phi
Homeomorphism Phi from the Open subset D of the 2-dimensional
topological manifold R^2 to the 2-dimensional topological manifold R^2
@@ -265,7 +259,8 @@ class ContinuousMap(Morphism):
sage: q.coord()
(1/3*sqrt(3), 0)
- The inverse homeomorphism is computed by means of the method :meth:`inverse`::
+ The inverse homeomorphism is computed by means of the method
+ :meth:`inverse`::
sage: Phi.inverse()
Homeomorphism Phi^(-1) from the 2-dimensional topological manifold R^2
@@ -405,7 +400,7 @@ class ContinuousMap(Morphism):
if chart_pair[1] not in self._codomain.atlas():
raise ValueError("{} is not a chart ".format(
chart_pair[1]) +
- " defined on the {}".format(self._codomain))
+ "defined on the {}".format(self._codomain))
if n2 == 1:
# a single expression entry is allowed (instead of a
# tuple)
@@ -503,7 +498,8 @@ class ContinuousMap(Morphism):
INPUT:
- - ``other`` -- another instance of :class:`ContinuousMap` to compare with
+ - ``other`` -- another instance of :class:`ContinuousMap` to compare
+ with
OUTPUT:
@@ -546,7 +542,8 @@ class ContinuousMap(Morphism):
INPUT:
- - ``other`` -- another instance of :class:`ContinuousMap` to compare with
+ - ``other`` -- another instance of :class:`ContinuousMap` to compare
+ with
OUTPUT:
@@ -601,7 +598,7 @@ class ContinuousMap(Morphism):
def _call_(self, point):
r"""
- Compute the image of a point by ``self``.
+ Compute the image of a point by the continous map.
INPUT:
@@ -621,7 +618,8 @@ class ContinuousMap(Morphism):
sage: M = TopManifold(2, 'R^2', r'\RR^2') # Euclidean plane
sage: c_cart.<x,y> = M.chart() # Cartesian coordinates
sage: # A pi/3 rotation around the origin defined in Cartesian coordinates:
- sage: rot = M.continuous_map(M, ((x - sqrt(3)*y)/2, (sqrt(3)*x + y)/2), name='R')
+ sage: rot = M.continuous_map(M, ((x - sqrt(3)*y)/2, (sqrt(3)*x + y)/2),
+ ....: name='R')
sage: p = M.point((1,2), name='p')
sage: q = rot(p) ; q
Point R(p) on the 2-dimensional topological manifold R^2
@@ -696,7 +694,7 @@ class ContinuousMap(Morphism):
def is_identity(self):
r"""
- Check whether ``self`` is an identity map.
+ Check whether the continuous map is an identity map.
EXAMPLES:
@@ -715,7 +713,7 @@ class ContinuousMap(Morphism):
sage: a.is_identity()
False
- Of course, if the codomain of ``self`` does not coincide with its
+ Of course, if the codomain of the map does not coincide with its
domain, the outcome is ``False``::
sage: N = TopManifold(2, 'N')
@@ -814,8 +812,7 @@ class ContinuousMap(Morphism):
This applies only when the parent of ``self`` is a monoid, i.e. when
``self`` is an endomorphism of the category of topological manifolds,
- i.e. a continuous map U --> U, where U is some open subset of
- a topological manifold.
+ i.e. a continuous map M --> M, where M is a topological manifold.
INPUT:
@@ -834,7 +831,8 @@ class ContinuousMap(Morphism):
sage: f = M.continuous_map(M, [x+y, x*y], name='f')
sage: g = M.continuous_map(M, [1-y, 2+x], name='g')
sage: s = f._mul_(g); s
- Continuous map from the 2-dimensional topological manifold M to itself
+ Continuous map from the 2-dimensional topological manifold M to
+ itself
sage: s.display()
M --> M
(x, y) |--> (x - y + 3, -(x + 2)*y + x + 2)
@@ -880,7 +878,6 @@ class ContinuousMap(Morphism):
r"""
Delete the derived quantities
-
TEST::
sage: M = TopManifold(2, 'M')
@@ -908,12 +905,12 @@ class ContinuousMap(Morphism):
INPUT:
- - ``chart1`` -- (default: ``None``) chart on the map's domain; if ``None``,
- the display is performed on all the charts on the domain
+ - ``chart1`` -- (default: ``None``) chart on the map's domain; if
+ ``None``, the display is performed on all the charts on the domain
in which the map is known or computable via some change of
coordinates
- ``chart2`` -- (default: ``None``) chart on the map's codomain; if
- None, the display is performed on all the charts on the codomain
+ ``None``, the display is performed on all the charts on the codomain
in which the map is known or computable via some change of
coordinates
@@ -934,8 +931,8 @@ class ContinuousMap(Morphism):
sage: N = TopManifold(3, 'R^3', r'\RR^3') # R^3
sage: c_cart.<X,Y,Z> = N.chart() # Cartesian coordinates on R^3
sage: Phi = M.continuous_map(N, \
- ....: {(c_xy, c_cart): [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)], \
- ....: (c_uv, c_cart): [2*u/(1+u^2+v^2), 2*v/(1+u^2+v^2), (1-u^2-v^2)/(1+u^2+v^2)]}, \
+ ....: {(c_xy, c_cart): [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)],
+ ....: (c_uv, c_cart): [2*u/(1+u^2+v^2), 2*v/(1+u^2+v^2), (1-u^2-v^2)/(1+u^2+v^2)]},
....: name='Phi', latex_name=r'\Phi')
sage: Phi.display(c_xy, c_cart)
Phi: S^2 --> R^3
@@ -1081,10 +1078,10 @@ class ContinuousMap(Morphism):
INPUT:
- - ``chart1`` -- (default: ``None``) chart on the map's domain; if ``None``,
- the domain's default chart is assumed
- - ``chart2`` -- (default: ``None``) chart on the map's codomain; if
- None, the codomain's default chart is assumed
+ - ``chart1`` -- (default: ``None``) chart on the map's domain;
+ if ``None``, the domain's default chart is assumed
+ - ``chart2`` -- (default: ``None``) chart on the map's codomain;
+ if ``None``, the codomain's default chart is assumed
OUTPUT:
@@ -1102,7 +1099,8 @@ class ContinuousMap(Morphism):
sage: N = TopManifold(3, 'N')
sage: c_uv.<u,v> = M.chart()
sage: c_xyz.<x,y,z> = N.chart()
- sage: Phi = M.continuous_map(N, (u*v, u/v, u+v), name='Phi', latex_name=r'\Phi')
+ sage: Phi = M.continuous_map(N, (u*v, u/v, u+v), name='Phi',
+ ....: latex_name=r'\Phi')
sage: Phi.display()
Phi: M --> N
(u, v) |--> (x, y, z) = (u*v, u/v, u + v)
@@ -1120,7 +1118,8 @@ class ContinuousMap(Morphism):
sage: ch_uv_UV.inverse()(U,V)
(1/2*U + 1/2*V, -1/2*U + 1/2*V)
sage: c_XYZ.<X,Y,Z> = N.chart() # new chart on N
- sage: ch_xyz_XYZ = c_xyz.transition_map(c_XYZ, [2*x-3*y+z, y+z-x, -x+2*y-z])
+ sage: ch_xyz_XYZ = c_xyz.transition_map(c_XYZ,
+ ....: [2*x-3*y+z, y+z-x, -x+2*y-z])
sage: ch_xyz_XYZ.inverse()(X,Y,Z)
(3*X + Y + 4*Z, 2*X + Y + 3*Z, X + Y + Z)
sage: Phi.coord_functions(c_UV, c_xyz)
@@ -1131,9 +1130,10 @@ class ContinuousMap(Morphism):
-((u - 1)*v^2 - u*v - u)/v, -((u + 1)*v^2 + u*v - 2*u)/v) on the
Chart (M, (u, v))
sage: Phi.coord_functions(c_UV, c_XYZ)
- Coordinate functions (-1/2*(U^3 - (U - 2)*V^2 + V^3 - (U^2 + 2*U + 6)*V
- - 6*U)/(U - V), 1/4*(U^3 - (U + 4)*V^2 + V^3 - (U^2 - 4*U + 4)*V - 4*U)/(U - V),
- 1/4*(U^3 - (U - 4)*V^2 + V^3 - (U^2 + 4*U + 8)*V - 8*U)/(U - V))
+ Coordinate functions
+ (-1/2*(U^3 - (U - 2)*V^2 + V^3 - (U^2 + 2*U + 6)*V - 6*U)/(U - V),
+ 1/4*(U^3 - (U + 4)*V^2 + V^3 - (U^2 - 4*U + 4)*V - 4*U)/(U - V),
+ 1/4*(U^3 - (U - 4)*V^2 + V^3 - (U^2 + 4*U + 8)*V - 8*U)/(U - V))
on the Chart (M, (U, V))
Coordinate representation w.r.t. a subchart in the domain::
@@ -1250,9 +1250,9 @@ class ContinuousMap(Morphism):
# 4/ If this point is reached, the demanded value cannot be
# computed
- raise ValueError("the expression of the map in the pair of " +
- "charts (" + str(chart1) + ", " + str(chart2) + ") cannot " +
- "be computed by means of known changes of charts")
+ raise ValueError("the expression of the map in the pair " +
+ "({}, {})".format(chart1, chart2) + " cannot " +
+ "be computed by means of known changes of charts")
return self._coord_expression[(chart1, chart2)]
@@ -1266,10 +1266,10 @@ class ContinuousMap(Morphism):
INPUT:
- - ``chart1`` -- (default: ``None``) chart on the map's domain; if ``None``,
- the domain's default chart is assumed
- - ``chart2`` -- (default: ``None``) chart on the map's codomain; if
- None, the codomain's default chart is assumed
+ - ``chart1`` -- (default: ``None``) chart on the map's domain;
+ if ``None``, the domain's default chart is assumed
+ - ``chart2`` -- (default: ``None``) chart on the map's codomain;
+ if ``None``, the codomain's default chart is assumed
OUTPUT:
@@ -1286,7 +1286,8 @@ class ContinuousMap(Morphism):
sage: N = TopManifold(3, 'N')
sage: c_uv.<u,v> = M.chart()
sage: c_xyz.<x,y,z> = N.chart()
- sage: Phi = M.continuous_map(N, (u*v, u/v, u+v), name='Phi', latex_name=r'\Phi')
+ sage: Phi = M.continuous_map(N, (u*v, u/v, u+v), name='Phi',
+ ....: latex_name=r'\Phi')
sage: Phi.display()
Phi: M --> N
(u, v) |--> (x, y, z) = (u*v, u/v, u + v)
@@ -1304,7 +1305,8 @@ class ContinuousMap(Morphism):
sage: ch_uv_UV.inverse()(U,V)
(1/2*U + 1/2*V, -1/2*U + 1/2*V)
sage: c_XYZ.<X,Y,Z> = N.chart() # new chart on N
- sage: ch_xyz_XYZ = c_xyz.transition_map(c_XYZ, [2*x-3*y+z, y+z-x, -x+2*y-z])
+ sage: ch_xyz_XYZ = c_xyz.transition_map(c_XYZ,
+ ....: [2*x-3*y+z, y+z-x, -x+2*y-z])
sage: ch_xyz_XYZ.inverse()(X,Y,Z)
(3*X + Y + 4*Z, 2*X + Y + 3*Z, X + Y + Z)
sage: Phi.expr(c_UV, c_xyz)
@@ -1314,7 +1316,9 @@ class ContinuousMap(Morphism):
-((u - 1)*v^2 - u*v - u)/v,
-((u + 1)*v^2 + u*v - 2*u)/v)
sage: Phi.expr(c_UV, c_XYZ)
- (-1/2*(U^3 - (U - 2)*V^2 + V^3 - (U^2 + 2*U + 6)*V - 6*U)/(U - V), 1/4*(U^3 - (U + 4)*V^2 + V^3 - (U^2 - 4*U + 4)*V - 4*U)/(U - V), 1/4*(U^3 - (U - 4)*V^2 + V^3 - (U^2 + 4*U + 8)*V - 8*U)/(U - V))
+ (-1/2*(U^3 - (U - 2)*V^2 + V^3 - (U^2 + 2*U + 6)*V - 6*U)/(U - V),
+ 1/4*(U^3 - (U + 4)*V^2 + V^3 - (U^2 - 4*U + 4)*V - 4*U)/(U - V),
+ 1/4*(U^3 - (U - 4)*V^2 + V^3 - (U^2 + 4*U + 8)*V - 8*U)/(U - V))
A rotation in some Euclidean plane::
@@ -1328,7 +1332,8 @@ class ContinuousMap(Morphism):
Expression of the rotation in terms of Cartesian coordinates::
sage: c_cart.<x,y> = M.chart() # Declaration of Cartesian coordinates
- sage: ch_spher_cart = c_spher.transition_map(c_cart, [r*cos(ph), r*sin(ph)]) # relation to spherical coordinates
+ sage: ch_spher_cart = c_spher.transition_map(c_cart,
+ ....: [r*cos(ph), r*sin(ph)]) # relation to spherical coordinates
sage: ch_spher_cart.set_inverse(sqrt(x^2+y^2), atan2(y,x))
Check of the inverse coordinate transformation:
r == r
@@ -1370,14 +1375,16 @@ class ContinuousMap(Morphism):
sage: c_cart = c_xy.restrict(U) # Cartesian coordinates on U
sage: c_spher.<r,ph> = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi') # spherical coordinates on U
sage: # Links between spherical coordinates and Cartesian ones:
- sage: ch_cart_spher = c_cart.transition_map(c_spher, [sqrt(x*x+y*y), atan2(y,x)])
+ sage: ch_cart_spher = c_cart.transition_map(c_spher,
+ ....: [sqrt(x*x+y*y), atan2(y,x)])
sage: ch_cart_spher.set_inverse(r*cos(ph), r*sin(ph))
Check of the inverse coordinate transformation:
x == x
y == y
r == r
ph == arctan2(r*sin(ph), r*cos(ph))
- sage: rot = U.continuous_map(U, ((x - sqrt(3)*y)/2, (sqrt(3)*x + y)/2), name='R')
+ sage: rot = U.continuous_map(U, ((x - sqrt(3)*y)/2, (sqrt(3)*x + y)/2),
+ ....: name='R')
sage: rot.display(c_cart, c_cart)
R: U --> U
(x, y) |--> (-1/2*sqrt(3)*y + 1/2*x, 1/2*sqrt(3)*x + 1/2*y)
@@ -1394,7 +1401,8 @@ class ContinuousMap(Morphism):
sage: rot._coord_expression
{(Chart (U, (r, ph)),
- Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph) on the Chart (U, (r, ph))}
+ Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph)
+ on the Chart (U, (r, ph))}
It is recovered (thanks to the known change of coordinates) by a call
to :meth:`display`::
@@ -1408,25 +1416,26 @@ class ContinuousMap(Morphism):
Chart (U, (x, y))): Coordinate functions (-1/2*sqrt(3)*y + 1/2*x,
1/2*sqrt(3)*x + 1/2*y) on the Chart (U, (x, y)),
(Chart (U, (r, ph)),
- Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph) on the Chart (U, (r, ph))}
+ Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph)
+ on the Chart (U, (r, ph))}
"""
if self._is_identity:
raise NotImplementedError("set_expr() must not be used for the " +
"identity map")
if chart1 not in self._domain.atlas():
- raise ValueError("The " + str(chart1) +
- " has not been defined on the " + str(self._domain))
+ raise ValueError("the {}".format(chart1) +
+ " has not been defined on the {}".format(self._domain))
if chart2 not in self._codomain.atlas():
- raise ValueError("The " + str(chart2) +
- " has not been defined on the " + str(self._codomain))
+ raise ValueError("the {}".format(chart2) +
+ " has not been defined on the {}".format(self._codomain))
self._coord_expression.clear()
self._del_derived()
n2 = self._codomain.dim()
if n2 > 1:
if len(coord_functions) != n2:
- raise ValueError(str(n2) +
- " coordinate function must be provided.")
+ raise ValueError("{} coordinate functions must ".format(n2) +
+ "be provided.")
self._coord_expression[(chart1, chart2)] = \
chart1.multifunction(*coord_functions)
else:
@@ -1453,7 +1462,7 @@ class ContinuousMap(Morphism):
.. WARNING::
If the map has already expressions in other charts, it
- is the user's responsability to make sure that the expression
+ is the user's responsibility to make sure that the expression
to be added is consistent with them.
EXAMPLES:
@@ -1475,7 +1484,8 @@ class ContinuousMap(Morphism):
y == y
r == r
ph == arctan2(r*sin(ph), r*cos(ph))
- sage: rot = U.continuous_map(U, ((x - sqrt(3)*y)/2, (sqrt(3)*x + y)/2), name='R')
+ sage: rot = U.continuous_map(U, ((x - sqrt(3)*y)/2, (sqrt(3)*x + y)/2),
+ ....: name='R')
sage: rot.display(c_cart, c_cart)
R: U --> U
(x, y) |--> (-1/2*sqrt(3)*y + 1/2*x, 1/2*sqrt(3)*x + 1/2*y)
@@ -1506,7 +1516,8 @@ class ContinuousMap(Morphism):
Chart (U, (x, y))): Coordinate functions (-1/2*sqrt(3)*y + 1/2*x,
1/2*sqrt(3)*x + 1/2*y) on the Chart (U, (x, y)),
(Chart (U, (r, ph)),
- Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph) on the Chart (U, (r, ph))}
+ Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph)
+ on the Chart (U, (r, ph))}
If, on the contrary, we use :meth:`set_expr`, the expression in
Cartesian coordinates is lost::
@@ -1514,7 +1525,8 @@ class ContinuousMap(Morphism):
sage: rot.set_expr(c_spher, c_spher, (r, ph+pi/3))
sage: rot._coord_expression
{(Chart (U, (r, ph)),
- Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph) on the Chart (U, (r, ph))}
+ Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph)
+ on the Chart (U, (r, ph))}
It is recovered (thanks to the known change of coordinates) by a call
to :meth:`display`::
@@ -1528,7 +1540,8 @@ class ContinuousMap(Morphism):
Chart (U, (x, y))): Coordinate functions (-1/2*sqrt(3)*y + 1/2*x,
1/2*sqrt(3)*x + 1/2*y) on the Chart (U, (x, y)),
(Chart (U, (r, ph)),
- Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph) on the Chart (U, (r, ph))}
+ Chart (U, (r, ph))): Coordinate functions (r, 1/3*pi + ph)
+ on the Chart (U, (r, ph))}
The rotation can be applied to a point by means of either coordinate
system::
@@ -1545,17 +1558,17 @@ class ContinuousMap(Morphism):
raise NotImplementedError("add_expr() must not be used for the " +
"identity map")
if chart1 not in self._domain.atlas():
- raise ValueError("The " + str(chart1) +
- " has not been defined on the " + str(self._domain))
+ raise ValueError("the {}".format(chart1) +
+ " has not been defined on the {}".format(self._domain))
if chart2 not in self._codomain.atlas():
- raise ValueError("The " + str(chart2) +
- " has not been defined on the " + str(self._codomain))
+ raise ValueError("the {}".format(chart2) +
+ " has not been defined on the {}".format(self._codomain))
self._del_derived()
n2 = self._codomain.dim()
if n2 > 1:
if len(coord_functions) != n2:
- raise ValueError(str(n2) +
- " coordinate function must be provided.")
+ raise ValueError("{} coordinate functions must ".format(n2) +
+ "be provided")
self._coord_expression[(chart1, chart2)] = \
chart1.multifunction(*coord_functions)
else:
@@ -1564,20 +1577,22 @@ class ContinuousMap(Morphism):
def restrict(self, subdomain, subcodomain=None):
r"""
- Restriction of the continuous map to some subdomain of its
+ Restriction of the continuous map to some open subset of its
domain of definition.
INPUT:
- - ``subdomain`` -- the subdomain of ``self._domain`` (instance of
- :class:`~sage.manifolds.manifold.TopManifold`)
- - ``subcodomain`` -- (default: ``None``) subdomain of ``self._codomain``;
- if ``None``, ``self._codomain`` is assumed.
+ - ``subdomain`` -- an open subset of the domain of the continuous map
+ (must be an instance of :class:`~sage.manifolds.manifold.TopManifold`)
+ - ``subcodomain`` -- (default: ``None``) an open subset of the codomain
+ of the continuous map (must be an instance of
+ :class:`~sage.manifolds.manifold.TopManifold`); if ``None``, the
+ codomain of the continuous map is assumed.
OUTPUT:
- - the restriction of ``self`` to ``dom``, as an instance of
- class :class:`ContinuousMap`
+ - the restriction of the continuous map to ``subdomain``, as an
+ instance of class :class:`ContinuousMap`
EXAMPLE:
@@ -1587,7 +1602,8 @@ class ContinuousMap(Morphism):
sage: M = TopManifold(2, 'R^2') # R^2
sage: c_xy.<x,y> = M.chart() # Cartesian coord. on R^2
sage: D = M.open_subset('D', coord_def={c_xy: x^2+y^2<1}) # the open unit disk
- sage: Phi = D.continuous_map(M, [x/sqrt(1-x^2-y^2), y/sqrt(1-x^2-y^2)], name='Phi', latex_name=r'\Phi')
+ sage: Phi = D.continuous_map(M, [x/sqrt(1-x^2-y^2), y/sqrt(1-x^2-y^2)],
+ ....: name='Phi', latex_name=r'\Phi')
sage: Phi.display()
Phi: D --> R^2
(x, y) |--> (x, y) = (x/sqrt(-x^2 - y^2 + 1), y/sqrt(-x^2 - y^2 + 1))
@@ -1595,7 +1611,8 @@ class ContinuousMap(Morphism):
sage: U = D.open_subset('U', coord_def={c_xy_D: x^2+y^2>1/2}) # the annulus 1/2 < r < 1
sage: Phi.restrict(U)
Continuous map Phi from the Open subset U of the 2-dimensional
- topological manifold R^2 to the 2-dimensional topological manifold R^2
+ topological manifold R^2 to the 2-dimensional topological
+ manifold R^2
sage: Phi.restrict(U).parent()
Set of Morphisms from Open subset U of the 2-dimensional topological
manifold R^2 to 2-dimensional topological manifold R^2 in Category
@@ -1671,7 +1688,8 @@ class ContinuousMap(Morphism):
else:
for sch2 in ch2._subcharts:
if (ch1, sch2) in resu._coord_expression:
- del resu._coord_expression[(ch1, sch2)]
+ del resu._coord_expression[(ch1,
+ sch2)]
coord_functions = \
self._coord_expression[charts].expr()
resu._coord_expression[(ch1, ch2)] = \
@@ -1682,7 +1700,7 @@ class ContinuousMap(Morphism):
def __invert__(self):
r"""
- Return the inverse of ``self`` if ``self`` is a isomorphism.
+ Return the inverse of the map whenever it is an isomorphism.
OUTPUT:
@@ -1696,7 +1714,8 @@ class ContinuousMap(Morphism):
sage: M = TopManifold(2, 'R^2', r'\RR^2')
sage: c_cart.<x,y> = M.chart()
sage: # A pi/3 rotation around the origin:
- sage: rot = M.homeomorphism(M, ((x - sqrt(3)*y)/2, (sqrt(3)*x + y)/2), name='R')
+ sage: rot = M.homeomorphism(M, ((x - sqrt(3)*y)/2, (sqrt(3)*x + y)/2),
+ ....: name='R')
sage: rot.inverse()
Homeomorphism R^(-1) of the 2-dimensional topological manifold R^2
sage: rot.inverse().display()
@@ -1734,11 +1753,12 @@ class ContinuousMap(Morphism):
sage: V = M.open_subset('V') # complement of the South pole
sage: c_uv.<u,v> = V.chart() # stereographic coordinates from the South pole
sage: M.declare_union(U,V) # S^2 is the union of U and V
- sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)), \
- intersection_name='W', restrictions1= x^2+y^2!=0, \
- restrictions2= u^2+v^2!=0)
+ sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)),
+ ....: intersection_name='W', restrictions1= x^2+y^2!=0,
+ ....: restrictions2= u^2+v^2!=0)
sage: uv_to_xy = xy_to_uv.inverse()
- sage: s = M.homeomorphism(M, {(c_xy, c_uv): [x, y], (c_uv, c_xy): [u, v]}, name='s')
+ sage: s = M.homeomorphism(M, {(c_xy, c_uv): [x, y], (c_uv, c_xy): [u, v]},
+ ....: name='s')
sage: s.display()
s: M --> M
on U: (x, y) |--> (u, v) = (x, y)
diff --git a/src/sage/manifolds/coord_func.py b/src/sage/manifolds/coord_func.py
index c66964d..fc4def0 100644
--- a/src/sage/manifolds/coord_func.py
+++ b/src/sage/manifolds/coord_func.py
@@ -502,7 +502,7 @@ class CoordFunction(SageObject):
def __call__(self, *coords, **options):
r"""
- Computes the value of the function at specified coordinates.
+ Compute the value of the function at specified coordinates.
INPUT:
@@ -1658,7 +1658,6 @@ class MultiCoordFunction(SageObject):
[[True, True], [True, True], [True, True]]
"""
- from sage.matrix.constructor import matrix
if self._jacob is None:
xx = self._chart[:] # coordinates x^j
self._jacob = [[ self._functions[i].diff(xx[j])
@@ -1760,4 +1759,3 @@ class MultiCoordFunction(SageObject):
self.jacobian() # forces the computation of self._jacob
self._jacob_det = simple_determinant(self._jacob)
return self._jacob_det
-
diff --git a/src/sage/manifolds/coord_func_symb.py b/src/sage/manifolds/coord_func_symb.py
index ca7c6fa..e90b977 100644
--- a/src/sage/manifolds/coord_func_symb.py
+++ b/src/sage/manifolds/coord_func_symb.py
@@ -436,7 +436,7 @@ class CoordFunctionSymb(CoordFunction):
def __call__(self, *coords, **options):
r"""
- Computes the value of the function at specified coordinates.
+ Compute the value of the function at specified coordinates.
INPUT:
diff --git a/src/sage/manifolds/differentiable/chart.py b/src/sage/manifolds/differentiable/chart.py
index 09bd5a7..baf466f 100644
--- a/src/sage/manifolds/differentiable/chart.py
+++ b/src/sage/manifolds/differentiable/chart.py
@@ -69,7 +69,7 @@ class DiffChart(Chart):
used via Sage preparser (see examples below)
- ``names`` -- (default: ``None``) unused argument, except if
``coordinates`` is not provided; it must then be a tuple containing
- the coordinate symbols (this is guaranted if the shortcut operator
+ the coordinate symbols (this is guaranteed if the shortcut operator
``<,>`` is used).
EXAMPLES:
@@ -421,7 +421,7 @@ class RealDiffChart(DiffChart, RealChart):
shortcut operator ``<,>`` is used via Sage preparser (see examples below)
- ``names`` -- (default: ``None``) unused argument, except if
``coordinates`` is not provided; it must then be a tuple containing
- the coordinate symbols (this is guaranted if the shortcut operator
+ the coordinate symbols (this is guaranteed if the shortcut operator
``<,>`` is used).
EXAMPLES:
@@ -626,7 +626,7 @@ class RealDiffChart(DiffChart, RealChart):
"""
RealChart.__init__(self, domain, coordinates=coordinates, names=names)
- #!# vector frame shall be initialized here
+ #!# vector frame shall be initialized here in ticket #18843
#*****************************************************************************
diff --git a/src/sage/manifolds/differentiable/diff_map.py b/src/sage/manifolds/differentiable/diff_map.py
index 87359aa..324756f 100644
--- a/src/sage/manifolds/differentiable/diff_map.py
+++ b/src/sage/manifolds/differentiable/diff_map.py
@@ -1,14 +1,13 @@
r"""
Differentiable maps between differentiable manifolds
-The class :class:`DiffMap` implements differentiable maps from an open
-subset `U` of a differentiable manifold `M` to some differentiable
-manifold `N` over the same topological field `K` as `M` (in most
-applications, `K = \RR` or `K = \CC`):
+The class :class:`DiffMap` implements differentiable maps from a differentiable
+manifold `M` to a differentiable manifold `N` over the same topological field
+`K` as `M` (in most applications, `K = \RR` or `K = \CC`):
.. MATH::
- \Phi: U\subset M \longrightarrow N
+ \Phi: M \longrightarrow N
AUTHORS:
@@ -17,10 +16,10 @@ AUTHORS:
REFERENCES:
-.. [1] Chap. 1 of S. Kobayashi & K. Nomizu : *Foundations of Differential Geometry*,
- vol. 1, Interscience Publishers (New York) (1963)
-.. [2] Chaps. 2 and 3 of J.M. Lee : *Introduction to Smooth Manifolds*, 2nd ed.,
- Springer (New York) (2013)
+.. [1] Chap. 1 of S. Kobayashi & K. Nomizu : *Foundations of Differential
+ Geometry*, vol. 1, Interscience Publishers (New York) (1963)
+.. [2] Chaps. 2 and 3 of J.M. Lee : *Introduction to Smooth Manifolds*,
+ 2nd ed., Springer (New York) (2013)
"""
@@ -44,16 +43,15 @@ class DiffMap(ContinuousMap):
.. MATH::
- \Phi: U\subset M \longrightarrow V\subset N
+ \Phi: M \longrightarrow N
where `M` and `N` are differentiable manifolds over the same topological
- field `K` (in most applications, `K = \RR` or `K = \CC`), `U` is an open
- subset of `M` and `V` is an open subset of `N`.
+ field `K` (in most applications, `K = \RR` or `K = \CC`).
Differentiable maps are the *morphisms* of the *category* of
- differentiable manifolds. The set of all differentiable maps from
- `U` to `V` is therefore the homset between `U` and `V` and is denoted
- by `\mathrm{Hom}(U,V)`.
+ differentiable manifolds. The set of all differentiable maps from `M` to
+ `N` is therefore the homset between `M` and `N`, which is denoted by
+ `\mathrm{Hom}(M,N)`.
The class :class:`DiffMap` is a Sage *element* class, whose *parent*
class is
@@ -64,13 +62,13 @@ class DiffMap(ContinuousMap):
INPUT:
- - ``parent`` -- homset `\mathrm{Hom}(U,V)` to which the differentiable
+ - ``parent`` -- homset `\mathrm{Hom}(M,N)` to which the differentiable
map belongs
- ``coord_functions`` -- (default: ``None``) if not ``None``, must be
a dictionary of the coordinate expressions (as lists (or tuples) of the
coordinates of the image expressed in terms of the coordinates of
the considered point) with the pairs of charts (chart1, chart2)
- as keys (chart1 being a chart on `U` and chart2 a chart on `V`).
+ as keys (chart1 being a chart on `M` and chart2 a chart on `N`).
If the dimension of codomain is 1, a single coordinate
expression can be passed instead of a tuple with a single element
- ``name`` -- (default: ``None``) name given to the differentiable map
@@ -82,7 +80,7 @@ class DiffMap(ContinuousMap):
``True``, then the manifolds `M` and `N` must have the same dimension.
- ``is_identity`` -- (default: ``False``) determines whether the
constructed object is the identity map; if set to ``True``,
- then `V` must be `U` and the entry ``coord_functions`` is not used.
+ then `N` must be `M` and the entry ``coord_functions`` is not used.
.. NOTE::
@@ -102,19 +100,19 @@ class DiffMap(ContinuousMap):
sage: V = M.open_subset('V') # complement of the South pole
sage: c_uv.<u,v> = V.chart() # stereographic coordinates from the South pole
sage: M.declare_union(U,V) # S^2 is the union of U and V
- sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)), \
- intersection_name='W', restrictions1= x^2+y^2!=0, \
- restrictions2= u^2+v^2!=0)
+ sage: xy_to_uv = c_xy.transition_map(c_uv, (x/(x^2+y^2), y/(x^2+y^2)),
+ ....: intersection_name='W', restrictions1= x^2+y^2!=0,
+ ....: restrictions2= u^2+v^2!=0)
sage: uv_to_xy = xy_to_uv.inverse()
sage: N = DiffManifold(3, 'R^3', r'\RR^3') # R^3
sage: c_cart.<X,Y,Z> = N.chart() # Cartesian coordinates on R^3
- sage: Phi = M.diff_map(N, \
- ....: {(c_xy, c_cart): [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)], \
- ....: (c_uv, c_cart): [2*u/(1+u^2+v^2), 2*v/(1+u^2+v^2), (1-u^2-v^2)/(1+u^2+v^2)]}, \
+ sage: Phi = M.diff_map(N,
+ ....: {(c_xy, c_cart): [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)],
+ ....: (c_uv, c_cart): [2*u/(1+u^2+v^2), 2*v/(1+u^2+v^2), (1-u^2-v^2)/(1+u^2+v^2)]},
....: name='Phi', latex_name=r'\Phi')
sage: Phi
- Differentiable map Phi from the 2-dimensional differentiable manifold S^2 to
- the 3-dimensional differentiable manifold R^3
+ Differentiable map Phi from the 2-dimensional differentiable manifold
+ S^2 to the 3-dimensional differentiable manifold R^3
sage: Phi.parent()
Set of Morphisms from 2-dimensional differentiable manifold S^2 to
3-dimensional differentiable manifold R^3 in Category of sets
@@ -124,8 +122,10 @@ class DiffMap(ContinuousMap):
<class 'sage.manifolds.differentiable.diff_map.DiffManifoldHomset_with_category.element_class'>
sage: Phi.display()
Phi: S^2 --> R^3
- on U: (x, y) |--> (X, Y, Z) = (2*x/(x^2 + y^2 + 1), 2*y/(x^2 + y^2 + 1), (x^2 + y^2 - 1)/(x^2 + y^2 + 1))
- on V: (u, v) |--> (X, Y, Z) = (2*u/(u^2 + v^2 + 1), 2*v/(u^2 + v^2 + 1), -(u^2 + v^2 - 1)/(u^2 + v^2 + 1))
+ on U: (x, y) |--> (X, Y, Z) = (2*x/(x^2 + y^2 + 1), 2*y/(x^2 + y^2 + 1),
+ (x^2 + y^2 - 1)/(x^2 + y^2 + 1))
+ on V: (u, v) |--> (X, Y, Z) = (2*u/(u^2 + v^2 + 1), 2*v/(u^2 + v^2 + 1),
+ -(u^2 + v^2 - 1)/(u^2 + v^2 + 1))
It is possible to create the map via the method
:meth:`~sage.manifolds.differentiable.manifold.DiffManifold.diff_map`
@@ -134,13 +134,17 @@ class DiffMap(ContinuousMap):
arguments ``chart1`` and ``chart2`` have to be provided if the charts
differ from the default ones on the domain and/or the codomain::
- sage: Phi1 = M.diff_map(N, [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)],
- ....: chart1=c_xy, chart2=c_cart, name='Phi', latex_name=r'\Phi')
+ sage: Phi1 = M.diff_map(N, [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2),
+ ....: (x^2+y^2-1)/(1+x^2+y^2)],
+ ....: chart1=c_xy, chart2=c_cart, name='Phi',
+ ....: latex_name=r'\Phi')
- Since c_xy and c_cart are the default charts on respectively M and N, they
- can be omitted, so that the above declaration is equivalent to::
+ Since ``c_xy`` and ``c_cart`` are the default charts on respectively ``M``
+ and ``N``, they can be omitted, so that the above declaration is equivalent
+ to::
- sage: Phi1 = M.diff_map(N, [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2), (x^2+y^2-1)/(1+x^2+y^2)],
+ sage: Phi1 = M.diff_map(N, [2*x/(1+x^2+y^2), 2*y/(1+x^2+y^2),
+ ....: (x^2+y^2-1)/(1+x^2+y^2)],
....: name='Phi', latex_name=r'\Phi')
With such a declaration, the differentiable map is only partially defined
@@ -163,7 +167,7 @@ class DiffMap(ContinuousMap):
on V: (u, v) |--> (X, Y, Z) = (2*u/(u^2 + v^2 + 1), 2*v/(u^2 + v^2 + 1),
-(u^2 + v^2 - 1)/(u^2 + v^2 + 1))
- At this stage, Phi1 and Phi are fully equivalent::
+ At this stage, ``Phi1`` and ``Phi`` are fully equivalent::
sage: Phi1 == Phi
True
@@ -175,12 +179,12 @@ class DiffMap(ContinuousMap):
The map acts on points::
- sage: np = M.point((0,0), chart=c_uv) # the North pole
+ sage: np = M.point((0,0), chart=c_uv, name='N') # the North pole
sage: Phi(np)
- Point on the 3-dimensional differentiable manifold R^3
+ Point Phi(N) on the 3-dimensional differentiable manifold R^3
sage: Phi(np).coord() # Cartesian coordinates
(0, 0, 1)
- sage: sp = M.point((0,0), chart=c_xy) # the South pole
+ sage: sp = M.point((0,0), chart=c_xy, name='S') # the South pole
sage: Phi(sp).coord() # Cartesian coordinates
(0, 0, -1)
@@ -192,7 +196,7 @@ class DiffMap(ContinuousMap):
sage: P = DiffManifold(2, 'R^2', r'\RR^2') # R^2 (equatorial plane)
sage: cP.<xP, yP> = P.chart()
sage: Psi = N.diff_map(P, (X/(1-Z), Y/(1-Z)), name='Psi',
- ....: latex_name=r'\Psi')
+ ....: latex_name=r'\Psi')
sage: Psi
Differentiable map Psi from the 3-dimensional differentiable manifold
R^3 to the 2-dimensional differentiable manifold R^2
@@ -227,7 +231,7 @@ class DiffMap(ContinuousMap):
sage: N = DiffManifold(1, 'N')
sage: c_N = N.chart('X')
- sage: Phi = M.diff_map(N, {(c_xy, c_N): x^2+y^2, \
+ sage: Phi = M.diff_map(N, {(c_xy, c_N): x^2+y^2,
....: (c_uv, c_N): 1/(u^2+v^2)}) # not ...[1/(u^2+v^2)] or (1/(u^2+v^2),)
An example of differentiable map `\RR \rightarrow \RR^2`::
@@ -345,8 +349,8 @@ class DiffMap(ContinuousMap):
True
"""
- def __init__(self, parent, coord_functions=None, name=None, latex_name=None,
- is_isomorphism=False, is_identity=False):
+ def __init__(self, parent, coord_functions=None, name=None,
+ latex_name=None, is_isomorphism=False, is_identity=False):
r"""
Construct a differentiable map.
diff --git a/src/sage/manifolds/differentiable/manifold.py b/src/sage/manifolds/differentiable/manifold.py
index 0abf4d6..2653b0a 100644
--- a/src/sage/manifolds/differentiable/manifold.py
+++ b/src/sage/manifolds/differentiable/manifold.py
@@ -85,9 +85,9 @@ and `V`::
sage: M.declare_union(U,V)
and we provide the transition map between the charts ``stereoN`` = `(U, (x, y))`
-and ``stereoS`` = `(V, (u, v))`, denoting by W the intersection of U and V
-(W is the subset of U defined by `x^2+y^2\not=0`, as well as the subset of V
-defined by`u^2+v^2\not=0`)::
+and ``stereoS`` = `(V, (u, v))`, denoting by `W` the intersection of `U` and
+`V` (`W` is the subset of `U` defined by `x^2+y^2\not=0`, as well as the subset
+of `V` defined by `u^2+v^2\not=0`)::
sage: stereoN_to_S = stereoN.transition_map(stereoS,
....: [x/(x^2+y^2), y/(x^2+y^2)], intersection_name='W',
@@ -123,7 +123,6 @@ At this stage, we have four open subsets on `S^2`::
sage: N in W or S in W
False
-
The North pole lies in `V` and the South pole in `U`::
sage: N in V, N in U
@@ -185,6 +184,7 @@ A differentiable scalar field on the sphere::
sage: f.parent().category()
Category of commutative algebras over Symbolic Ring
+
.. RUBRIC:: Example 2: the Riemann sphere as a differentiable manifold of
dimension 1 over `\CC`
@@ -289,6 +289,8 @@ REFERENCES:
.. [5] W. Bertram : *Differential Geometry, Lie Groups and Symmetric Spaces
over General Base Fields and Rings*, Memoirs of the American Mathematical
Society, vol. 192 (2008); :doi:`10.1090/memo/0900`; :arxiv:`math/0502168`
+.. [6] M. Berger & B. Gostiaux : *Differential Geometry: Manifolds, Curves and
+ Surfaces*, Springer (New York) (1988); :doi:`10.1007/978-1-4612-1033-7`
"""
@@ -307,10 +309,11 @@ from sage.categories.sets_cat import Sets
#*# After #18175:
# from sage.categories.manifolds import Manifolds
from sage.categories.homset import Hom
-from sage.rings.infinity import infinity
+from sage.rings.infinity import infinity, minus_infinity
from sage.misc.latex import latex
from sage.manifolds.manifold import TopManifold
-from sage.manifolds.differentiable.scalarfield_algebra import DiffScalarFieldAlgebra
+from sage.manifolds.differentiable.scalarfield_algebra import \
+ DiffScalarFieldAlgebra
class DiffManifold(TopManifold):
r"""
@@ -351,7 +354,7 @@ class DiffManifold(TopManifold):
- ``start_index`` -- (default: 0) integer; lower value of the range of
indices used for "indexed objects" on the manifold, e.g. coordinates
in a chart
- - ``category`` -- (default: ``None``) to specify the categeory; the
+ - ``category`` -- (default: ``None``) to specify the category; the
default being ``Sets()`` (``DiffManifolds()`` after :trac:`18175` is
implemented)
- ``ambient_manifold`` -- (default: ``None``) ``None`` or a differentiable
@@ -487,7 +490,7 @@ class DiffManifold(TopManifold):
ambient_manifold = self
elif not isinstance(ambient_manifold, DiffManifold):
raise TypeError("the argument 'ambient_manifold' must be " +
- " a differentiable manifold")
+ "a differentiable manifold")
TopManifold.__init__(self, n, name, latex_name=latex_name, field=field,
start_index=start_index, category=category,
ambient_manifold=ambient_manifold)
@@ -547,8 +550,9 @@ class DiffManifold(TopManifold):
r"""
Return the manifold's degree of differentiability.
- The degree of differentiablity is the integer `k` (possibly `k=\infty`)
- such that the manifold is a `C^k`-manifold over its base field.
+ The degree of differentiability is the integer `k` (possibly
+ `k=\infty`) such that the manifold is a `C^k`-manifold over its base
+ field.
EXAMPLES::
@@ -649,16 +653,31 @@ class DiffManifold(TopManifold):
field=self._field, diff_degree=self._diff_degree,
start_index=self._sindex, category=self.category(),
ambient_manifold=self._manifold)
+ #!# NB: the above could have been
+ # resu = type(self).__base__(...) instead of resu = DiffManifold(...)
+ # to allow for open_subset() of derived classes to call first this
+ # version,
+ # but, because of the category framework, it could NOT have been
+ # resu = self.__class__(...)
+ # cf. the discussion in
+ # https://groups.google.com/forum/#!topic/sage-devel/jHlFxhMDf3Y
resu._supersets.update(self._supersets)
for sd in self._supersets:
sd._subsets.add(resu)
self._top_subsets.add(resu)
+ # Charts on the result from the coordinate definition:
for chart, restrictions in coord_def.iteritems():
if chart not in self._atlas:
- raise ValueError("the " + str(chart) + "does not belong to " +
- "the atlas of " + str(self))
+ raise ValueError("the {} does not belong to ".format(chart) +
+ "the atlas of {}".format(self))
chart.restrict(resu, restrictions)
- #!# update tensor spaces
+ # Transition maps on the result inferred from those of self:
+ for chart1 in coord_def:
+ for chart2 in coord_def:
+ if chart2 != chart1:
+ if (chart1, chart2) in self._coord_changes:
+ self._coord_changes[(chart1, chart2)].restrict(resu)
+ #!# update vector frames and change of frames
return resu
def chart(self, coordinates='', names=None):
@@ -710,7 +729,7 @@ class DiffManifold(TopManifold):
below)
- ``names`` -- (default: ``None``) unused argument, except if
``coordinates`` is not provided; it must then be a tuple containing
- the coordinate symbols (this is guaranted if the shortcut operator
+ the coordinate symbols (this is guaranteed if the shortcut operator
``<,>`` is used).
OUTPUT:
@@ -965,6 +984,31 @@ class DiffManifold(TopManifold):
coord_functions = {(chart1, chart2): coord_functions}
return homset(coord_functions, name=name, latex_name=latex_name)
+ def diff_mapping(self, codomain, coord_functions=None, chart1=None,
+ chart2=None, name=None, latex_name=None):
+ r"""
+ Deprecated.
+
+ Use :meth:`diff_map` instead.
+
+ EXAMPLE::
+
+ sage: M = DiffManifold(2, 'M'); X.<x,y> = M.chart()
+ sage: N = DiffManifold(2, 'M'); Y.<u,v> = N.chart()
+ sage: Phi = M.diff_mapping(N, {(X,Y): [x+y, x-y]}, name='Phi')
+ doctest:...: DeprecationWarning: Use diff_map() instead.
+ See http://trac.sagemath.org/18783 for details.
+ sage: Phi
+ Differentiable map Phi from the 2-dimensional differentiable
+ manifold M to itself
+
+ """
+ from sage.misc.superseded import deprecation
+ deprecation(18783, 'Use diff_map() instead.')
+ return self.diff_map(codomain, coord_functions=coord_functions,
+ chart1=chart1, chart2=chart2, name=name,
+ latex_name=latex_name)
+
def diffeomorphism(self, codomain, coord_functions=None, chart1=None,
chart2=None, name=None, latex_name=None):
r"""
@@ -1016,6 +1060,7 @@ class DiffManifold(TopManifold):
sage: DiffManifold._clear_cache_() # for doctests only
sage: M = DiffManifold(2, 'M') # the open unit disk
+ sage: forget() # for doctests only
sage: c_xy.<x,y> = M.chart('x:(-1,1) y:(-1,1)') # Cartesian coord on M
sage: c_xy.add_restrictions(x^2+y^2<1)
sage: N = DiffManifold(2, 'N') # R^2
@@ -1061,53 +1106,3 @@ class DiffManifold(TopManifold):
coord_functions = {(chart1, chart2): coord_functions}
return homset(coord_functions, name=name, latex_name=latex_name,
is_isomorphism=True)
-
- def identity_map(self):
- r"""
- Identity map of the manifold.
-
- The identity map of a differentiable manifold `M` is the trivial
- diffeomorphism
-
- .. MATH::
-
- \begin{array}{cccc}
- \mathrm{Id}_M: & M & \longrightarrow & M \\
- & p & \longmapsto & p
- \end{array}
-
- See :class:`~sage.manifolds.differentiable.diff_map.DiffMap` for a
- complete documentation.
-
- OUTPUT:
-
- - the identity map, as an instance of
- :class:`~sage.manifolds.differentiable.diff_map.DiffMap`
-
- EXAMPLE:
-
- Identity map of a complex manifold::
-
- sage: M = DiffManifold(2, 'M', field='complex')
- sage: X.<x,y> = M.chart()
- sage: id = M.identity_map(); id
- Identity map Id_M of the 2-dimensional complex manifold M
- sage: id.parent()
- Set of Morphisms from 2-dimensional complex manifold M to
- 2-dimensional complex manifold M in Category of sets
- sage: id.display()
- Id_M: M --> M
- (x, y) |--> (x, y)
-
- The identity map acting on a point::
-
- sage: p = M((1+I, 3-I), name='p'); p
- Point p on the 2-dimensional complex manifold M
- sage: id(p)
- Point p on the 2-dimensional complex manifold M
- sage: id(p) == p
- True
-
- """
- return self._identity_map
-
diff --git a/src/sage/manifolds/differentiable/manifold_homset.py b/src/sage/manifolds/differentiable/manifold_homset.py
index 70305d6..f914e16 100644
--- a/src/sage/manifolds/differentiable/manifold_homset.py
+++ b/src/sage/manifolds/differentiable/manifold_homset.py
@@ -14,8 +14,8 @@ REFERENCES:
.. [1] J.M. Lee : *Introduction to Smooth Manifolds*, 2nd ed., Springer
(New York) (2013)
-.. [2] S. Kobayashi & K. Nomizu : *Foundations of Differential Geometry*, vol. 1,
- Interscience Publishers (New York) (1963)
+.. [2] S. Kobayashi & K. Nomizu : *Foundations of Differential Geometry*,
+ vol. 1, Interscience Publishers (New York) (1963)
"""
#******************************************************************************
@@ -36,26 +36,24 @@ class DiffManifoldHomset(TopManifoldHomset):
Given two differentiable manifolds `M` and `N` over a topological field `K`,
the class :class:`DiffManifoldHomset` implements the set
- `\mathrm{Hom}(U,V)` of morphisms (i.e. differentiable maps)
- `U\rightarrow V`, where `U` is an open subset of `M` and `V` an open
- subset of `N`. Note that, as open subsets of differentiable manifolds, `U`
- and `V` are differentiable manifolds by themselves.
+ `\mathrm{Hom}(M,N)` of morphisms (i.e. differentiable maps)
+ `M\rightarrow N`.
This is a Sage *parent* class, whose *element* class is
:class:`~sage.manifolds.differentiable.diff_map.DiffMap`.
INPUT:
- - ``domain`` -- open subset `U\subset M` (domain of the morphisms),
+ - ``domain`` -- differentiable manifold `M` (domain of the morphisms),
as an instance of
:class:`~sage.manifolds.differentiable.manifold.DiffManifold`
- - ``codomain`` -- open subset `V\subset N` (codomain of the morphisms),
+ - ``codomain`` -- differentiable manifold `N` (codomain of the morphisms),
as an instance of
:class:`~sage.manifolds.differentiable.manifold.DiffManifold`
- ``name`` -- (default: ``None``) string; name given to the homset; if
- none is provided, Hom(U,V) will be used
+ none is provided, Hom(M,N) will be used
- ``latex_name`` -- (default: ``None``) string; LaTeX symbol to denote the
- homset; if none is provided, `\mathrm{Hom}(U,V)` will be used
+ homset; if none is provided, `\mathrm{Hom}(M,N)` will be used
EXAMPLES:
diff --git a/src/sage/manifolds/differentiable/scalarfield.py b/src/sage/manifolds/differentiable/scalarfield.py
index bf70613..9aaa0a1 100644
--- a/src/sage/manifolds/differentiable/scalarfield.py
+++ b/src/sage/manifolds/differentiable/scalarfield.py
@@ -3,13 +3,13 @@ Differentiable scalar fields
Given a differentiable manifold `M` of class `C^k` over a topological field `K`
(in most applications, `K = \RR` or `K = \CC`), a *differentiable scalar field*
-on `M` is a map of class `C^k`
+on `M` is a map
.. MATH::
- f: U\subset M \longrightarrow K
+ f: M \longrightarrow K
-where `U` is an open subset of `M`.
+of class `C^k`.
Differentiable scalar fields are implemented by the class
:class:`DiffScalarField`.
@@ -45,12 +45,12 @@ class DiffScalarField(ScalarField):
Differentiable scalar field on a differentiable manifold.
Given a differentiable manifold `M` of class `C^k` over a topological field
- `K` (in most applications, `K = \RR` or `K = \CC`), and an open subset `U`
- of `M`, a *differentiable scalar field* defined on `U` a map
+ `K` (in most applications, `K = \RR` or `K = \CC`), a *differentiable
+ scalar field* defined on `M` is a map
.. MATH::
- f: U\subset M \longrightarrow K
+ f: M \longrightarrow K
that is `k`-times continuously differentiable.
@@ -58,12 +58,12 @@ class DiffScalarField(ScalarField):
*parent* class is
:class:`~sage.manifolds.differentiable.scalarfield_algebra.DiffScalarFieldAlgebra`.
It inherits from the class :class:`~sage.manifolds.scalarfield.ScalarField`
- devoted to generic continuous scalar fields on a topological manifold.
+ devoted to generic continuous scalar fields on topological manifolds.
INPUT:
- - ``domain`` -- the manifold open subset `U` on which the scalar field is
- defined (must be an instance of class
+ - ``domain`` -- the differentiable manifold `M` on which the scalar field
+ is defined (must be an instance of class
:class:`~sage.manifolds.differentiable.manifold.DiffManifold`)
- ``coord_expression`` -- (default: ``None``) coordinate expression(s) of
the scalar field; this can be either
@@ -118,18 +118,21 @@ class DiffScalarField(ScalarField):
can be passed instead of the dictionary over the charts::
sage: g = U.scalar_field(x*y, chart=c_xy, name='g') ; g
- Scalar field g on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field g on the Open subset U of the 2-dimensional differentiable
+ manifold M
The above is indeed equivalent to::
sage: g = U.scalar_field({c_xy: x*y}, name='g') ; g
- Scalar field g on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field g on the Open subset U of the 2-dimensional differentiable
+ manifold M
Since ``c_xy`` is the default chart of ``U``, the argument ``chart`` can
be skipped::
sage: g = U.scalar_field(x*y, name='g') ; g
- Scalar field g on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field g on the Open subset U of the 2-dimensional differentiable
+ manifold M
The scalar field `g` is defined on `U` and has an expression in terms of
the coordinates `(u,v)` on `W=U\cap V`::
@@ -183,7 +186,8 @@ class DiffScalarField(ScalarField):
coordinates::
sage: h = U.scalar_field(function('H', x, y), name='h') ; h
- Scalar field h on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field h on the Open subset U of the 2-dimensional differentiable
+ manifold M
sage: h.display()
h: U --> R
(x, y) |--> H(x, y)
@@ -427,13 +431,15 @@ class DiffScalarField(ScalarField):
sage: g.domain()
Open subset U of the 2-dimensional differentiable manifold M
sage: s = f + g ; s
- Scalar field on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field on the Open subset U of the 2-dimensional differentiable
+ manifold M
sage: s.domain()
Open subset U of the 2-dimensional differentiable manifold M
sage: s.display()
U --> R
(x, y) |--> (x*y^3 + (x^3 + x)*y + 1)/(x^2 + y^2 + 1)
- on W: (u, v) |--> (u^6 + 3*u^4*v^2 + 3*u^2*v^4 + v^6 + u*v^3 + (u^3 + u)*v)/(u^6 + v^6 + (3*u^2 + 1)*v^4 + u^4 + (3*u^4 + 2*u^2)*v^2)
+ on W: (u, v) |--> (u^6 + 3*u^4*v^2 + 3*u^2*v^4 + v^6 + u*v^3
+ + (u^3 + u)*v)/(u^6 + v^6 + (3*u^2 + 1)*v^4 + u^4 + (3*u^4 + 2*u^2)*v^2)
The operation actually performed is `f|_U + g`::
@@ -443,7 +449,7 @@ class DiffScalarField(ScalarField):
In Sage framework, the addition of `f` and `g` is permitted because
there is a *coercion* of the parent of `f`, namely `C^k(M)`, to
the parent of `g`, namely `C^k(U)` (see
- :class:`~sage.manifolds.scalarfield_algebra.ScalarFieldAlgebra`)::
+ :class:`~sage.manifolds.differentiable.scalarfield_algebra.DiffScalarFieldAlgebra`)::
sage: CM = M.scalar_field_algebra()
sage: CU = U.scalar_field_algebra()
@@ -509,7 +515,8 @@ class DiffScalarField(ScalarField):
on U: (x, y) |--> 1/(x^4 + y^4 + 2*(x^2 + 1)*y^2 + 2*x^2 + 1)
on V: (u, v) |--> (u^4 + 2*u^2*v^2 + v^4)/(u^4 + v^4 + 2*(u^2 + 1)*v^2 + 2*u^2 + 1)
sage: s = g*h ; s
- Scalar field g*h on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field g*h on the Open subset U of the 2-dimensional
+ differentiable manifold M
sage: s.display()
g*h: U --> R
(x, y) |--> x*y*H(x, y)
@@ -524,7 +531,8 @@ class DiffScalarField(ScalarField):
(2-dimensional differentiable manifold M,
Open subset U of the 2-dimensional differentiable manifold M)
sage: s = f*g ; s
- Scalar field on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field on the Open subset U of the 2-dimensional differentiable
+ manifold M
sage: s.display()
U --> R
(x, y) |--> x*y/(x^2 + y^2 + 1)
@@ -541,13 +549,15 @@ class DiffScalarField(ScalarField):
on U: (x, y) |--> 1/(a*x^2 + a*y^2 + a)
on V: (u, v) |--> (u^2 + v^2)/(a*u^2 + a*v^2 + a)
sage: s = g/h ; s
- Scalar field g/h on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field g/h on the Open subset U of the 2-dimensional
+ differentiable manifold M
sage: s.display()
g/h: U --> R
(x, y) |--> x*y/H(x, y)
on W: (u, v) |--> u*v/((u^4 + 2*u^2*v^2 + v^4)*H(u/(u^2 + v^2), v/(u^2 + v^2)))
sage: s = f/g ; s
- Scalar field on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field on the Open subset U of the 2-dimensional differentiable
+ manifold M
sage: s.display()
U --> R
(x, y) |--> 1/(x*y^3 + (x^3 + x)*y)
@@ -559,7 +569,8 @@ class DiffScalarField(ScalarField):
arithmetics with symbolic expressions involving the chart coordinates::
sage: s = g + x^2 - y ; s
- Scalar field on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field on the Open subset U of the 2-dimensional differentiable
+ manifold M
sage: s.display()
U --> R
(x, y) |--> x^2 + (x - 1)*y
@@ -568,7 +579,8 @@ class DiffScalarField(ScalarField):
::
sage: s = g*x ; s
- Scalar field on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field on the Open subset U of the 2-dimensional differentiable
+ manifold M
sage: s.display()
U --> R
(x, y) |--> x^2*y
@@ -577,13 +589,15 @@ class DiffScalarField(ScalarField):
::
sage: s = g/x ; s
- Scalar field on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field on the Open subset U of the 2-dimensional differentiable
+ manifold M
sage: s.display()
U --> R
(x, y) |--> y
on W: (u, v) |--> v/(u^2 + v^2)
sage: s = x/g ; s
- Scalar field on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field on the Open subset U of the 2-dimensional differentiable
+ manifold M
sage: s.display()
U --> R
(x, y) |--> 1/y
@@ -633,7 +647,7 @@ class DiffScalarField(ScalarField):
"""
ScalarField._init_derived(self) # derived quantities of the mother class
- self._differential = None # differential 1-form of the scalar field
+ # More to come in ticket #18843
def _del_derived(self):
r"""
@@ -646,13 +660,17 @@ class DiffScalarField(ScalarField):
sage: f = M.scalar_field({X: x+y})
sage: U = M.open_subset('U', coord_def={X: x>0})
sage: f.restrict(U)
- Scalar field on the Open subset U of the 2-dimensional differentiable manifold M
+ Scalar field on the Open subset U of the 2-dimensional
+