# How do you construct a vector field of a 4-dimensional manifold from the components of a 3-dimensional vector field?

Hello, I'm doing a 3-dimensional curl calculation (the electric field from the magnetic field, for example) which I'd like to use to define a vector field (the Faraday tensor). To do this I define two manifolds, one with 4 dim and one with 3 dim (the same without the time dimension). Unfortunately, I can't extract the components of my 3-dim calculation to inject it into 4-dim. Here's my simplified code where I just define a vector field in 3D (F) that I'd like to inject into another in 4D (G):

M = Manifold(4, 'M')
N = Manifold(3, 'N', ambient=M)
CM.<t,x,y,z> = M.chart()
CN.<x,y,z> = N.chart()

t = var('t')
phi = N.continuous_map(M, {(CN,CM): [t,x, y, z]})
phi_inv = M.continuous_map(N, {(CM, CN): [x, y, z]})
phi_inv_t = M.scalar_field({CM: t})
N.set_embedding(phi, inverse=phi_inv, var=t, t_inverse={t: phi_inv_t})

F = N.vector_field('F')
Fx, Fy, Fz = function('F_x')(x,y,z), function('F_y')(x,y,z), function('F_z')(x,y,z)
F[0] = Fx
F[1] = Fy
F[2] = Fz

G = M.vector_field('G')
G[0] = t
G[1] = F[0]
G[2] = F[1]
G[3] = F[2]
edit retag close merge delete

Sort by » oldest newest most voted

Simply replace

G[1] = F[0]
G[2] = F[1]
G[3] = F[2]

by

G[1] = F[0].expr()
G[2] = F[1].expr()
G[3] = F[2].expr()

The reason is that F[0] returns a chart function based on the chart CN, which is not suited for initializing the chart function G[1], which is based on the chart CM. On the contrary F[0].expr() returns the symbolic expression of the chart function F[0] and this is a valid input for G[1].

With the above change, G.display() yields

G = t ∂/∂t + F_x(x, y, z) ∂/∂x + F_y(x, y, z) ∂/∂y + F_z(x, y, z) ∂/∂z
more

Thanks for your help., it works! It was obvious finally...

( 2024-06-01 18:50:14 +0200 )edit