0

Using einsteinpy package of Python, I am defining the electromagnetic tensor (or any other arbitrary tensor). While defining, I am defining it as 'uu' tensor using the BaseRelativityTensor class file. I want the 'll' version from this, ie. F_covariant from F_contravariant. But the package seems not to provide any .change_config() property, which EinsteinTensor (another class which defines (G^{\mu\nu})) does.

FYI: I am using the 0.3.1 version of the package.

So my question is, once F^{\mu\nu} has been defined as a BaseRelativityTensor, how to get (F_{\mu\nu}) from F^{\mu\nu}? My code is given below:

from IPython.display import display
import sympy as sp
from einsteinpy.symbolic import BaseRelativityTensor, MetricTensor

Ex, Ey, Ez, Bx, By, Bz, c = sp.symbols("E_x E_y E_z B_x B_y B_z c")
t, x, y, z = sp.symbols("t x y z")

# Define Minkowski metric (signature -,+,+,+)
eta = sp.Array([
    [-1, 0, 0, 0],
    [ 0, 1, 0, 0],
    [ 0, 0, 1, 0],
    [ 0, 0, 0, 1]
])
syms = (t, x, y, z)
metric = MetricTensor(eta, syms)
g = metric.tensor()

# Define the F array for F^{mu,nu}
F_contra_array = sp.Array([
    [0,    Ex/c,   Ey/c,   Ez/c],
    [-Ex/c, 0,     Bz,    -By],
    [-Ey/c, -Bz,   0,      Bx],
    [-Ez/c, By,   -Bx,     0]
])

# Define contravariant tensor F^{mu nu}
F_contra = BaseRelativityTensor(F_contra_array, syms, "uu", 
                            parent_metric=metric)
print("F^{mu nu} =")
display(F_contra.tensor())

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.