# How to use CTensor for the Maxwell stress tensor F?

I have used the CTensor to compute an equation of motion. Everything is ok but the stress tensor F. How can I rewrite this tensor using CTensor. The needed definitions are as follows:

DefManifold[M, 6, {\[Alpha], \[Beta], \[Sigma], \[Delta], \[Iota], \
\[Mu], \[Omicron], \[FinalSigma], \[Tau], \[Upsilon], \[Chi], \
\[Omega], \[Nu], \[Rho], \[Gamma]}]

DefChart[\[ScriptCapitalB], M, {0, 1, 2, 3, 4, 5}, {t[],
r[], \[Eta]1[], \[Zeta]1[], \[Eta]2[], \[Zeta]2[]},
ChartColor -> Blue]

MakeRule[{F[-\[Alpha], -\[Beta]],
CD[-\[Alpha]]@A[-\[Beta]] - CD[-\[Beta]]@A[-\[Alpha]]}]


and A(r) is

A = {h[r[]], 0, 0, 2 h[r[]] m \[Eta]1[], 0, 2 h[r[]] m \[Eta]2[]}.


• Have you defined a metric? I'm pretty sure that xAct & xCoba need one to do coordinate calculations involving CD. Also, I believe that you'll need to invoke DefScalarFunction[h] to let xCoba know that h is a scalar function of your coordinates, and it's probably good practice to invoke DefConstantSymbol[m] as well (assuming it is in fact a constant.) Jul 16, 2019 at 14:41

I think this will be the answer.

AA0 = {h[r[]], 0, 0, 2 h[r[]] m \[Eta]1[], 0, 2 h[r[]] m \[Eta]2[]};

AA = CTensor[AA0, {-\[ScriptCapitalB]}];

FF1 = (CD[-\[Alpha]]@AA[-\[Beta]] - CD[-\[Beta]]@AA[-\[Alpha]])[[0,
1]]

• Your code in the original question is in 6-D, but your vector here is 8-D. Did you mean to include the \[Eta]3[] part? Jul 16, 2019 at 14:46
• @MichaelSeifert I correct it. Thanx. Jul 17, 2019 at 5:32
• Thanks for the clarification. Note also that you'll need to specify a metric before you can actually calculate anything using xCoba — see my comment on your original question. Jul 17, 2019 at 12:14
• @MichaelSeifert Yes, of course for final calculation a metric will be needed. Jul 17, 2019 at 12:43