@@ -72,10 +72,6 @@ class DiffChart(Chart):
7272 If no period and no LaTeX spelling are to be set for any coordinate, the
7373 argument ``coordinates`` can be omitted when the shortcut operator
7474 ``<,>`` is used to declare the chart (see examples below).
75- - ``names`` -- (default: ``None``) unused argument, except if
76- ``coordinates`` is not provided; it must then be a tuple containing
77- the coordinate symbols (this is guaranteed if the shortcut operator
78- ``<,>`` is used).
7975 - ``calc_method`` -- (default: ``None``) string defining the calculus
8076 method for computations involving coordinates of the chart; must be
8177 one of
@@ -85,6 +81,27 @@ class DiffChart(Chart):
8581 - ``None``: the default of
8682 :class:`~sage.manifolds.calculus_method.CalculusMethod` will be
8783 used
84+ - ``names`` -- (default: ``None``) unused argument, except if
85+ ``coordinates`` is not provided; it must then be a tuple containing
86+ the coordinate symbols (this is guaranteed if the shortcut operator
87+ ``<,>`` is used).
88+ - ``coord_restrictions``: Additional restrictions on the coordinates.
89+ A restriction can be any symbolic equality or inequality involving
90+ the coordinates, such as ``x > y`` or ``x^2 + y^2 != 0``. The items
91+ of the list (or set or frozenset) ``coord_restrictions`` are combined
92+ with the ``and`` operator; if some restrictions are to be combined with
93+ the ``or`` operator instead, they have to be passed as a tuple in some
94+ single item of the list (or set or frozenset) ``coord_restrictions``.
95+ For example::
96+
97+ coord_restrictions=[x > y, (x != 0, y != 0), z^2 < x]
98+
99+ means ``(x > y) and ((x != 0) or (y != 0)) and (z^2 < x)``.
100+ If the list ``coord_restrictions`` contains only one item, this
101+ item can be passed as such, i.e. writing ``x > y`` instead
102+ of the single element list ``[x > y]``. If the chart variables have
103+ not been declared as variables yet, ``coord_restrictions`` must
104+ be ``lambda``-quoted.
88105
89106 EXAMPLES:
90107
@@ -259,7 +276,7 @@ class DiffChart(Chart):
259276 on differentiable manifolds over `\RR`.
260277
261278 """
262- def __init__ (self , domain , coordinates = '' , names = None , calc_method = None ):
279+ def __init__ (self , domain , coordinates , calc_method = None , periods = None , coord_restrictions = None ):
263280 r"""
264281 Construct a chart.
265282
@@ -276,8 +293,8 @@ def __init__(self, domain, coordinates='', names=None, calc_method=None):
276293 sage: TestSuite(X).run()
277294
278295 """
279- Chart .__init__ (self , domain , coordinates = coordinates , names = names ,
280- calc_method = calc_method )
296+ super () .__init__ (domain , coordinates , calc_method = calc_method ,
297+ periods = periods , coord_restrictions = coord_restrictions )
281298 # Construction of the coordinate frame associated to the chart:
282299 self ._frame = CoordFrame (self )
283300 self ._coframe = self ._frame ._coframe
@@ -391,8 +408,8 @@ def transition_map(self, other, transformations, intersection_name=None,
391408 [Chart (R^2, (x, y)), Chart (U, (r, phi)), Chart (U, (x, y))]
392409
393410 """
394- dom1 = self ._domain
395- dom2 = other ._domain
411+ dom1 = self .domain ()
412+ dom2 = other .domain ()
396413 dom = dom1 .intersection (dom2 , name = intersection_name )
397414 if dom is dom1 :
398415 chart1 = self
@@ -548,7 +565,7 @@ def restrict(self, subset, restrictions=None):
548565 Chart (B, (z1, z2))
549566
550567 """
551- if subset == self ._domain :
568+ if subset == self .domain () :
552569 return self
553570 if subset not in self ._dom_restrict :
554571 resu = Chart .restrict (self , subset , restrictions = restrictions )
@@ -558,8 +575,8 @@ def restrict(self, subset, restrictions=None):
558575 sframe ._subframes .add (resu ._frame )
559576 sframe ._restrictions [subset ] = resu ._frame
560577 # The subchart frame is not a "top frame" in the supersets
561- # (including self._domain ):
562- for dom in self ._domain .open_supersets ():
578+ # (including self.domain() ):
579+ for dom in self .domain () .open_supersets ():
563580 if resu ._frame in dom ._top_frames :
564581 # it was added by the Chart constructor invoked in
565582 # Chart.restrict above
@@ -709,10 +726,6 @@ class RealDiffChart(DiffChart, RealChart):
709726 If interval range, no period and no LaTeX spelling are to be set for any
710727 coordinate, the argument ``coordinates`` can be omitted when the shortcut
711728 operator ``<,>`` is used to declare the chart (see examples below).
712- - ``names`` -- (default: ``None``) unused argument, except if
713- ``coordinates`` is not provided; it must then be a tuple containing
714- the coordinate symbols (this is guaranteed if the shortcut operator
715- ``<,>`` is used).
716729 - ``calc_method`` -- (default: ``None``) string defining the calculus
717730 method for computations involving coordinates of the chart; must be
718731 one of
@@ -722,6 +735,27 @@ class RealDiffChart(DiffChart, RealChart):
722735 - ``None``: the default of
723736 :class:`~sage.manifolds.calculus_method.CalculusMethod` will be
724737 used
738+ - ``names`` -- (default: ``None``) unused argument, except if
739+ ``coordinates`` is not provided; it must then be a tuple containing
740+ the coordinate symbols (this is guaranteed if the shortcut operator
741+ ``<,>`` is used).
742+ - ``coord_restrictions``: Additional restrictions on the coordinates.
743+ A restriction can be any symbolic equality or inequality involving
744+ the coordinates, such as ``x > y`` or ``x^2 + y^2 != 0``. The items
745+ of the list (or set or frozenset) ``coord_restrictions`` are combined
746+ with the ``and`` operator; if some restrictions are to be combined with
747+ the ``or`` operator instead, they have to be passed as a tuple in some
748+ single item of the list (or set or frozenset) ``coord_restrictions``.
749+ For example::
750+
751+ coord_restrictions=[x > y, (x != 0, y != 0), z^2 < x]
752+
753+ means ``(x > y) and ((x != 0) or (y != 0)) and (z^2 < x)``.
754+ If the list ``coord_restrictions`` contains only one item, this
755+ item can be passed as such, i.e. writing ``x > y`` instead
756+ of the single element list ``[x > y]``. If the chart variables have
757+ not been declared as variables yet, ``coord_restrictions`` must
758+ be ``lambda``-quoted.
725759
726760 EXAMPLES:
727761
@@ -908,9 +942,9 @@ class RealDiffChart(DiffChart, RealChart):
908942 `\{y=0, x\geq 0\}`, we must have `y\not=0` or `x<0` on U. Accordingly,
909943 we set::
910944
911- sage: c_cartU.<x,y,z> = U.chart()
912- sage: c_cartU.add_restrictions((y!=0, x<0)) # the tuple (y!=0, x<0) means y!=0 or x<0
913- sage: # c_cartU.add_restrictions( [y!=0, x<0]) would have meant y!=0 AND x<0
945+ sage: c_cartU.<x,y,z> = U.chart(coord_restrictions=lambda x,y,z: (y!=0, x<0) )
946+ ....: # the tuple (y!=0, x<0) means y!=0 or x<0
947+ ....: # [y!=0, x<0] would have meant y!=0 AND x<0
914948 sage: U.atlas()
915949 [Chart (U, (r, th, ph)), Chart (U, (x, y, z))]
916950 sage: M.atlas()
@@ -942,7 +976,8 @@ class RealDiffChart(DiffChart, RealChart):
942976 :meth:`~sage.manifolds.chart.RealChart.plot`.
943977
944978 """
945- def __init__ (self , domain , coordinates = '' , names = None , calc_method = None ):
979+ def __init__ (self , domain , coordinates , calc_method = None ,
980+ bounds = None , periods = None , coord_restrictions = None ):
946981 r"""
947982 Construct a chart on a real differentiable manifold.
948983
@@ -960,8 +995,8 @@ def __init__(self, domain, coordinates='', names=None, calc_method=None):
960995 sage: TestSuite(X).run()
961996
962997 """
963- RealChart .__init__ (self , domain , coordinates = coordinates , names = names ,
964- calc_method = calc_method )
998+ RealChart .__init__ (self , domain , coordinates , calc_method = calc_method ,
999+ bounds = bounds , periods = periods , coord_restrictions = coord_restrictions )
9651000 # Construction of the coordinate frame associated to the chart:
9661001 self ._frame = CoordFrame (self )
9671002 self ._coframe = self ._frame ._coframe
@@ -1031,7 +1066,7 @@ def restrict(self, subset, restrictions=None):
10311066 True
10321067
10331068 """
1034- if subset == self ._domain :
1069+ if subset == self .domain () :
10351070 return self
10361071 if subset not in self ._dom_restrict :
10371072 resu = RealChart .restrict (self , subset , restrictions = restrictions )
@@ -1041,8 +1076,8 @@ def restrict(self, subset, restrictions=None):
10411076 sframe ._subframes .add (resu ._frame )
10421077 sframe ._restrictions [subset ] = resu ._frame
10431078 # The subchart frame is not a "top frame" in the supersets
1044- # (including self._domain ):
1045- for dom in self ._domain .open_supersets ():
1079+ # (including self.domain() ):
1080+ for dom in self .domain () .open_supersets ():
10461081 if resu ._frame in dom ._top_frames :
10471082 # it was added by the Chart constructor invoked in
10481083 # Chart.restrict above
@@ -1125,8 +1160,8 @@ def __init__(self, chart1, chart2, *transformations):
11251160 self ._jacobian = self ._transf .jacobian ()
11261161 # If the two charts are on the same open subset, the Jacobian matrix is
11271162 # added to the dictionary of changes of frame:
1128- if chart1 ._domain == chart2 ._domain :
1129- domain = chart1 ._domain
1163+ if chart1 .domain () == chart2 .domain () :
1164+ domain = chart1 .domain ()
11301165 frame1 = chart1 ._frame
11311166 frame2 = chart2 ._frame
11321167 vf_module = domain .vector_field_module ()
0 commit comments