Skip to content

Instantly share code, notes, and snippets.

@donaldmunro
Created November 20, 2021 16:33
Show Gist options
  • Save donaldmunro/61a5e886dd69e2e4d6d69442e7997ae5 to your computer and use it in GitHub Desktop.
Save donaldmunro/61a5e886dd69e2e4d6d69442e7997ae5 to your computer and use it in GitHub Desktop.
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