I have a couple abstract indexed quantities, both differential elements

$dx = dx^\mu e_\mu + x^\mu de_\mu$

$du = du^\mu e_\mu + u^\mu de_\mu$

I can compute the expression $(dx + du) \cdot (dx + du) - dx \cdot dx$ manually on paper, contracting the products appropriately and taking the differences. However, evaluating that end result for specific parameterizations and basis representations becomes messy (I've done only the 3D Euclidian cartesian and cylindrical coordinate cases).

This seems to be a perfect opportunity for a symbolic computation engine, but I'm having trouble starting. The mathematica book hints that tensor expressions can be represented by lists, but an expression of the above form does not require any specific dimensionality, and can still be symbolically manipulated (on paper).

If I use a list, does that list not have to have specific dimension? For example, I'm guessing that I could use an explicit 3D representation for the upper index coordinates like so:

x = { x1, x2, x3 }
u = { u1, u2, u3 }

then define a metric tensor for the lower index coordinates. I don't know how I'd represent the basis vectors $e_\mu$ in Mathematica though, even if I restricted myself to 3D Euclidean spaces.

Is this sort of computation within the scope of Mathematica, and if so, how does one setup the variables?

  • $\begingroup$ A list of software for tensor calculations is collected here. This includes 3 Mathematica packages that can do differential forms MathSource/683, MathSource/482 and Ricci. It also includes xAct which is a good GR package has differential forms on its todo list. Do any of these packages meet your needs? $\endgroup$
    – Simon
    Jan 20, 2012 at 10:31
  • 1
    $\begingroup$ There are lots of answers below that only give suggestions for packages but don't actually answer the question, i.e., show that the package can do the work. As a meta question (similar to this meta question) are these answers appropriate or better off as comments? $\endgroup$
    – Simon
    Jan 20, 2012 at 10:40
  • $\begingroup$ @Simon comments, I'd say. $\endgroup$
    – acl
    Jan 20, 2012 at 10:57
  • $\begingroup$ One problem is that the question title is about indexed expressions and tensors, while the question comments care about differential forms. I read the latter as being more important, but maybe others thought the tensor part was the key part. So maybe I was being a little harsh, since the links did answer the title of the question. $\endgroup$
    – Simon
    Jan 20, 2012 at 10:58
  • 1
    $\begingroup$ @Simon: On that note, I think one could make a communitywiki thread with a list of packages sorted for all the possible areas of research for which Mathematica is used. $\endgroup$
    – Nikolaj-K
    Jan 20, 2012 at 11:33

2 Answers 2


On this wikipedia page you find a collection of Tensor software and Mathematica has the biggest section.

The package Ricci, which username acl pointed out in his answer is there, and I personally have used xAct. It looks like this


And yes, as you suggest in your question, for smaller computation in specific dimensions you can also work in components directly. For me, this usually looks something like this (only have a screenshot atm.).


Although the expression $de_\mu$ makes me think the package variant is best suited for you.

  • 1
    $\begingroup$ Your images appear to have disappeared. $\endgroup$ Nov 13, 2014 at 18:36
  • 1
    $\begingroup$ @PeeterJoot: Yeah, Imageshack went private this year. I don't have copies of the pictures I think. Maybe I make new ones.. $\endgroup$
    – Nikolaj-K
    Nov 14, 2014 at 8:20
  • 1
    $\begingroup$ Would you please fix the image files. :) $\endgroup$ Feb 18, 2016 at 17:03

Mathematica does not yet support tensor calculus and notation natively, but there are numerous 3rd party packages which address this issue very well. This is a list of the packages I am more familiar with:

xAct suite: free (GPL license), most powerful, created by relativists, actively supported.

Disclosure: I contributed to the suite by creating the WYSIWYG user interface.


MathTensor: used to cost around 1000$ in the 90's, very powerful, A bit outdated but still working.


Tensorial: 50$, powerful, very well supported by David Park.


Ricci: free, some limitations "Limitations: Ricci currently does not support computation of explicit values for tensor components in coordinates,..." http://www.math.washington.edu/~lee/Ricci/

  • $\begingroup$ (+1) You are answer is useful. :) Don't you have any updates on this concerning Mathematica or other softwares? :) $\endgroup$ Feb 10, 2016 at 14:57
  • 1
    $\begingroup$ @H.R. xAct is still the most complete package in my opinion. It is free. Go for it! $\endgroup$
    – magma
    Feb 15, 2016 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.