1. Example session

This is a simple example of the use of Invar`. The package is very easy to use: all its capabilities can be controlled through 10 basic commands. In addition, you will have to setup a basic xTensor` session, which we proceed to do now. We need to start by defining the manifold and metric of the Riemann tensor. For information on xTensor` see the file xTensorDoc.nb.

Define a 4d manifold M:

In[10]:=

DefManifold[M, {1, 2, 3, 4}, {a, b, c, d, e, f, g, h, i, j, k, l, m, n}]

** DefManifold: Defining manifold M.

** DefVBundle: Defining vbundle TangentM.

Define a metric with negative determinant, with associated Levi-Civita connection CD:

In[11]:=

DefMetric[-1, metric[-a, -b], CD, {";", "▽"}, CurvatureRelations→False]

** DefTensor: Defining symmetric metric tensor metric[-a, -b] .

** DefTensor: Defining antisymmetric tensor epsilonmetric[a, b, c, d] .

** DefCovD: Defining covariant derivative CD[-a] .

** DefTensor: Defining vanishing torsion tensor TorsionCD[a, -b, -c] .

** DefTensor: Defining symmetric Christoffel tensor ChristoffelCD[a, -b, -c] .

** DefTensor: Defining Riemann tensor RiemannCD[-a, -b, -c, -d] .

** DefTensor: Defining symmetric Ricci tensor RicciCD[-a, -b] .

** DefTensor: Defining Ricci scalar RicciScalarCD[] .

** DefTensor: Defining symmetric Einstein tensor EinsteinCD[-a, -b] .

** DefTensor: Defining Weyl tensor WeylCD[-a, -b, -c, -d] .

   Rules  {1, 2, 3, 4, 5, 6, 7, 8}  have been declared as DownValues for WeylCD .

** DefTensor: Defining symmetric TFRicci tensor TFRicciCD[-a, -b] .

   Rules  {1, 2}  have been declared as DownValues for TFRicciCD .

** DefCovD:  Computing RiemannToWeylRules for dim 4

** DefCovD:  Computing RicciToTFRicci for dim 4

** DefCovD:  Computing RicciToEinsteinRules for dim 4

We included the option CurvatureRelations -> False so contractions of Riemanns will not be converted into Riccis. A number of tensors have been automatically defined. In particular there are the three curvature tensor fields

In[12]:=

RiemannCD[-a, -b, -c, -d]

Out[12]=

R[▽] _abcd^    

In[13]:=

RicciCD[-a, -b]

Out[13]=

R[▽] _ab^  

In[14]:=

RicciScalarCD[]

Out[14]=

R[▽] _^

and their traceless counterparts:

In[15]:=

WeylCD[-a, -b, -c, -d]

Out[15]=

W[▽] _abcd^    

In[16]:=

TFRicciCD[-a, -b]

Out[16]=

S[▽] _ab^  

with their expected trace properties:

In[17]:=

WeylCD[a, -b, -c, -a]

Out[17]=

0

In[18]:=

TFRicciCD[-a, a]

Out[18]=

0

The Riemann and Ricci tensors are not automatically replaced when they have contracted indices. Use ContractCurvature to do that:

In[19]:=

RiemannCD[a, -b, -c, -a]

Out[19]=

R[▽] _ ( bca)^a   

In[20]:=

ContractCurvature[%]

Out[20]=

-R[▽] _bc^  

In[21]:=

RicciCD[-b, b]

Out[21]=

R[▽] _b ^( b)

In[22]:=

ContractCurvature[%]

Out[22]=

R[▽] _^

We can change the output form of the tensors (note the use of Mathematica downvalues ^= )

In[23]:=

PrintAs[metric]^="g" ;

PrintAs[epsilonmetric]^="ε" ;

PrintAs[RiemannCD]^="R" ;

PrintAs[RicciCD]^="R" ;

PrintAs[RicciScalarCD]^="R" ;

PrintAs[WeylCD]^="W" ;

PrintAs[TFRicciCD]^="S" ;

So much for xTensor`. You will not need many more xTensor` functions to work with Invar`, but you will be able to do it more efficiently if you read the specific documentation for that package. Now we can start using the commands added by the package Invar`:

A typical algebraic Riemann scalar could be

In[30]:=

RiemannCD[a, b, -c, e] RiemannCD[-b, -e, -f, d] RiemannCD[c, f, -a, -d]

Out[30]=

R_ (  c )^(ab e) R_bef ^(   d) R_ (  ad)^cf  

which simplifies to

In[31]:=

RiemannSimplify[%]//Timing

Reading InvRules for step 1 and case  {0, 0, 0}

Reading InvRules for step 2 and case  {0, 0, 0}

Reading InvRules for step 3 and case  {0, 0, 0}

Reading InvRules for step 4 and case  {0, 0, 0}

Reading InvRules for step 5, case  {0, 0, 0}  and dimension 4

Reading InvRules for step 6, case  {0, 0, 0}  and dimension 4

Out[31]=

{0.084005 Second, -1/4 Scalar[R_ab  ^(  ef) R_    ^abcd R_cdef^    ]}

Notice how the different rules are read on the fly. We do not read them automatically because they would need several GB of memory.  They are read only once (note the shorter timing now):

In[32]:=

RiemannSimplify[%%]//Timing

Out[32]=

{0.024001 Second, -1/4 Scalar[R_ab  ^(  ef) R_    ^abcd R_cdef^    ]}

The head Scalar is introduced to avoid problems of index collisions.It can be removed using NoScalar:

In[33]:=

Last[%]//NoScalar

Out[33]=

-1/4 R_ab  ^(  ef) R_    ^abcd R_cdef^    

We can generate random Riemann invariants using the command RandomRiemannMonomial, having as argument the case (see Section 2), in this example {0,4}, meaning one Riemann with no derivatives and another with a fourth derivative:

In[34]:=

expr = RandomRiemannMonomial[{0, 4}]//NoScalar

Out[34]=

R_ (  a )^(ea d) R_ ( c b   ; f ; e ; d)^(c f ; b      )

Any monomial can be canonicalized into one of a predefined list of canonical invariants. For the case {0,4} the list contains 126 canonical invariants, apart from the trivial canonical 0.

In[35]:=

MaxIndex[{0, 4}]

Out[35]=

126

In particular, the previous object canonicalizes to

In[36]:=

RiemannToInv[expr]

Out[36]=

0

Many of the invariants actually do canonicalize to 0 so we iterate those two commands until we get something different from zero:

In[37]:=

inv = 0 ;

While[inv === 0, expr = RandomRiemannMonomial[{0, 4}]//NoScalar ; inv = RiemannToInv[expr] ; Print[ScreenDollarIndices[expr], " -> ", inv]] ;

Reading InvRules for step 1 and case  {0, 4}

R_ (  bd)^ce   R_ (  f ; a ; e   ; c)^(ba d     ; f  )  -> I_04,113

In[39]:=

RiemannToInv[expr]

Out[39]=

I_04,113

The canonical invariants can be expressed as a polynomial in a basis of indepent invariants, taking into account all the symmetries of the problem. This implies reading rules for additional `steps'

In[40]:=

InvSimplify[%]

Reading InvRules for step 2 and case  {0, 4}

Reading InvRules for step 3 and case  {0, 4}

Reading InvRules for step 4 and case  {0, 4}

Reading InvRules for step 5, case  {0, 4}  and dimension 4

Reading InvRules for step 6, case  {0, 4}  and dimension 4

Reading InvRules for step 5, case  {0, 0, 2}  and dimension 4

Reading InvRules for step 5, case  {0, 1, 1}  and dimension 4

Reading InvRules for step 5, case  {0, 0, 0, 0}  and dimension 4

Reading InvRules for step 6, case  {0}  and dimension 4

Reading InvRules for step 6, case  {2}  and dimension 4

Reading InvRules for step 6, case  {0, 0}  and dimension 4

Reading InvRules for step 6, case  {0, 2}  and dimension 4

Reading InvRules for step 6, case  {0, 0, 2}  and dimension 4

Reading InvRules for step 6, case  {0, 1, 1}  and dimension 4

Reading InvRules for step 6, case  {1, 1}  and dimension 4

Reading InvRules for step 6, case  {0, 0, 0, 0}  and dimension 4

Out[40]=

Finally this expression can be translated back into Riemann invariants.

In[41]:=

InvToRiemann[%]

Reading InvRules for step 1 and case  {0}

Reading InvRules for step 1 and case  {2}

Reading InvRules for step 1 and case  {0, 0}

Reading InvRules for step 1 and case  {0, 2}

Reading InvRules for step 1 and case  {1, 1}

Reading InvRules for step 1 and case  {0, 0, 2}

Reading InvRules for step 1 and case  {0, 1, 1}

Reading InvRules for step 1 and case  {0, 0, 0, 0}

Out[41]=

The whole process can be done in a single step using the command RiemannSimplify:

In[42]:=

RiemannSimplify[expr]

Out[42]=

This is the example expression shown in the first paper:

In[43]:=

Out[43]=

In[44]:=

RiemannSimplify[expr] //Timing

Reading DualInvRules for step 1 and case  {0, 0}

Reading DualInvRules for step 1 and case  {0, 0, 0, 0, 0}

Reading DualInvRules for step 2 and case  {0, 0, 0, 0, 0}

Reading DualInvRules for step 3 and case  {0, 0, 0, 0, 0}

Reading DualInvRules for step 4 and case  {0, 0, 0, 0, 0}

Reading DualInvRules for step 5 and case  {0, 0, 0, 0, 0}

Reading DualInvRules for step 2 and case  {0, 0}

Reading DualInvRules for step 3 and case  {0, 0}

Reading DualInvRules for step 4 and case  {0, 0}

Reading DualInvRules for step 5 and case  {0, 0}

Out[44]=

{0.524032 Second, 0}

And this is the example expression shown in the second paper:

In[45]:=

Out[45]=

In[46]:=

RiemannSimplify[expr] //Timing

Reading InvRules for step 1 and case  {2, 2, 2}

Reading InvRules for step 2 and case  {2, 2, 2}

Reading InvRules for step 3 and case  {2, 2, 2}

Reading NEInvRules for step 4 and case  {2, 2, 2}

Reading InvRules for step 5, case  {2, 2, 2}  and dimension 4

Reading InvRules for step 6, case  {2, 2, 2}  and dimension 4

Reading InvRules for step 5, case  {0, 0, 2, 2}  and dimension 4

Reading InvRules for step 6, case  {0, 0, 2, 2}  and dimension 4

Out[46]=

{1.72411 Second, 0}


Created by Mathematica  (May 16, 2008) Valid XHTML 1.1!