Ask Your Question
0

Sub-manifold: bug or my misunderstanding?

asked 8 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 8 years ago

eric_g gravatar image

updated 8 years ago

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.

Preview: (hide)
link

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: 8 years ago

Seen: 258 times

Last updated: May 10 '16