Computational General Relativity

In summary, the author has written a Python program to compute the Einstein Tensor, but is not a programmer. The program takes in a particular form of the metric and outputs the Ricci Tensor. The author has copied in the Python code below, but is sure there is a better way to display it. Any ideas about how to make the program better, or how to make a better post on this forum are greatly appreciated, but the main goal of the author is to hear from people who know more about GR than him.
  • #1
dylanreynolds1
2
2
Hello all, first post.

I have come here to get second opinions on the program I have written to compute the Einstein Tensor (the Riemann Tensor and Ricci Tensor). I enjoy looking for solutions to the Einstein Field Equations, however computing them by hand is not realistic. I decided to write a program, but I am by no means a programmer.

The program takes in a particular form of the metric, and outputs the Ricci Tensor. Since I am mostly interested in vacuum solutions at the moment, this is all I need. I have copied in the Python code below, however I am sure there is a better way to display it.

Any ideas about how to make the program better, or how to make a better post on this forum are greatly appreciated, however my main goal is to hear form people who know more about GR than me.

basic1.png

This code has helped me derive the Schwarzschild solution, so it must be at least somewhat accurate. However there may be some small detail that I have missed.

Any help would be much appreciated.
 
Last edited:
  • Like
Likes Vick and bcrowell
Physics news on Phys.org
  • #2
dylanreynolds1 said:
Hello all, first post.

I have come here to get second opinions on the program I have written to compute the Einstein Tensor (the Riemann Tensor and Ricci Tensor). I enjoy looking for solutions to the Einstein Field Equations, however computing them by hand is not realistic. I decided to write a program, but I am by no means a programmer.

The program takes in a particular form of the metric, and outputs the Ricci Tensor. Since I am mostly interested in vacuum solutions at the moment, this is all I need. I have copied in the Python code below, however I am sure there is a better way to display it.

Any ideas about how to make the program better, or how to make a better post on this forum are greatly appreciated, however my main goal is to hear form people who know more about GR than me.

This code has helped me derive the Schwarzschild solution, so it must be at least somewhat accurate. However there may be some small detail that I have missed.

Any help would be much appreciated.
That is all very good but you'll soon run into trouble if you have complicated algebraic expressions that need simplification.

I use Maxima with the windows interface wxMaxima with great success. For free software it is extraordinary. If you can write Python like that you will be able to write scripts that find geodesics, Killing vectors, kinematic decomposition and so on. It also outputs expressions as Latex on demand.

It is available at sourceforge.
 
Last edited:
  • #3
Have you seen/used Maxima with its ctensor stuff?
 
  • #4
Cool little project! Although I also would have used maxima and ctensor for this, I'm sure you got some real educational benefit from writing it, which is great. If you want to test whether your software is working correctly, one way to do it would be to write down the Minkowski space metric and then transform into some random, unusual coordinates, then input the metric into your code in that form. It should give zero for the Riemann tensor.

BTW, I hadn't realized that windows versions of maxima were distributed through sourceforge. That's unfortunate, because sourceforge, which was formerly a respected resource in the open-source community, has now degenerated to the point where it has been bundling malware with the binaries it distributes. For linux, maxima is available from more reliable sources, e.g., apt-get for debian and ubuntu.
 
  • Like
Likes PeterDonis
  • #5
I use Mathematica, because indeed to evaluate the Ricci or Einstein tensor is cumbersome even for simple cases as the spherical symmetric spacetime, leading to the Schwarzschild solution. I was not aware of the free CA maxima. How powerful is that in comparison to Mathematica?
 
  • #6
vanhees71 said:
I use Mathematica, because indeed to evaluate the Ricci or Einstein tensor is cumbersome even for simple cases as the spherical symmetric spacetime, leading to the Schwarzschild solution. I was not aware of the free CA maxima. How powerful is that in comparison to Mathematica?
I respectfully request to all that future recommendations for Mathematica/Maple be accompanied by pricing information.
 
  • Like
Likes bcrowell

1. What is Computational General Relativity?

Computational General Relativity is a branch of physics that uses numerical methods and algorithms to study and simulate the effects of Einstein's theory of General Relativity. It involves using computers to solve complex equations and simulate the behavior of space, time, and gravity.

2. How does Computational General Relativity differ from traditional General Relativity?

Traditional General Relativity uses mathematical equations and analytical methods to describe the behavior of space and time in the presence of massive objects. Computational General Relativity, on the other hand, uses computers to solve these equations and simulate the behavior of space and time in more complex and realistic scenarios.

3. What are some real-world applications of Computational General Relativity?

Some real-world applications of Computational General Relativity include studying the behavior of black holes, simulating the evolution of the universe, and predicting the gravitational effects of massive objects such as planets and stars. It is also used in the development and testing of new technologies, such as gravitational wave detectors.

4. What are some challenges in Computational General Relativity?

One of the main challenges in Computational General Relativity is the complexity of the equations and the large amount of computational power required to solve them. Additionally, accurately simulating the effects of strong gravitational fields and interactions between multiple massive objects can be difficult and requires advanced numerical methods.

5. How does Computational General Relativity contribute to our understanding of the universe?

Computational General Relativity allows us to simulate and study scenarios that are not easily observable or testable in the real world. This helps us to better understand the behavior of space, time, and gravity in extreme conditions, such as near black holes or during the early stages of the universe. It also allows for the testing and refinement of Einstein's theory of General Relativity, which is a fundamental component of our understanding of the universe.

Similar threads

  • Special and General Relativity
Replies
20
Views
1K
  • Special and General Relativity
Replies
15
Views
1K
  • Special and General Relativity
Replies
4
Views
913
  • Special and General Relativity
Replies
6
Views
1K
  • Special and General Relativity
Replies
33
Views
3K
  • Special and General Relativity
6
Replies
186
Views
7K
  • Special and General Relativity
Replies
9
Views
942
Replies
14
Views
1K
  • Special and General Relativity
Replies
3
Views
1K
  • Special and General Relativity
2
Replies
57
Views
2K
Back
Top