Ask Your Question
1

setting components of differential form

asked 2025-01-29 02:29:49 +0100

micron gravatar image

Hi, I don't understand how to set the components of a two-form.

M = Manifold(3, 'M', start_index=1)
U = M.open_subset('U')
X.<x,y,z> = M.chart()
basisframe = X.frame()
a = M.diff_form(2, name='a')

I just want to set a = dx wedge z^2 dy. I don't understand the format of examples in the main differential forms page on http://doc.sagemath.org. for example, this is one way they set one:

 a = M.diff_form(2, name='a')
 a[eU,0,1] = x*y^2 + 2*x

followed by an add_comp_by_continuation and I am not sure why or how that even works. I appreciate your help.

I was able to get a 1-form built on E3 with setting the components like

E.<x,y,z> = EuclideanSpace()
a = E.diff_form(1, name='a')
a[1]=1
a[2]= z^2

so I would have thought I could make a 2-form and set it a similar way but I am unsure what to do.. I'm also wondering how to access the basis forms for calculations. I couldn't see how to do a wedge product of my 1-form with dx, for example. I built it by setting the first component of a 1-form to 1 but is there an easier way?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2025-01-30 10:01:05 +0100

eric_g gravatar image

updated 2025-01-30 11:10:22 +0100

You can easily get the 1-forms $\mathrm{d}x$, $\mathrm{d}y$ and $\mathrm{d}z$ from X.coframe(), so to initialize the 2-form $a = \mathrm{d}x\wedge(z^2 \mathrm{d}y)$, the simplest is to do

sage: M = Manifold(3, 'M', start_index=1)
sage: X.<x,y,z> = M.chart()
sage: dx, dy, dz = X.coframe()[:]
sage: a = dx.wedge(z^2*dy)
sage: a.set_name('a')
sage: a.display()
a = z^2 dx∧dy

Then, for instance:

sage: da = diff(a)
sage: da.display()
da = 2*z dx∧dy∧dz

You may find more examples in the sections 1-forms and Differential forms and exterior calculus of the Manifold Tutorial.

edit flag offensive delete link more

Comments

thank you. this is helpful.

micron gravatar imagemicron ( 2025-01-30 20:12:34 +0100 )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

Stats

Asked: 2025-01-29 02:29:49 +0100

Seen: 50 times

Last updated: Jan 30