Problem with display of result by using xCoba

96 views
Skip to first unread message

雷扬

unread,
Apr 17, 2017, 3:35:50 AM4/17/17
to xAct Tensor Computer Algebra

Dear All

I want to calculate a second order covariant derivative on scalar field. I do not know how to  input the function information appropriately, so that the out put can be a matrix: 

given a metric, I want to calculate cd[-a]@ cd[-b]@ \[Phi] 

I am expecting a matrix, but it displays not only a matrix part, but also e_a^1 e_b^1 part as shown in the picture. How do I force the  e_a^1 e_b^1 part display as a matrix? Code relevant is given below.

<< xAct`xTras`;
<< xAct`xCoba`;
DefManifold[M, 10, IndexRange[a, m]]
DefBasis[fr, TangentM, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}];
DefChart[d0, M, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, {t[], r[], x1[], x2[],
   x3[], x4[], x5[], x6[], x7[], x8[]}, ChartColor -> Red];

DefConstantSymbol[Leng, PrintAs -> "L"]
DefConstantSymbol[blackhole, 
 PrintAs -> "\!\(\*SubscriptBox[\(r\), \(0\)]\)"]

met = CTensor[{{-((1 - blackhole^7/r[]^7)/Sqrt[1 + Leng^7/r[]^7]), 0, 
    0, 0, 0, 0, 0, 0, 0, 0}, {0, 
    Sqrt[1 + Leng^7/r[]^7]/(1 - blackhole^7/r[]^7), 0, 0, 0, 0, 0, 0, 
    0, 0}, {0, 0, Sqrt[1 + Leng^7/r[]^7] r[]^2, 0, 0, 0, 0, 0, 0, 0
    }, {0, 0, 0, r[]^2 Sqrt[1 + Leng^7/r[]^7] Sin[x1[]]^2, 0, 0, 0, 0,
     0, 0}, {0, 0, 0, 0, 
    r[]^2 Sqrt[1 + Leng^7/r[]^7] Sin[x1[]]^2 Sin[x2[]]^2, 0, 0, 0, 0, 
    0}, {0, 0, 0, 0, 0, 
    r[]^2 Sqrt[1 + Leng^7/r[]^7] Sin[x1[]]^2 Sin[x2[]]^2 Sin[x3[]]^2, 
    0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 
    r[]^2 Sqrt[1 + Leng^7/r[]^7] Sin[x1[]]^2 Sin[x2[]]^2 Sin[
      x3[]]^2 Sin[x4[]]^2, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 
    r[]^2 Sqrt[1 + Leng^7/r[]^7] Sin[x1[]]^2 Sin[x2[]]^2 Sin[
      x3[]]^2 Sin[x4[]]^2 Sin[x5[]]^2, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0,
     r[]^2 Sqrt[1 + Leng^7/r[]^7] Sin[x1[]]^2 Sin[x2[]]^2 Sin[
      x3[]]^2 Sin[x4[]]^2 Sin[x5[]]^2 Sin[x6[]]^2, 0}, {0, 0, 0, 0, 0,
     0, 0, 0, 0, 
    r[]^2 Sqrt[1 + Leng^7/r[]^7] Sin[x1[]]^2 Sin[x2[]]^2 Sin[
      x3[]]^2 Sin[x4[]]^2 Sin[x5[]]^2 Sin[x6[]]^2 Sin[
      x7[]]^2}}, {-d0, -d0}]

SetCMetric[met, d0]
cd = CovDOfMetric[met]

\[Phi] = 3/4 Log[(1 + Leng^7/r[]^7)]

2 cd[-a]@cd[-b]@(\[Phi]) // ContractBasis // Simplify // MatrixForm


Thank you

Yang

Jacob Oost

unread,
Oct 9, 2017, 11:33:06 PM10/9/17
to xAct Tensor Computer Algebra
I am having similar output problems and would like some help on this.

ghadir jafari

unread,
Oct 11, 2017, 10:43:36 AM10/11/17
to xAct Tensor Computer Algebra
Dear Yang
Adding the commands "BasisExpand"  and "FromBasisExpand" will solve the problem. just change your last line as:

2 cd[-a]@cd[-b]@(\[Phi]) // BasisExpand[#, d0] & // 
  FromBasisExpand[#, {-d0, -d0}] & // Simplify
Reply all
Reply to author
Forward
0 new messages