# Ricci scalar for a diagonal metric tensor

I was wondering if there is a general formula for calculating Ricci scalar for any diagonal $n\times n$ metric tensor?

-
For a non compact manifold, use the Ricci flow equation: $$\partial_0 g_{ij}=-2 R_{ij}$$ For a compact manifold, use the normalized Ricci flow equation: $$\partial_0 g_{ij}=-2 R_{ij} +\frac{2}{n} R_\mathrm{avg} g_{ij}$$ Here, $n$ stands for $n$ dimensions of spacetime. –  Sanath Devalapurkar Jan 14 '14 at 2:45

The previous answer is correct, but does not give a practical algorithm for humans, because it is a nightmare to calculate the curvature tensor. You need a good hand algorithm, or else you need a symbolic manipulation package. I prefer hand calculations for the symmetric Ansatzes, because they are always revealing.

The traditional simplified method is to use curvature forms, and this method is described in Misner Thorne and Wheeler. It is indespensible for understanding Kerr Solutions. It also pays to study the Newman-Penrose formalism, because it gives physical insight. I prefer to use my own mathematically inelegant home-made method, because much of the simplification in the advanced methods is really only due to the use of what is called "sparse-matrix computation" in the computer science literature.

If you have a matrix which is mostly zeros, like the on-diagonal curvature, you shouldn't write it in matrix form, unless you want to build good strong writing-hand muscles. Introduce noncovariant basis tensors "l_{ij}" which are nonzero in i,j position. Then write the metric in a mostly-plus convention as:

$$g_{\mu\nu} = -A l_{00} + B l_{11} + C l_{22}$$ $$g^{\mu\nu} = -{1\over A}l^{00} + {1\over B} l^{11} + {1\over C}l^{22}$$

Where I have gone to three dimensions so as to prevent a hopelessly long answer, and where I hope the notation is clear. For theoretical elegance, the basis tensor $l_{00}$ should really be written as $l^{00}_{\mu\nu}$ if you want it to be consistent with the usual index conventions, but since the goal is to get the writing muscles as flabby as possible, don't do that. Since the l's are ridiculously coordinate dependent, you can express ridiculously non-tensorial objects like the connection coefficients and the pseudo-stress-energy tensor.

### Calculating the connection

There are tricks to calculating the connection, like deriving the geodesic equation, but I won't use them. If you use the basis-tensors, it is no work at all to get the connection coefficients, and with practice, you can do most of the work in your head for the simpler Ansatzes.

First, differentiate the metric. Since "diagonal" is not much of a simplification, I will assume "diagonal and dependent only on x1 and x0". I will use a prime for differentiating with respect to $x_1$, and a dot for differentiating with respect to $x_0$:

$$g_{\mu\nu,\alpha} = - \dot{A} l_{000} - A' l_{001} + \dot{B}l_{110} + B'l_{111} + \dot{C}l_{220} + C' l_{221}$$

The lesson is--- differentiation is trivial. Notice that this is symmetric on the first two indices, and nothing special on the third index. The Christoffel symbols are symmetric on the last two indices, and nothing special on the first. You transfer symmetry between index positions like this:

$$P_{i|jk} = Q_{ij|k} + Q_{ik|j} - Q_{jk|i}$$

Where P is symmetric in the last two position, and Q is symmetric in the first two. Get used to this, because it comes up a lot. The first term has the same index order just by using a good index order convention, the second term forcibly symmetrizes the second and third positions, and the last term is required so that P keeps all the information in Q. You can do this procedure on the l's automatically, just by replacing $l_{001}$ with $l_{001} + l_{010} - l_{100}$, and so on. This is what you do to get $\Gamma$ from the derivative of g.

Here is the formula for the all-lower-index $\Gamma$ (its not written this way ever, because $\Gamma$ is not a tensor, but I do it here, just to spare the writing hand).

$$\Gamma_{\mu|\nu\sigma} = -{1\over 2} ( -\dot{A} l_{000} - A'(l_{001} + l_{010} -l_{100})$$ $$+ \dot{B} (l_{110} + l_{101} - l_{011}) + B' l_{111}$$ $$+ \dot{C}(l_{220} + l_{202} - l_{022}) + C'(l_{221} + l_{212} - l_{122}) )$$

To raise the indices when the metric is diagonal is trivial, you just raise the index on the l and divide by the appropriate diagonal entry:

$$\Gamma^\mu_{\nu\sigma} = {\dot{A}\over 2A} l^0_{00} - {A'\over 2A} (l^0_{01} + l^0_{10}) - {A'\over 2B} l^1_{00} + {\dot{B}\over 2B}(l^1_{10} + l^1_{01}) - {\dot{B}\over 2A}l^0_{11} + {B'\over 2B} l_{111} +...$$

Where the rest should be obvious. With practice, this takes a minute to do by hand.

### Calculating the Ricci curvature.

To calculate the curvatures, it is important to trace as you go, because this halves the work. The Riemann curvature always has a bunch of Weyl junk that you mostly don't care about.

I always write the formula for the Riemann tensor this way:

$$R^\mu_{\nu\lambda\sigma} = \Gamma^\mu_{\nu\lambda,\sigma} \mathrm{(AS)} + \Gamma^\mu_{\nu s}\Gamma^s_{\lambda\sigma} \mathrm{(AS)}$$

The "AS" means subtract the same expression with $\nu$ and $\sigma$ interchanged. This form has the property that it is antisymmetric on the lower first and third index, so this is not the usual convention for the Riemann tensor, which is antisymmetric on the last two indices. But this is easy to fix at the end. Trust me, this is the best convention, you fix it up at the end.

The Ricci trace in this convention is on the first two indices:

$$R_{\mu\nu} = R^\alpha_{\alpha\mu\nu}$$

This is important, because each term you get in the Riemann tensor comes with an "l", and if the upper number of the l is not the same as the leftmost lower number, then that term doesn't contribute to the Ricci tensor. To get the Ricci tensor, you just ignore all $l^a_{bcd}$ with $a\ne b$ and write down $l_{cd}$ in place of those $l$'s which have $a=b$.

Now, differentiate the expression for $\Gamma$, tacking an index on the end. I will demonstrate with one of the contributions, from taking the $x_1$ derivative of the first term:

$$\Gamma^\mu_{\nu\lambda,\sigma} \mathrm{(AS)} = ..+ ({\dot{A}\over 2A})' (l^0_{001} - l^0_{100})$$

Where the second term is the antisymmetrizer. But now, look at the two l's --- does one of them have a matching index on the top left and bottom left? Yes! So erase the top and bottom left numbers from the l, and you are left with a contribution to the Ricci tensor:

$$({\dot{A}\over 2A})'l_{01}$$

This can all be done in your head, term by term. If you get an $l$ which is $l^0_{221}$ it can't contribute to Ricci, because the bottom first and third index don't match the top, if you get $l^0_{121}$ then it is killed by antisymmetrization, etc, etc, it's all obvious.

Next you need to multiply $\Gamma$ with itself, and trace. Here you work out all the terms. But it is a finite calculation, not a hopeless one. You don't get a contribution unless the leftmost lower index is the same as the upper index, so that leaves only a few terms, and further, you get zero on some l-terms after antisymmetrizing and tracing (in your head). Then there are only a handful of remaining terms, and these are real contributions to the curvature, so there is no way to avoid calculating them.

The first time takes a while, but with practice it only takes some minutes for simpler Ansatzes and some hours for the worst ones.

-
A comment on efficiency--- there are still some "miraculous cancellations" of terms in this method, so it does not take into account all the mathematical structure present. But these cancellations are in practice less than 50% of the surviving terms you get, so you are only doing double the best-possible work. So there is not much room for improvement in learning better methods. I find that keeping track of the signs is the trickiest part, and it sometimes pays to use an all-plus metric for this purpose, keeping in mind that A is supposed to be negative. –  Ron Maimon Aug 31 '11 at 21:45
thank you very much for your clear and very helpful answer! I've been practicing your method on a simple case. And I'm really pleased. However, I noticed that if I am to get the correct result for $\Gamma$, I need to divide by the entry that corresponds to the upper index of $\Gamma$. For example, in your equation for $\Gamma^\mu_{\nu\sigma}$, I put $$...\frac{A^\prime}{2A}l^0_{11} ... -\frac{\dot{B}}{2A} l^0_{11}...$$ and I get correct results. Am I doing it right? –  stupidity Sep 1 '11 at 14:25
That's raising the index--- I did it in the answer too (and made stupid mistakes, I see now, I fixed them--- thanks): it comes from the $g^{\mu\nu}$ in the front. Be careful when you move to nondiagonal metrics to multiply/trace by $g^{\mu\nu}$ instead. –  Ron Maimon Sep 1 '11 at 15:45

The Ricci scalar is just the trace of the Ricci tensor, which in turn is a tensor contraction of the Riemann curvature tensor, which can be expressed in Cristoffel symbols defined by the local metric.

$$R=R^i_i=g^{ij}R_{ij}$$

$$R_{ij}={R^k}_{ikj}$$

$${R^{\rho}}_{\sigma\mu\nu} = \partial_\mu\Gamma^{\rho}_{\nu\sigma}-\partial_\nu\Gamma^{\rho}_{\mu\sigma}+\Gamma^{\rho}_{\mu\lambda}\Gamma^{\lambda}_{\nu\sigma}-\Gamma^{\rho}_{\nu\lambda}\Gamma^{\lambda}_{\mu\sigma}$$

$$\Gamma^{i}_{kl} = \frac{1}{2}g^{im}(\partial_lg_{mk}+\partial_kg_{ml}-\partial_mg_{kl})$$

as you see once you have the metric you can calculate all those quantities.

-
Note that there is no guarantee of ANY simplification of the Ricci tensor or scalar even in the case of a diagonal metric. –  Jerry Schirmer Aug 30 '11 at 16:56
Well, there is a reduction in terms of the number of computations needed. If $g$ is diagonal, so is $g^{-1}$, so we only need to compute the diagonal entries of Ricci. Furthermore, the only non-zero terms of the Christoffel symbols are those with two of $i,k,l$ being the same: reducing number of terms from $O(N^3)$ ($N$ being the dimension of the manifold) to $O(N^2)$. –  Willie Wong Aug 30 '11 at 17:46
Sure. But you can't expect anything about the form of your final answer for either the ricci tensor or the ricci scalar. But the OP only asks for $R$ and you need not calculate $R_{ab}$ for $a\neq b$ in the diagonal case, not to mention the simplification in the $\Gamma$'s. –  Jerry Schirmer Sep 1 '11 at 15:54

Even so this question is old, but yes there is such formulas, you can check Landau book on Classical Fields (Vol 2, Paragraph 92), or check out this work (there formulas are not as nice as Landau's)

Ricci Tensor of Diagonal Metric

Update:

Because the book is Russian and old, I will summarize the result here (with slight modifications):

If we assume that the diagonal metric has the form: $$g_{\mu\mu}\equiv u_{\mu}e^{2l_{\mu}}\::\: u_{\mu}=\sign g_{\mu\mu}$$ then define: $$L_{\mu\nu\rho}\equiv l_{\rho,\nu}\left(l_{\nu}-l_{\rho}\right)_{,\mu}-l_{\rho,\mu\nu}$$ then Riemann Tensor has the form: $$R_{\rho\mu\rho\nu}=\begin{cases} {\displaystyle g_{\mu\mu}\left(L_{\mu\nu\rho}+l_{\mu,\nu}l_{\rho,\mu}\right)} & :\:\rho\neq\mu\neq\nu\\ {\displaystyle g_{\mu\mu}L_{\mu\mu\rho}+g_{\nu\nu}L_{\rho\rho\mu}-g_{\rho\rho}g_{\mu\mu}\sum_{\lambda\neq\rho,\mu}\frac{l_{\mu,\lambda}l_{\rho,\lambda}}{g_{\lambda\lambda}}} & :\:\rho\neq\mu=\nu \end{cases}$$ and Ricci Tensor: $$R_{\mu\nu}=\begin{cases} {\displaystyle \sum_{\rho\neq\mu,\nu}\left(L_{\mu\nu\rho}+l_{\mu,\nu}l_{\rho,\mu}\right)} & :\:\mu\neq\nu\\ {\displaystyle \sum_{\rho\neq\mu}\left[L_{\mu\mu\rho}+\frac{g_{\mu\mu}}{g_{\rho\rho}}\left(L_{\rho\rho\mu}-l_{\mu,\rho}\sum_{\lambda\neq\mu,\rho}l_{\lambda,\rho}\right)\right]} & :\mu=\nu \end{cases}$$

The rest of tensor components vanishes.

-
I couldnt find such formula in paragraph 92, can you give the page-number? Which edition do you use? –  user41404 Nov 1 '14 at 23:11
@user41404: Please see the update. –  TMS Nov 29 '14 at 12:35