Ask Your Question

Sub-manifold: bug or my misunderstanding?

asked 2016-05-10 00:04:21 +0200

Richard_L gravatar image

Define a manifold and sub-manifold:

R2 = Manifold(2, 'R^2', start_index=1) # R^2
c_xy.<x,y> = R2.chart() # Cartesian coordinates on R^2
M = R2.open_subset('M', coord_def={c_xy: x>0 and y>0}) # First quadrant

Test the coordinate restrictions:

R2.point((0,1)) in M; R2.point((0,0)) in M; R2.point((1,0)) in M; R2.point((1,1)) in M


False False True True

Question: Have I misunderstood how to restrict to the first quadrant, or have I stumbled on a bug?

edit retag flag offensive close merge delete

1 Answer

Sort by ┬╗ oldest newest most voted

answered 2016-05-10 10:17:30 +0200

eric_g gravatar image

updated 2016-05-10 10:29:21 +0200

Actually, you must declare the first quadrant as

M = R2.open_subset('M', coord_def={c_xy: [x>0, y>0]})

Then the output of your test is correct, i.e. it is False False False True.

Of course the syntax you used, i.e. x>0 and y>0, is more user friendly, and we should definitively implement it! For the time being, coordinate conditions passed as a list are combined with and, while those passed as a tuple are combined with or. For instance [x>0, (y>2, y<-2)] stands for x>0 and (y>2 or y<-2). This is documented in the function add_restrictionson, but not in the function open_subset, as it should; sorry for the inconvenience.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-05-10 00:04:21 +0200

Seen: 207 times

Last updated: May 10 '16