TInvar
The TInvar package provides a set of functions for canonicalization of expressions involving the Riemann tensor. The core xAct canonicalization functionality provided by ToCanonical is able to efficiently handle single-term symmetries such as
. However the Riemann tensor has additional multi-term symmetries through the Bianchi identities, and ToCanonical does not have any way of handling those and using them to canonicalize expressions. The purpose of TInvar is to provide that extra functionality through an new function RiemannSimplify that makes use of the Bianchi identities to simplify expressions into a fully canonical form.

When considering the problem of canonicalization, one must think about a basis with which to represent an expression in its canonical form. Such a basis was proposed in "Normal forms for tensor polynomials: I. The Riemann tensor", S. A. Fulling, R. C. King, B. G. Wybourne and C. J. Cummins, Classical and Quantum Gravity 9, 1151. In that article the authors identified an appropriate basis of independent monomials for the Riemann tensor. The elements of their basis are organised by order (number of derivatives of the metric), degree (number of Riemann tensors) and rank (number of free indices). In the article they enumerated all basis elements up to order 12, degree 6 and rank 12. TInvar is designed to take an arbitrary Riemann polynomial and simplify it into its normal form with respect to that basis.
This tutorial covers some basic usage of the package, showing how it can verify some well-known identities.
Next we define some basic xAct structures: a manifold M, a metric gab and an associated covariant derivative CD:
RiemannSimplify | simplify Riemann tensors |
InvSimplify | simplify invariants |
RiemannToInv | convert Riemann tensors to invariants |
InvToRiemann | convert invariant to explicit Riemann tensor expressions |
At the highest level is RiemannSimplify. This takes as input a tensor expression involving the Riemann tensor and writes it in canonical form in terms of the Fulling et al. basis.
Internally, TInvar converts all expressions to an "invariant" format. We do not usually need to know about this when running RiemannSimplify, but if we wise we can convert explicitly to and from this format using RiemannToInv and InvToRiemann:
The notation Ini1i2...im,j here represents the j-th invariant in the part of the basis with n free indices, m Riemann tensors, and i1,...,im covariant derivatives acting on those Riemann tensors.
Note that j counts not only independent elements of the basis, but a larger set of canonical permutations. These permutations are a step between tensor expressions and invariants. The set of all permutations represent all possibilities that can be produced by ToCanonical for a given order, degree and rank. Not all of these permutations are independent, but they can all be projected to the canonical basis of independent invariants. The functions RiemannToPerm, PermToRiemann, InvToPerm and PermToInv allow transforming between these different representations:
MathTensor identities
The MathTensor package by Leonard Parker and Steven M. Christensen includes a database of several commonly used identities. Let's use RiemannSimplify to check them. First, we define the 40 identities:
These expressions should all be equal to zero, but to show that in many cases the Bianchi identities are required. Let's now print out a table of all invariants and indicate whether they are identified as being equal to zero by ToCanonical and by RiemannSimplify:
Decanini & Folacci identities
Another large set of useful identities were also derived in "FKWC-bases and geometrical identities for classical and quantum field theories in curved spacetime", Y. Decanini and A. Folacci. Let's also check those. First we define the expressions by their equation number in the paper: