# Doubt about Python code for calculation of Energy Conditions in General Relativity

In General Relativity, one possible way to decide if a space-time [i.e. a Lorentzian Manifold $$(\mathcal{M}, \textbf{g})$$ where $$\textbf{g}$$ is an arbitrary metric tensor.] is a "resonable physical" $$$$ one, is then check the so called Energy Conditions $$$$, for exemple:

A physical Space-time is the one who satisfies both:

$$\begin{cases} G_{\mu \nu} =: R_{\mu \nu} - \frac{1}{2}Rg_{\mu \nu} = \frac{8\pi G}{c^{4}}T_{\mu \nu}\\ T_{\mu \nu}u^{\mu}u^{\nu}\geq 0 \end{cases}$$

Where $$T_{\mu \nu}u^{\mu}u^{\nu}\geq 0$$ for all timelike vectors $$u^{\alpha}$$ is called the Weak Energy Condition (WEC).

Now, if you have a metric and energy-momentum tensor you can calculate almost all the basic quantities in GR, including the WEC. Knowing that fact, consider then this Python Code for SageManifolds:

https://nbviewer.jupyter.org/github/sagemanifolds/SageManifolds/blob/master/Worksheets/v1.3/SM_Friedmann_equations.ipynb

How can I calculate the WEC based on this code? (I used this example because the author have used a perfect fluid energy-momentum tensor, also, he defined the 4-(time-like) vectors and 4-(time-like) dual vectors (covectors or one-forms)

$$* * *$$

$$$$ WALD.R., General Relativity. Chicago University Press. pages 211-219. Chicago, 1984

$$$$ LOBO.F.S.N., Fundamental Theories of Physics: Wormholes, Warp Drives and Energy Conditions. Springer. pages 193-196.vol 186. Switzerland. 2017.

• What is $u^\mu$? – nicoguaro Jun 12 '19 at 15:45
• It's a contravariant time-like 4-vector called four-velocity. – M.N.Raia Jun 12 '19 at 18:59
• Are you familiar with tensor calculus and general relativity? – M.N.Raia Jun 12 '19 at 19:00
• @M.N.Raia I think we are facing a common problem of "language/notation difference" between physicists and computational scientists. – Anton Menshov Jun 12 '19 at 19:25
• Then, what you need is to prove that $T$ is positive semidefinite? I would say that the easiest way is to write $T$ in a coordinate system as a matrix and finding all minors or eigenvalues. Another option would be to expand the product to get an explicit form for the bilinear form and find the minimum, that should be $0$. – nicoguaro Jun 14 '19 at 11:57

Given $$T_{\mu\nu}$$ you must compute its components in an orthonormal base , then find the eigenvalues ($$\lambda_0,\lambda_1,\lambda_2,\lambda_3$$) corresponding to the timelike and spacelike eigenvectors, then WEC is equivalent to : $$\lambda_0\geq0, \lambda_0+\lambda_i\geq0, (i=1..3)$$
In your case, using an obvious orthonormal basis, $$T_{\mu\nu}$$ becomes diagonal$$(\rho,p,p,p)$$ so the condition reads $$\rho\ge0,\rho+p\ge0$$ This is also exlained in Wald and wikipedia.