Ask Your Question
1

set_name causes an error on external_derivative display

asked 2018-03-10 22:03:01 +0100

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()
omega.display()

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

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.

Daniel

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-03-11 09:32:58 +0100

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

Comments

Thanks Eric!

danielvolinski gravatar imagedanielvolinski ( 2018-03-11 18:11:37 +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

1 follower

Stats

Asked: 2018-03-10 22:03:01 +0100

Seen: 203 times

Last updated: Mar 11 '18