Changes between Initial Version and Version 2 of Ticket #32929

11/27/21 16:13:15 (7 months ago)

Here is a proposed fix. The bug was triggered in Chart.__classcall__ by the unconditional resetting of the argument coordinate_options, so that neither bounds nor periods could be transmitted to __init__ while constructing the restricted chart in Chart.restrict or RealChart.restrict.

In correcting the bug, I had to change the attribute _periods of charts from a dictionary to a tuple, to make it hashable. Hence the changes in the file (method ManifoldPoint.__eq__). As a benefit, the output of Chart.periods() is more readable.

The doctest change in line 669 of simply restores the correct coordinate values for a point constructed via TopologicalManifold._an_element_(). Indeed, git blame reveals that this doctest was incorrectly changed when the bug was introduced in Sage 9.4.

New commits:

3ad5407Fix bug in chart restrictions to subdomain (#32929)


  • Ticket #32929

    • Property Status changed from new to needs_review
    • Property Cc mkoeppe added
    • Property Priority changed from major to critical
    • Property Branch changed from to public/manifolds/bug_chart_restrict-32929
    • Property Keywords chart added
    • Property Commit changed from to 3ad54075a77a5c2ad64204a20842a90a8f8c3e83
  • Ticket #32929 – Description

    initial v2  
    33sage: M = Manifold(2, 'M')
    4 sage: X.<x,y> = M.chart(r"x:(0,+oo) y")
     4sage: X.<x,y> = M.chart(r"x:(0,+oo) y:(0,2):periodic")
    55sage: X.coord_range()
    6 x: (0, +oo); y: (-oo, +oo)
     6x: (0, +oo); y: [0, 2] (periodic)
    77sage: U = M.open_subset('U', coord_def={X: x<1})
    88sage: X.restrict(U).coord_range()
    99x: (-oo, 1); y: (-oo, +oo)
    11 The lower bound for `x` should be `O`, not `-oo`.
     11The lower bound for `x` should be `O`, not `-oo`, and `y` should appear as a periodic coordinate, i.e. one should get
     13sage: X.restrict(U).coord_range()
     14x: (0, 1); y: [0, 2] (periodic)
    1318Sage <= 9.3 was free of this bug. In Sage >= 9.4, one can trace it to the optional argument `bounds` of `RealChart.__init__`, which is used in `RealChart.restrict` (cf. the line `res = type(self)(..., bounds=self._bounds, ...)`)