Ejemplo n.º 1
0
    def __init__(self, domain, coordinates='', names=None, calc_method=None):
        r"""
        Construct a chart.

        TESTS::

            sage: M = Manifold(2, 'M', field='complex')
            sage: X.<x,y> = M.chart()
            sage: X
            Chart (M, (x, y))
            sage: type(X)
            <class 'sage.manifolds.differentiable.chart.DiffChart'>
            sage: assumptions() # no assumptions on x,y set by X._init_coordinates
            []
            sage: TestSuite(X).run()

        """
        Chart.__init__(self,
                       domain,
                       coordinates=coordinates,
                       names=names,
                       calc_method=calc_method)
        # Construction of the coordinate frame associated to the chart:
        self._frame = CoordFrame(self)
        self._coframe = self._frame._coframe
Ejemplo n.º 2
0
    def __init__(self, domain, coordinates='', names=None):
        r"""
        Construct a chart.

        TESTS::

            sage: M = Manifold(2, 'M', field='complex')
            sage: X.<x,y> = M.chart()
            sage: X
            Chart (M, (x, y))
            sage: type(X)
            <class 'sage.manifolds.differentiable.chart.DiffChart'>
            sage: assumptions() # no assumptions on x,y set by X._init_coordinates
            []
            sage: TestSuite(X).run()

        """
        Chart.__init__(self, domain, coordinates=coordinates, names=names)
Ejemplo n.º 3
0
    def restrict(self, subset, restrictions=None):
        r"""
        Return the restriction of ``self`` to some subset.

        If the current chart is `(U, \varphi)`, a *restriction* (or
        *subchart*) is a chart `(V, \psi)` such that `V \subset U`
        and `\psi = \varphi |_V`.

        If such subchart has not been defined yet, it is constructed here.

        The coordinates of the subchart bare the same names as the
        coordinates of the original chart.

        INPUT:

        - ``subset`` -- open subset `V` of the chart domain `U`
        - ``restrictions`` -- (default: ``None``) list of coordinate
          restrictions defining the subset `V`

        A restriction can be any symbolic equality or inequality involving
        the coordinates, such as ``x > y`` or ``x^2 + y^2 != 0``. The items
        of the list ``restrictions`` are combined with the ``and`` operator;
        if some restrictions are to be combined with the ``or`` operator
        instead, they have to be passed as a tuple in some single item
        of the list ``restrictions``. For example::

          restrictions = [x > y, (x != 0, y != 0), z^2 < x]

        means ``(x > y) and ((x != 0) or (y != 0)) and (z^2 < x)``.
        If the list ``restrictions`` contains only one item, this
        item can be passed as such, i.e. writing ``x > y`` instead
        of the single element list ``[x > y]``.

        OUTPUT:

        - a :class:`DiffChart` `(V, \psi)`

        EXAMPLES:

        Coordinates on the unit open ball of  `\CC^2` as a subchart
        of the global coordinates of `\CC^2`::

            sage: M = Manifold(2, 'C^2', field='complex')
            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
            Chart (B, (z1, z2))

        """
        if subset == self._domain:
            return self
        if subset not in self._dom_restrict:
            resu = Chart.restrict(self, subset, restrictions=restrictions)
            # Update of superframes and subframes:
            resu._frame._superframes.update(self._frame._superframes)
            for sframe in self._frame._superframes:
                sframe._subframes.add(resu._frame)
                sframe._restrictions[subset] = resu._frame
            # The subchart frame is not a "top frame" in the supersets
            # (including self._domain):
            for dom in self._domain._supersets:
                if resu._frame in dom._top_frames:
                    # it was added by the Chart constructor invoked in
                    # Chart.restrict above
                    dom._top_frames.remove(resu._frame)
        return self._dom_restrict[subset]
Ejemplo n.º 4
0
    def restrict(self, subset, restrictions=None):
        r"""
        Return the restriction of ``self`` to some subset.

        If the current chart is `(U, \varphi)`, a *restriction* (or
        *subchart*) is a chart `(V, \psi)` such that `V \subset U`
        and `\psi = \varphi |_V`.

        If such subchart has not been defined yet, it is constructed here.

        The coordinates of the subchart bare the same names as the
        coordinates of the original chart.

        INPUT:

        - ``subset`` -- open subset `V` of the chart domain `U`
        - ``restrictions`` -- (default: ``None``) list of coordinate
          restrictions defining the subset `V`

        A restriction can be any symbolic equality or inequality involving
        the coordinates, such as ``x > y`` or ``x^2 + y^2 != 0``. The items
        of the list ``restrictions`` are combined with the ``and`` operator;
        if some restrictions are to be combined with the ``or`` operator
        instead, they have to be passed as a tuple in some single item
        of the list ``restrictions``. For example::

          restrictions = [x > y, (x != 0, y != 0), z^2 < x]

        means ``(x > y) and ((x != 0) or (y != 0)) and (z^2 < x)``.
        If the list ``restrictions`` contains only one item, this
        item can be passed as such, i.e. writing ``x > y`` instead
        of the single element list ``[x > y]``.

        OUTPUT:

        - a :class:`DiffChart` `(V, \psi)`

        EXAMPLES:

        Coordinates on the unit open ball of  `\CC^2` as a subchart
        of the global coordinates of `\CC^2`::

            sage: M = Manifold(2, 'C^2', field='complex')
            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
            Chart (B, (z1, z2))

        """
        if subset == self._domain:
            return self
        if subset not in self._dom_restrict:
            resu = Chart.restrict(self, subset, restrictions=restrictions)
            # Update of superframes and subframes:
            resu._frame._superframes.update(self._frame._superframes)
            for sframe in self._frame._superframes:
                sframe._subframes.add(resu._frame)
                sframe._restrictions[subset] = resu._frame
            # The subchart frame is not a "top frame" in the supersets
            # (including self._domain):
            for dom in self._domain._supersets:
                if resu._frame in dom._top_frames:
                    # it was added by the Chart constructor invoked in
                    # Chart.restrict above
                    dom._top_frames.remove(resu._frame)
        return self._dom_restrict[subset]