Ask Your Question

Compute the inverse of a 2-form

asked 2019-10-23 12:39:17 +0200

MLainz gravatar image

I have a nondegenerate (0,2)-tensor omega on a manifold which is not a metric and I would like to compute its 'inverse', which is a (2,0)-tensor.

I tried omega[:].inverse() but I get the following error 'ChartFunctionRing_with_category' object has no attribute 'fraction_field'. This worked for me in older versions of Sagemath (I think it was 7.4).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-10-23 17:59:59 +0200

eric_g gravatar image

A workaround is the following, assuming that M is the manifold where omega is defined:

om = matrix([[omega[i, j].expr() for j in M.irange()] for i in M.irange()])
omega_inv = M.multivector_field(2, om.inverse())

Here is a full example:

sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: omega = M.diff_form(2)
sage: omega[0, 1] = 1 + x^2
sage: omega.display()
(x^2 + 1) dx/\dy
sage: om = matrix([[omega[i, j].expr() for j in M.irange()] for i in M.irange()])
sage: omega_inv = M.multivector_field(2, om.inverse())
sage: omega_inv.display()
-1/(x^2 + 1) d/dx/\d/dy
edit flag offensive delete link more


omega is not a form, but a general 2-tensor. Apart from that, the idea works (at least when we only have one chart).

MLainz gravatar imageMLainz ( 2019-10-30 14:36:36 +0200 )edit

For the record, one would have to write omega_inv = M.tensor_field(2, 0, om.inverse())

MLainz gravatar imageMLainz ( 2019-10-30 14:40:14 +0200 )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


Asked: 2019-10-23 12:39:17 +0200

Seen: 220 times

Last updated: Oct 23 '19