Ask Your Question

Revision history [back]

Use the chart method add_restrictions (type X.add_restrictions? for the documentation). On your example, this gives:

sage: M = Manifold(4, 'M', latex_name=r'\mathcal{M}', structure='Lorentzian')                       
sage: X.<t,r,th,ph> = M.chart(r"t r:(0,+inf) th:(0,pi):\theta ph:(0,2*pi):periodic\phi")            
sage: X.add_restrictions(r < th^2+0.52)

The condition r < th^2 + 0.52 is not shown by X.coord_range() (maybe it should?), but one can check that it has been taken into account:

sage: X.valid_coordinates(0, 1, pi/2, pi)                                                           
True
sage: X.valid_coordinates(0, 4, pi/2, pi)                                                           
False
sage: p = M((0, 4, pi/2, pi))                                                                       
ValueError                                Traceback (most recent call last)
...
ValueError: the coordinates (0, 4, 1/2*pi, pi) are not valid on the Chart (M, (t, r, th, ph))