# General Relativity - (numerically) compute the metric from the stress-energy tensor?

I am new to GR and I am having trouble understanding how one goes back and forth between the metric $$g_{\mu\nu}$$ and the stress-energy tensor $$T_{\mu\nu}$$.

First, have a look at the following post. It provides an "easy" method for calculating $$T_{\mu\nu}$$ given a metric $$g_{\mu\nu}$$:

How does one reverse this formula? That is, given a stress-energy tensor $$T_{\mu\nu}$$ (or even more specifically, a distribution of mass-energy $$T_{00}$$), how do you compute $$g_{\mu\nu}$$? Of course it's technically possible to simply expand Einstein's equations by rewriting $$R_{\mu\nu}$$ in terms of $$\Gamma^{\lambda}_{\mu\nu}$$, which can then be expanded in terms of derivatives of $$g_{\mu\nu}$$, but the result would be a large, disgusting sum of gross PDEs. If it is possible to avoid that, I would love to know.

I understand that this is a bit unorthodox, since in most applications, it suffices to simply find $$\Gamma^{\lambda}_{\mu\nu}$$ from $$R_{\mu\nu}$$ in order to derive the equations of motion.

I want to know because, ultimately, I would like to create a Mathematica notebook in which the input would be an arbitrary geometry for the the mass-energy density and it would output the metric. It seems relatively straightforward but I cannot find anything online as a guide.

• Well, by solving EFE. – Qmechanic May 3 at 22:11
• "It seems relatively straightforward" Please don't take this the wrong way, but this statement is as wrong as it gets. Solving the Einstein equations is extremely complicated. If an analytic solution exists, you kinda have to find it by educated guessing. Numerically solving the equations in interesting scenarios has only been possible in the last fifteen years or so. You won't be able to just do it with a Mathematica notebook. – Javier May 3 at 23:17

You can't invert the relation to find $$g_{\mu\nu}$$ from $$T_{\mu\nu}$$. The metric uniquely determines the stress tensor, but not vice versa. For example, the Minkowski metric and the Schwarzschild metric are not equivalent, but both solve $$G_{\mu\nu}=8\pi T_{\mu\nu}=0$$.