Mangled output problems

64 views
Skip to first unread message

Jacob Oost

unread,
Oct 10, 2017, 9:08:45 AM10/10/17
to xAct Tensor Computer Algebra
Hi, I'm very new at this.  I'm trying to look at components of a stress-energy tensor (I got the correct results on a trial case), and getting some weird output involving column vectors, inverse matrices, and tetrad unit vector things, and I was hoping somebody could tell me what my problem is and maybe how I could fix it.

My setup was like this:

Needs["xAct`xTensor`"]
Needs["xAct`xCoba`"]
Needs["xAct`xTras`"]
DefManifold[M4, 4, {a, b, c, d, e, f, g, h}];
DefChart[cb, M4, {0, 1, 2, 3}, {uu[], v[], y[], z[]}, 
 ChartColor -> Blue]
cb /: CIndexForm[0, cb] := "u";
cb /: CIndexForm[1, cb] := "v";
cb /: CIndexForm[2, cb] := "y";
cb /: CIndexForm[3, cb] := "z";
DefConstantSymbol[G];
DefConstantSymbol[c1];
DefConstantSymbol[c2];
DefConstantSymbol[c3];
DefConstantSymbol[c4];
DefScalarFunction[aa];
DefScalarFunction[U];
DefScalarFunction[V];
u = CTensor[{1/Sqrt[2], 1/Sqrt[2], 0, 0}, {cb}];
g = CTensor[{{0, -1, 0, 0}, {-1, 0, 0, 0}, {0, 0, 
     Exp[V[uu[]] - U[uu[]]], 0}, {0, 0, 0, 
     Exp[-(U[uu[]] + V[uu[]])]}}, {-cb, -cb}];
SetCMetric[g, cb, SignatureOfMetric -> {3, 1, 0}];
CD = CovDOfMetric[g];
MetricCompute[g, cb, All];

Then I entered the tensor function like T[a_,b_]:=<stuff from another notebook where I used variation to get the equations of motion>

If I enter:

Simplification[ContractBasis[T[{0, -cb}, {0, -cb}]]]

then I get the 00-component of the tensor in a nice simplified form, but other components I get nastiness like you see in the attached pictures.  What can I do?  Thanks.
OutputWeirdness1.png
OutputWeirdness2.png

BD

unread,
Feb 28, 2018, 2:42:48 AM2/28/18
to xAct Tensor Computer Algebra
This is probably too late of a response to help you by now :-p 

A quick fix would be to define some helper functions:

TB = ToBasis[cb][ToBasis[cb][#]] &;
CA = ToValues[ComponentArray[ToValues[TraceBasisDummy[TB[#]]]]] &;

then try 

CA[T[-a,-b]]

(you might have to run it twice if you get an error)

----------------------------
an aside... this is good for cleaning up code:

the block: 

DefConstantSymbol[G];
DefConstantSymbol[c1];
DefConstantSymbol[c2];
DefConstantSymbol[c3];
DefConstantSymbol[c4];

can be replaced with: 

DefConstantSymbol[#]&/@{G,c1,c2,c3,c4};

with similar like replacements for all of your other Def"..."[]

----------------------------
_
Reply all
Reply to author
Forward
0 new messages