# Compute the inverse of a 2-form

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 close merge delete

Sort by » oldest newest most voted

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

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).

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