CTensor contraction

124 views
Skip to first unread message

Maryna М

unread,
May 14, 2023, 3:30:34 PM5/14/23
to xAct Tensor Computer Algebra
Hi everyone,

I'm new to Mathematica, and I'm currently trying to define some tensors that I'll need in further calculations. However, Mathematica fails to contract the tensors I give it. Instead, it just lists all the tensors with respective indices. I tried to find some similar threads, but not seem to success. Could you may be point out, what I'm doing wrong? Thanks!

ClearAll["Global`*"]
<< xAct`xCoba`
Needs["xAct`xPert`"]
Quiet@Block[{Print}, << xAct`xTras`]
$DefInfoQ = False;

DefManifold[M,
  4, {\[Mu], \[Nu], \[Lambda], \[Sigma], \[Rho], i, j, k}];
DefChart[ch, M, {0, 1, 2, 3}, {t[], x[], y[], z[]}]
DefScalarFunction[a]
g = CTensor[{{-1, 0, 0, 0}, {0, a[t[]]^2, 0, 0}, {0, 0, a[t[]]^2,
     0}, {0, 0, 0, a[t[]]^2}}, {-ch, -ch}];
SetCMetric[g, ch]
DefScalarFunction[\[Phi]]
CD = CovDOfMetric[g]

A = CTensor[{\[Phi][t[]], 0, 0, 0}, {ch}]
X = -1/2 A[\[Mu]] A[-\[Mu]]
G = X^p
Fmn[-\[Mu], -\[Nu]] = CD[-\[Mu]]@A[-\[Nu]] - CD[-\[Nu]]@A[-\[Mu]]
F = -1/4 Fmn[-\[Mu], -\[Nu]] Fmn[\[Mu], \[Nu]]
Y = A[\[Mu]] A[\[Nu]] Fmn[-\[Mu], \[Alpha]] Fmn[\[Nu], \[Alpha]] 

Jose

unread,
May 14, 2023, 4:10:48 PM5/14/23
to xAct Tensor Computer Algebra
Hi,

There are a few issues here:

1) With symbolic components, SetCMetric cannot compute the sign of the determinant of the metric. Therefore you should add the option SignatureOfMetric -> {3, 1, 0}, meaning three +1s, one -1 and zero 0s.

   SetCMetric[g, ch, SignatureOfMetric -> {3, 1, 0}]

2) The vector A you have defined has zero antisymmetric part in its covariant derivative, so it's not a generic example here. Let me complicate it a bit so that the following computations are not trivial:

   A = CTensor[{\[Phi][t[]], t[]^2, 0, 0}, {ch}]

3) Once you do a computation with CTensor and you want to define a new tensor, this is what you need:

   Fmn = HeadOfTensor[CD[-\[Mu]]@A[-\[Nu]] - CD[-\[Nu]]@A[-\[Mu]] // Simplify, {-\[Mu], -\[Nu]}]

This returns a new CTensor object, which gets assigned to Fmn. Then the following computations will work as you expect.

4) Your final computation has index \[Alpha], but \[Alpha] was not in the list of indices of the manifold M (actually of its tangent bundle TangentM). You should define all the indices you use in inputs.

Ask again if you continue having problems.

Cheers,
Jose. 
Reply all
Reply to author
Forward
0 new messages