11
$\begingroup$

I would like to use an open source computer algebra system (CAS) for research in general relativity. Kindly suggest a good choice between Ipython and Sage. I am more interested in the theoretical aspect rather than numerical computations.

$\endgroup$
4
  • 6
    $\begingroup$ Are you aware of Cadabra? Also see its home page here and also this paper as a summary for tensor algebra in GR: Brewin, L.C., 2010, "A brief introduction to Cadabra: A tool for tensor computations in General Relativity", Computer Physics Communications [P], vol 181, Elsevier BV, Amsterdam Netherlands, pp. 489-498. It's written in C++ though, and I think its only interface is TeX. $\endgroup$ Commented Jan 18, 2015 at 11:05
  • 1
    $\begingroup$ There is also Maxima/wxMaxima, which comes with tensor packages (I use ctensor a lot), andrejv.github.io/wxmaxima $\endgroup$
    – m4r35n357
    Commented Jan 18, 2015 at 16:52
  • 2
    $\begingroup$ "Symbolic and Numerical Analysis in General Relativity with Open Source Computer Algebra Systems" arxiv.org/abs/1703.09738 $\endgroup$
    – Mafra
    Commented Mar 30, 2017 at 23:27
  • $\begingroup$ Related physics.stackexchange.com/q/104805/226902 $\endgroup$
    – Quillo
    Commented Oct 10, 2023 at 21:05

5 Answers 5

10
$\begingroup$

There are only two open source GR/tensor packages that I am aware of, Cadabra (coordinate-free) and Maxima/xwMaxima (coordinate based, ctensor, itensor and atensor packages)

$\endgroup$
1
  • 1
    $\begingroup$ Cadabra is no longer 'coordinate-free' only; you can also do component computations in explicit coordinates in the 2.x series. $\endgroup$ Commented Sep 22, 2018 at 10:03
3
$\begingroup$

I would not recommend either of the choices you mentioned. If you have Mathematica, and your needs in general relativity are fairly basic (computing connections, curvature, geodesics), then I recommend using the notebooks from Hartle's text freely available here.


If your needs are more advanced, or you need something more capable, I would suggest using xAct and all its packages which include features such as,

  • Generic tensor manipulation
  • High order gravitational perturbation theory
  • Tensor spherical harmonics
  • Spinor computations in G.R.
  • Exterior calculus

I have used the packages several times for computations, and not only is xAct capable of many feats, it is also quite fast$^\dagger$ and very well-documented. Every package comes with examples as well and notebooks to help you get started. The only downside: there's a bit of a learning curve. However, the authors created a Google group/forum for users to help each other.


$\dagger$ I can attest to this given that I had to use it for computations in $d=26$.

$\endgroup$
6
  • 1
    $\begingroup$ The OP asked specifically for Open Source packages. $\endgroup$
    – m4r35n357
    Commented Jan 18, 2015 at 16:53
  • $\begingroup$ @m4r35n357 Both packages have Mathematica source code available. If by open source, you are referring to the fact that Mathematica itself is not open source, then you're right, but so what? The primary reason to want open source is to customize ones tools, and the packages allow one to do that, so there's no issue. Of course, there's also a moral reason to want open source, but that shouldn't enter into one's decisions in selecting tools for research in theoretical physics. $\endgroup$
    – JamalS
    Commented Jan 18, 2015 at 20:04
  • 1
    $\begingroup$ The OP asked specifically for Open Source packages. There is no definition of open source that fits Mathematica add-ons. I can't use them, and most probably the OP can't either. Why else would he be asking for an open source package? $\endgroup$
    – m4r35n357
    Commented Jan 18, 2015 at 20:45
  • 1
    $\begingroup$ @m4r35n357 Do you realize SE answers aren't just for the OP, but for anyone that may be interested in the topic? $\endgroup$
    – JamalS
    Commented Jan 18, 2015 at 20:49
  • 2
    $\begingroup$ "Open source" is becoming synonymous with "free." The primary reason to prefer such is because most researchers and universities don't have enough money to give everyone all the proprietary software they might ask for. Note that all science is done in collaboration, and there's no better way to annoy collaborators than to tell them they have to spend their own money to use the code you've written. $\endgroup$
    – user10851
    Commented Jan 19, 2015 at 0:04
3
$\begingroup$

Recently this paper came out on arXiv: Symbolic tensor calculus on manifolds: a SageMath implementation.

It describes how differentiable manifolds, vector and tensor fields classes are implemented in SageMath (via the SageManifold project) and how you can use them.

$\endgroup$
1
$\begingroup$

I have been developing a toolkit; spacetimeengine as a research tool. It is extremely lightweight but fully focused on General Relativity.

$\endgroup$
1
$\begingroup$

We have been developing and maintaining a python library to do symbolic calculations for General Relativity, among other things. Check out the "symbolic" module of EinsteinPy and also give a look at the various examples.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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