Ask Your Question

Define differential form in n variables

asked 2014-01-15 11:28:42 -0500

anonymous user


updated 2014-01-15 11:31:26 -0500

I'd like to define a differential form in n variables (where n is defined beforehand, and I'd like for it to be able to be arbitrarily big. For this reason I'd like to write a code for general n). My first idea is to write something of the sort:

x = list(var('x_%d' % i) for i in (1..n));
U = CoordinatePatch(x);
F = DifferentialForms(U);
w = DifferentialForm(F,2);
[w[i,2]=3 for i in range(0,n-1)]

The value w[i,2]=3 is obviously arbitrary. I don't know why the code doesn't work, it says that there's a syntax error with w[i,2]=3.

edit retag flag offensive close merge delete


does `w[i][2]` do what you want?

niles gravatar imageniles ( 2014-01-15 12:57:50 -0500 )edit

Unfortunately, no. Usually, without the for, w[i,2] works. For example if I just put w[1,2]=3 then it defines the form dx1/\dx2 to be 3. I don't know why it won't let me use for.

rfauffar gravatar imagerfauffar ( 2014-01-15 13:17:56 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-01-15 13:34:01 -0500

rfauffar gravatar image

Ok, I fixed it with the following code:

for i in range(0,2*n-1):
for j in range(0,2*n-1):
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


Asked: 2014-01-15 11:28:42 -0500

Seen: 64 times

Last updated: Jan 15 '14