# Using differential forms---within SageManifolds

Hi all.

I'm aware of the implementation of DifferentialForms within SageManifolds, but I'd like to know how could I use this forms with ease.

In the Sage Reference Manual_Manifolds, there are examples of AffineConnection and the connection_form. However, it seems that the last (connection_form) does not allow to store the calculations, like for example:

nab = g.connection() ## This works for the usual connection
nab.display()
omega = nab.connection_form() ## DOES NOT work, one needs to specify components


I would like to calculate all the components of the connection form, to be able of compute covariant exterior derivatives of other objects.

How can the connection, curvature and torsion forms be stored (as differential forms)?

Thank you, and cheers.

edit retag close merge delete

Sort by » oldest newest most voted

Given an affine connection, there is not a unique connection form but a set of them specified by two indices and a vector frame. Hence the method connection_form requires the indices as argument and, as an option, the vector frame with respect to which the connection form is defined (by default, the manifold's default frame). Here is a full example, yielding to the connection 1-form Omega^0_1 with respect to the vector frame (d/dx, d/dy) in the hyperbolic plane (Poincaré half-plane model):

sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart('x y:(0,+oo)')
sage: g = M.metric('g')
sage: g[0,0], g[1,1] = 1/y, 1/y
sage: g.display()
g = 1/y dx*dx + 1/y dy*dy
sage: nab = g.connection()
sage: omega = nab.connection_form(0,1)
sage: omega.display()
nabla_g connection 1-form (0,1) = -1/2/y dx


As you can see from the display, the object returned by nab.connection_form(0,1) is not some component, but a genuine 1-form, which is colinear to dx. You can check this further:

sage: print(omega)
1-form nabla_g connection 1-form (0,1) on the 2-dimensional differentiable manifold M
sage: omega.category()
Category of elements of Free module /\^1(M) of 1-forms on the 2-dimensional differentiable manifold M


Note that the result is stored internally in some data attribute of the connection nab. So you can access it again by nab.connection_form(0,1) without triggering any new computation:

sage: nab.connection_form(0,1) is omega
True


Similar considerations hold for the torsion and curvature 2-forms.

more