summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-11-09 11:12:31 +0100
committerEric Gourgoulhon <eric.gourgoulhon@obspm.fr>2015-11-09 11:12:31 +0100
commit668bc26960cf5d2b23c32e3ce51001180e50004b (patch)
tree824cda18997961b4d7f6572b0c39ffd1d0f84295
parentImplement top. manifolds (morphisms, #18725) on the new manifold categories (... (diff)
parentRemove UniqueRepresentation, leaving only WithEqualityById, for scalar fields... (diff)
Remove UniqueRepresentation, leaving only WithEqualityById, for topological manifold homsets
-rw-r--r--src/sage/manifolds/all.py2
-rw-r--r--src/sage/manifolds/chart.py262
-rw-r--r--src/sage/manifolds/continuous_map.py153
-rw-r--r--src/sage/manifolds/coord_func.py153
-rw-r--r--src/sage/manifolds/coord_func_symb.py129
-rw-r--r--src/sage/manifolds/manifold.py469
-rw-r--r--src/sage/manifolds/manifold_homset.py87
-rw-r--r--src/sage/manifolds/point.py102
-rw-r--r--src/sage/manifolds/scalarfield.py212
-rw-r--r--src/sage/manifolds/scalarfield_algebra.py95
-rw-r--r--src/sage/manifolds/subset.py208
-rw-r--r--src/sage/manifolds/utilities.py8
12 files changed, 1220 insertions, 660 deletions
diff --git a/src/sage/manifolds/all.py b/src/sage/manifolds/all.py
index 13f8964..01834c1 100644
--- a/src/sage/manifolds/all.py
+++ b/src/sage/manifolds/all.py
@@ -1,4 +1,4 @@
from sage.misc.lazy_import import lazy_import
-lazy_import('sage.manifolds.manifold', 'TopManifold')
+lazy_import('sage.manifolds.manifold', 'Manifold')
lazy_import('sage.manifolds.utilities', 'nice_derivatives')
lazy_import('sage.manifolds.utilities', 'omit_function_args')
diff --git a/src/sage/manifolds/chart.py b/src/sage/manifolds/chart.py
index 77781da..f47b3de 100644
--- a/src/sage/manifolds/chart.py
+++ b/src/sage/manifolds/chart.py
@@ -35,16 +35,16 @@ REFERENCES:
#*****************************************************************************
from sage.structure.sage_object import SageObject
-from sage.structure.unique_representation import UniqueRepresentation
+from sage.misc.fast_methods import WithEqualityById
from sage.symbolic.ring import SR
from sage.rings.all import CC
from sage.rings.real_mpfr import RR
from sage.rings.infinity import Infinity
from sage.misc.latex import latex
-from sage.manifolds.manifold import TopManifold
+from sage.manifolds.manifold import TopologicalManifold
from sage.manifolds.coord_func_symb import CoordFunctionSymb
-class Chart(UniqueRepresentation, SageObject):
+class Chart(WithEqualityById, SageObject):
r"""
Chart on a topological manifold.
@@ -60,7 +60,7 @@ class Chart(UniqueRepresentation, SageObject):
INPUT:
- ``domain`` -- open subset `U` on which the chart is defined (must be
- an instance of :class:`~sage.manifolds.manifold.TopManifold`)
+ 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 ':':
@@ -84,7 +84,7 @@ class Chart(UniqueRepresentation, SageObject):
A chart on a complex 2-dimensional topological manifold::
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X = M.chart('x y'); X
Chart (M, (x, y))
sage: latex(X)
@@ -100,8 +100,7 @@ class Chart(UniqueRepresentation, SageObject):
side of the chart declaration (there is then no need to pass the string
``'x y'`` to ``chart()``)::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart(); X
Chart (M, (x, y))
@@ -121,8 +120,7 @@ class Chart(UniqueRepresentation, SageObject):
names and do not have to coincide with the coordinate symbols;
for instance, one may write::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x1,y1> = M.chart('x y'); X
Chart (M, (x, y))
@@ -139,8 +137,7 @@ class Chart(UniqueRepresentation, SageObject):
However, having the name of the Python variable coincide with the
coordinate symbol is quite convenient; so it is recommended to declare::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M', field='complex')
+ 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::
@@ -182,7 +179,8 @@ class Chart(UniqueRepresentation, SageObject):
default, it starts at 0, but this can be changed via the parameter
``start_index``::
- sage: M1 = TopManifold(2, 'M_1', field='complex', start_index=1)
+ sage: M1 = Manifold(2, 'M_1', field='complex', type='topological',
+ ....: start_index=1)
sage: Z.<u,v> = M1.chart()
sage: Z[1], Z[2]
(u, v)
@@ -206,7 +204,7 @@ class Chart(UniqueRepresentation, SageObject):
Manifold subsets have a *default chart*, which, unless changed via the
method
- :meth:`~sage.manifolds.manifold.TopManifold.set_default_chart`,
+ :meth:`~sage.manifolds.manifold.TopologicalManifold.set_default_chart`,
is the first defined chart on the subset (or on a open subset of it)::
sage: M.default_chart()
@@ -240,7 +238,7 @@ class Chart(UniqueRepresentation, SageObject):
TESTS::
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart()
sage: X
Chart (M, (x, y))
@@ -251,12 +249,13 @@ class Chart(UniqueRepresentation, SageObject):
sage: TestSuite(X).run()
"""
- if not isinstance(domain, TopManifold):
+ if not isinstance(domain, TopologicalManifold):
raise TypeError("the first argument must be an open subset of " +
"a topological manifold")
if coordinates == '':
for x in names:
coordinates += x + ' '
+ self._coordinate_string = coordinates[:-1] # for pickling (cf. __reduce__)
self._manifold = domain.manifold()
self._domain = domain
# Treatment of the coordinates:
@@ -334,7 +333,7 @@ class Chart(UniqueRepresentation, SageObject):
TESTS::
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<z1, z2> = M.chart()
sage: X._init_coordinates(['z1', 'z2'])
sage: X
@@ -365,7 +364,7 @@ class Chart(UniqueRepresentation, SageObject):
TESTS::
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart()
sage: X._repr_()
'Chart (M, (x, y))'
@@ -383,7 +382,7 @@ class Chart(UniqueRepresentation, SageObject):
TESTS::
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart()
sage: X._latex_()
'\\left(M,(x, y)\\right)'
@@ -413,6 +412,104 @@ class Chart(UniqueRepresentation, SageObject):
"""
return self[:]
+ def __reduce__(self):
+ r"""
+ Reduction function for the pickle protocole.
+
+ TESTS::
+
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: X.<x,y> = M.chart()
+ sage: X.__reduce__()
+ (<class 'sage.manifolds.chart.RealChart'>,
+ (2-dimensional topological manifold M, 'x y'),
+ [])
+ sage: X.add_restrictions(x^2 + y^2 < 1)
+ sage: X.__reduce__()
+ (<class 'sage.manifolds.chart.RealChart'>,
+ (2-dimensional topological manifold M, 'x y'),
+ [x^2 + y^2 < 1])
+
+ Test of pickling::
+
+ sage: loads(dumps(X))
+ Chart (M, (x, y))
+
+ """
+ return (type(self), (self._domain, self._coordinate_string),
+ self.__getstate__())
+
+ def __getstate__(self):
+ r"""
+ Return the attributes of ``self`` that have been set after
+ the construction of the object.
+
+ This is used in pickling, to handle the coordinate restrictions,
+ since the latter have been defined by calls to
+ ``self.add_restrictions()`` and not at the object construction.
+
+ TESTS::
+
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: X.<x,y> = M.chart()
+ sage: X.__getstate__()
+ []
+ sage: X.add_restrictions(x^2 + y^2 < 1)
+ sage: X.__getstate__()
+ [x^2 + y^2 < 1]
+
+ """
+ return self._restrictions
+
+ def __setstate__(self, coord_restrictions):
+ r"""
+ Set the attributes of ``self`` that are not initialized at the object
+ construction.
+
+ This is used in unpickling, to handle the coordinate restrictions,
+ since the latter have been defined by calls to
+ ``self.add_restrictions()`` and not at the object construction.
+
+ TESTS::
+
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: X.<x,y> = M.chart()
+ sage: X._restrictions
+ []
+ sage: X.__setstate__([x^2+y^2<1])
+ sage: X._restrictions
+ [x^2 + y^2 < 1]
+
+ """
+ self._restrictions = coord_restrictions
+
+ def _test_pickling(self, **options):
+ r"""
+ Test pickling.
+
+ This test is weaker than
+ :meth:`sage.structure.sage_object.SageObject._test_pickling` in that
+ 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.
+
+ TESTS::
+
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: X.<x,y> = M.chart()
+ sage: X._test_pickling()
+ sage: X.add_restrictions(x < 0)
+ sage: X._test_pickling()
+
+ """
+ tester = self._tester(**options)
+ from sage.misc.all import loads, dumps
+ bckp = loads(dumps(self))
+ tester.assertEqual(type(bckp), type(self))
+ tester.assertEqual(bckp._xx, self._xx)
+ tester.assertEqual(bckp._restrictions, self._restrictions)
+
def __getitem__(self, i):
r"""
Access to the coordinates.
@@ -429,7 +526,7 @@ class Chart(UniqueRepresentation, SageObject):
EXAMPLES::
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart()
sage: X[0]
x
@@ -440,7 +537,8 @@ class Chart(UniqueRepresentation, SageObject):
The index range is controlled by the parameter ``start_index``::
- sage: M = TopManifold(2, 'M', field='complex', start_index=1)
+ sage: M = Manifold(2, 'M', field='complex', type='topological',
+ ....: start_index=1)
sage: X.<x,y> = M.chart()
sage: X[1]
x
@@ -469,7 +567,7 @@ class Chart(UniqueRepresentation, SageObject):
EXAMPLES::
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M.point((1+i, 2-i), chart=X)
sage: X(p)
@@ -486,7 +584,7 @@ class Chart(UniqueRepresentation, SageObject):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: X.domain()
2-dimensional topological manifold M
@@ -504,7 +602,7 @@ class Chart(UniqueRepresentation, SageObject):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: U = M.open_subset('U')
sage: X.<x,y> = U.chart()
sage: X.manifold()
@@ -536,7 +634,7 @@ class Chart(UniqueRepresentation, SageObject):
EXAMPLES::
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart()
sage: X.add_restrictions(abs(x) > 1)
sage: X.valid_coordinates(2+i, 1)
@@ -565,7 +663,7 @@ class Chart(UniqueRepresentation, SageObject):
INPUT:
- ``subset`` -- open subset `V` of the chart domain `U` (must be an
- instance of :class:`~sage.manifolds.manifold.TopManifold`)
+ instance of :class:`~sage.manifolds.manifold.TopologicalManifold`)
- ``restrictions`` -- (default: ``None``) list of coordinate
restrictions defining the subset `V`.
A restriction can be any symbolic equality or
@@ -590,7 +688,7 @@ class Chart(UniqueRepresentation, SageObject):
Coordinates on the unit open ball of `\CC^2` as a subchart
of the global coordinates of `\CC^2`::
- sage: M = TopManifold(2, 'C^2', field='complex')
+ sage: M = Manifold(2, 'C^2', field='complex', type='topological')
sage: X.<z1, z2> = M.chart()
sage: B = M.open_subset('B')
sage: X_B = X.restrict(B, abs(z1)^2 + abs(z2)^2 < 1); X_B
@@ -606,7 +704,7 @@ class Chart(UniqueRepresentation, SageObject):
coordinates = ""
for coord in self._xx:
coordinates += repr(coord) + ' '
- res = self.__class__(subset, coordinates)
+ res = type(self)(subset, coordinates)
res._restrictions.extend(self._restrictions)
# The coordinate restrictions are added to the result chart and
# possibly transformed into coordinate bounds:
@@ -641,8 +739,7 @@ class Chart(UniqueRepresentation, SageObject):
EXAMPLE::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', field='complex', type='topological')
sage: X.<x,y> = M.chart()
sage: X.add_restrictions([abs(x)<1, y!=0])
sage: X.valid_coordinates(0, i)
@@ -747,7 +844,7 @@ class Chart(UniqueRepresentation, SageObject):
Transition map between two stereographic charts on the circle `S^1`::
- sage: M = TopManifold(1, 'S^1')
+ sage: M = Manifold(1, 'S^1', type='topological')
sage: U = M.open_subset('U') # Complement of the North pole
sage: cU.<x> = U.chart() # Stereographic chart from the North pole
sage: V = M.open_subset('V') # Complement of the South pole
@@ -777,8 +874,7 @@ class Chart(UniqueRepresentation, SageObject):
Transition map between the spherical chart and the Cartesian one on
`\RR^2`::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'R^2')
+ sage: M = Manifold(2, 'R^2', type='topological')
sage: c_cart.<x,y> = M.chart()
sage: U = M.open_subset('U') # the complement of the half line {y=0, x >= 0}
sage: c_spher.<r,phi> = U.chart(r'r:(0,+oo) phi:(0,2*pi):\phi')
@@ -796,7 +892,7 @@ class Chart(UniqueRepresentation, SageObject):
[2-dimensional topological manifold R^2,
Open subset U of the 2-dimensional topological manifold R^2]
- ... but a new chart has been created: `(U, (x, y))`::
+ but a new chart has been created: `(U, (x, y))`::
sage: M.atlas()
[Chart (R^2, (x, y)), Chart (U, (r, phi)), Chart (U, (x, y))]
@@ -863,7 +959,7 @@ class Chart(UniqueRepresentation, SageObject):
A symbolic coordinate function::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(sin(x*y))
sage: f
@@ -908,7 +1004,7 @@ class Chart(UniqueRepresentation, SageObject):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: X.zero_function()
0
@@ -924,7 +1020,7 @@ class Chart(UniqueRepresentation, SageObject):
Zero function on a p-adic manifold::
- sage: M = TopManifold(2, 'M', field=Qp(5)); M
+ sage: M = Manifold(2, 'M', type='topological', field=Qp(5)); M
2-dimensional topological manifold M over the 5-adic Field with
capped relative precision 20
sage: X.<x,y> = M.chart()
@@ -962,7 +1058,7 @@ class Chart(UniqueRepresentation, SageObject):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: X.one_function()
1
@@ -978,7 +1074,7 @@ class Chart(UniqueRepresentation, SageObject):
One function on a p-adic manifold::
- sage: M = TopManifold(2, 'M', field=Qp(5)); M
+ sage: M = Manifold(2, 'M', type='topological', field=Qp(5)); M
2-dimensional topological manifold M over the 5-adic Field with
capped relative precision 20
sage: X.<x,y> = M.chart()
@@ -1031,7 +1127,7 @@ class Chart(UniqueRepresentation, SageObject):
Function of two coordinates with values in `\RR^3`::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x+y, sin(x*y), x^2 + 3*y); f
Coordinate functions (x + y, sin(x*y), x^2 + 3*y) on the Chart (M, (x, y))
@@ -1096,7 +1192,8 @@ class RealChart(Chart):
Cartesian coordinates on `\RR^3`::
- sage: M = TopManifold(3, 'R^3', r'\RR^3', start_index=1)
+ sage: M = Manifold(3, 'R^3', r'\RR^3', type='topological',
+ ....: start_index=1)
sage: c_cart = M.chart('x y z'); c_cart
Chart (R^3, (x, y, z))
sage: type(c_cart)
@@ -1110,8 +1207,8 @@ class RealChart(Chart):
side of the chart declaration (there is then no need to pass the string
``'x y z'`` to ``chart()``)::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(3, 'R^3', r'\RR^3', start_index=1)
+ sage: M = Manifold(3, 'R^3', r'\RR^3', type='topological',
+ ....: start_index=1)
sage: c_cart.<x,y,z> = M.chart(); c_cart
Chart (R^3, (x, y, z))
@@ -1131,7 +1228,7 @@ class RealChart(Chart):
names and do not have to coincide with the coordinate symbols; for instance,
one may write::
- sage: M = TopManifold(3, 'R^3', r'\RR^3', start_index=1)
+ 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
Chart (R^3, (x, y, z))
@@ -1146,9 +1243,8 @@ class RealChart(Chart):
However, having the name of the Python variable coincide with the
coordinate symbol is quite convenient; so it is recommended to declare::
- sage: TopManifold._clear_cache_() # for doctests only
sage: forget() # for doctests only
- sage: M = TopManifold(3, 'R^3', r'\RR^3', start_index=1)
+ sage: M = Manifold(3, 'R^3', r'\RR^3', type='topological', start_index=1)
sage: c_cart.<x,y,z> = M.chart()
Spherical coordinates on the subset `U` of `\RR^3` that is the
@@ -1220,7 +1316,7 @@ class RealChart(Chart):
Manifold subsets have a *default chart*, which, unless changed via the
method
- :meth:`~sage.manifolds.manifold.TopManifold.set_default_chart`,
+ :meth:`~sage.manifolds.manifold.TopologicalManifold.set_default_chart`,
is the first defined chart on the subset (or on a open subset of it)::
sage: M.default_chart()
@@ -1282,7 +1378,7 @@ class RealChart(Chart):
TESTS::
sage: forget() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: X
Chart (M, (x, y))
@@ -1311,7 +1407,7 @@ class RealChart(Chart):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: X._init_coordinates(['x', 'y'])
sage: X
@@ -1408,8 +1504,7 @@ class RealChart(Chart):
Some coordinate bounds on a 2-dimensional manifold::
sage: forget() # for doctests only
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: c_xy.<x,y> = M.chart('x y:[0,1)')
sage: c_xy.coord_bounds(0) # x in (-oo,+oo) (the default)
((-Infinity, False), (+Infinity, False))
@@ -1457,7 +1552,7 @@ class RealChart(Chart):
Ranges of coordinates on a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: X.coord_range()
x: (-oo, +oo); y: (-oo, +oo)
@@ -1549,8 +1644,7 @@ class RealChart(Chart):
Cartesian coordinates on the open unit disc in $\RR^2$::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M') # the open unit disc
+ sage: M = Manifold(2, 'M', type='topological') # the open unit disc
sage: X.<x,y> = M.chart()
sage: X.add_restrictions(x^2+y^2<1)
sage: X.valid_coordinates(0,2)
@@ -1650,7 +1744,7 @@ class RealChart(Chart):
INPUT:
- ``subset`` -- open subset `V` of the chart domain `U` (must be an
- instance of :class:`~sage.manifolds.manifold.TopManifold`)
+ instance of :class:`~sage.manifolds.manifold.TopologicalManifold`)
- ``restrictions`` -- (default: ``None``) list of coordinate
restrictions defining the subset `V`.
A restriction can be any symbolic equality or
@@ -1675,7 +1769,7 @@ class RealChart(Chart):
Cartesian coordinates on the unit open disc in `\RR^2` as a subchart
of the global Cartesian coordinates::
- sage: M = TopManifold(2, 'R^2')
+ sage: M = Manifold(2, 'R^2', type='topological')
sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2
sage: D = M.open_subset('D') # the unit open disc
sage: c_cart_D = c_cart.restrict(D, x^2+y^2<1)
@@ -1706,7 +1800,7 @@ class RealChart(Chart):
coordinates = ""
for coord in self._xx:
coordinates += repr(coord) + ' '
- res = self.__class__(subset, coordinates)
+ res = type(self)(subset, coordinates)
res._bounds = self._bounds
res._restrictions.extend(self._restrictions)
# The coordinate restrictions are added to the result chart and
@@ -1746,7 +1840,7 @@ class RealChart(Chart):
Cartesian coordinates on a square interior::
sage: forget() # for doctest only
- sage: M = TopManifold(2, 'M') # the square interior
+ sage: M = Manifold(2, 'M', type='topological') # the square interior
sage: X.<x,y> = M.chart('x:(-2,2) y:(-2,2)')
sage: X.valid_coordinates(0,1)
True
@@ -1920,7 +2014,7 @@ class RealChart(Chart):
Grid of polar coordinates in terms of Cartesian coordinates in the
Euclidean plane::
- sage: R2 = TopManifold(2, 'R^2') # the Euclidean plane
+ sage: R2 = Manifold(2, 'R^2', type='topological') # the Euclidean plane
sage: c_cart.<x,y> = R2.chart() # Cartesian coordinates
sage: U = R2.open_subset('U', coord_def={c_cart: (y!=0, x<0)}) # the complement of the segment y=0 and x>0
sage: c_pol.<r,ph> = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi') # polar coordinates on U
@@ -1932,7 +2026,7 @@ class RealChart(Chart):
.. PLOT::
- R2 = TopManifold(2, 'R^2')
+ R2 = Manifold(2, 'R^2', type='topological')
c_cart = R2.chart('x y'); x, y = c_cart[:]
U = R2.open_subset('U', coord_def={c_cart: (y!=0, x<0)})
c_pol = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi'); r, ph = c_pol[:]
@@ -1947,7 +2041,7 @@ class RealChart(Chart):
.. PLOT::
- R2 = TopManifold(2, 'R^2')
+ R2 = Manifold(2, 'R^2', type='topological')
c_cart = R2.chart('x y'); x, y = c_cart[:]
U = R2.open_subset('U', coord_def={c_cart: (y!=0, x<0)})
c_pol = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi'); r, ph = c_pol[:]
@@ -1962,7 +2056,7 @@ class RealChart(Chart):
.. PLOT::
- R2 = TopManifold(2, 'R^2')
+ R2 = Manifold(2, 'R^2', type='topological')
c_cart = R2.chart('x y'); x, y = c_cart[:]
U = R2.open_subset('U', coord_def={c_cart: (y!=0, x<0)})
c_pol = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi'); r, ph = c_pol[:]
@@ -1976,7 +2070,7 @@ class RealChart(Chart):
.. PLOT::
- R2 = TopManifold(2, 'R^2')
+ R2 = Manifold(2, 'R^2', type='topological')
c_cart = R2.chart('x y'); x, y = c_cart[:]
U = R2.open_subset('U', coord_def={c_cart: (y!=0, x<0)})
c_pol = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi'); r, ph = c_pol[:]
@@ -1992,7 +2086,7 @@ class RealChart(Chart):
.. PLOT::
- R2 = TopManifold(2, 'R^2')
+ R2 = Manifold(2, 'R^2', type='topological')
c_cart = R2.chart('x y'); x, y = c_cart[:]
g = c_cart.plot()
sphinx_plot(g)
@@ -2001,7 +2095,7 @@ class RealChart(Chart):
some manifold map: 3D plot of the stereographic charts on the
2-sphere::
- sage: S2 = TopManifold(2, 'S^2') # the 2-sphere
+ sage: S2 = Manifold(2, 'S^2', type='topological') # the 2-sphere
sage: U = S2.open_subset('U') ; V = S2.open_subset('V') # complement of the North and South pole, respectively
sage: S2.declare_union(U,V)
sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole
@@ -2010,7 +2104,7 @@ class RealChart(Chart):
....: intersection_name='W', restrictions1= x^2+y^2!=0,
....: restrictions2= u^2+v^2!=0)
sage: uv_to_xy = xy_to_uv.inverse()
- sage: R3 = TopManifold(3, 'R^3') # the Euclidean space R^3
+ sage: R3 = Manifold(3, 'R^3', type='topological') # the Euclidean space R^3
sage: c_cart.<X,Y,Z> = R3.chart() # Cartesian coordinates on R^3
sage: Phi = S2.continuous_map(R3, {(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)],
@@ -2044,7 +2138,7 @@ class RealChart(Chart):
.. PLOT::
- S2 = TopManifold(2, 'S^2')
+ S2 = Manifold(2, 'S^2', type='topological')
U = S2.open_subset('U'); V = S2.open_subset('V'); S2.declare_union(U,V)
c_xy = U.chart('x y'); x, y = c_xy[:]
c_uv = V.chart('u v'); u, v = c_uv[:]
@@ -2069,7 +2163,7 @@ class RealChart(Chart):
.. PLOT::
- S2 = TopManifold(2, 'S^2')
+ S2 = Manifold(2, 'S^2', type='topological')
U = S2.open_subset('U'); V = S2.open_subset('V'); S2.declare_union(U,V)
c_xy = U.chart('x y'); x, y = c_xy[:]
c_uv = V.chart('u v'); u, v = c_uv[:]
@@ -2096,7 +2190,7 @@ class RealChart(Chart):
performed for at most 3 coordinates, which must be specified via
the argument ``ambient_coords``)::
- sage: M = TopManifold(4, 'M')
+ sage: M = Manifold(4, 'M', type='topological')
sage: X.<t,x,y,z> = M.chart()
sage: g = X.plot(ambient_coords=(t,x,y)) # the coordinate z is not depicted
sage: show(g) # a 3D mesh cube
@@ -2105,7 +2199,7 @@ class RealChart(Chart):
.. PLOT::
- M = TopManifold(4, 'M')
+ M = Manifold(4, 'M', type='topological')
X = M.chart('t x y z'); t,x,y,z = X[:]
g = X.plot(ambient_coords=(t,y))
sphinx_plot(g)
@@ -2401,7 +2495,7 @@ class CoordChange(SageObject):
Transition map on a 2-dimensional topological manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: Y.<u,v> = M.chart()
sage: X_to_Y = X.transition_map(Y, [x+y, x-y])
@@ -2420,7 +2514,7 @@ class CoordChange(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: Y.<u,v> = M.chart()
sage: X_to_Y = X.transition_map(Y, [x+y, x-y])
@@ -2459,7 +2553,7 @@ class CoordChange(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: Y.<u,v> = M.chart()
sage: X_to_Y = X.transition_map(Y, [x+y, x-y])
@@ -2480,7 +2574,7 @@ class CoordChange(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: Y.<u,v> = M.chart()
sage: X_to_Y = X.transition_map(Y, [x+y, x-y])
@@ -2506,7 +2600,7 @@ class CoordChange(SageObject):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: Y.<u,v> = M.chart()
sage: X_to_Y = X.transition_map(Y, [x+y, x-y])
@@ -2530,7 +2624,7 @@ class CoordChange(SageObject):
Inverse of a coordinate transformation corresponding to a pi/3-rotation
in the plane::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: c_xy.<x,y> = M.chart()
sage: c_uv.<u,v> = M.chart()
sage: xy_to_uv = c_xy.transition_map(c_uv, ((x - sqrt(3)*y)/2, (sqrt(3)*x + y)/2))
@@ -2624,7 +2718,7 @@ class CoordChange(SageObject):
"transformation; use set_inverse() to set the inverse " +
"manually")
x2_to_x1 = list_x2_to_x1[0]
- self._inverse = self.__class__(self._chart2, self._chart1, *x2_to_x1)
+ self._inverse = type(self)(self._chart2, self._chart1, *x2_to_x1)
return self._inverse
@@ -2649,7 +2743,7 @@ class CoordChange(SageObject):
From spherical coordinates to Cartesian ones in the plane::
- sage: M = TopManifold(2, 'R^2')
+ sage: M = Manifold(2, 'R^2', type='topological')
sage: U = M.open_subset('U') # the complement of the half line {y=0, x>= 0}
sage: c_cart.<x,y> = U.chart()
sage: c_spher.<r,ph> = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi')
@@ -2682,7 +2776,7 @@ class CoordChange(SageObject):
check = kwds['check']
else:
check = True
- self._inverse = self.__class__(self._chart2, self._chart1,
+ self._inverse = type(self)(self._chart2, self._chart1,
*transformations)
if check:
print "Check of the inverse coordinate transformation:"
@@ -2710,7 +2804,7 @@ class CoordChange(SageObject):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: U.<u,v> = M.chart()
sage: X_to_U = X.transition_map(U, (x+y, x-y))
@@ -2730,7 +2824,7 @@ class CoordChange(SageObject):
"{} is different from {}".format(other._chart2,
other._chart1))
transf = self._transf(*(other._transf.expr()))
- return self.__class__(other._chart1, self._chart2, *transf)
+ return type(self)(other._chart1, self._chart2, *transf)
def restrict(self, dom1, dom2=None):
r"""
@@ -2749,7 +2843,7 @@ class CoordChange(SageObject):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: Y.<u,v> = M.chart()
sage: X_to_Y = X.transition_map(Y, [x+y, x-y])
@@ -2772,8 +2866,8 @@ class CoordChange(SageObject):
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()))
+ return type(self)(self._chart1.restrict(dom1),
+ self._chart2.restrict(dom2), *(self._transf.expr()))
def display(self):
r"""
@@ -2786,7 +2880,7 @@ class CoordChange(SageObject):
From spherical coordinates to Cartesian ones in the plane::
- sage: M = TopManifold(2, 'R^2')
+ sage: M = Manifold(2, 'R^2', type='topological')
sage: U = M.open_subset('U') # the complement of the half line {y=0, x>= 0}
sage: c_cart.<x,y> = U.chart()
sage: c_spher.<r,ph> = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi')
diff --git a/src/sage/manifolds/continuous_map.py b/src/sage/manifolds/continuous_map.py
index 83b15e9..5d3790d 100644
--- a/src/sage/manifolds/continuous_map.py
+++ b/src/sage/manifolds/continuous_map.py
@@ -49,7 +49,7 @@ class ContinuousMap(Morphism):
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`.
+ class is :class:`~sage.manifolds.manifold_homset.TopologicalManifoldHomset`.
INPUT:
@@ -84,7 +84,7 @@ class ContinuousMap(Morphism):
The standard embedding of the sphere `S^2` into `\RR^3`::
- sage: M = TopManifold(2, 'S^2') # the 2-dimensional sphere S^2
+ sage: M = Manifold(2, 'S^2', type='topological') # the 2-dimensional sphere S^2
sage: U = M.open_subset('U') # complement of the North pole
sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole
sage: V = M.open_subset('V') # complement of the South pole
@@ -94,7 +94,7 @@ class ContinuousMap(Morphism):
....: 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: N = Manifold(3, 'R^3', latex_name=r'\RR^3', type='topological') # 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)],
@@ -110,14 +110,14 @@ class ContinuousMap(Morphism):
sage: Phi.parent() is Hom(M, N)
True
sage: type(Phi)
- <class 'sage.manifolds.continuous_map.TopManifoldHomset_with_category.element_class'>
+ <class 'sage.manifolds.continuous_map.TopologicalManifoldHomset_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))
It is possible to create the map via the method
- :meth:`~sage.manifolds.manifold.TopManifold.continuous_map`
+ :meth:`~sage.manifolds.manifold.TopologicalManifold.continuous_map`
only in a single pair of charts: the argument ``coord_functions`` is then
a mere list of coordinate expressions (and not a dictionary) and the
arguments ``chart1`` and ``chart2`` have to be provided if the charts
@@ -174,7 +174,7 @@ class ContinuousMap(Morphism):
the projection from the point `(X,Y,Z)=(0,0,1)` onto the equatorial plane
`Z=0`::
- sage: P = TopManifold(2, 'R^2', r'\RR^2') # R^2 (equatorial plane)
+ sage: P = Manifold(2, 'R^2', latex_name=r'\RR^2', type='topological') # R^2 (equatorial plane)
sage: cP.<xP, yP> = P.chart()
sage: Psi = N.continuous_map(P, (X/(1-Z), Y/(1-Z)), name='Psi',
....: latex_name=r'\Psi')
@@ -210,16 +210,16 @@ class ContinuousMap(Morphism):
defined by a single symbolic expression for each pair of charts, and not
by a list/tuple with a single element::
- sage: N = TopManifold(1, 'N')
+ sage: N = Manifold(1, 'N', type='topological')
sage: c_N = N.chart('X')
sage: Phi = M.continuous_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 continuous map `\RR \rightarrow \RR^2`::
- sage: R = TopManifold(1, 'R') # field R
+ sage: R = Manifold(1, 'R', type='topological') # field R
sage: T.<t> = R.chart() # canonical chart on R
- sage: R2 = TopManifold(2, 'R^2') # R^2
+ sage: R2 = Manifold(2, 'R^2', type='topological') # R^2
sage: c_xy.<x,y> = R2.chart() # Cartesian coordinates on R^2
sage: Phi = R.continuous_map(R2, [cos(t), sin(t)], name='Phi') ; Phi
Continuous map Phi from the 1-dimensional topological manifold R to
@@ -338,9 +338,9 @@ class ContinuousMap(Morphism):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: N = TopManifold(3, 'N')
+ sage: N = Manifold(3, 'N', type='topological')
sage: Y.<u,v,w> = N.chart()
sage: f = Hom(M,N)({(X,Y): (x+y, x*y, x-y)}, name='f') ; f
Continuous map f from the 2-dimensional topological manifold M to
@@ -431,9 +431,9 @@ class ContinuousMap(Morphism):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: N = TopManifold(2, 'N')
+ sage: N = Manifold(2, 'N', type='topological')
sage: Y.<u,v> = N.chart()
sage: f = Hom(M,N)({(X,Y): (x+y,x*y)})
sage: f._repr_()
@@ -480,7 +480,7 @@ class ContinuousMap(Morphism):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = Hom(M,M)({(X,X): (x+y,x*y)}, name='f')
sage: f._latex_()
@@ -510,20 +510,22 @@ class ContinuousMap(Morphism):
TESTS::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: X.<x,y,z> = M.chart()
- sage: N = TopManifold(2, 'N')
+ sage: N = Manifold(2, 'N', type='topological')
sage: Y.<u,v> = N.chart()
sage: f = M.continuous_map(N, {(X,Y): [x+y+z, 2*x*y*z]}, name='f')
sage: g = M.continuous_map(N, {(X,Y): [x+y+z, 2*x*y*z]}, name='g')
- sage: f.__eq__(g)
+ sage: f == g
True
sage: g = M.continuous_map(N, {(X,Y): [x+y+z, 1]}, name='g')
- sage: f.__eq__(g)
+ sage: f == g
False
"""
- if not isinstance(other, self.__class__):
+ if other is self:
+ return True
+ if not isinstance(other, type(self)):
return False
if self.parent() != other.parent():
return False
@@ -554,9 +556,9 @@ class ContinuousMap(Morphism):
TESTS::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: X.<x,y,z> = M.chart()
- sage: N = TopManifold(2, 'N')
+ sage: N = Manifold(2, 'N', type='topological')
sage: Y.<u,v> = N.chart()
sage: f = M.continuous_map(N, {(X,Y): [x+y+z, 2*x*y*z]}, name='f')
sage: g = M.continuous_map(N, {(X,Y): [x+y+z, 2*x*y*z]}, name='g')
@@ -567,7 +569,7 @@ class ContinuousMap(Morphism):
True
"""
- return not self.__eq__(other)
+ return not (self == other)
def __cmp__(self, other):
r"""
@@ -577,9 +579,9 @@ class ContinuousMap(Morphism):
TESTS::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: X.<x,y,z> = M.chart()
- sage: N = TopManifold(2, 'N')
+ sage: N = Manifold(2, 'N', type='topological')
sage: Y.<u,v> = N.chart()
sage: f = M.continuous_map(N, {(X,Y): [x+y+z, 2*x*y*z]}, name='f')
sage: g = M.continuous_map(N, {(X,Y): [x+y+z, 2*x*y*z]}, name='g')
@@ -590,11 +592,41 @@ class ContinuousMap(Morphism):
-1
"""
- if self.__eq__(other):
+ if self == other:
return 0
else:
return -1
+ def _test_pickling(self, **options):
+ r"""
+ Test pickling.
+
+ This test is weaker than
+ :meth:`sage.structure.sage_object.SageObject._test_pickling` in that
+ 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 continuous map of the same
+ type as ``self``.
+
+ TEST::
+
+ sage: M = Manifold(3, 'M', type='topological')
+ sage: X.<x,y,z> = M.chart()
+ sage: N = Manifold(2, 'N', type='topological')
+ sage: Y.<u,v> = N.chart()
+ sage: f = M.continuous_map(N, {(X,Y): [x+y+z, 2*x*y*z]}, name='f')
+ sage: f._test_pickling()
+
+ """
+ tester = self._tester(**options)
+ from sage.misc.all import loads, dumps
+ bckp = loads(dumps(self))
+ tester.assertEqual(type(bckp), type(self))
+ tester.assertEqual(bckp._domain.dimension(), self._domain.dimension())
+ tester.assertEqual(bckp._codomain.dimension(), self._codomain.dimension())
+ tester.assertEqual(bckp._is_identity, self._is_identity)
+ tester.assertEqual(bckp._is_isomorphism, self._is_isomorphism)
+
#
# Map methods
#
@@ -606,19 +638,18 @@ class ContinuousMap(Morphism):
INPUT:
- ``point`` -- point in the domain of ``self``, as an instance of
- :class:`~sage.manifolds.point.TopManifoldPoint`
+ :class:`~sage.manifolds.point.TopologicalManifoldPoint`
OUTPUT:
- image of the point by ``self`` (instance of
- :class:`~sage.manifolds.point.TopManifoldPoint`)
+ :class:`~sage.manifolds.point.TopologicalManifoldPoint`)
EXAMPLES:
Planar rotation acting on a point::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'R^2', r'\RR^2') # Euclidean plane
+ sage: M = Manifold(2, 'R^2', latex_name=r'\RR^2', type='topological') # 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),
@@ -703,7 +734,7 @@ class ContinuousMap(Morphism):
Tests on continuous maps of a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: M.identity_map().is_identity() # obviously...
True
@@ -719,7 +750,7 @@ class ContinuousMap(Morphism):
Of course, if the codomain of the map does not coincide with its
domain, the outcome is ``False``::
- sage: N = TopManifold(2, 'N')
+ sage: N = Manifold(2, 'N', type='topological')
sage: Y.<u,v> = N.chart()
sage: a = M.continuous_map(N, {(X,Y): (x, y)})
sage: a.display()
@@ -767,11 +798,11 @@ class ContinuousMap(Morphism):
TESTS::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: X.<x,y,z> = M.chart()
- sage: N = TopManifold(2, 'N')
+ sage: N = Manifold(2, 'N', type='topological')
sage: Y.<u,v> = N.chart()
- sage: Q = TopManifold(4, 'Q')
+ sage: Q = Manifold(4, 'Q', type='topological')
sage: Z.<a,b,c,d> = Q.chart()
sage: f = N.continuous_map(Q, [u+v, u*v, 1+u, 2-v])
sage: g = M.continuous_map(N, [x+y+z, x*y*z])
@@ -829,7 +860,7 @@ class ContinuousMap(Morphism):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = M.continuous_map(M, [x+y, x*y], name='f')
sage: g = M.continuous_map(M, [1-y, 2+x], name='g')
@@ -861,7 +892,7 @@ class ContinuousMap(Morphism):
TEST::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = M.homeomorphism(M, [x+y, x-y])
sage: f._init_derived()
@@ -883,7 +914,7 @@ class ContinuousMap(Morphism):
TEST::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = M.homeomorphism(M, [x+y, x-y])
sage: f^(-1)
@@ -924,14 +955,13 @@ class ContinuousMap(Morphism):
Standard embedding of the sphere `S^2` in `\RR^3`::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'S^2') # the 2-dimensional sphere S^2
+ sage: M = Manifold(2, 'S^2', type='topological') # the 2-dimensional sphere S^2
sage: U = M.open_subset('U') # complement of the North pole
sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole
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: N = TopManifold(3, 'R^3', r'\RR^3') # R^3
+ sage: N = Manifold(3, 'R^3', latex_name=r'\RR^3', type='topological') # 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)],
@@ -1097,9 +1127,8 @@ class ContinuousMap(Morphism):
Continuous map from a 2-dimensional manifold to a 3-dimensional
one::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
- sage: N = TopManifold(3, 'N')
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: N = Manifold(3, 'N', type='topological')
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',
@@ -1284,9 +1313,8 @@ class ContinuousMap(Morphism):
Continuous map from a 2-dimensional manifold to a 3-dimensional
one::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
- sage: N = TopManifold(3, 'N')
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: N = Manifold(3, 'N', type='topological')
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',
@@ -1325,8 +1353,7 @@ class ContinuousMap(Morphism):
A rotation in some Euclidean plane::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M') # the plane (minus a segment to have global regular spherical coordinates)
+ sage: M = Manifold(2, 'M', type='topological') # the plane (minus a segment to have global regular spherical coordinates)
sage: c_spher.<r,ph> = M.chart(r'r:(0,+oo) ph:(0,2*pi):\phi') # spherical coordinates on the plane
sage: rot = M.continuous_map(M, (r, ph+pi/3), name='R') # pi/3 rotation around r=0
sage: rot.expr()
@@ -1371,8 +1398,7 @@ class ContinuousMap(Morphism):
Polar representation of a planar rotation initally defined in
Cartesian coordinates::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'R^2', r'\RR^2') # the Euclidean plane R^2
+ sage: M = Manifold(2, 'R^2', latex_name=r'\RR^2', type='topological') # the Euclidean plane R^2
sage: c_xy.<x,y> = M.chart() # Cartesian coordinate on R^2
sage: U = M.open_subset('U', coord_def={c_xy: (y!=0, x<0)}) # the complement of the segment y=0 and x>0
sage: c_cart = c_xy.restrict(U) # Cartesian coordinates on U
@@ -1473,8 +1499,7 @@ class ContinuousMap(Morphism):
Polar representation of a planar rotation initally defined in
Cartesian coordinates::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'R^2', r'\RR^2') # the Euclidean plane R^2
+ sage: M = Manifold(2, 'R^2', latex_name=r'\RR^2', type='topological') # the Euclidean plane R^2
sage: c_xy.<x,y> = M.chart() # Cartesian coordinate on R^2
sage: U = M.open_subset('U', coord_def={c_xy: (y!=0, x<0)}) # the complement of the segment y=0 and x>0
sage: c_cart = c_xy.restrict(U) # Cartesian coordinates on U
@@ -1586,11 +1611,12 @@ class ContinuousMap(Morphism):
INPUT:
- ``subdomain`` -- an open subset of the domain of the continuous map
- (must be an instance of :class:`~sage.manifolds.manifold.TopManifold`)
+ (must be an instance of
+ :class:`~sage.manifolds.manifold.TopologicalManifold`)
- ``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.
+ :class:`~sage.manifolds.manifold.TopologicalManifold`); if ``None``,
+ the codomain of the continuous map is assumed.
OUTPUT:
@@ -1602,7 +1628,7 @@ class ContinuousMap(Morphism):
Restriction to an annulus of a homeomorphism between the open unit
disk and `\RR^2`::
- sage: M = TopManifold(2, 'R^2') # R^2
+ sage: M = Manifold(2, 'R^2', type='topological') # 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)],
@@ -1679,8 +1705,8 @@ class ContinuousMap(Morphism):
return self._restrictions[(subdomain, subcodomain)]
# Generic case:
homset = Hom(subdomain, subcodomain)
- resu = self.__class__(homset, name=self._name,
- latex_name=self._latex_name)
+ resu = type(self)(homset, name=self._name,
+ latex_name=self._latex_name)
for charts in self._coord_expression:
for ch1 in charts[0]._subcharts:
if ch1._domain.is_subset(subdomain):
@@ -1714,8 +1740,7 @@ class ContinuousMap(Morphism):
The inverse of a rotation in the Euclidean plane::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'R^2', r'\RR^2')
+ sage: M = Manifold(2, 'R^2', latex_name=r'\RR^2', type='topological')
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),
@@ -1751,7 +1776,7 @@ class ContinuousMap(Morphism):
An example with multiple charts: the equatorial symmetry on the
2-sphere::
- sage: M = TopManifold(2, 'M') # the 2-dimensional sphere S^2
+ sage: M = Manifold(2, 'M', type='topological') # the 2-dimensional sphere S^2
sage: U = M.open_subset('U') # complement of the North pole
sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole
sage: V = M.open_subset('V') # complement of the South pole
@@ -1820,9 +1845,9 @@ class ContinuousMap(Morphism):
else:
latex_name = self._latex_name + r'^{-1}'
homset = Hom(self._codomain, self._domain)
- self._inverse = self.__class__(homset, coord_functions=coord_functions,
- name=name, latex_name=latex_name,
- is_isomorphism=True)
+ self._inverse = type(self)(homset, coord_functions=coord_functions,
+ name=name, latex_name=latex_name,
+ is_isomorphism=True)
return self._inverse
inverse = __invert__
diff --git a/src/sage/manifolds/coord_func.py b/src/sage/manifolds/coord_func.py
index fc4def0..89551fb 100644
--- a/src/sage/manifolds/coord_func.py
+++ b/src/sage/manifolds/coord_func.py
@@ -69,7 +69,7 @@ class CoordFunction(SageObject):
TEST::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -92,7 +92,7 @@ class CoordFunction(SageObject):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(1+x+y^2)
sage: f.chart()
@@ -126,7 +126,7 @@ class CoordFunction(SageObject):
Construction of a scalar field on a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: c_xy.<x,y> = M.chart()
sage: fc = c_xy.function(x+2*y^3)
sage: f = fc.scalar_field() ; f
@@ -157,7 +157,7 @@ class CoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x*y)
@@ -168,7 +168,7 @@ class CoordFunction(SageObject):
False
"""
- return not self.__eq__(other)
+ return not (self == other)
def __radd__(self, other):
r"""
@@ -185,7 +185,7 @@ class CoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x*y)
@@ -214,7 +214,7 @@ class CoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x*y)
@@ -243,7 +243,7 @@ class CoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x*y)
@@ -272,7 +272,7 @@ class CoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x*y)
@@ -301,7 +301,7 @@ class CoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x*y)
@@ -332,7 +332,7 @@ class CoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x*y)
@@ -361,7 +361,7 @@ class CoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x*y)
@@ -390,7 +390,7 @@ class CoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x*y)
@@ -417,7 +417,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -438,7 +438,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -459,7 +459,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -488,7 +488,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -521,7 +521,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -542,7 +542,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -567,7 +567,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -601,7 +601,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -630,12 +630,12 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
sage: g = CoordFunction(X)
- sage: f.__eq__(g)
+ sage: f == g
Traceback (most recent call last):
...
NotImplementedError: CoordFunction.__eq__ not implemented
@@ -656,7 +656,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -681,7 +681,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -711,7 +711,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -741,7 +741,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -771,7 +771,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -801,7 +801,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -831,7 +831,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -857,7 +857,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -889,7 +889,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -920,7 +920,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -947,7 +947,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -973,7 +973,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -999,7 +999,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1025,7 +1025,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1051,7 +1051,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1077,7 +1077,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1103,7 +1103,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1129,7 +1129,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1155,7 +1155,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1181,7 +1181,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1207,7 +1207,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1233,7 +1233,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1259,7 +1259,7 @@ class CoordFunction(SageObject):
This method must be implemented by derived classes; it is not
implemented here::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: from sage.manifolds.coord_func import CoordFunction
sage: f = CoordFunction(X)
@@ -1309,7 +1309,7 @@ class MultiCoordFunction(SageObject):
A function `f: V\subset \RR^2 \longrightarrow \RR^3`::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, cos(x)*exp(y)); f
Coordinate functions (x - y, x*y, cos(x)*e^y) on the Chart (M, (x, y))
@@ -1373,7 +1373,7 @@ class MultiCoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: X.<x,y,z> = M.chart()
sage: f = X.multifunction(x+y+z, x*y*z); f
Coordinate functions (x + y + z, x*y*z) on the Chart (M, (x, y, z))
@@ -1397,7 +1397,7 @@ class MultiCoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, cos(x)*exp(y))
sage: f._repr_()
@@ -1415,7 +1415,7 @@ class MultiCoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, cos(x)*exp(y))
sage: f._latex_()
@@ -1441,7 +1441,7 @@ class MultiCoordFunction(SageObject):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, cos(x)*exp(y))
sage: f.expr()
@@ -1467,7 +1467,7 @@ class MultiCoordFunction(SageObject):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, cos(x)*exp(y))
sage: f.chart()
@@ -1494,7 +1494,7 @@ class MultiCoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, cos(x*y))
sage: f == X.multifunction(x-y, x*y)
@@ -1508,6 +1508,8 @@ class MultiCoordFunction(SageObject):
False
"""
+ if other is self:
+ return True
if not isinstance(other, MultiCoordFunction):
return False
if other._chart != self._chart:
@@ -1534,7 +1536,7 @@ class MultiCoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, cos(x*y))
sage: f != X.multifunction(x-y, x*y)
@@ -1545,7 +1547,35 @@ class MultiCoordFunction(SageObject):
False
"""
- return not self.__eq__(other)
+ return not (self == other)
+
+ def _test_pickling(self, **options):
+ r"""
+ Test pickling.
+
+ This test is weaker than
+ :meth:`sage.structure.sage_object.SageObject._test_pickling` in that
+ 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 multi-coordinate function
+ of the same type as ``self`` and with the same coordinate expressions.
+
+ TEST::
+
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: X.<x,y> = M.chart()
+ sage: f = X.multifunction(x-y, x*y, cos(x*y))
+ sage: f._test_pickling()
+
+ """
+ tester = self._tester(**options)
+ from sage.misc.all import loads, dumps
+ bckp = loads(dumps(self))
+ tester.assertEqual(type(bckp), type(self))
+ tester.assertEqual(bckp._nf, self._nf)
+ for i in range(self._nf):
+ tester.assertEqual(bckp._functions[i]._express,
+ self._functions[i]._express)
def __getitem__(self, index):
r"""
@@ -1561,7 +1591,7 @@ class MultiCoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, cos(x*y))
sage: f.__getitem__(0)
@@ -1594,7 +1624,7 @@ class MultiCoordFunction(SageObject):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, cos(x*y))
sage: f.__call__(2,3)
@@ -1628,7 +1658,7 @@ class MultiCoordFunction(SageObject):
Jacobian of a set of 3 functions of 2 coordinates::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, y^3*cos(x))
sage: f.jacobian()
@@ -1648,7 +1678,7 @@ class MultiCoordFunction(SageObject):
Test with ``start_index=1``::
- sage: M = TopManifold(2, 'M', start_index=1)
+ sage: M = Manifold(2, 'M', type='topological', start_index=1)
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y, y^3*cos(x))
sage: f.jacobian()
@@ -1679,8 +1709,7 @@ class MultiCoordFunction(SageObject):
Jacobian determinant of a set of 2 functions of 2 coordinates::
- sage: M = TopManifold(3, 'M')
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.multifunction(x-y, x*y)
sage: f.jacobian_det()
@@ -1710,7 +1739,7 @@ class MultiCoordFunction(SageObject):
Jacobian determinant of a set of 3 functions of 3 coordinates::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: X.<x,y,z> = M.chart()
sage: f = X.multifunction(x*y+z^2, z^2*x+y^2*z, (x*y*z)^3)
sage: f.jacobian_det().display()
diff --git a/src/sage/manifolds/coord_func_symb.py b/src/sage/manifolds/coord_func_symb.py
index 6463771..fe5c64c 100644
--- a/src/sage/manifolds/coord_func_symb.py
+++ b/src/sage/manifolds/coord_func_symb.py
@@ -74,7 +74,7 @@ class CoordFunctionSymb(CoordFunction):
A symbolic coordinate function associated with a 2-dimensional chart::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x^2+3*y+1)
sage: type(f)
@@ -270,7 +270,7 @@ class CoordFunctionSymb(CoordFunction):
Coordinate function on a real manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(1+x*y); f
x*y + 1
@@ -280,7 +280,7 @@ class CoordFunctionSymb(CoordFunction):
Coordinate function on a complex manifold::
- sage: N = TopManifold(2, 'N', field='complex')
+ sage: N = Manifold(2, 'N', type='topological', field='complex')
sage: Y.<z,w> = N.chart()
sage: g = Y.function(i*z + 2*w); g
2*w + I*z
@@ -300,6 +300,31 @@ class CoordFunctionSymb(CoordFunction):
self._der = None # list of partial derivatives (to be set by diff()
# and unset by del_derived())
+ def _test_pickling(self, **options):
+ r"""
+ Test pickling.
+
+ This test is weaker than
+ :meth:`sage.structure.sage_object.SageObject._test_pickling` in that
+ 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 coordinate function with
+ the same coordinate expression as ``self``.
+
+ TEST::
+
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: X.<x,y> = M.chart()
+ sage: f = X.function(1+x*y)
+ sage: f._test_pickling()
+
+ """
+ tester = self._tester(**options)
+ from sage.misc.all import loads, dumps
+ bckp = loads(dumps(self))
+ tester.assertEqual(type(bckp), type(self))
+ tester.assertEqual(bckp._express, self._express)
+
# -------------------------------------------------------------
# Methods to be implemented by derived classes of CoordFunction
# -------------------------------------------------------------
@@ -310,7 +335,7 @@ class CoordFunctionSymb(CoordFunction):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(1+x*y)
sage: f._repr_()
@@ -332,7 +357,7 @@ class CoordFunctionSymb(CoordFunction):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(cos(x*y/2))
sage: f._latex_()
@@ -357,7 +382,7 @@ class CoordFunctionSymb(CoordFunction):
Coordinate function on a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(cos(x*y/2))
sage: f.display()
@@ -399,7 +424,7 @@ class CoordFunctionSymb(CoordFunction):
Coordinate function of a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x^2+3*y+1)
sage: f.expr()
@@ -453,7 +478,7 @@ class CoordFunctionSymb(CoordFunction):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(sin(x*y))
sage: f.__call__(-2, 3)
@@ -492,7 +517,7 @@ class CoordFunctionSymb(CoordFunction):
Coordinate functions associated to a 2-dimensional chart::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x^2+3*y+1)
sage: f.is_zero()
@@ -522,7 +547,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y^2)
sage: g = f.copy(); g
@@ -565,7 +590,7 @@ class CoordFunctionSymb(CoordFunction):
Partial derivatives of a 2-dimensional coordinate function::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x^2+3*y+1); f
x^2 + 3*y + 1
@@ -588,7 +613,7 @@ class CoordFunctionSymb(CoordFunction):
The index range depends on the convention used on the chart's domain::
- sage: M = TopManifold(2, 'M', start_index=1)
+ sage: M = Manifold(2, 'M', type='topological', start_index=1)
sage: X.<x,y> = M.chart()
sage: f = X.function(x^2+3*y+1)
sage: f.diff(0)
@@ -636,29 +661,29 @@ class CoordFunctionSymb(CoordFunction):
Coordinate functions associated to a 2-dimensional chart::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y^2)
sage: g = X.function(x+y^2)
- sage: f.__eq__(g)
- True
sage: f == g
True
- sage: f.__eq__(1)
+ sage: f == 1
False
sage: h = X.function(1)
- sage: h.__eq__(1)
+ sage: h == 1
True
- sage: h.__eq__(f)
+ sage: h == f
False
- sage: h.__eq__(0)
+ sage: h == 0
False
- sage: X.function(0).__eq__(0)
+ sage: X.function(0) == 0
True
- sage: X.zero_function().__eq__(0)
+ sage: X.zero_function() == 0
True
"""
+ if other is self:
+ return True
if isinstance(other, CoordFunctionSymb):
if other._chart != self._chart:
return False
@@ -681,7 +706,7 @@ class CoordFunctionSymb(CoordFunction):
Coordinate functions associated to a 2-dimensional chart::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y^2)
sage: g = +f; g
@@ -706,7 +731,7 @@ class CoordFunctionSymb(CoordFunction):
Coordinate functions associated to a 2-dimensional chart::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y^2)
sage: g = -f; g
@@ -736,7 +761,7 @@ class CoordFunctionSymb(CoordFunction):
Coordinate functions associated to a 2-dimensional chart::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(1+x^2+y^2)
sage: g = f.__invert__(); g
@@ -770,7 +795,7 @@ class CoordFunctionSymb(CoordFunction):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y^2)
sage: g = X.function(x+1)
@@ -824,7 +849,7 @@ class CoordFunctionSymb(CoordFunction):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y^2)
sage: g = X.function(x+1)
@@ -881,7 +906,7 @@ class CoordFunctionSymb(CoordFunction):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(x-y)
@@ -936,7 +961,7 @@ class CoordFunctionSymb(CoordFunction):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: g = X.function(1+x^2+y^2)
@@ -994,7 +1019,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: f.exp()
@@ -1026,7 +1051,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: f.log()
@@ -1059,7 +1084,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: f.__pow__(3)
@@ -1090,7 +1115,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x+y)
sage: f.sqrt()
@@ -1117,7 +1142,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.cos()
@@ -1144,7 +1169,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.sin()
@@ -1171,7 +1196,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.tan()
@@ -1198,7 +1223,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.arccos()
@@ -1227,7 +1252,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.arcsin()
@@ -1256,7 +1281,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.arctan()
@@ -1285,7 +1310,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.cosh()
@@ -1312,7 +1337,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.sinh()
@@ -1339,7 +1364,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.tanh()
@@ -1366,7 +1391,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.arccosh()
@@ -1395,7 +1420,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.arcsinh()
@@ -1424,7 +1449,7 @@ class CoordFunctionSymb(CoordFunction):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x*y)
sage: f.arctanh()
@@ -1452,7 +1477,7 @@ class CoordFunctionSymb(CoordFunction):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(cos(x*y))
sage: f._der
@@ -1484,7 +1509,7 @@ class CoordFunctionSymb(CoordFunction):
Simplification of a 2-dimension coordinate function::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(cos(x)^2+sin(x)^2 + sqrt(x^2))
sage: f.display()
@@ -1507,7 +1532,7 @@ class CoordFunctionSymb(CoordFunction):
Examples taking into account the declared range of a coordinate::
- sage: M = TopManifold(2, 'M_1')
+ sage: M = Manifold(2, 'M_1', type='topological')
sage: X.<x,y> = M.chart('x:(0,+oo) y')
sage: f = X.function(sqrt(x^2))
sage: f
@@ -1518,7 +1543,7 @@ class CoordFunctionSymb(CoordFunction):
::
sage: forget() # to clear the previous assumption on x
- sage: M = TopManifold(2, 'M_2')
+ sage: M = Manifold(2, 'M_2', type='topological')
sage: X.<x,y> = M.chart('x:(-oo,0) y')
sage: f = X.function(sqrt(x^2))
sage: f
@@ -1543,7 +1568,7 @@ class CoordFunctionSymb(CoordFunction):
Factorization of a 2-dimensional coordinate function::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x^2 + 2*x*y + y^2)
sage: f.display()
@@ -1573,7 +1598,7 @@ class CoordFunctionSymb(CoordFunction):
Expanding a 2-dimensional coordinate function::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function((x - y)^2)
sage: f.display()
@@ -1609,7 +1634,7 @@ class CoordFunctionSymb(CoordFunction):
Action on a 2-dimensional coordinate function::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x^2*y + x*y + (x*y)^2)
sage: f.display()
@@ -1644,7 +1669,7 @@ class CoordFunctionSymb(CoordFunction):
Action on a 2-dimensional coordinate function::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = X.function(x/(x^2*y + x*y))
sage: f.display()
diff --git a/src/sage/manifolds/manifold.py b/src/sage/manifolds/manifold.py
index aa94a05..2ab96ec 100644
--- a/src/sage/manifolds/manifold.py
+++ b/src/sage/manifolds/manifold.py
@@ -9,26 +9,30 @@ 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:`TopManifold`.
+Topological manifolds are implemented via the class :class:`TopologicalManifold`.
Open subsets of topological manifolds are also implemented via
-:class:`TopManifold`, since they are topological manifolds by themselves.
+: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`).
-:class:`TopManifold` 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'``.
.. RUBRIC:: Example 1: the 2-sphere as a topological manifold of dimension
2 over `\RR`
One starts by declaring `S^2` as a 2-dimensional topological manifold::
- sage: M = TopManifold(2, 'S^2')
+ sage: M = Manifold(2, 'S^2', type='topological')
sage: M
2-dimensional topological manifold S^2
Since the base topological field has not been specified in the argument list
-of ``TopManifold``, `\RR` is assumed::
+of ``Manifold``, `\RR` is assumed::
sage: M.base_field()
Real Field with 53 bits of precision
@@ -82,9 +86,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', restrictions1= x^2+y^2!=0,
@@ -143,7 +147,8 @@ Let us consider the point of coordinates (1,2) in the chart ``stereoN``::
sage: p in W
True
-The coordinates of `p` in the chart ``stereoS`` are::
+The coordinates of `p` in the chart ``stereoS`` are computed by letting
+the chart act on the point::
sage: stereoS(p)
(1/5, 2/5)
@@ -188,7 +193,7 @@ A continuous map `S^2\rightarrow \RR` (scalar field)::
We declare the Riemann sphere `\CC^*` as a 1-dimensional topological manifold
over `\CC`::
- sage: M = TopManifold(1, 'C*', field='complex'); M
+ sage: M = Manifold(1, 'C*', type='topological', field='complex'); M
Complex 1-dimensional topological manifold C*
We introduce a first open subset, which is actually
@@ -268,6 +273,25 @@ The following subsets and charts have been defined::
sage: M.atlas()
[Chart (U, (z,)), Chart (V, (w,)), Chart (A, (z,)), Chart (A, (w,))]
+A constant map `\CC^* \rightarrow \CC`::
+
+ sage: f = M.constant_scalar_field(3+2*I, name='f'); f
+ Scalar field f on the Complex 1-dimensional topological manifold C*
+ sage: f.display()
+ f: C* --> C
+ on U: z |--> 2*I + 3
+ on V: w |--> 2*I + 3
+ sage: f(O)
+ 2*I + 3
+ sage: f(i)
+ 2*I + 3
+ sage: f(inf)
+ 2*I + 3
+ sage: f.parent()
+ Algebra of scalar fields on the Complex 1-dimensional topological
+ manifold C*
+ sage: f.parent().category()
+ Category of commutative algebras over Symbolic Ring
AUTHORS:
@@ -298,10 +322,10 @@ from sage.categories.manifolds import Manifolds
from sage.rings.all import CC
from sage.rings.real_mpfr import RR
from sage.categories.homset import Hom
-from sage.manifolds.subset import TopManifoldSubset
+from sage.manifolds.subset import TopologicalManifoldSubset
from sage.manifolds.scalarfield_algebra import ScalarFieldAlgebra
-class TopManifold(TopManifoldSubset):
+class TopologicalManifold(TopologicalManifoldSubset):
r"""
Topological manifold over a topological field `K`.
@@ -314,7 +338,7 @@ class TopManifold(TopManifoldSubset):
- 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.TopManifoldPoint`.
+ class being :class:`~sage.manifolds.point.TopologicalManifoldPoint`.
INPUT:
@@ -346,11 +370,13 @@ class TopManifold(TopManifoldSubset):
A 4-dimensional topological manifold (over `\RR`)::
- sage: M = TopManifold(4, 'M', latex_name=r'\mathcal{M}')
+ sage: M = Manifold(4, 'M', latex_name=r'\mathcal{M}', type='topological')
sage: M
4-dimensional topological manifold M
sage: latex(M)
\mathcal{M}
+ sage: type(M)
+ <class 'sage.manifolds.manifold.TopologicalManifold_with_category'>
sage: M.base_field()
Real Field with 53 bits of precision
sage: dim(M)
@@ -359,28 +385,28 @@ class TopManifold(TopManifoldSubset):
The input parameter ``start_index`` defines the range of indices on the
manifold::
- sage: M = TopManifold(4, 'M')
+ sage: M = Manifold(4, 'M', type='topological')
sage: list(M.irange())
[0, 1, 2, 3]
- sage: M = TopManifold(4, 'M', start_index=1)
+ sage: M = Manifold(4, 'M', type='topological', start_index=1)
sage: list(M.irange())
[1, 2, 3, 4]
- sage: list(TopManifold(4, 'M', start_index=-2).irange())
+ sage: list(Manifold(4, 'M', type='topological', start_index=-2).irange())
[-2, -1, 0, 1]
A complex manifold::
- sage: N = TopManifold(3, 'N', field='complex'); N
+ sage: N = Manifold(3, 'N', type='topological', field='complex'); N
Complex 3-dimensional topological manifold N
A manifold over `\QQ`::
- sage: N = TopManifold(6, 'N', field=QQ); N
+ sage: N = Manifold(6, 'N', type='topological', field=QQ); N
6-dimensional topological manifold N over the Rational Field
A manifold over `\QQ_5`, the field of 5-adic numbers::
- sage: N = TopManifold(2, 'N', field=Qp(5)); N
+ sage: N = Manifold(2, 'N', type='topological', field=Qp(5)); N
2-dimensional topological manifold N over the 5-adic Field with capped
relative precision 20
@@ -415,27 +441,18 @@ class TopManifold(TopManifoldSubset):
True
The manifold's points are instances of class
- :class:`~sage.manifolds.point.TopManifoldPoint`::
+ :class:`~sage.manifolds.point.TopologicalManifoldPoint`::
- sage: isinstance(p, sage.manifolds.point.TopManifoldPoint)
+ sage: isinstance(p, sage.manifolds.point.TopologicalManifoldPoint)
True
- Manifolds are unique, as long as they are created with the same arguments::
-
- sage: M is TopManifold(4, 'M', start_index=1)
- True
- sage: M is TopManifold(4, 'M')
- False
- sage: M is TopManifold(4, 'M', latex_name='M', start_index=1)
- False
-
Since an open subset of a topological manifold `M` is itself a topological
manifold, open subsets of `M` are instances of the class
- :class:`TopManifold`::
+ :class:`TopologicalManifold`::
sage: U = M.open_subset('U'); U
Open subset U of the 4-dimensional topological manifold M
- sage: isinstance(U, sage.manifolds.manifold.TopManifold)
+ sage: isinstance(U, sage.manifolds.manifold.TopologicalManifold)
True
sage: U.base_field() == M.base_field()
True
@@ -455,7 +472,8 @@ class TopManifold(TopManifoldSubset):
TESTS::
- sage: M = TopManifold(3, 'M', latex_name=r'\mathbb{M}', start_index=1)
+ sage: M = Manifold(3, 'M', latex_name=r'\mathbb{M}',
+ ....: type='topological', start_index=1)
sage: M
3-dimensional topological manifold M
sage: latex(M)
@@ -489,12 +507,12 @@ class TopManifold(TopManifoldSubset):
category = Manifolds(self._field)
if ambient_manifold is None:
ambient_manifold = self
- elif not isinstance(ambient_manifold, TopManifold):
+ elif not isinstance(ambient_manifold, TopologicalManifold):
raise TypeError("the argument 'ambient_manifold' must be " +
"a topological manifold")
# Initialization as a subset of the ambient manifold (possibly itself):
- TopManifoldSubset.__init__(self, ambient_manifold, name,
- latex_name=latex_name, category=category)
+ TopologicalManifoldSubset.__init__(self, ambient_manifold, name,
+ latex_name=latex_name, category=category)
self._is_open = True
self._open_covers = [[self]] # list of open covers of self
self._atlas = [] # list of charts defined on subsets of self
@@ -511,6 +529,8 @@ class TopManifold(TopManifoldSubset):
self._zero_scalar_field = self.scalar_field_algebra().zero()
# The unit scalar field:
self._one_scalar_field = self.scalar_field_algebra().one()
+ # Dictionary of sets of morphisms to over manifolds (keys: codomains):
+ self._homsets = {} # to be populated by self._Hom_
# The identity map on self:
self._identity_map = Hom(self, self).one()
@@ -520,17 +540,17 @@ class TopManifold(TopManifoldSubset):
TESTS::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: M._repr_()
'3-dimensional topological manifold M'
sage: repr(M) # indirect doctest
'3-dimensional topological manifold M'
sage: M # indirect doctest
3-dimensional topological manifold M
- sage: M = TopManifold(3, 'M', field='complex')
+ sage: M = Manifold(3, 'M', type='topological', field='complex')
sage: M._repr_()
'Complex 3-dimensional topological manifold M'
- sage: M = TopManifold(3, 'M', field=QQ)
+ sage: M = Manifold(3, 'M', type='topological', field=QQ)
sage: M._repr_()
'3-dimensional topological manifold M over the Rational Field'
@@ -561,12 +581,13 @@ class TopManifold(TopManifoldSubset):
TESTS::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: M._latex_()
'M'
sage: latex(M)
M
- sage: M = TopManifold(3, 'M', latex_name=r'\mathcal{M}')
+ sage: M = Manifold(3, 'M', latex_name=r'\mathcal{M}',
+ ....: type='topological')
sage: M._latex_()
'\\mathcal{M}'
sage: latex(M)
@@ -575,13 +596,83 @@ class TopManifold(TopManifoldSubset):
"""
return self._latex_name
+ def __reduce__(self):
+ r"""
+ Reduction function for the pickle protocole.
+
+ TESTS::
+
+ sage: M = Manifold(3, 'M', type='topological')
+ sage: M.__reduce__()
+ (<class 'sage.manifolds.manifold.TopologicalManifold'>,
+ (3,
+ 'M',
+ 'M',
+ Real Field with 53 bits of precision,
+ 0,
+ Category of manifolds over Real Field with 53 bits of precision,
+ None))
+ sage: U = M.open_subset('U')
+ sage: U.__reduce__()
+ (<class 'sage.manifolds.manifold.TopologicalManifold'>,
+ (3,
+ 'U',
+ 'U',
+ Real Field with 53 bits of precision,
+ 0,
+ Category of facade manifolds over Real Field with 53 bits of precision,
+ 3-dimensional topological manifold M))
+
+ Tests of pickling::
+
+ sage: loads(dumps(M))
+ 3-dimensional topological manifold M
+ sage: loads(dumps(U))
+ Open subset U of the 3-dimensional topological manifold M
+
+ """
+ if self._manifold is self:
+ ambient_manifold = None
+ else:
+ ambient_manifold = self._manifold
+ return (TopologicalManifold, (self._dim, self._name, self._latex_name,
+ self._field, self._sindex,
+ self.category(), ambient_manifold))
+
+ def _test_pickling(self, **options):
+ r"""
+ Test pickling.
+
+ This test is weaker than
+ :meth:`sage.structure.sage_object.SageObject._test_pickling` in that
+ 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).
+
+ TESTS::
+
+ sage: M = Manifold(3, 'M', type='topological')
+ sage: M._test_pickling()
+ sage: M = Manifold(3, 'M', type='topological', field='complex')
+ sage: M._test_pickling()
+
+ """
+ tester = self._tester(**options)
+ from sage.misc.all import loads, dumps
+ bckp = loads(dumps(self))
+ tester.assertEqual(type(bckp), type(self))
+ tester.assertEqual(bckp.category(), self.category())
+ tester.assertEqual(bckp._dim, self._dim)
+ tester.assertEqual(bckp._name, self._name)
+
def _an_element_(self):
r"""
Construct some point on the manifold.
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M._an_element_(); p
Point on the 2-dimensional topological manifold M
@@ -678,7 +769,7 @@ class TopManifold(TopManifoldSubset):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M.point((1,2), chart=X)
sage: M.__contains__(p)
@@ -719,7 +810,7 @@ class TopManifold(TopManifoldSubset):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: M.dimension()
2
@@ -748,13 +839,13 @@ class TopManifold(TopManifoldSubset):
EXAMPLES::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: M.base_field()
Real Field with 53 bits of precision
- sage: M = TopManifold(3, 'M', field='complex')
+ sage: M = Manifold(3, 'M', type='topological', field='complex')
sage: M.base_field()
Complex Field with 53 bits of precision
- sage: M = TopManifold(3, 'M', field=QQ)
+ sage: M = Manifold(3, 'M', type='topological', field=QQ)
sage: M.base_field()
Rational Field
@@ -776,10 +867,10 @@ class TopManifold(TopManifoldSubset):
EXAMPLES::
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: M.start_index()
0
- sage: M = TopManifold(3, 'M', start_index=1)
+ sage: M = Manifold(3, 'M', type='topological', start_index=1)
sage: M.start_index()
1
@@ -805,7 +896,7 @@ class TopManifold(TopManifoldSubset):
Index range on a 4-dimensional manifold::
- sage: M = TopManifold(4, 'M')
+ sage: M = Manifold(4, 'M', type='topological')
sage: for i in M.irange():
....: print i,
....:
@@ -819,7 +910,7 @@ class TopManifold(TopManifoldSubset):
Index range on a 4-dimensional manifold with starting index=1::
- sage: M = TopManifold(4, 'M', start_index=1)
+ sage: M = Manifold(4, 'M', type='topological', start_index=1)
sage: for i in M.irange():
....: print i,
....:
@@ -862,7 +953,7 @@ class TopManifold(TopManifoldSubset):
Indices on a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M', start_index=1)
+ sage: M = Manifold(2, 'M', type='topological', start_index=1)
sage: for ind in M.index_generator(2):
....: print ind
....:
@@ -910,23 +1001,42 @@ class TopManifold(TopManifoldSubset):
EXAMPLES:
- Charts on subsets of `\RR^2`::
+ Let us consider `\RR^2` as a 2-dimensional manifold::
+
+ sage: M = Manifold(2, 'R^2', type='topological')
+
+ Immediately after the manifold creation, the atlas is empty, since no
+ chart has been defined yet::
- sage: M = TopManifold(2, 'R^2')
- sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2
+ sage: M.atlas()
+ []
+
+ Let us introduce the chart of Cartesian coordinates::
+
+ sage: c_cart.<x,y> = M.chart()
sage: M.atlas()
[Chart (R^2, (x, y))]
- sage: U = M.open_subset('U', coord_def={c_cart: (y!=0,x<0)}) # U = R^2 \ half line {y=0,x>=0}
+
+ The complement of the half line `\{y=0,\; x\geq 0\}`::
+
+ sage: U = M.open_subset('U', coord_def={c_cart: (y!=0,x<0)})
sage: U.atlas()
[Chart (U, (x, y))]
sage: M.atlas()
[Chart (R^2, (x, y)), Chart (U, (x, y))]
- sage: c_spher.<r, ph> = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi') # spherical (polar) coordinates on U
+
+ Spherical (polar) coordinates on `U`::
+
+ sage: c_spher.<r, ph> = U.chart(r'r:(0,+oo) ph:(0,2*pi):\phi')
sage: U.atlas()
[Chart (U, (x, y)), Chart (U, (r, ph))]
sage: M.atlas()
[Chart (R^2, (x, y)), Chart (U, (x, y)), Chart (U, (r, ph))]
+ .. SEEALSO::
+
+ :meth:`top_charts`
+
"""
return self._atlas
@@ -944,20 +1054,24 @@ class TopManifold(TopManifoldSubset):
Charts on a 2-dimensional manifold::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: U = M.open_subset('U', coord_def={X: x>0})
sage: Y.<u,v> = U.chart()
sage: M.top_charts()
[Chart (M, (x, y)), Chart (U, (u, v))]
- Note that the (user) atlas contains one more chart: (U, (x,y)), which
- is not a "top" chart::
+ Note that the (user) atlas contains one more chart: ``(U, (x,y))``,
+ which is not a "top" chart::
sage: M.atlas()
[Chart (M, (x, y)), Chart (U, (x, y)), Chart (U, (u, v))]
+ .. SEEALSO::
+
+ :meth:`atlas` for the complete list of charts defined on the
+ manifold.
+
"""
return self._top_charts
@@ -977,8 +1091,7 @@ class TopManifold(TopManifoldSubset):
Default chart on a 2-dimensional manifold and on some subsets::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: M.chart('x y')
Chart (M, (x, y))
sage: M.chart('u v')
@@ -1006,8 +1119,7 @@ class TopManifold(TopManifoldSubset):
Charts on a 2-dimensional manifold::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: c_xy.<x,y> = M.chart()
sage: c_uv.<u,v> = M.chart()
sage: M.default_chart()
@@ -1052,13 +1164,12 @@ class TopManifold(TopManifoldSubset):
Change of coordinates on a 2-dimensional manifold::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: c_xy.<x,y> = M.chart()
sage: c_uv.<u,v> = M.chart()
- sage: c_xy.transition_map(c_uv, (x+y, x-y)) # defines the coordinate change
+ sage: c_xy.transition_map(c_uv, (x+y, x-y)) # defines the coord. change
Change of coordinates from Chart (M, (x, y)) to Chart (M, (u, v))
- sage: M.coord_change(c_xy, c_uv) # returns the coordinate change defined above
+ sage: M.coord_change(c_xy, c_uv) # returns the coord. change defined above
Change of coordinates from Chart (M, (x, y)) to Chart (M, (u, v))
"""
@@ -1081,8 +1192,7 @@ class TopManifold(TopManifoldSubset):
Various changes of coordinates on a 2-dimensional manifold::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: c_xy.<x,y> = M.chart()
sage: c_uv.<u,v> = M.chart()
sage: xy_to_uv = c_xy.transition_map(c_uv, [x+y, x-y])
@@ -1128,8 +1238,7 @@ class TopManifold(TopManifoldSubset):
EXAMPLES::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: U = M.open_subset('U')
sage: X.<x,y> = U.chart()
sage: U.is_manifestly_coordinate_domain()
@@ -1150,7 +1259,7 @@ class TopManifold(TopManifoldSubset):
An open subset is a set that is (i) included in the manifold and (ii)
open with respect to the manifold's topology. It is a topological
manifold by itself. Hence the returned object is an instance of
- :class:`TopManifold`.
+ :class:`TopologicalManifold`.
INPUT:
@@ -1164,14 +1273,13 @@ class TopManifold(TopManifoldSubset):
OUTPUT:
- - the open subset, as an instance of :class:`TopManifold`.
+ - the open subset, as an instance of :class:`TopologicalManifold`.
EXAMPLES:
Creating an open subset of a 2-dimensional manifold::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: A = M.open_subset('A'); A
Open subset A of the 2-dimensional topological manifold M
@@ -1179,7 +1287,7 @@ class TopManifold(TopManifoldSubset):
topological manifold, on the same topological field and of the same
dimension as ``M``::
- sage: isinstance(A, sage.manifolds.manifold.TopManifold)
+ sage: isinstance(A, sage.manifolds.manifold.TopologicalManifold)
True
sage: A.base_field() == M.base_field()
True
@@ -1204,7 +1312,7 @@ class TopManifold(TopManifoldSubset):
Defining an open subset by some coordinate restrictions: the open
unit disk in `\RR^2`::
- sage: M = TopManifold(2, 'R^2')
+ sage: M = Manifold(2, 'R^2', type='topological')
sage: c_cart.<x,y> = M.chart() # Cartesian coordinates on R^2
sage: U = M.open_subset('U', coord_def={c_cart: x^2+y^2<1}); U
Open subset U of the 2-dimensional topological manifold R^2
@@ -1226,16 +1334,17 @@ class TopManifold(TopManifoldSubset):
False
"""
- resu = TopManifold(self._dim, name, latex_name=latex_name,
+ resu = TopologicalManifold(self._dim, name, latex_name=latex_name,
field=self._field, start_index=self._sindex,
category=self.category(),
ambient_manifold=self._manifold)
#!# NB: the above could have been
- # resu = type(self).__base__(...) instead of resu = TopManifold(...)
+ # resu = type(self).__base__(...)
+ # instead of resu = TopologicalManifold(...)
# 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__(...)
+ # resu = type(self)(...)
# cf. the discussion in
# https://groups.google.com/forum/#!topic/sage-devel/jHlFxhMDf3Y
resu._supersets.update(self._supersets)
@@ -1316,8 +1425,7 @@ class TopManifold(TopManifoldSubset):
Chart on a 2-dimensional manifold::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: U = M.open_subset('U')
sage: X = U.chart('x y'); X
Chart (U, (x, y))
@@ -1347,8 +1455,7 @@ class TopManifold(TopManifoldSubset):
left-hand side of the chart declaration (there is then no need to
pass the string 'x y' to chart())::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: U = M.open_subset('U')
sage: X.<x,y> = U.chart(); X
Chart (U, (x, y))
@@ -1392,8 +1499,7 @@ class TopManifold(TopManifoldSubset):
Scalar algebra of a 3-dimensional open subset::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: U = M.open_subset('U')
sage: CU = U.scalar_field_algebra() ; CU
Algebra of scalar fields on the Open subset U of the 3-dimensional topological manifold M
@@ -1451,8 +1557,7 @@ class TopManifold(TopManifoldSubset):
A scalar field defined by its coordinate expression in the open
set's default chart::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(3, 'M')
+ sage: M = Manifold(3, 'M', type='topological')
sage: U = M.open_subset('U')
sage: c_xyz.<x,y,z> = U.chart()
sage: f = U.scalar_field(sin(x)*cos(y) + z, name='F'); f
@@ -1521,7 +1626,7 @@ class TopManifold(TopManifoldSubset):
A constant scalar field on the 2-sphere::
- sage: M = TopManifold(2, 'M') # the 2-dimensional sphere S^2
+ sage: M = Manifold(2, 'M', type='topological') # the 2-dimensional sphere S^2
sage: U = M.open_subset('U') # complement of the North pole
sage: c_xy.<x,y> = U.chart() # stereographic coordinates from the North pole
sage: V = M.open_subset('V') # complement of the South pole
@@ -1568,8 +1673,7 @@ class TopManifold(TopManifoldSubset):
EXAMPLE::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = M.zero_scalar_field() ; f
Scalar field zero on the 2-dimensional topological manifold M
@@ -1597,7 +1701,7 @@ class TopManifold(TopManifoldSubset):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: f = M.one_scalar_field(); f
Scalar field 1 on the 2-dimensional topological manifold M
@@ -1629,23 +1733,28 @@ class TopManifold(TopManifoldSubset):
- the homset Hom(U,V), where U is ``self`` and V is ``other``
See class
- :class:`~sage.manifolds.manifold_homset.TopManifoldHomset`
+ :class:`~sage.manifolds.manifold_homset.TopologicalManifoldHomset`
for more documentation.
TESTS::
- sage: M = TopManifold(2, 'M')
- sage: N = TopManifold(3, 'N')
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: N = Manifold(3, 'N', type='topological')
sage: H = M._Hom_(N); H
Set of Morphisms from 2-dimensional topological manifold M to
3-dimensional topological manifold N in Category of manifolds over
Real Field with 53 bits of precision
+
+ The result is cached::
+
sage: H is Hom(M, N)
True
"""
- from sage.manifolds.manifold_homset import TopManifoldHomset
- return TopManifoldHomset(self, other)
+ from sage.manifolds.manifold_homset import TopologicalManifoldHomset
+ if other not in self._homsets:
+ self._homsets[other] = TopologicalManifoldHomset(self, other)
+ return self._homsets[other]
def continuous_map(self, codomain, coord_functions=None, chart1=None,
chart2=None, name=None, latex_name=None):
@@ -1659,7 +1768,7 @@ class TopManifold(TopManifoldSubset):
INPUT:
- ``codomain`` -- the map's codomain (must be an instance
- of :class:`TopManifold`)
+ of :class:`TopologicalManifold`)
- ``coord_functions`` -- (default: ``None``) if not ``None``, must be
either
@@ -1699,11 +1808,10 @@ class TopManifold(TopManifoldSubset):
A continuous map between an open subset of `S^2` covered by regular
spherical coordinates and `\RR^3`::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'S^2')
+ sage: M = Manifold(2, 'S^2', type='topological')
sage: U = M.open_subset('U')
sage: c_spher.<th,ph> = U.chart(r'th:(0,pi):\theta ph:(0,2*pi):\phi')
- sage: N = TopManifold(3, 'R^3', r'\RR^3')
+ sage: N = Manifold(3, 'R^3', latex_name=r'\RR^3', type='topological')
sage: c_cart.<x,y,z> = N.chart() # Cartesian coord. on R^3
sage: Phi = U.continuous_map(N, (sin(th)*cos(ph), sin(th)*sin(ph), cos(th)),
....: name='Phi', latex_name=r'\Phi')
@@ -1764,7 +1872,7 @@ class TopManifold(TopManifoldSubset):
INPUT:
- ``codomain`` -- codomain of the homeomorphism (must be an instance
- of :class:`TopManifold`)
+ of :class:`TopologicalManifold`)
- ``coord_functions`` -- (default: ``None``) if not ``None``, must be
either
@@ -1802,12 +1910,11 @@ class TopManifold(TopManifoldSubset):
Homeomorphism between the open unit disk in `\RR^2` and `\RR^2`::
- sage: TopManifold._clear_cache_() # for doctests only
sage: forget() # for doctests only
- sage: M = TopManifold(2, 'M') # the open unit disk
+ sage: M = Manifold(2, 'M', type='topological') # the open unit disk
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 = TopManifold(2, 'N') # R^2
+ sage: N = Manifold(2, 'N', type='topological') # R^2
sage: c_XY.<X,Y> = N.chart() # canonical coordinates on R^2
sage: Phi = M.homeomorphism(N, [x/sqrt(1-x^2-y^2), y/sqrt(1-x^2-y^2)],
....: name='Phi', latex_name=r'\Phi')
@@ -1877,7 +1984,7 @@ class TopManifold(TopManifoldSubset):
Identity map of a complex manifold::
- sage: M = TopManifold(2, 'M', field='complex')
+ sage: M = Manifold(2, 'M', type='topological', field='complex')
sage: X.<x,y> = M.chart()
sage: id = M.identity_map(); id
Identity map Id_M of the Complex 2-dimensional topological manifold M
@@ -1900,3 +2007,147 @@ class TopManifold(TopManifoldSubset):
"""
return self._identity_map
+
+
+def Manifold(dim, name, latex_name=None, field='real', type='smooth',
+ start_index=0, **extra_kwds):
+ r"""
+ Construct a manifold of a given type over a topological field `K`.
+
+ INPUT:
+
+ - ``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 ``RR`` for a manifold over `\RR`
+ - ``'complex'`` or ``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
+
+ - ``'topological'`` or ``'top'`` for a topological manifold
+ - ``'differentiable'`` or ``'diff'`` for a differentiable manifold
+ - ``'smooth'`` for a smooth manifold
+ - ``'analytic'`` for an analytic manifold
+
+ - ``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
+ - ``extra_kwds`` -- keywords meaningful only for some specific types of
+ manifolds
+
+ OUTPUT:
+
+ - a manifold of the specified type, as an instance of
+ :class:`~sage.manifolds.manifold.TopologicalManifold` or one of its
+ subclasses.
+
+ EXAMPLES:
+
+ A 3-dimensional real topological manifold::
+
+ 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::
+
+ sage: M = Manifold(3, 'M', type='topological', field='real'); M
+ 3-dimensional topological manifold M
+
+ A complex topological manifold::
+
+ sage: M = Manifold(3, 'M', type='topological', field='complex'); M
+ Complex 3-dimensional topological manifold M
+
+ A topological manifold over `\QQ`::
+
+ sage: M = Manifold(3, 'M', type='topological', field=QQ); M
+ 3-dimensional topological manifold M over the Rational Field
+
+ See the documentation of class
+ :class:`~sage.manifolds.manifold.TopologicalManifold` for more
+ detailed examples.
+
+ .. RUBRIC:: Uniqueness of manifold objects
+
+ Suppose we construct a manifold named `M`::
+
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: X.<x,y> = M.chart()
+
+ At some point, we change our mind and would like to restart with a new
+ manifold, using the same name `M` and keeping the previous manifold for
+ reference::
+
+ sage: M_old = M # for reference
+ sage: M = Manifold(2, 'M', type='topological')
+
+ This results in a brand new object::
+
+ sage: M.atlas()
+ []
+
+ The object ``M_old`` is intact::
+
+ sage: M_old.atlas()
+ [Chart (M, (x, y))]
+
+ Both objects have the same display::
+
+ sage: M
+ 2-dimensional topological manifold M
+ sage: M_old
+ 2-dimensional topological manifold M
+
+ but they are different::
+
+ sage: M != M_old
+ True
+
+ Let us introduce a chart on ``M``, using the same coordinate symbols as
+ for ``M_old``::
+
+ sage: X.<x,y> = M.chart()
+
+ The charts are displayed in the same way::
+
+ sage: M.atlas()
+ [Chart (M, (x, y))]
+ sage: M_old.atlas()
+ [Chart (M, (x, y))]
+
+ but they are actually different::
+
+ sage: M.atlas()[0] != M_old.atlas()[0]
+ True
+
+ Moreover, the two manifolds ``M`` and ``M_old`` are still considered
+ distinct::
+
+ sage: M != M_old
+ True
+
+ This reflects the fact that the equality of manifold objects holds only
+ for identical objects, i.e. one has ``M1 == M2`` if, and only if,
+ ``M1 is M2``. Actually, the manifold classes inherit from
+ :class:`~sage.misc.fast_methods.WithEqualityById`::
+
+ sage: isinstance(M, sage.misc.fast_methods.WithEqualityById)
+ True
+
+ """
+ type_ = type # in case the built-in function type is to be restored...
+ if type_ in ['topological', 'top']:
+ return TopologicalManifold(dim, name, latex_name=latex_name,
+ field=field, start_index=start_index)
+ raise NotImplementedError("manifolds of type {} are not ".format(type_) +
+ "implemented")
diff --git a/src/sage/manifolds/manifold_homset.py b/src/sage/manifolds/manifold_homset.py
index 2ba9a63..7ed4d72 100644
--- a/src/sage/manifolds/manifold_homset.py
+++ b/src/sage/manifolds/manifold_homset.py
@@ -1,7 +1,7 @@
r"""
Sets of morphisms between topological manifolds
-The class :class:`TopManifoldHomset` implements sets of morphisms between
+The class :class:`TopologicalManifoldHomset` implements sets of morphisms between
two topological manifolds over the same topological field `K`, a morphism
being a *continuous map* for the category of topological manifolds.
@@ -28,15 +28,15 @@ REFERENCES:
from sage.categories.homset import Homset
from sage.structure.parent import Parent
-from sage.structure.unique_representation import UniqueRepresentation
+from sage.misc.fast_methods import WithEqualityById
from sage.manifolds.continuous_map import ContinuousMap
-class TopManifoldHomset(UniqueRepresentation, Homset):
+class TopologicalManifoldHomset(WithEqualityById, Homset):
r"""
Set of continuous maps between two topological manifolds.
Given two topological manifolds `M` and `N` over a topological field `K`,
- the class :class:`TopManifoldHomset` implements the set
+ the class :class:`TopologicalManifoldHomset` implements the set
`\mathrm{Hom}(M,N)` of morphisms (i.e. continuous maps) `M\rightarrow N`.
This is a Sage *parent* class, whose *element* class is
@@ -46,10 +46,10 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
- ``domain`` -- topological manifold `M` (domain of the morphisms belonging
to the homset), as an instance of
- :class:`~sage.manifolds.manifold.TopManifold`
+ :class:`~sage.manifolds.manifold.TopologicalManifold`
- ``codomain`` -- topological manifold `N` (codomain of the morphisms
belonging to the homset), as an instance of
- :class:`~sage.manifolds.manifold.TopManifold`
+ :class:`~sage.manifolds.manifold.TopologicalManifold`
- ``name`` -- (default: ``None``) string; name given to the homset; if
``None``, Hom(M,N) will be used
- ``latex_name`` -- (default: ``None``) string; LaTeX symbol to denote the
@@ -60,16 +60,16 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
Set of continuous maps between a 2-dimensional manifold and a
3-dimensional one::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: N = TopManifold(3, 'N')
+ sage: N = Manifold(3, 'N', type='topological')
sage: Y.<u,v,w> = N.chart()
sage: H = Hom(M, N) ; H
Set of Morphisms from 2-dimensional topological manifold M to
3-dimensional topological manifold N in Category of manifolds over
Real Field with 53 bits of precision
sage: type(H)
- <class 'sage.manifolds.manifold_homset.TopManifoldHomset_with_category'>
+ <class 'sage.manifolds.manifold_homset.TopologicalManifoldHomset_with_category'>
sage: H.category()
Category of homsets of topological spaces
sage: latex(H)
@@ -143,9 +143,9 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
r"""
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: N = TopManifold(3, 'N')
+ sage: N = Manifold(3, 'N', type='topological')
sage: Y.<u,v,w> = N.chart()
sage: H = Hom(M, N) ; H
Set of Morphisms from 2-dimensional topological manifold M to
@@ -162,13 +162,13 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
sage: TestSuite(E).run()
"""
- from sage.manifolds.manifold import TopManifold
- if not isinstance(domain, TopManifold):
+ from sage.manifolds.manifold import TopologicalManifold
+ if not isinstance(domain, TopologicalManifold):
raise TypeError("domain = {} is not an ".format(domain) +
- "instance of TopManifold")
- if not isinstance(codomain, TopManifold):
+ "instance of TopologicalManifold")
+ if not isinstance(codomain, TopologicalManifold):
raise TypeError("codomain = {} is not an ".format(codomain) +
- "instance of TopManifold")
+ "instance of TopologicalManifold")
Homset.__init__(self, domain, codomain)
if name is None:
self._name = "Hom(" + domain._name + "," + codomain._name + ")"
@@ -189,9 +189,9 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: N = TopManifold(3, 'N')
+ sage: N = Manifold(3, 'N', type='topological')
sage: H = Hom(M, N)
sage: H._latex_()
'\\mathrm{Hom}\\left(M,N\\right)'
@@ -202,6 +202,32 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
else:
return self._latex_name
+ def _test_pickling(self, **options):
+ r"""
+ Test pickling.
+
+ This test is weaker than
+ :meth:`sage.structure.sage_object.SageObject._test_pickling` in that
+ 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 topological manifold homset of
+ the same type as ``self``.
+
+ TEST::
+
+ sage: M = Manifold(2, 'M', type='topological')
+ sage: X.<x,y> = M.chart()
+ sage: N = Manifold(3, 'N', type='topological')
+ sage: Y.<u,v,w> = N.chart()
+ sage: H = Hom(M, N)
+ sage: H._test_pickling()
+
+ """
+ tester = self._tester(**options)
+ from sage.misc.all import loads, dumps
+ bckp = loads(dumps(self))
+ tester.assertEqual(type(bckp), type(self))
+ tester.assertEqual(bckp._name, self._name)
#### Parent methods ####
@@ -244,19 +270,18 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
EXAMPLES::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: N = TopManifold(3, 'N')
+ sage: N = Manifold(3, 'N', type='topological')
sage: Y.<u,v,w> = N.chart()
sage: H = Hom(M, N)
- sage: f = H._element_constructor_({(X, Y): [x+y, x-y, x*y]},
- ....: name='f'); f
+ sage: f = H({(X, Y): [x+y, x-y, x*y]}, name='f'); f
Continuous map f from the 2-dimensional topological manifold M to
the 3-dimensional topological manifold N
sage: f.display()
f: M --> N
(x, y) |--> (u, v, w) = (x + y, x - y, x*y)
- sage: id = Hom(M, M)._element_constructor_({}, is_identity=True)
+ sage: id = Hom(M, M)({}, is_identity=True)
sage: id
Identity map Id_M of the 2-dimensional topological manifold M
sage: id.display()
@@ -281,9 +306,9 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: N = TopManifold(3, 'N')
+ sage: N = Manifold(3, 'N', type='topological')
sage: Y.<u,v,w> = N.chart()
sage: H = Hom(M,N)
sage: f = H._an_element_() ; f
@@ -318,9 +343,9 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: N = TopManifold(3, 'N')
+ sage: N = Manifold(3, 'N', type='topological')
sage: Y.<u,v,w> = N.chart()
sage: H = Hom(M,N)
sage: H._coerce_map_from_(ZZ)
@@ -341,9 +366,9 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
EXAMPLE::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
- sage: N = TopManifold(3, 'N')
+ sage: N = Manifold(3, 'N', type='topological')
sage: Y.<u,v,w> = N.chart()
sage: H = Hom(M,N)
sage: f = H.__call__({(X, Y): [x+y, x-y, x*y]}, name='f') ; f
@@ -380,7 +405,7 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
The identity map of a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: H = Hom(M, M) ; H
Set of Morphisms from 2-dimensional topological manifold M to
@@ -404,7 +429,7 @@ class TopManifoldHomset(UniqueRepresentation, Homset):
If the homset is not a set of endomorphisms, the identity element is
meaningless::
- sage: N = TopManifold(3, 'N')
+ sage: N = Manifold(3, 'N', type='topological')
sage: Y.<u,v,w> = N.chart()
sage: Hom(M, N).one()
Traceback (most recent call last):
diff --git a/src/sage/manifolds/point.py b/src/sage/manifolds/point.py
index b816ac7..a0dd94f 100644
--- a/src/sage/manifolds/point.py
+++ b/src/sage/manifolds/point.py
@@ -1,9 +1,9 @@
r"""
Points of topological manifolds
-The class :class:`TopManifoldPoint` implements points of a
+The class :class:`TopologicalManifoldPoint` implements points of a
topological manifold.
-A :class:`TopManifoldPoint` object can have coordinates in
+A :class:`TopologicalManifoldPoint` object can have coordinates in
various charts defined on the manifold. Two points are declared equal if they
have the same coordinates in the same chart.
@@ -22,7 +22,7 @@ EXAMPLES:
Defining a point in `\RR^3` by its spherical coordinates::
- sage: M = TopManifold(3, 'R^3')
+ sage: M = Manifold(3, 'R^3', type='topological')
sage: U = M.open_subset('U') # the complement of the half-plane (y=0, x>=0)
sage: c_spher.<r,th,ph> = U.chart(r'r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi')
sage: p = U((1, pi/2, pi), name='P') # coordinates in U's default chart (c_spher)
@@ -70,12 +70,12 @@ Points can be compared::
from sage.structure.element import Element
-class TopManifoldPoint(Element):
+class TopologicalManifoldPoint(Element):
r"""
Point of a topological manifold.
This is a Sage *element* class, the corresponding *parent* class being
- :class:`~sage.manifolds.manifold.TopManifold`.
+ :class:`~sage.manifolds.manifold.TopologicalManifold`.
INPUT:
@@ -97,7 +97,7 @@ class TopManifoldPoint(Element):
A point on a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: c_xy.<x,y> = M.chart()
sage: (a, b) = var('a b') # generic coordinates for the point
sage: p = M.point((a, b), name='P'); p
@@ -154,8 +154,7 @@ class TopManifoldPoint(Element):
TESTS::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M((2,3), name='p'); p
Point p on the 2-dimensional topological manifold M
@@ -203,7 +202,7 @@ class TopManifoldPoint(Element):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M((2,-3))
sage: p._repr_()
@@ -227,7 +226,7 @@ class TopManifoldPoint(Element):
TESTS::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M((2,-3))
sage: p._latex_()
@@ -257,14 +256,13 @@ class TopManifoldPoint(Element):
OUTPUT:
- an instance of
- :class:`~sage.manifolds.subset.TopManifoldSubset`
+ :class:`~sage.manifolds.subset.TopologicalManifoldSubset`
EXAMPLES:
Points on a 2-dimensional manifold::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M.point((1,3), name='p'); p
Point p on the 2-dimensional topological manifold M
@@ -314,8 +312,7 @@ class TopManifoldPoint(Element):
Spherical coordinates of a point on `\RR^3`::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(3, 'M') # the part of R^3 covered by spherical coordinates
+ sage: M = Manifold(3, 'M', type='topological') # the part of R^3 covered by spherical coordinates
sage: c_spher.<r,th,ph> = M.chart(r'r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi') # spherical coordinates
sage: p = M.point((1, pi/2, pi))
sage: p.coord() # coordinates on the manifold's default chart
@@ -342,8 +339,7 @@ class TopManifoldPoint(Element):
Coordinates of a point on a 2-dimensional manifold::
- sage: TopManifold._clear_cache_() # for doctests only
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: c_xy.<x,y> = M.chart()
sage: (a, b) = var('a b') # generic coordinates for the point
sage: p = M.point((a, b), name='P')
@@ -462,7 +458,7 @@ class TopManifoldPoint(Element):
Setting coordinates to a point on a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M.point()
sage: p.set_coord((2,-3)) # coordinates on the manifold's default chart
@@ -513,7 +509,7 @@ class TopManifoldPoint(Element):
Setting coordinates to a point on a 2-dimensional manifold::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M.point()
sage: p.add_coord((2,-3)) # coordinates on the manifold's default chart
@@ -561,7 +557,7 @@ class TopManifoldPoint(Element):
Comparison with coordinates in the same chart::
- sage: M = TopManifold(2, 'M')
+ sage: M = Manifold(2, 'M', type='topological')
sage: X.<x,y> = M.chart()
sage: p = M((2,-3), chart=X)
sage: q = M((2,-3), chart=X)
@@ -596,14 +592,19 @@ class TopManifoldPoint(Element):
False
"""
- if not isinstance(other, TopManifoldPoint):