Ask Your Question

set_name causes an error on external_derivative display

asked 2018-03-10 15:03:01 -0500

danielvolinski gravatar image

I have the following code:

R3 = Manifold(3, 'R3', start_index=1, latex_name=r'\mathbb{R}^3')
cartesian3d.<x,y,z> = R3.chart()

omega = R3.diff_form(1, 'omega', latex_name=r'\omega')
omega[:] = (x^2+y*z+e^y, y^3+x*z+x*e^y+z^2, e^z+x*y+2*y*z)
print omega.category()

domega = omega.exterior_derivative()
domega.set_name(domega, r'\mathrm{d}\omega')
print domega.category()

I get a TypeError: unsupported operand type(s) for +: 'DiffFormFreeModule_with_category.element_class' and 'str'

If I delete the set_name command the code works fine.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-03-11 03:32:58 -0500

eric_g gravatar image

It's because the first argument of set_name must be a string (the name you want to give to the differential form), i.e. the correct syntax is:

domega.set_name('domega', r'\mathrm{d}\omega')

Probably the error message should be more explicit.

edit flag offensive delete link more


Thanks Eric!

danielvolinski gravatar imagedanielvolinski ( 2018-03-11 12:11:37 -0500 )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

1 follower


Asked: 2018-03-10 15:03:01 -0500

Seen: 18 times

Last updated: Mar 11