When Physics is loaded, all the components of are set equal to 0
In order to set these components in any particular way use the Define command passing to it an equation with EnergyMomentum[mu, nu] on the left-hand side and the desired definition, as a symmetric tensorial expression or a symmetric matrix, on the right-hand side. For example, the general form of in terms of the energy density , the flux density and the stress tensor of a system can be entered as
You can now set these to be the components of
After this definition, you can query about the definition, the nonzero components, any particular covariant or contravariant component via
In the definition above, all the components of are constant. To set part or all of them as depending on the coordinates, for instance in a generic coordinate system and using spherical coordinates,
you can indicate the functionality in the definition. For example, set to be constant (i.e. no functionality) but the flux density and stress tensors depending on
Define now with these components
To see the continuity equations for the components of , use for instance the inert version of the covariant derivative operator D_ and the TensorArray command
In curved spaces, EnergyMomentum enters Einstein's equations as the source of the gravitational field
Take the first of these two equations and compute a tensor array for it
This is the expected result for the Schwarzschild metric: in vacuum, the components of the Einstein tensor, and with them those of are all equal to zero.
Consider now the Tolman metric also in spherical coordinates and the resulting equations for the flux and the stress tensors and
To use the right-hand sides as definitions for the stress and flux tensors, take for instance the space components of the definition of the EnergyMomentum tensor
Construct a defining equation for
The definition and contravariant components of
This definition of is now also part of the definition of the EnergyMomentum. Note however that in the definition (11) we used , so to avoid having redo that definition using just :
In the same way you can define the components of and remove the dependency in used in the definition above to have , , the Einstein and EnergyMomentum tensors all defined consistently with each other.