FemtoCad

FemtoCad is an implementation of a subset of the functionality of Kasper Peeters's field theory tensor algebra program Cadabra. FemtoCad is completely independent of Cadabra at the source code level, and the intention is that the two programs should be able to provide independent cross-checks on each other's calculations.

FemtoCad is provided as C++ source code, and on a Linux system with gcc can be built for example with the command:

g++ -o FemtoCad FemtoCad.cpp -Wall

FemtoCad can be run interactively, if started with the command ./FemtoCad, or it can act as a filter, if called with a command like ./FemtoCad < InputFile > OutputFile.

FemtoCad allows tensor names, coefficient names, and index names to be any displayable ASCII words that do not start with a decimal digit or /, and do not contain any of the special-purpose characters ()+-{}#_,.;:.

The numerical coefficients recognized by FemtoCad are integers, and rational numbers written in the form integer/integer, for example 23/41.

FemtoCad recognizes subscript tensor indices only, so if an inverse metric is required, it must be introduced as a field with a different name from the metric, and with subscript indices. For example ginv_{\mu \nu} could be used instead of g^{\mu \nu}.

FemtoCad maintains only one expression. The Cadabra definition notation := is not recognized, and any command that is neither a Property nor an Algorithm is interpreted as a new expression, which replaces the current expression.

FemtoCad is intended to run correctly written scripts correctly, and provides only minimal syntax checking and error diagnosis.

The Properties currently recognized by FemtoCad are Indices, Integer, and Coefficients.

The Algorithms currently implemented for FemtoCad are @distribute, @quit, @rename_dummies, @standardize, and @substitute.

The Properties and Algorithms implemented for FemtoCad are intended to function as in the Cadabra documentation, except as noted below.

FemtoCad applies each algorithm to the current expression, or in other words, acts as though the expression argument of the algorithm was %, regardless of the actual value of the expression argument.

FemtoCad always applies an algorithm at each appropriate point in a single pass through the current expression, and ignores any ! that immediately follow the algorithm name. For example @distribute acts on only the first opened pair of parentheses, if any, in each term of the current expression.

The Coefficients property enables non-numerical coefficients, that may have subscripts, to be declared, so that FemtoCad will ignore their indices when manipulating tensor indices.

The @rename_dummies algorithm treats all indices as dummies, so before applying it to an expression with free indices, the expression should be contracted on the left with a dummy tensor that contracts with all the free indices.

The @substitute algorithm requires the substitution left-hand side to be either a single tensor, or a product of two tensors, for example A_{p q} or B or C_n D_{i j} are accepted. A separate application of @substitute is required for each distinct internal contraction pattern of the substitution left-hand side that is required to be replaced. For example @substitute!(%)( A_{p q} -> B_p C_{q} ); will replace A_{d e} but not A_{p p}.

FemtoCad is copyright (c) Chris Austin 2010 and is licensed for use under the Free Software Foundation GNU General Public License. This documentation page is copyright (c) Chris Austin 2010 and is licensed for use under the Free Software Foundation GNU Free Documentation License.

Page last updated 1 November 2010.