Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
clear_vars
reset()
%display latex

u,v,w,T = SR.var('x y z t')
E_x,E_y,E_z  = function('Ex'),function('Ey'), function('Ez')
B_x,B_y,B_z  = function('Bx'),function('By'), function('Bz')
M.<t, x, y, z> = manifolds.Minkowski(positive_spacelike=False)
F = M.diff_form(2, name='F')
F[0,1] = -E_x(u,v,w, T)
F[0,2] = -E_y(u,v,w, T)
F[0,3] = -E_z(u,v,w, T)
F[1,2] = B_z(u,v,w, T)
F[1,3] = B_y(u,v,w, T)
F[2,3] = B_x(u,v,w, T)

pretty_print(F.display())
pretty_print(F.exterior_derivative().display())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment