# Tensor software for General Relativity

1. May 26, 2013

### Herb1989

I have used GRTensorII and Cadabra for some time. And I think Cadabra have great potential for GR. But the current vision of Cadabra only deals with abstract tensor analysis, not with writing out of explicit components. So ,(eq :)when I try to check my final tensor expressions of solutions of black hole or any other kinds of spacetime problem ,I have to rewrite the expressions on GRTensorII.
Is there any other software or pactage that can do all the things? I'm not particularly familiar with Mathematica and Maxima, they can both achieve abstract tensor analysis and write out of explicit components?

2. May 26, 2013

### Mentz114

Maxima has a useful package called ctensor which handles tensor components. It has routines to calculate the GR tensors from a metric or frame field. I've used it a lot written many scripts to do covariant differentiation and other useful things.

3. May 26, 2013

### George Jones

Staff Emeritus
What version of Maple do you use. I just had the latest version (17) installed on my computers a couple days ago. I think this version has more facility for doing GR calculations without having to use GRTensorII.

4. May 26, 2013

### Herb1989

Maple 7 in winXP and Maple 13 in Ubuntu 13.04 ~ Actually, I have downloaded the Maple 17 x64 Linux ,but the licence doesn't work.

5. May 26, 2013

### Herb1989

I'm going to study Maxima (ctensor) , I feel it is very similar to GRTensor ,I do not know if it could do the abstract tensor analysis.

6. May 26, 2013

### Mentz114

There is a package called 'itensor' which can do some abstract computations.

7. May 26, 2013

### Herb1989

Thanks a lot !~ I decided to give it a try.

8. May 26, 2013

### Mentz114

The best way to use Maxima is with batch files. Here's one to start you off. Copy this into a text file and (if you're using Windows) give it a .mac extension. Use the 'Load Batch File' menu option to run it.
Code (Text):

/********************************
Einstein-DeSitter ( FRW with k=0)
Spherical polar
***************************/
kill(all);
ratflag:true;
ratricci:true;
ratriemann:true;
ct_coords:[t,r,theta,phi];

depends([a],[t])$lg:matrix([-1,0,0,0], [0,a^2,0,0], [0,0,a^2*r^2,0], [0,0,0,a^2*r^2*sin(theta)^2]); ug:ratsimp(invert(lg)); ricci(true); lriemann(false); uriemann(false); leinstein(false); einlow:zeromatrix(4,4)$
for _a thru 4 do  for _b thru 4 do ( einlow[_a,_b]:factor(ratsimp(lein[_a,_b])) );
einlow;

/** Ricci scalar **/
scurvature();
ratsimp(%);
/** K-invariant ***/
rinvariant();
ratsimp(%);
/** V = \partial_t ***/
V:zeromatrix(1,4)$V[1,1]:1$
V;
/* gravitoElectric- tensor : contract lriem with V */
lriemann(false);
T:zeromatrix(4,4)\$
for a thru 4 do ( for b thru 4 do ( for m thru 4 do ( for n thru 4 do
( T[a,b]:T[a,b] + lriem[a,m,b,n]*V[1,m]*V[1,n] ))));
T:ratsimp(T);

9. May 26, 2013

### George Jones

Staff Emeritus
It looks like you are going to use other packages, but here is what Maple documentation says,

http://www.maplesoft.com/products/maple/new_features/physics.aspx#Tensors

I haven't had a chance to investigate this.

10. May 27, 2013

### Herb1989

11. May 27, 2013

### George Jones

Staff Emeritus
My employer has a site license.

Sorry, Physics Forums cannot support illegal activities.

12. Jun 4, 2014

Hi everyone!
How can I make a Riemann tensor for a metric in a locally inertial frame?

What I mean is that, maple makes Riemann tensor by Riemann(ginv, D2, Cf1), and it uses the four sentences consisting Christoffel symbols and their derivatives in order to make the Riemann tensor.
However, I want to make a Riemann tensor in which just the derivatives of the Christoffel symbols are considered.

13. Jun 4, 2014

### pervect

Staff Emeritus
I think what you probably want is to use an anholonomic basis. I use GRTensor, but try looking at FrameData with DGSetup and look for remarks about anholonomic basis in the documentation.

14. Jun 4, 2014

### bcrowell

Staff Emeritus
15. Jun 6, 2014

Dear friends,
Now that I am using GRTensor, I get t a very strange error- at least for me!!!
I used to read an .mpl file, consisting some functions, definitions, ... but now maple cannot read my file.
I mean when I say: read "/home/.../ myfile.mpl", I get to the error:
Error, unable to read /home/.../ myfile.mpl.

16. Jun 10, 2014

Hi again!
any suggestions for my last problem?
since I installed the grii package, "read " command does not work any more :(

17. Jun 10, 2014

Sorry friends!
I found the problem!!!!
I have changed one of the directory's name!! :rofl:

18. Aug 7, 2015

### ohannuks

Hey, I'm sorry to revive a dead topic, but does anyone have experience with SageManifolds (http://sagemanifolds.obspm.fr/)? I would especially appreciate a comparison of SageManifolds to Mathematica. I am considering whether I should use free software or simply buy Mathematica.

The reason I would like Sage is because it seems fairly easy to use.

Ps. As a side note, does anyone have any opinion on the usage of Sage itself?