summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Scrimshaw <tscrimsh at umn.edu>2015-11-19 13:53:41 -0600
committerTravis Scrimshaw <tscrimsh at umn.edu>2015-11-19 13:53:41 -0600
commit0b08b114e03c063bd2e500ac900fd843fb12673b (patch)
treec887cd8a06526c06ae8a0896940d3db04a37c990
parentMerge branch 'public/manifolds/top_manif_basics' of trac.sagemath.org:sage in... (diff)
Some small tweaks as part of the review.
-rw-r--r--src/sage/manifolds/chart.py179
-rw-r--r--src/sage/manifolds/manifold.py170
-rw-r--r--src/sage/manifolds/point.py14
-rw-r--r--src/sage/manifolds/subset.py4
4 files changed, 181 insertions, 186 deletions
diff --git a/src/sage/manifolds/chart.py b/src/sage/manifolds/chart.py
index fc281cb..660007b 100644
--- a/src/sage/manifolds/chart.py
+++ b/src/sage/manifolds/chart.py
@@ -14,12 +14,11 @@ AUTHORS:
REFERENCES:
-- Chap. 2 of J.M. Lee : *Introduction to Topological Manifolds*, 2nd ed.,
- Springer (New York) (2011)
-
-- Chap. 1 of J.M. Lee : *Introduction to Smooth Manifolds*, 2nd ed., Springer
- (New York) (2013)
+- Chap. 2 of [Lee11]_ J.M. Lee: *Introduction to Topological Manifolds*,
+ 2nd ed., Springer (New York) (2011)
+- Chap. 1 of [Lee13]_ J.M. Lee : *Introduction to Smooth Manifolds*,
+ 2nd ed., Springer (New York) (2013)
"""
#*****************************************************************************
@@ -48,32 +47,32 @@ class Chart(WithEqualityById, SageObject):
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`,
- are called the *coordinates* of the chart `(U,\varphi)`.
+ 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`, are called the *coordinates* of the chart `(U, \varphi)`.
INPUT:
- ``domain`` -- open subset `U` on which the chart is defined (must be
an instance of :class:`~sage.manifolds.manifold.TopologicalManifold`)
- - ``coordinates`` -- (default: '' (empty string)) single string defining
- the coordinate symbols, with ' ' (whitespace) as a separator; each item
- has at most two fields, separated by ':':
+ - ``coordinates`` -- (default: ``''`` (empty string)) single string
+ defining the coordinate symbols, with ``' '`` (whitespace) as a
+ separator; each item has at most two fields, separated by ``:``:
- 1. The coordinate symbol (a letter or a few letters)
- 2. (optional) The LaTeX spelling of the coordinate; if not provided the
- coordinate symbol given in the first field will be used.
+ 1. The coordinate symbol (a letter or a few letters)
+ 2. (optional) The LaTeX spelling of the coordinate; if not provided the
+ coordinate symbol given in the first field will be used.
If it contains any LaTeX expression, the string ``coordinates`` must be
declared with the prefix 'r' (for "raw") to allow for a proper treatment
of LaTeX's backslash character (see examples below).
If no LaTeX spelling is to be set for any coordinate, the argument
``coordinates`` can be omitted when the shortcut operator ``<,>`` is
- used via Sage preparser (see examples below)
+ 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 guaranteed if the shortcut operator
- ``<,>`` is used).
+ ``<,>`` is used)
EXAMPLES:
@@ -87,7 +86,8 @@ class Chart(WithEqualityById, SageObject):
sage: type(X)
<class 'sage.manifolds.chart.Chart'>
- To manipulate the coordinates `(x,y)` as global variables, one has to set::
+ To manipulate the coordinates `(x,y)` as global variables,
+ one has to set::
sage: x,y = X[:]
@@ -106,11 +106,6 @@ class Chart(WithEqualityById, SageObject):
sage: x is X[0] and y is X[1]
True
- The trick is performed by Sage preparser::
-
- sage: preparse("X.<x,y> = M.chart()")
- "X = M.chart(names=('x', 'y',)); (x, y,) = X._first_ngens(2)"
-
Note that ``x`` and ``y`` declared in ``<x,y>`` are mere Python variable
names and do not have to coincide with the coordinate symbols;
for instance, one may write::
@@ -135,12 +130,12 @@ class Chart(WithEqualityById, SageObject):
sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart()
- In the above example, the chart X covers entirely the manifold M::
+ In the above example, the chart X covers entirely the manifold ``M``::
sage: X.domain()
Complex 2-dimensional topological manifold M
- Of course, one may declare a chart only on an open subset of M::
+ Of course, one may declare a chart only on an open subset of ``M``::
sage: U = M.open_subset('U')
sage: Y.<z1, z2> = U.chart(r'z1:\zeta_1 z2:\zeta_2'); Y
@@ -211,8 +206,8 @@ class Chart(WithEqualityById, SageObject):
charts whose name can be skipped in the argument list of functions having
an optional ``chart=`` argument.
- The chart map `\varphi` acting on a point is obtained by means of the
- call operator, i.e. the operator ``()``::
+ The chart map `\varphi` acting on a point is obtained by passing
+ it as an input to the map::
sage: p = M.point((1+i, 2), chart=X); p
Point on the Complex 2-dimensional topological manifold M
@@ -266,10 +261,7 @@ class Chart(WithEqualityById, SageObject):
# _init_coordinates, which sets self._xx and
# which may be redefined for subclasses (for instance RealChart).
self._init_coordinates(coord_list)
- coord_string = ''
- for x in self._xx:
- coord_string += str(x) + ' '
- coord_string = coord_string[:-1]
+ coord_string = ' '.join(str(x) for x in self._xx)
if coord_string in self._domain._charts_by_coord:
raise ValueError("the chart with coordinates " + coord_string +
" has already been declared on " +
@@ -354,15 +346,11 @@ class Chart(WithEqualityById, SageObject):
sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart()
- sage: X._repr_()
- 'Chart (M, (x, y))'
- sage: repr(X) # indirect doctest
- 'Chart (M, (x, y))'
- sage: X # indirect doctest
+ sage: X
Chart (M, (x, y))
"""
- return 'Chart (' + self._domain._name + ', ' + str(self._xx) + ')'
+ return 'Chart ({}, {})'.format(self._domain._name, self._xx)
def _latex_(self):
r"""
@@ -377,7 +365,7 @@ class Chart(WithEqualityById, SageObject):
sage: Y.<z1, z2> = M.chart(r'z1:\zeta_1 z2:\zeta2')
sage: Y._latex_()
'\\left(M,({\\zeta_1}, {\\zeta2})\\right)'
- sage: latex(Y) # indirect doctest
+ sage: latex(Y)
\left(M,({\zeta_1}, {\zeta2})\right)
"""
@@ -402,7 +390,7 @@ class Chart(WithEqualityById, SageObject):
def __reduce__(self):
r"""
- Reduction function for the pickle protocole.
+ Reduction function for the pickle protocol.
TESTS::
@@ -480,7 +468,7 @@ class Chart(WithEqualityById, SageObject):
it does not require ``loads(dumps(self)) == self``.
It however checks that ``loads(dumps(self))`` proceeds without any
error and results in an object that is a chart with the same
- coordinates as self.
+ coordinates as ``self``.
TESTS::
@@ -504,13 +492,13 @@ class Chart(WithEqualityById, SageObject):
INPUT:
- - ``i`` -- index of the coordinate; if [:] all the coordinates
- are returned
+ - ``i`` -- index of the coordinate; if the slice ``[:]``, then all
+ the coordinates are returned
OUTPUT:
- the coordinate of index ``i`` or all the coordinates (as a tuple) if
- ``i`` is [:]
+ ``i`` is the slice ``[:]``
EXAMPLES::
@@ -535,9 +523,20 @@ class Chart(WithEqualityById, SageObject):
sage: X[:]
(x, y)
+ We check that slices are properly shifted as well::
+
+ sage: X[2:]
+ (y,)
+ sage: X[:2]
+ (x,)
"""
if isinstance(i, slice):
- return self._xx
+ start,stop = i.start,i.stop
+ if start is not None:
+ start -= self._manifold._sindex
+ if stop is not None:
+ stop -= self._manifold._sindex
+ return self._xx[start:stop:i.step]
else:
return self._xx[i-self._manifold._sindex]
@@ -761,8 +760,8 @@ class Chart(WithEqualityById, SageObject):
else:
parameters = None
# Check of restrictions:
- if self._restrictions != []:
- substitutions = dict(zip(self._xx, coordinates))
+ if self._restrictions:
+ substitutions = {x: coordintes[i] for i,x in enumerate(self._xx)}
if parameters:
substitutions.update(parameters)
for restrict in self._restrictions:
@@ -782,10 +781,10 @@ class Chart(WithEqualityById, SageObject):
restrictions1=None, restrictions2=None):
r"""
Construct the transition map between the current chart,
- `(U,\varphi)` say, and another one, `(V,\psi)` say.
+ `(U, \varphi)` say, and another one, `(V, \psi)` say.
- If `n` is the manifold's dimension, the *transition map* is the
- map
+ If `n` is the manifold's dimension, the *transition map*
+ is the map
.. MATH::
@@ -793,19 +792,19 @@ class Chart(WithEqualityById, SageObject):
\rightarrow \psi(U\cap V) \subset K^n,
where `K` is the manifold's base field. In other words, the
- transition map expresses the coordinates `(y^1,\ldots,y^n)` of
- `(V,\psi)` in terms of the coordinates `(x^1,\ldots,x^n)` of
- `(U,\varphi)` on the open subset where the two charts intersect, i.e.
- on `U\cap V`.
+ transition map expresses the coordinates `(y^1, \ldots, y^n)` of
+ `(V, \psi)` in terms of the coordinates `(x^1, \ldots, x^n)` of
+ `(U, \varphi)` on the open subset where the two charts intersect,
+ i.e. on `U \cap V`.
INPUT:
- - ``other`` -- the chart `(V,\psi)`
- - ``transformations`` -- tuple (or list) `(Y_1,\ldots,Y_2)`, where
+ - ``other`` -- the chart `(V, \psi)`
+ - ``transformations`` -- tuple (or list) `(Y_1, \ldots, Y_n)`, where
`Y_i` is the symbolic expression of the coordinate `y^i` in terms
- of the coordinates `(x^1,\ldots,x^n)`
+ of the coordinates `(x^1, \ldots, x^n)`
- ``intersection_name`` -- (default: ``None``) name to be given to the
- subset `U\cap V` if the latter differs from `U` or `V`
+ subset `U \cap V` if the latter differs from `U` or `V`
- ``restrictions1`` -- (default: ``None``) list of conditions on the
coordinates of the current chart that define `U\cap V` if the
latter differs from `U`. ``restrictions1`` must be a list of
@@ -825,8 +824,8 @@ class Chart(WithEqualityById, SageObject):
OUTPUT:
- - The transition map `\psi\circ\varphi^{-1}` defined on `U\cap V`, as an
- instance of :class:`CoordChange`.
+ - the transition map `\psi \circ \varphi^{-1}` defined on
+ `U \cap V`, as an instance of :class:`CoordChange`
EXAMPLES:
@@ -859,8 +858,8 @@ class Chart(WithEqualityById, SageObject):
sage: M.atlas()
[Chart (U, (x,)), Chart (V, (y,)), Chart (W, (x,)), Chart (W, (y,))]
- Transition map between the spherical chart and the Cartesian one on
- `\RR^2`::
+ Transition map between the spherical chart and the Cartesian
+ one on `\RR^2`::
sage: M = Manifold(2, 'R^2', type='topological')
sage: c_cart.<x,y> = M.chart()
@@ -874,7 +873,7 @@ class Chart(WithEqualityById, SageObject):
x = r*cos(phi)
y = r*sin(phi)
- In this case, no new subset has been created since `U\cap M = U`::
+ In this case, no new subset has been created since `U \cap M = U`::
sage: M.list_of_subsets()
[2-dimensional topological manifold R^2,
@@ -912,9 +911,9 @@ class RealChart(Chart):
`\varphi: U \rightarrow V \subset \RR^n` is a homeomorphism from `U` to
an open subset `V` of `\RR^n`.
- The components `(x^1,\ldots,x^n)` of `\varphi`, defined by
- `\varphi(p) = (x^1(p),\ldots,x^n(p))\in \RR^n` for any point `p\in U`,
- are called the *coordinates* of the chart `(U,\varphi)`.
+ The components `(x^1, \ldots, x^n)` of `\varphi`, defined by
+ `\varphi(p) = (x^1(p), \ldots, x^n(p))\in \RR^n` for any point `p \in U`,
+ are called the *coordinates* of the chart `(U, \varphi)`.
INPUT:
@@ -979,14 +978,9 @@ class RealChart(Chart):
sage: y is c_cart[2]
True
- The trick is performed by Sage preparser::
-
- sage: preparse("c_cart.<x,y,z> = M.chart()")
- "c_cart = M.chart(names=('x', 'y', 'z',)); (x, y, z,) = c_cart._first_ngens(3)"
-
Note that ``x, y, z`` declared in ``<x,y,z>`` are mere Python variable
- names and do not have to coincide with the coordinate symbols; for instance,
- one may write::
+ names and do not have to coincide with the coordinate symbols; for
+ instance, one may write::
sage: M = Manifold(3, 'R^3', r'\RR^3', type='topological', start_index=1)
sage: c_cart.<x1,y1,z1> = M.chart('x y z'); c_cart
@@ -1008,7 +1002,7 @@ class RealChart(Chart):
sage: c_cart.<x,y,z> = M.chart()
Spherical coordinates on the subset `U` of `\RR^3` that is the
- complement of the half-plane `\{y=0, x\geq 0\}`::
+ complement of the half-plane `\{y=0, x \geq 0\}`::
sage: U = M.open_subset('U')
sage: c_spher.<r,th,ph> = U.chart(r'r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi')
@@ -1036,7 +1030,7 @@ class RealChart(Chart):
sage: (x1, x2, x3) == (r, th, ph)
True
- The full set of coordinates is obtained by means of the operator [:]::
+ The full set of coordinates is obtained by means of the slice ``[:]``::
sage: c_cart[:]
(x, y, z)
@@ -1073,7 +1067,6 @@ class RealChart(Chart):
sage: U.atlas()
[Chart (U, (r, th, ph))]
-
Manifold subsets have a *default chart*, which, unless changed via the
method
:meth:`~sage.manifolds.manifold.TopologicalManifold.set_default_chart`,
@@ -1110,8 +1103,8 @@ class RealChart(Chart):
Cartesian coordinates on `U` as an example of chart construction with
coordinate restrictions: since `U` is the complement of the half-plane
- `\{y=0, x\geq 0\}`, we must have `y\not=0` or `x<0` on U. Accordingly,
- we set::
+ `\{y = 0, x \geq 0\}`, we must have `y \neq 0` or `x < 0` on U.
+ Accordingly, we set::
sage: c_cartU.<x,y,z> = U.chart()
sage: c_cartU.add_restrictions((y!=0, x<0)) # the tuple (y!=0, x<0) means y!=0 or x<0
@@ -1244,17 +1237,16 @@ class RealChart(Chart):
OUTPUT:
- the coordinate bounds as the tuple
- ((xmin, min_included), (xmax, max_included))
- where
-
- - xmin is the coordinate lower bound
- - min_included is a Boolean, indicating whether the coordinate can
- take the value xmin, i.e. xmin is a strict lower bound iff
- min_included is False.
- - xmin is the coordinate upper bound
- - max_included is a Boolean, indicating whether the coordinate can
- take the value xmax, i.e. xmax is a strict upper bound iff
- max_included is False.
+ ``((xmin, min_included), (xmax, max_included))`` where
+
+ - ``xmin`` is the coordinate lower bound
+ - ``min_included`` is a boolean, indicating whether the coordinate
+ can take the value ``xmin``, i.e. ``xmin`` is a strict lower
+ bound iff ``min_included`` is ``False``
+ - ``xmin`` is the coordinate upper bound
+ - ``max_included`` is a boolean, indicating whether the coordinate
+ can take the value ``xmax``, i.e. ``xmax`` is a strict upper
+ bound iff ``max_included`` is ``False``
EXAMPLES:
@@ -1301,9 +1293,9 @@ class RealChart(Chart):
INPUT:
- - ``xx`` -- (default: ``None``) symbolic expression corresponding to a
- coordinate of the current chart; if ``None``, the ranges of all
- coordinates are displayed.
+ - ``xx`` -- (default: ``None``) symbolic expression corresponding
+ to a coordinate of the current chart; if ``None``, the ranges of
+ all coordinates are displayed
EXAMPLES:
@@ -2037,12 +2029,12 @@ class CoordChange(SageObject):
- ``dom1`` -- open subset of the domain of ``chart1``
- ``dom2`` -- (default: ``None``) open subset of the domain of
- ``chart2``; if ``None``, ``dom1`` is assumed.
+ ``chart2``; if ``None``, ``dom1`` is assumed
OUTPUT:
- - the transition map between the charts restricted to the specified
- subsets.
+ - the transition map between the charts restricted to the
+ specified subsets
EXAMPLE::
@@ -2131,3 +2123,4 @@ class CoordChange(SageObject):
return FormattedExpansion(rtxt, rlatex)
disp = display
+
diff --git a/src/sage/manifolds/manifold.py b/src/sage/manifolds/manifold.py
index 6a6ed52..4abf1bb 100644
--- a/src/sage/manifolds/manifold.py
+++ b/src/sage/manifolds/manifold.py
@@ -9,18 +9,19 @@ dimension* `n` *over K* is a topological space `M` such that
- `M` is second countable,
- every point in `M` has a neighborhood homeomorphic to `K^n`
-Topological manifolds are implemented via the class :class:`TopologicalManifold`.
-Open subsets of topological manifolds are also implemented via
-:class:`TopologicalManifold`, since they are topological manifolds by themselves.
+Topological manifolds are implemented via the class
+:class:`TopologicalManifold`. Open subsets of topological manifolds
+are also implemented via :class:`TopologicalManifold`, since they are
+topological manifolds by themselves.
-In the current setting, topological manifolds are mostly described by means of
-charts (see :class:`~sage.manifolds.chart.Chart`).
+In the current setting, topological manifolds are mostly described by
+means of charts (see :class:`~sage.manifolds.chart.Chart`).
-:class:`TopologicalManifold` serves as a base class for more specific manifold
-classes.
+:class:`TopologicalManifold` serves as a base class for more specific
+manifold classes.
-The user interface is provided by the generic function :func:`Manifold`, with
-the argument ``type`` set to ``'topological'``.
+The user interface is provided by the generic function :func:`Manifold`,
+with the argument ``type`` set to ``'topological'``.
.. RUBRIC:: Example 1: the 2-sphere as a topological manifold of dimension
2 over `\RR`
@@ -52,8 +53,8 @@ North pole to the equatorial plane::
Chart (U, (x, y))
Thanks to the operator ``<x,y>`` on the left-hand side, the coordinates
-declared in a chart (here `x` and `y`), are accessible by their names; they are
-Sage's symbolic variables::
+declared in a chart (here `x` and `y`), are accessible by their names;
+they are Sage's symbolic variables::
sage: y
y
@@ -85,10 +86,11 @@ 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 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 \neq 0`, as well as the subset of `V` defined by
+`u^2 + v^2 \neq 0`)::
sage: stereoN_to_S = stereoN.transition_map(stereoS, [x/(x^2+y^2), y/(x^2+y^2)],
....: intersection_name='W', restrictions1= x^2+y^2!=0,
@@ -99,11 +101,12 @@ and ``stereoS`` = `(V, (u, v))`, denoting by `W` the intersection of `U` and `V`
u = x/(x^2 + y^2)
v = y/(x^2 + y^2)
-We give the name ``W`` to the Python variable representing `W=U\cap V`::
+We give the name ``W`` to the Python variable representing `W = U \cap V`::
sage: W = U.intersection(V)
-The inverse of the transition map is computed by the method ``inverse()``::
+The inverse of the transition map is computed by the method
+:meth:`sage.manifolds.chart.CoordChange.inverse`::
sage: stereoN_to_S.inverse()
Change of coordinates from Chart (W, (u, v)) to Chart (W, (x, y))
@@ -124,7 +127,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
@@ -136,7 +138,8 @@ The manifold's (user) atlas contains four charts, two of them
being restrictions of charts to a smaller domain::
sage: M.atlas()
- [Chart (U, (x, y)), Chart (V, (u, v)), Chart (W, (x, y)), Chart (W, (u, v))]
+ [Chart (U, (x, y)), Chart (V, (u, v)),
+ Chart (W, (x, y)), Chart (W, (u, v))]
Let us consider the point of coordinates (1,2) in the chart ``stereoN``::
@@ -176,8 +179,8 @@ over `\CC`::
Complex 1-dimensional topological manifold C*
We introduce a first open subset, which is actually
-`\CC = \CC^*\setminus\{\infty\}` if we interpret `\CC^*` as the Alexandroff
-one-point compactification of `\CC`::
+`\CC = \CC^*\setminus\{\infty\}` if we interpret `\CC^*` as the
+Alexandroff one-point compactification of `\CC`::
sage: U = M.open_subset('U')
@@ -186,7 +189,7 @@ we denote the associated coordinate by `z`::
sage: Z.<z> = U.chart()
-The origin of the complex plane is the point of coordinate `z=0`::
+The origin of the complex plane is the point of coordinate `z = 0`::
sage: O = U.point((0,), chart=Z, name='O'); O
Point O on the Complex 1-dimensional topological manifold C*
@@ -204,13 +207,13 @@ coordinate 0 in this chart::
sage: inf
Point inf on the Complex 1-dimensional topological manifold C*
-To fully construct the Riemann sphere, we declare that it is the union of `U`
-and `V`::
+To fully construct the Riemann sphere, we declare that it is the union
+of `U` and `V`::
sage: M.declare_union(U,V)
-and we provide the transition map between the two charts as `w=1/z` on
-on `A = U\cap V`::
+and we provide the transition map between the two charts as `w = 1 / z`
+on `A = U \cap V`::
sage: Z_to_W = Z.transition_map(W, 1/z, intersection_name='A',
....: restrictions1= z!=0, restrictions2= w!=0)
@@ -259,12 +262,14 @@ AUTHORS:
REFERENCES:
-- J.M. Lee : *Introduction to Topological Manifolds*, 2nd ed., Springer (New
- York) (2011)
-- S. Kobayashi & K. Nomizu : *Foundations of Differential Geometry*, vol. 1,
- Interscience Publishers (New York) (1963)
-- D. Huybrechts : *Complex Geometry*, Springer (Berlin) (2005)
-
+.. [Lee11] J.M. Lee : *Introduction to Topological Manifolds*,
+ 2nd ed., Springer (New York) (2011).
+.. [Lee13] J.M. Lee : *Introduction to Smooth Manifolds*,
+ 2nd ed., Springer (New York) (2013)
+.. [KN63] S. Kobayashi & K. Nomizu : *Foundations of Differential Geometry*,
+ vol. 1, Interscience Publishers (New York) (1963).
+.. [Huybrechts05] D. Huybrechts : *Complex Geometry*,
+ Springer (Berlin) (2005).
"""
#*****************************************************************************
@@ -293,8 +298,8 @@ class TopologicalManifold(TopologicalManifoldSubset):
dimension* `n` *over K* is a topological space `M` such that
- `M` is a Hausdorff space,
- - `M` is second countable,
- - every point in `M` has a neighborhood homeomorphic to `K^n`
+ - `M` is second countable, and
+ - every point in `M` has a neighborhood homeomorphic to `K^n`.
This is a Sage *parent* class, the corresponding *element*
class being :class:`~sage.manifolds.point.TopologicalManifoldPoint`.
@@ -303,22 +308,22 @@ class TopologicalManifold(TopologicalManifoldSubset):
- ``n`` -- positive integer; dimension of the manifold
- ``name`` -- string; name (symbol) given to the manifold
- - ``latex_name`` -- (default: ``None``) string; LaTeX symbol to denote the
- manifold; if none is provided, it is set to ``name``
+ - ``latex_name`` -- (default: ``None``) string; LaTeX symbol to
+ denote the manifold; if none is provided, it is set to ``name``
- ``field`` -- (default: ``'real'``) field `K` on which the manifold is
defined; allowed values are
- - ``'real'`` or an object of type ``RealField`` (e.g. ``RR``) for a
- manifold over `\RR`
- - ``'complex'`` or an object of type ``ComplexField`` (e.g. ``CC``) for
- a manifold over `\CC`
- - an object in the category of topological fields (see
- :class:`~sage.categories.fields.Fields` and
- :class:`~sage.categories.topological_spaces.TopologicalSpaces`)
- for other types of manifolds
+ - ``'real'`` or an object of type ``RealField`` (e.g., ``RR``) for
+ a manifold over `\RR`
+ - ``'complex'`` or an object of type ``ComplexField`` (e.g., ``CC``)
+ for a manifold over `\CC`
+ - an object in the category of topological fields (see
+ :class:`~sage.categories.fields.Fields` and
+ :class:`~sage.categories.topological_spaces.TopologicalSpaces`)
+ for other types of manifolds
- ``start_index`` -- (default: 0) integer; lower value of the range of
- indices used for "indexed objects" on the manifold, e.g. coordinates
+ indices used for "indexed objects" on the manifold, e.g., coordinates
in a chart
- ``category`` -- (default: ``None``) to specify the category; if ``None``,
``Manifolds(field)`` is assumed (see the category
@@ -343,8 +348,8 @@ class TopologicalManifold(TopologicalManifoldSubset):
sage: dim(M)
4
- The input parameter ``start_index`` defines the range of indices on the
- manifold::
+ The input parameter ``start_index`` defines the range of indices
+ on the manifold::
sage: M = Manifold(4, 'M', type='topological')
sage: list(M.irange())
@@ -407,8 +412,8 @@ class TopologicalManifold(TopologicalManifoldSubset):
sage: isinstance(p, sage.manifolds.point.TopologicalManifoldPoint)
True
- Since an open subset of a topological manifold `M` is itself a topological
- manifold, open subsets of `M` are instances of the class
+ Since an open subset of a topological manifold `M` is itself a
+ topological manifold, open subsets of `M` are instances of the class
:class:`TopologicalManifold`::
sage: U = M.open_subset('U'); U
@@ -450,8 +455,7 @@ class TopologicalManifold(TopologicalManifoldSubset):
if not isinstance(n, (int, Integer)):
raise TypeError("the manifold dimension must be an integer")
if n<1:
- raise ValueError("the manifold dimension must be strictly " +
- "positive")
+ raise ValueError("the manifold dimension must be strictly positive")
self._dim = n
if field == 'real':
self._field = RR
@@ -472,8 +476,7 @@ class TopologicalManifold(TopologicalManifoldSubset):
if not isinstance(start_index, (int, Integer)):
raise TypeError("the starting index must be an integer")
self._sindex = start_index
- if category is None:
- category = Manifolds(self._field)
+ category = Manifolds(self._field).or_subcategory(category)
if ambient_manifold is None:
ambient_manifold = self
elif not isinstance(ambient_manifold, TopologicalManifold):
@@ -499,7 +502,7 @@ class TopologicalManifold(TopologicalManifoldSubset):
def _repr_(self):
r"""
- String representation of the manifold.
+ Return a string representation of the manifold.
TESTS::
@@ -535,12 +538,11 @@ class TopologicalManifold(TopologicalManifoldSubset):
return "{}-dimensional topological manifold {} over the {}".format(
self._dim, self._name, self._field)
else:
- return "Open subset {} of the {}".format(self._name,
- self._manifold)
+ return "Open subset {} of the {}".format(self._name, self._manifold)
def _latex_(self):
r"""
- LaTeX representation of the manifold.
+ Return a LaTeX representation of the manifold.
TESTS::
@@ -561,7 +563,7 @@ class TopologicalManifold(TopologicalManifoldSubset):
def __reduce__(self):
r"""
- Reduction function for the pickle protocole.
+ Reduction function for the pickle protocol.
TESTS::
@@ -611,7 +613,7 @@ class TopologicalManifold(TopologicalManifoldSubset):
it does not require ``loads(dumps(self)) == self``.
It however checks that ``loads(dumps(self))`` proceeds without any
error and results in an object that is a manifold of the same type as
- ``self``, with some identical characteristics (dimension, name).
+ ``self``, with some identical characteristics ``(dimension, name)``.
TESTS::
@@ -1351,23 +1353,22 @@ class TopologicalManifold(TopologicalManifoldSubset):
# 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)
+ if chart2 != chart1 and (chart1, chart2) in self._coord_changes:
+ self._coord_changes[(chart1, chart2)].restrict(resu)
return resu
def chart(self, coordinates='', names=None):
r"""
Define a chart, the domain of which is the manifold.
- A *chart* is a pair `(U,\varphi)`, where `U` is the current manifold
- and `\varphi: U \rightarrow V \subset K^n`
- is a homeomorphism from `U` to an open subset `V` of `K^n`, `K` being
- the field on which the manifold is defined.
+ A *chart* is a pair `(U, \varphi)`, where `U` is the current
+ manifold and `\varphi: U \rightarrow V \subset K^n`
+ is a homeomorphism from `U` to an open subset `V` of `K^n`, `K`
+ being the field on which the manifold is defined.
- 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`,
- are called the *coordinates* of the chart `(U,\varphi)`.
+ 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`, are called the *coordinates* of the chart `(U, \varphi)`.
See :class:`~sage.manifolds.chart.Chart` for a complete
documentation.
@@ -1538,19 +1539,19 @@ def Manifold(dim, name, latex_name=None, field='real', type='smooth',
- ``dim`` -- positive integer; dimension of the manifold
- ``name`` -- string; name (symbol) given to the manifold
- - ``latex_name`` -- (default: ``None``) string; LaTeX symbol to denote the
- manifold; if none is provided, it is set to ``name``
- - ``field`` -- (default: ``'real'``) field `K` on which the manifold is
- defined; allowed values are
-
- - ``'real'`` or an object of type ``RealField`` (e.g. ``RR``) for a
- manifold over `\RR`
- - ``'complex'`` or an object of type ``ComplexField`` (e.g. ``CC``) for
- a manifold over `\CC`
- - an object in the category of topological fields (see
- :class:`~sage.categories.fields.Fields` and
- :class:`~sage.categories.topological_spaces.TopologicalSpaces`)
- for other types of manifolds
+ - ``latex_name`` -- (default: ``None``) string; LaTeX symbol to
+ denote the manifold; if none is provided, it is set to ``name``
+ - ``field`` -- (default: ``'real'``) field `K` on which the
+ manifold is defined; allowed values are
+
+ - ``'real'`` or an object of type ``RealField`` (e.g. ``RR``) for a
+ manifold over `\RR`
+ - ``'complex'`` or an object of type ``ComplexField`` (e.g. ``CC``) for
+ a manifold over `\CC`
+ - an object in the category of topological fields (see
+ :class:`~sage.categories.fields.Fields` and
+ :class:`~sage.categories.topological_spaces.TopologicalSpaces`)
+ for other types of manifolds
- ``type`` -- (default: ``'smooth'``) to specify the type of manifold;
allowed values are
@@ -1579,8 +1580,8 @@ def Manifold(dim, name, latex_name=None, field='real', type='smooth',
sage: M = Manifold(3, 'M', type='topological'); M
3-dimensional topological manifold M
- Given the default value of the parameter ``field``, the above is equivalent
- to::
+ Given the default value of the parameter ``field``, the above is
+ equivalent to::
sage: M = Manifold(3, 'M', type='topological', field='real'); M
3-dimensional topological manifold M
@@ -1673,3 +1674,4 @@ def Manifold(dim, name, latex_name=None, field='real', type='smooth',
field=field, start_index=start_index)
raise NotImplementedError("manifolds of type {} are not ".format(type_) +
"implemented")
+
diff --git a/src/sage/manifolds/point.py b/src/sage/manifolds/point.py
index 25c8adc..7fcf0f5 100644
--- a/src/sage/manifolds/point.py
+++ b/src/sage/manifolds/point.py
@@ -13,10 +13,10 @@ AUTHORS:
REFERENCES:
-- J.M. Lee : *Introduction to Topological Manifolds*, 2nd ed., Springer (New
- York) (2011)
-- J.M. Lee : *Introduction to Smooth Manifolds*, 2nd ed., Springer (New York,
- 2013)
+- [Lee11]_ J.M. Lee : *Introduction to Topological Manifolds*, 2nd ed.,
+ Springer (New York) (2011)
+- [Lee13]_ J.M. Lee : *Introduction to Smooth Manifolds*, 2nd ed.,
+ Springer (New York, 2013)
EXAMPLES:
@@ -91,7 +91,7 @@ class TopologicalManifoldPoint(Element):
if ``None``, the LaTeX symbol is set to ``name``
- ``check_coords`` -- (default: ``True``) determines whether ``coords`` are
valid coordinates for the chart ``chart``; for symbolic coordinates, it
- is recommended to set ``check_coords`` to ``False``.
+ is recommended to set ``check_coords`` to ``False``
EXAMPLES:
@@ -178,8 +178,8 @@ class TopologicalManifoldPoint(Element):
chart = self._subset._def_chart
elif self._subset._is_open:
if chart not in self._subset._atlas:
- raise ValueError("the {}".format(chart) + " has not " +
- "been defined on the {}".format(self._subset))
+ raise ValueError("the {} has not been".format(chart) +
+ "defined on the {}".format(self._subset))
if check_coords:
if not chart.valid_coordinates(*coords):
raise ValueError("the coordinates {}".format(coords) +
diff --git a/src/sage/manifolds/subset.py b/src/sage/manifolds/subset.py
index 8eb231f..16e911e 100644
--- a/src/sage/manifolds/subset.py
+++ b/src/sage/manifolds/subset.py
@@ -13,8 +13,8 @@ AUTHORS:
REFERENCES:
-- J.M. Lee : *Introduction to Topological Manifolds*, 2nd ed., Springer (New
- York) (2011)
+- [Lee11]_ J.M. Lee : *Introduction to Topological Manifolds*, 2nd ed.,
+ Springer (New York) (2011)
EXAMPLES: