# Cadabra

## A field-theory motivated approach to symbolic computer algebra

### Copyright © 2001-2006 Kasper Peeters

## Overview

Cadabra is a computer algebra system (CAS) for the manipulation of tensorial expressions. It is aimed at, though not necessarily restricted to, theoretical high-energy physicists. Because of its target audience, the program's interface, storage system and underlying philosophy differ substantially from other computer algebra systems. Its main characteristics are:

- Usage of a TeX-like notation, which eliminates many errors in transcribing problems from paper to computer and back.
- Built-in understanding of dummy indices and dummy symbols, including their automatic relabelling when necessary. Powerful algorithms for canonicalisation of objects with index symmetries, both mono-term and multi-term.
- A typing system through properties, but freedom to dispense with this system entirely when it is not needed.
- A new way to deal with products of non-commuting objects, enabling a notation which is identical to standard physicist's notation (i.e. no need for special non-commuting product operators).
- A flexible optional undo system. Interactive calculations can be undone to arbitrary level without requiring a full re-evaluation of the entire calculation.
- A simple and documented way to add new algorithms in the form of C++ modules, which directly operate on the internal expression tree.

Cadabra has been under development for some time now, but has never left my own computer. The current version is the first public release, intended to collect feedback from a wider audience. So, feel free to mail me at `kasper.peeters (at) aei.mpg.de` with suggestions or constructive criticism.

## License and acknowledgements

If you use cadabra or even just play with it, I would like to hear about it. Please drop me an email so that I can get an idea of who is interested in this program.

Cadabra is available under the conditions of the GNU General Public License. If you use cadabra in your own work, please cite the paper mentioned below (to keep the bean counters happy).

Cadabra contains code taken from José Martin-Garcia's xPerm in order to canonicalise tensor expressions. Some of the algorithms rely on the LiE software by Marc van Leeuwen, Arjeh Cohen and Bert Lisser.

## Screenshots

Cadabra comes with its own graphical frontend, which is based on the gtk toolkit (or rather its C++ wrapper gtkmm) and uses LaTeX to typeset expressions. This is a screenshot:

There is also a TeXmacs frontend, displayed in the screenshots below. The associated TeXmacs files can be found in the "texmacs" subdirectory of the source tarball.

## Install a binary

(note: there are no binaries or packages yet for the new graphical frontend)

First check below whether there is a package for your system, which is always the easiest installation method.

If you are running Linux (on an Intel processor) or Mac OS X, the next simplest way to install cadabra is to install a statically linked binary. You need to download two programs,

Linux, i386 | Mac OS X, PPC
--- | ---
prompt.gz | prompt.gz
CDBRELEASE.gz | CDBRELEASE.gz

gunzip them both and make them executable with "`chmod u+x prompt cadabra`". Put them somewhere in your path. Then the command "`prompt cadabra`" should start the program (or `./prompt ./cadabra` if the current directory is not in your path); if not, email me.

If you want to use the TeXmacs frontend, you will also need the following file:

- init-cadabra.scm

Store this file in the directory `~/.TeXmacs/plugins/cadabra/progs/` and restart TeXmacs.

Alternatively you can try to locate the `TeXmacs/plugins` directory on your filesystem (it is usually something like `/usr/share/TeXmacs/plugins`), and make a (nested) subdirectory `cadabra/progs` below that. Then copy the `init-cadabra.scm` file to this directory and (re)start TeXmacs.

## Install using Debian, Red Hat, MacPorts, ...

Thanks to Greg Wright, cadabra is available for Mac OS X users through MacPorts. Simply type `sudo port install cadabra` and all required software will be installed automatically. For questions about this port, please contact `gwright (at) macports.org`.

Debian and RPM packages will follow in the near future.

## Install from source

Installing from source should be no harder than with any other well-behaved GNU tools, i.e. it should be as simple as configure/make/make install. However, you will need to have some additional libraries and tools installed before you can compile cadabra itself. In particular,

- tcl8.4 with libexpect
(on Debian, `apt-get install tcl8.4 expect-dev`)
- gmp (configured with `--enable-cxx`)
(on Debian, `apt-get install libgmp3-dev libgmpxx3`)
- pcre with C++ wrapper enabled (on Debian, `apt-get install libpcre3-dev lib`)
- LiE
(no Debian package available)

In order to compile the graphical front-end (add the --enable-gui flag to configure) you also need

- gtk+
- gtkmm
- pangomm
- dvipng
- LaTeX
- the breqn package for LaTeX

Cadabra's configure script will look for these libraries and programs, and tell you when you need to install them. Consult the documentation of these programs/libraries for installation instructions.

You then need to compile and install my modglue library, which is used to connect the various pieces of cadabra together. Download this version here, since it's tuned to cadabra:

- MODGLUERELEASE.tar.gz

This should be a matter of configure/make/make install. Finally, compile and install cadabra itself,

- CDBRELEASE.tar.gz

Again, this should be a matter of configure/make/make install. If compilation succeeds, you can also try "make test" for some self-tests (which should all pass).

Since this is the first public release, chances are that some people will encounter problems at one of these steps. Please mail me if you need help.

## Documentation

There are currently two documents about cadabra. One is a paper explaining the motivation for writing this software, as well as sketching the internal structure:

> Kasper Peeters
> A field-theory motivated approach to symbolic computer algebra
> cs.SC/0608005

The second document is the reference guide and tutorial, available only from here, and still incomplete,

> Kasper Peeters
> Cadabra: reference guide and tutorial
> preprint AEI-2006-038

Finally, if you are interested in the internals of the program, there is some doxygen documentation, though this is still in a rather preliminary stage.

For a history of the changes made since the first release, consult the ChangeLog.

## Mailing list

There is a mailing list for discussions about cadabra and announcements of new versions (hosted by HEPforge). To subscribe, send an email to

> majordomo@cedar.ac.uk

with a body containing the line

> subscribe cadabra-discuss

You will receive a confirmation email to which you have to reply, quoting the given authentication key, in order to get subscribed.

There is also an archive of the mailing list available.