Ask Your Question
0

Sub-manifold: bug or my misunderstanding?

asked 2016-05-09 17:04:21 -0500

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

Result:

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
0

answered 2016-05-10 03:17:30 -0500

eric_g gravatar image

updated 2016-05-10 03:29:21 -0500

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 http://sagemanifolds.obspm.fr/doc/ref..., 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

Stats

Asked: 2016-05-09 17:04:21 -0500

Seen: 37 times

Last updated: May 10 '16