xAct`SymManipulator`

This is the doc file SymManipulatorDoc.nb of version 0.8.3 of SymManipulator`. Last update on 5 May 2012.

Author

© 2011-2012, under the GNU General Public License (GPL)
     Thomas Bäckdahl
    Max-Planck-Institut für Gravitationsphysik
    Albert Einstein Institut
    Golm, Germany
    thomas.backdahl@aei.mpg.de

Intro

SymManipulator` is the xAct` package for computations with symmetrized tensor expressions. By a symmetrized tensor expression we mean a sum of tensors where each term is the original expression with the indices permuted. We require the set of permutations to form a group. We call this group the imposed symmetry group. It is a group of signed permutations. The sign of the permutation gives the sign of the corresponding term.

Load the package

This loads the package from the default directory, for example $Home/.Mathematica/Applications/xAct/ for a single-user installation under Linux.  

In[1]:=

SymManipulatorDoc.nb_1.gif

Out[1]=

SymManipulatorDoc.nb_2.gif

In[2]:=

SymManipulatorDoc.nb_3.gif

SymManipulatorDoc.nb_4.gif

SymManipulatorDoc.nb_5.gif

SymManipulatorDoc.nb_6.gif

SymManipulatorDoc.nb_7.gif

SymManipulatorDoc.nb_8.gif

SymManipulatorDoc.nb_9.gif

SymManipulatorDoc.nb_10.gif

SymManipulatorDoc.nb_11.gif

SymManipulatorDoc.nb_12.gif

SymManipulatorDoc.nb_13.gif

SymManipulatorDoc.nb_14.gif

SymManipulatorDoc.nb_15.gif

SymManipulatorDoc.nb_16.gif

SymManipulatorDoc.nb_17.gif

In[3]:=

<<xAct`TexAct`

SymManipulatorDoc.nb_18.gif

SymManipulatorDoc.nb_19.gif

SymManipulatorDoc.nb_20.gif

SymManipulatorDoc.nb_21.gif

SymManipulatorDoc.nb_22.gif

SymManipulatorDoc.nb_23.gif

Comparing, we see that what packages take in Mathematica 8.0:

In[4]:=

SymManipulatorDoc.nb_24.gif

Out[4]=

SymManipulatorDoc.nb_25.gif

In[5]:=

SymManipulatorDoc.nb_26.gif

Out[5]=

SymManipulatorDoc.nb_27.gif

There are several contexts: xAct`SymManipulator`, xAct`xTensor`, xAct`xPerm` and xAct`xCore` contain the respective reserved words. System` contains Mathematica's reserved words.  The current context Global` will contain your definitions and right now is empty.

In[6]:=

SymManipulatorDoc.nb_28.gif

Out[6]=

SymManipulatorDoc.nb_29.gif

In[7]:=

SymManipulatorDoc.nb_30.gif

Out[7]=

SymManipulatorDoc.nb_31.gif

In[8]:=

SymManipulatorDoc.nb_32.gif

SymManipulatorDoc.nb_33.gif

1. Example session

The package works for all dimensions. At the moment only abstract indices can be used.

Basic examples

Definition of a four dimensional  manifold M4:

In[9]:=

SymManipulatorDoc.nb_34.gif

SymManipulatorDoc.nb_35.gif

SymManipulatorDoc.nb_36.gif

For most things we don’t need a metric so we do not need to define one now.

We define a tensor without symmetries:

In[10]:=

SymManipulatorDoc.nb_37.gif

SymManipulatorDoc.nb_38.gif

If we want to completely symmetrize T, we can do it using just xTensor:

In[11]:=

SymManipulatorDoc.nb_39.gif

Out[11]=

SymManipulatorDoc.nb_40.gif

This representation is often inconvenient to use so we can impose the symmetry abstractly instead using ImposeSym:

In[12]:=

SymManipulatorDoc.nb_41.gif

Out[12]=

SymManipulatorDoc.nb_42.gif
a b c d

The label (1234) means that the symmetrization is taken over the slots 1, 2, 3 and 4.

We can manipulate this expression, and only expand it when we need to. We expand it with ExpandSym:

In[13]:=

SymManipulatorDoc.nb_43.gif

Out[13]=

SymManipulatorDoc.nb_44.gif

We can check that this is the same as ImposeSymmetry:

In[14]:=

SymManipulatorDoc.nb_45.gif

Out[14]=

SymManipulatorDoc.nb_46.gif

The symmetrized expression is treated as a tensor. That is most xTensor tools will work on it. A new tensor is not defined, so all information is carried in the head of the symmetrized object.

In[15]:=

SymManipulatorDoc.nb_47.gif

Out[15]=

SymManipulatorDoc.nb_48.gif

In[16]:=

SymManipulatorDoc.nb_49.gif

Out[16]=

SymManipulatorDoc.nb_50.gif

In[17]:=

SymManipulatorDoc.nb_51.gif

Out[17]=

SymManipulatorDoc.nb_52.gif

The canonicalizer can therefore work on SymH objects:

In[18]:=

SymManipulatorDoc.nb_53.gif

Out[18]=

SymManipulatorDoc.nb_54.gif

In[19]:=

SymManipulatorDoc.nb_55.gif

Out[19]=

SymManipulatorDoc.nb_56.gif

Other groups can also be imposed. For instance symmetrize over -a,-c and antisymmetrize over -b,-d:

In[20]:=

SymManipulatorDoc.nb_57.gif

Out[20]=

SymManipulatorDoc.nb_58.gif
a b c d

In[21]:=

SymManipulatorDoc.nb_59.gif

Out[21]=

SymManipulatorDoc.nb_60.gif

If the group has more complicaed structure, the label only shows the slots involved.

In[22]:=

SymManipulatorDoc.nb_61.gif

Out[22]=

SymManipulatorDoc.nb_62.gif
a b c d

In[23]:=

SymManipulatorDoc.nb_63.gif

Out[23]=

SymManipulatorDoc.nb_64.gif

TexAct package can produce a nice TeX code output if the symmetrized object is possible to write in a nice way.

In[24]:=

SymManipulatorDoc.nb_65.gif

Out[24]=

SymManipulatorDoc.nb_66.gif
a b c d

In[25]:=

SymManipulatorDoc.nb_67.gif

Out[25]=

SymManipulatorDoc.nb_68.gif

In[26]:=

SymManipulatorDoc.nb_69.gif

Out[26]=

SymManipulatorDoc.nb_70.gif
a
b c d

In[27]:=

SymManipulatorDoc.nb_71.gif

Out[27]=

SymManipulatorDoc.nb_72.gif

The internal tensor can also have symmetries.

In[28]:=

SymManipulatorDoc.nb_73.gif

SymManipulatorDoc.nb_74.gif

In[29]:=

SymManipulatorDoc.nb_75.gif

Out[29]=

SymManipulatorDoc.nb_76.gif
a b c d

Now the total symmetry is a mixture of the symmetry of S and the imposed symmetry.

In[30]:=

SymManipulatorDoc.nb_77.gif

Out[30]=

SymManipulatorDoc.nb_78.gif

The calculation of this symmetry has special codes for the cases when the imposed symmetry is the symmetric or antisymmetric group on some indices. In all other cases, a more time consuming code is used to compute the mixed symmetry.

If the tensor already has the the imposed symmetry, it is automatically simplified.

In[31]:=

SymManipulatorDoc.nb_79.gif

Out[31]=

S
a b c d

If one antisymmetrizes over a pair of symmetric slots, one will get zero. This idea have been generalized, and this is checked automatically by ImposeSym. This check works for any combination of groups.

In[32]:=

SymManipulatorDoc.nb_80.gif

Out[32]=

SymManipulatorDoc.nb_81.gif

In[33]:=

SymManipulatorDoc.nb_82.gif

Out[33]=

SymManipulatorDoc.nb_83.gif

Sometimes the expansion of a symmetry gives many more terms than need due to the internal symmetry.

In[34]:=

SymManipulatorDoc.nb_84.gif

Out[34]=

SymManipulatorDoc.nb_85.gif
a b c d

In[35]:=

SymManipulatorDoc.nb_86.gif

Out[35]=

SymManipulatorDoc.nb_87.gif

In[36]:=

SymManipulatorDoc.nb_88.gif

Out[36]=

SymManipulatorDoc.nb_89.gif

Then one can give the option SmartExpand->True. Instead of computing all elements of the imposed symmetry group, only a transversal is computed. This is a new feature in release 0.8.3 and not very well tested.

In[37]:=

SymManipulatorDoc.nb_90.gif

Out[37]=

SymManipulatorDoc.nb_91.gif

This idea is used in the new commands SmartSymmetrize and SmartAntisymmetrize. They do the same thing as Symmetrize and Antisymmetrize, but number of terms is reduced by taking the internal symmetry into consideration. Observe that this is a new feature in release 0.8.3 and not very well tested.

In[38]:=

SymManipulatorDoc.nb_92.gif

Out[38]=

SymManipulatorDoc.nb_93.gif

In[39]:=

SymManipulatorDoc.nb_94.gif

Out[39]=

SymManipulatorDoc.nb_95.gif

In[40]:=

SymManipulatorDoc.nb_96.gif

Out[40]=

SymManipulatorDoc.nb_97.gif

Product of tensors can be handled. In this case, interchange symmetries etc will be considered as usual.

In[41]:=

SymManipulatorDoc.nb_98.gif

Out[41]=

SymManipulatorDoc.nb_99.gif
a b c d f h l m

In[42]:=

SymManipulatorDoc.nb_100.gif

Out[42]=

SymManipulatorDoc.nb_101.gif

In[43]:=

SymManipulatorDoc.nb_102.gif

Out[43]=

SymManipulatorDoc.nb_103.gif
a b c d f h l m

The order of the tensors is automatically sorted by ImposeSym.

In[44]:=

SymManipulatorDoc.nb_104.gif

Out[44]=

SymManipulatorDoc.nb_105.gif
a b c d f h l m

If one would like to sort them alphabetically at any ther time one can use SortTensorsInSym

In[45]:=

SymManipulatorDoc.nb_106.gif

Out[45]=

SymManipulatorDoc.nb_107.gif
a b c d f h l m

In[46]:=

SymManipulatorDoc.nb_108.gif

Out[46]=

SymManipulatorDoc.nb_109.gif
f h l m a b c d

If a tensor is inside the SymH object, but the symmetrization is not acting on its indices, one can move it outside the SymH object.

In[47]:=

SymManipulatorDoc.nb_110.gif

Out[47]=

SymManipulatorDoc.nb_111.gif
a b c d f h l m

In[48]:=

SymManipulatorDoc.nb_112.gif

Out[48]=

SymManipulatorDoc.nb_113.gif

One can also move tensors inside the SymH object.

In[49]:=

SymManipulatorDoc.nb_114.gif

Out[49]=

SymManipulatorDoc.nb_115.gif
a b c d f h l m

Symmetrizations can be nested

In[50]:=

SymManipulatorDoc.nb_116.gif

Out[50]=

SymManipulatorDoc.nb_117.gif
a b c d

In[51]:=

SymManipulatorDoc.nb_118.gif

Out[51]=

SymManipulatorDoc.nb_119.gif
a b c d

ExpandSym only expands the outermost SymH object

In[52]:=

SymManipulatorDoc.nb_120.gif

Out[52]=

SymManipulatorDoc.nb_121.gif

In[53]:=

SymManipulatorDoc.nb_122.gif

Out[53]=

SymManipulatorDoc.nb_123.gif

Sometimes, when nesting symmeries the inner symmetrization might not be needed because of the outer symmetrization. Then this can be removed by RemoveSuperfluousInnerSym

In[54]:=

SymManipulatorDoc.nb_124.gif

Out[54]=

SymManipulatorDoc.nb_125.gif
a b c d

In[55]:=

SymManipulatorDoc.nb_126.gif

Out[55]=

SymManipulatorDoc.nb_127.gif
a b c d

In[56]:=

SymManipulatorDoc.nb_128.gif

Out[56]=

SymManipulatorDoc.nb_129.gif
a b c d

In[57]:=

SymManipulatorDoc.nb_130.gif

Out[57]=

SymManipulatorDoc.nb_131.gif

The functions for dealing with nested SymH objects work best when all tensors are innermost. To get that, use MoveTensorsInsideSym before you apply the second ImposeSym.

In[58]:=

SymManipulatorDoc.nb_132.gif

Out[58]=

SymManipulatorDoc.nb_133.gif

In[59]:=

SymManipulatorDoc.nb_134.gif

Out[59]=

SymManipulatorDoc.nb_135.gif
f h l m a b c d

In[60]:=

SymManipulatorDoc.nb_136.gif

Out[60]=

SymManipulatorDoc.nb_137.gif
f h l m a b c d

In[61]:=

SymManipulatorDoc.nb_138.gif

Out[61]=

SymManipulatorDoc.nb_139.gif
f h l m a b c d

In[62]:=

SymManipulatorDoc.nb_140.gif

Out[62]=

SymManipulatorDoc.nb_141.gif
f h l m a b c d

In[63]:=

SymManipulatorDoc.nb_142.gif

Out[63]=

SymManipulatorDoc.nb_143.gif
f h l m a b c d

In[64]:=

SymManipulatorDoc.nb_144.gif

Out[64]=

SymManipulatorDoc.nb_145.gif

Examples with a metric

Definition of a Lorentzian metric on the manifold:

In[65]:=

SymManipulatorDoc.nb_146.gif

SymManipulatorDoc.nb_147.gif

SymManipulatorDoc.nb_148.gif

SymManipulatorDoc.nb_149.gif

SymManipulatorDoc.nb_150.gif

SymManipulatorDoc.nb_151.gif

SymManipulatorDoc.nb_152.gif

SymManipulatorDoc.nb_153.gif

SymManipulatorDoc.nb_154.gif

SymManipulatorDoc.nb_155.gif

SymManipulatorDoc.nb_156.gif

SymManipulatorDoc.nb_157.gif

SymManipulatorDoc.nb_158.gif

SymManipulatorDoc.nb_159.gif

SymManipulatorDoc.nb_160.gif

SymManipulatorDoc.nb_161.gif

SymManipulatorDoc.nb_162.gif

SymManipulatorDoc.nb_163.gif

SymManipulatorDoc.nb_164.gif

SymManipulatorDoc.nb_165.gif

SymManipulatorDoc.nb_166.gif

If you contract indices of a SymH object, this is means that the symmetrization is done first and then the contraction.

In[66]:=

SymManipulatorDoc.nb_167.gif

Out[66]=

SymManipulatorDoc.nb_168.gif
a b c d

In[67]:=

SymManipulatorDoc.nb_169.gif

Out[67]=

SymManipulatorDoc.nb_170.gif
b
a b d

In[68]:=

SymManipulatorDoc.nb_171.gif

Out[68]=

SymManipulatorDoc.nb_172.gif

In[69]:=

SymManipulatorDoc.nb_173.gif

Out[69]=

SymManipulatorDoc.nb_174.gif

Observe that the symmetrization and trace operations do not commute in general as seen by this example:

In[70]:=

SymManipulatorDoc.nb_175.gif

SymManipulatorDoc.nb_176.gif

In[71]:=

SymManipulatorDoc.nb_177.gif

Out[71]=

V
b
a b d

In[72]:=

SymManipulatorDoc.nb_178.gif

Out[72]=

SymManipulatorDoc.nb_179.gif

In[73]:=

SymManipulatorDoc.nb_180.gif

Out[73]=

SymManipulatorDoc.nb_181.gif

In[74]:=

SymManipulatorDoc.nb_182.gif

Out[74]=

SymManipulatorDoc.nb_183.gif

In[75]:=

SymManipulatorDoc.nb_184.gif

Out[75]=

SymManipulatorDoc.nb_185.gif

In[76]:=

SymManipulatorDoc.nb_186.gif

Out[76]=

SymManipulatorDoc.nb_187.gif

In[77]:=

SymManipulatorDoc.nb_188.gif

Out[77]=

SymManipulatorDoc.nb_189.gif

The same example with SymH objects:

In[78]:=

SymManipulatorDoc.nb_190.gif

Out[78]=

V
b
a b d

In[79]:=

SymManipulatorDoc.nb_191.gif

Out[79]=

SymManipulatorDoc.nb_192.gif

In[80]:=

SymManipulatorDoc.nb_193.gif

Out[80]=

SymManipulatorDoc.nb_194.gif

In[81]:=

SymManipulatorDoc.nb_195.gif

Out[81]=

SymManipulatorDoc.nb_196.gif
a b c d

In[82]:=

SymManipulatorDoc.nb_197.gif

Out[82]=

SymManipulatorDoc.nb_198.gif
b
a b d

In[83]:=

SymManipulatorDoc.nb_199.gif

Out[83]=

SymManipulatorDoc.nb_200.gif

However, symmetrization and traces do commute if the traces and symmetrizations are taken over disjoint sets of indices.

In[84]:=

SymManipulatorDoc.nb_201.gif

Out[84]=

V
b
a b c

In[85]:=

SymManipulatorDoc.nb_202.gif

Out[85]=

SymManipulatorDoc.nb_203.gif

In[86]:=

SymManipulatorDoc.nb_204.gif

Out[86]=

SymManipulatorDoc.nb_205.gif

In[87]:=

SymManipulatorDoc.nb_206.gif

Out[87]=

SymManipulatorDoc.nb_207.gif
a b c d

In[88]:=

SymManipulatorDoc.nb_208.gif

Out[88]=

SymManipulatorDoc.nb_209.gif
b
a c b

In[89]:=

SymManipulatorDoc.nb_210.gif

Out[89]=

SymManipulatorDoc.nb_211.gif

In[90]:=

SymManipulatorDoc.nb_212.gif

Out[90]=

SymManipulatorDoc.nb_213.gif

In[91]:=

SymManipulatorDoc.nb_214.gif

Out[91]=

SymManipulatorDoc.nb_215.gif

In[92]:=

SymManipulatorDoc.nb_216.gif

Out[92]=

SymManipulatorDoc.nb_217.gif

Sometimes there is a metric inside the SymH object that later can be contracted. The code for ContractMetricsInsideSym is new in release 0.8.3 and is not well tested.

In[93]:=

SymManipulatorDoc.nb_218.gif

Out[93]=

SymManipulatorDoc.nb_219.gif
f h a b c d

In[94]:=

SymManipulatorDoc.nb_220.gif

Out[94]=

SymManipulatorDoc.nb_221.gif
h
f h a c d

In[95]:=

SymManipulatorDoc.nb_222.gif

Out[95]=

SymManipulatorDoc.nb_223.gif
a f c d

In[96]:=

SymManipulatorDoc.nb_224.gif

Out[96]=

SymManipulatorDoc.nb_225.gif

Examples with a derivative

This far only derivatives compatible with the metric are handled. Prefix notation is used.

In[97]:=

SymManipulatorDoc.nb_226.gif

Out[97]=

SymManipulatorDoc.nb_227.gif

The derivative index is the first index of the SymH object. That is, we keep the order of the indices when we use prefix notation.

In[98]:=

SymManipulatorDoc.nb_228.gif

Out[98]=

SymManipulatorDoc.nb_229.gif
a b c d f

In many cases the TexAct package can produce the correct TeX code for the expression.

In[99]:=

SymManipulatorDoc.nb_230.gif

In[100]:=

SymManipulatorDoc.nb_231.gif

Out[100]=

SymManipulatorDoc.nb_232.gif

The derivative is internally represented by CovarD[CD,T,{-TangentM4}]. The list {-TangentM4} gives VBundle for the derivative index.

In[101]:=

SymManipulatorDoc.nb_233.gif

Out[101]//InputForm=

SymH[{CovarD[CD, T, {-TangentM4}]}, StrongGenSet[{1, 2, 4},
   GenSet[Cycles[{1, 2}], Cycles[{2, 4}]]], "(124)"][-a,
-b, -c, -d, -f]

Higher order derivatives also work

In[102]:=

SymManipulatorDoc.nb_234.gif

Out[102]=

SymManipulatorDoc.nb_235.gif

In[103]:=

SymManipulatorDoc.nb_236.gif

Out[103]=

SymManipulatorDoc.nb_237.gif
a b c d f h

In[104]:=

SymManipulatorDoc.nb_238.gif

Out[104]=

SymManipulatorDoc.nb_239.gif

Examples with irreducible decompositions of Spinors (new feature)

The IrrDecompose code needs spinors and loads it if it is not already loaded

In[105]:=

SymManipulatorDoc.nb_240.gif

SymManipulatorDoc.nb_241.gif

SymManipulatorDoc.nb_242.gif

SymManipulatorDoc.nb_243.gif

SymManipulatorDoc.nb_244.gif

SymManipulatorDoc.nb_245.gif

SymManipulatorDoc.nb_246.gif

SymManipulatorDoc.nb_247.gif

Out[105]=

SymManipulatorDoc.nb_248.gif

Define the spin structure

In[106]:=

SymManipulatorDoc.nb_249.gif

Out[106]=

SymManipulatorDoc.nb_250.gif

In[107]:=

SymManipulatorDoc.nb_251.gif

SymManipulatorDoc.nb_252.gif

SymManipulatorDoc.nb_253.gif

SymManipulatorDoc.nb_254.gif

SymManipulatorDoc.nb_255.gif

SymManipulatorDoc.nb_256.gif

SymManipulatorDoc.nb_257.gif

SymManipulatorDoc.nb_258.gif

SymManipulatorDoc.nb_259.gif

SymManipulatorDoc.nb_260.gif

Define some spinors

In[108]:=

SymManipulatorDoc.nb_261.gif

In[109]:=

SymManipulatorDoc.nb_262.gif

In[110]:=

SymManipulatorDoc.nb_263.gif

In[111]:=

SymManipulatorDoc.nb_264.gif

In[112]:=

SymManipulatorDoc.nb_265.gif

In[113]:=

SymManipulatorDoc.nb_266.gif

The basic example is

In[114]:=

SymManipulatorDoc.nb_267.gif

Out[114]=

SymManipulatorDoc.nb_268.gif

It can be tested by making all possible contractions and symmetrizations

In[115]:=

SymManipulatorDoc.nb_269.gif

Out[115]=

SymManipulatorDoc.nb_270.gif

In[116]:=

SymManipulatorDoc.nb_271.gif

Out[116]=

SymManipulatorDoc.nb_272.gif

In[117]:=

SymManipulatorDoc.nb_273.gif

Out[117]=

SymManipulatorDoc.nb_274.gif

A sligthly more complicated case

In[118]:=

SymManipulatorDoc.nb_275.gif

Out[118]=

SymManipulatorDoc.nb_276.gif

The IrrDecompose code uses the symmetries of the expression to simplify it

In[119]:=

SymManipulatorDoc.nb_277.gif

Out[119]=

SymManipulatorDoc.nb_278.gif

In[120]:=

SymManipulatorDoc.nb_279.gif

Out[120]=

SymManipulatorDoc.nb_280.gif

One can also simplify it afterwards

In[121]:=

SymManipulatorDoc.nb_281.gif

Out[121]=

SymManipulatorDoc.nb_282.gif

In[122]:=

SymManipulatorDoc.nb_283.gif

Out[122]=

SymManipulatorDoc.nb_284.gif

The decomposition can be simplified further. We see that the left hand side of IrrDecS4 is symmetric in {-A,-B,-C}, but this is not obvoius on the right hand side.

In[123]:=

SymManipulatorDoc.nb_285.gif

Out[123]=

SymManipulatorDoc.nb_286.gif

In[124]:=

SymManipulatorDoc.nb_287.gif

Out[124]=

SymManipulatorDoc.nb_288.gif

The function CompleteIrrDecompose automatically finds this symmetry and imposes it

In[125]:=

SymManipulatorDoc.nb_289.gif

SymManipulatorDoc.nb_290.gif

SymManipulatorDoc.nb_291.gif

Out[125]=

SymManipulatorDoc.nb_292.gif

Larger cases can be handled

In[126]:=

SymManipulatorDoc.nb_293.gif

SymManipulatorDoc.nb_294.gif

SymManipulatorDoc.nb_295.gif

Out[126]=

SymManipulatorDoc.nb_296.gif

And even larger

In[127]:=

SymManipulatorDoc.nb_297.gif

SymManipulatorDoc.nb_298.gif

SymManipulatorDoc.nb_299.gif

Out[127]=

SymManipulatorDoc.nb_300.gif

Notes

In[128]:=

SymManipulatorDoc.nb_301.gif

Out[128]=

SymManipulatorDoc.nb_302.gif

In[129]:=

SymManipulatorDoc.nb_303.gif

Out[129]=

SymManipulatorDoc.nb_304.gif

Note: For further information about SymManipulator`, and to be kept informed about new releases, you may contact the author electronically at thomas.backdahl@aei.mpg.de. This is SymManipulatorDoc.nb, the docfile of SymManipulator`, currently in version 0.8.3.    

In[130]:=

SymManipulatorDoc.nb_305.gif

SymManipulatorDoc.nb_306.gif

Spikey Created with Wolfram Mathematica 8.0