Ask Your Question
1

Defining manifolds in a systematic way.

asked 2019-07-10 11:35:45 -0500

sum8tion gravatar image

I'm working on writing an algorithm that does some specific computations with manifolds. I would like to be able to simply enter 2 numbers "p" and "q" which determine the manifold's dimension p*q, and have the algorithm run right from there. This requires having Sage set up the manifold right from those two numbers. I'm having trouble at the level of defining the chart. Below I begin a naive attempt.

Sage: p=1
Sage: q=2
Sage: M = Manifold((2*p*q), 'M', field='complex')
Sage: U = M.open_subset('U')
Sage: x = list(var('x_%d' %i) for i in range((2*p*q)))

Everything works fine up to this point. Now, I need to define variables for a chart for this manifold. I would like to do something like

Sage: c.<x[0],x[1],x[2],x[3]> = U.chart()

where I'm using the variables I've defined as my coordinates. However, Sage doesn't allow me to do this. Furthermore, even if I could, I'm not sure how I would set this up so I didn't have to type in the variables by hand, because I want to set it up so I just have to feed Sage p and q, and let it build the manifold on its own.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2019-07-10 11:51:26 -0500

rburing gravatar image

See the documentation on charts, particularly the arguments coordinates and names.

For example, you can do the following:

sage: x = U.chart(names=tuple('x_%d' % i for i in range(2*p*q)))
sage: x[:]
(x_0, x_1, x_2, x_3)
sage: x[0]
x_0
edit flag offensive delete link more

Comments

How do I define a frame then? My naive attempt in analogy to the usual situation,

Sage: eU = x.frame()

but this doesn't work.

sum8tion gravatar imagesum8tion ( 2019-07-10 12:06:07 -0500 )edit

That should work (and it does for me). What version of SageMath are you running?

rburing gravatar imagerburing ( 2019-07-10 13:00:34 -0500 )edit
1

Oh, I just tried it again and it worked, must have made a typo the first time, thanks.

sum8tion gravatar imagesum8tion ( 2019-07-10 13:06:16 -0500 )edit

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: 2019-07-10 11:35:45 -0500

Seen: 28 times

Last updated: Jul 10