Function Repository Resource:

StressEnergyTensor

Source Notebook

Represent a stress-energy tensor (field) over a Riemannian or pseudo-Riemannian manifold

Contributed by: Jonathan Gorard

ResourceFunction["StressEnergyTensor"][mat,MetricTensor[],i1,i2]

represents a stress-energy tensor associated to the given metric tensor, with matrix representation mat and indices i1 and i2 (with True repesenting a covariant index and False representing a contravariant one).

ResourceFunction["StressEnergyTensor"]["name",]

represents a named stress-energy tensor "name".

ResourceFunction["StressEnergyTensor"][{"name",},]

represents a named parameterized stress-energy tensor "name", with additional parameter(s) specified within a list.

ResourceFunction["StressEnergyTensor"][d,]

represents a generic d-dimensional (symmetric) stress-energy tensor.

ResourceFunction["StressEnergyTensor"][ResourceFunction["StressEnergyTensor"][],coords]

transforms a specified ResourceFunction["StressEnergyTensor"] into the new coordinate system coords.

ResourceFunction["StressEnergyTensor"][ResourceFunction["StressEnergyTensor"][],i1,i2]

transforms a specified ResourceFunction["StressEnergyTensor"] into one with new indices i1 and i2 (with True representing a covariant index and False representing a contravariant one), raising and lowering existing indices as necessary.

ResourceFunction["StressEnergyTensor"][ResourceFunction["StressEnergyTensor"][],coords,i1,i2]

transforms a specified ResourceFunction["StressEnergyTensor"] into one with new coordinate system coords and new indices i1 and i2 (with True representing a covariant index and False representing a contravariant one), raising and lowering existing indices as necessary.

Details and Options

Formally, the stress-energy tensor is a (symmetric) bilinear form defined on the tangent space at a specified point of a manifold, and the stress-energy tensor field associates a stress-energy tensor to every such point in that manifold. Informally, the stress-energy tensor is the spacetime generalization of the Cauchy stress tensor from continuum mechanics: it quantifies the density of energy, momentum and stress (i.e. the flux of energy/momentum) associated with all non-gravitational fields in spacetime.
Strictly speaking, ResourceFunction["StressEnergyTensor"] represents a stress-energy tensor field rather than a single stress-energy tensor (this terminological ambiguity is commonplace in physics, and ResourceFunction["StressEnergyTensor"] generally does not make any such distinction).
By default, ResourceFunction["StressEnergyTensor"][mat,MetricTensor[],i1,i2] represents a stress-energy tensor by a (symmetric) matrix representation mat in a coordinate basis specifed by the MetricTensor, such that the entries of this matrix transform either covariantly or contravariantly, or some mixture of the two, with respect to transformations of the coordinates. The indices i1 and i2 can either be set to True (covariant) or False (contravariant). By default, both indices are set to False (i.e. all components of the matrix transform contravariantly).
In general relativity, the significance of the contravariant/raised-index form of the stress-energy tensor is that it represents the flux of relativistic (spacetime) momentum through an arbitrary hypersurface of codimension-1. More specifically, the time-time component represents energy density, the time-space components represent momentum density and the space-space components represent the Cauchy/normal stress (which may be further decomposed as a sum of a trace part, representing bulk pressure/isotropic stress, and a trace-free part, representing shear stress).
In the most general case, the Einstein field equations assert that the Einstein curvature tensor is equal to the stress-energy tensor (up to a multiplicative constant), plus a possible cosmological constant term; in this way, the existence of a non-zero stress-energy tensor indicates the presence of matter fields/non-gravitational fields in spacetime (thus distinguishing the full Einstein field equations from the vacuum Einstein field equations). The vanishing of the covariant divergence of the Einstein curvature tensor, as guaranteed geometrically by the (contracted) Bianchi identities, hence guarantees the vanishing of the covariant divergence of the stress-energy tensor, which is equivalent to the statement that energy and momentum are conserved identically.
Additional energy conditions may be applied to a given stress-energy tensor (typically in the form of an inequality constraining certain projections of the stress-energy tensor onto some class of vector fields) so as to enforce the principle that the mass-energy densities of spatial regions should always be non-negative in a relativistically-invariant way. ResourceFunction["StressEnergyTensor"] has the ability to compute the standard energy conditions (null, weak, dominant and strong) for arbitrary energy/matter distributions within arbitrary spacetimes.
ResourceFunction["StressEnergyTensor"] does not assume any particular number of dimensions, nor any particular metric convention, for the underlying manifold (although some properties, such as "LorentzianConditions", implicitly assume a (-,+,+,+,) signature, and more generally ResourceFunction["StressEnergyTensor"] assumes that the first row and first column of the matrix representation in contravariant form represents the time-time component). ResourceFunction["StressEnergyTensor"] also does not require the metric to be strictly symmetric (i.e. spin and torsion connections are also supported), nor does it require its own matrix representation to be strictly symmetric (i.e. non-zero spin tensors are supported), although many computations implicitly assume the torsion-free Levi-Civita connection by default.
ResourceFunction["StressEnergyTensor"] implicitly keeps track of all known algebraic equivalences between tensor expressions, and can apply them for simplification purposes where necessary. Requesting any property with "Reduced" in its name has the effect of applying all known tensor equivalences and simplifying (note that this can have the effect of increasing computation time significantly).
By default, ResourceFunction["StressEnergyTensor"] evaluates all partial derivatives of the metric and stress-energy tensors automatically. In certain cases, however, these partial derivatives may be difficult or even impossible to compute, in which case the evaluation may not terminate in a reasonable time. Requesting any property with "Symbolic" in its name has the effect of leaving all partial derivatives unevaluated instead (note that this can have the effect of increasing expression length significantly).
In ResourceFunction["StressEnergyTensor"]["name",] or ResourceFunction["StressEnergyTensor"][{"name",},], the following named (in-built) stress-energy models are supported:
"Symmetric"a generic 4-dimensional symmetric stress-energy tensor (whose matrix representation is populated with constants of the form Tij=Tji)
{"Symmetric",d}a generic d-dimensional symmetric stress-energy tensor (whose matrix representation is populated with constants of the form Tij=Tji)
"SymmetricField"a generic 4-dimensional symmetric stress-energy tensor field (whose matrix representation is populated with functions of the chosen spacetime coordinates of the form Tij=Tji)
{"SymmetricField",d}a generic d-dimensional symmetric stress-energy tensor field (whose matrix representation is populated with functions of the chosen spacetime coordinates of the form Tij=Tji)
"Asymmetric"a generic 4-dimensional asymmetric stress-energy tensor (whose matrix representation is populated with constants of the form TijTji)
{"Asymmetric",d}a generic d-dimensional asymmetric stress-energy tensor (whose matrix representation is populated with constants of the form TijTji)
"AsymmetricField"a generic 4-dimensional asymmetric stress-energy tensor field (whose matrix representation is populated with functions of the chosen spacetime coordinates of the form TijTji)
{"AsymmetricField",d}a generic d-dimensional asymmetric stress-energy tensor field (whose matrix representation is populated with functions of the chosen spacetime coordinates of the form TijTji)
"PerfectFluid"the stress-energy tensor describing a static perfect fluid distribution in thermal equilibrium (i.e. an idealized fluid with no heat conduction, viscosity or shear stresses), with purely symbolic spacetime velocity "u", purely symbolic mass-energy density "" and purely symbolic hydrostatic pressure "P"
{"PerfectFluid",uμ}the stress-energy tensor describing a static perfect fluid distribution in thermal equilibrium (i.e. an idealized fluid with no heat conduction, viscosity or shear stresses), with numerical spacetime velocity uμ, purely symbolic mass-energy density "" and purely symbolic hydrostatic pressure "P"
{"PerfectFluid",uμ,ρ}the stress-energy tensor describing a static perfect fluid distribution in thermal equilibrium (i.e. an idealized fluid with no heat conduction, viscosity or shear stresses), with numerical spacetime velocity uμ, numerical mass-energy density ρ and purely symbolic hydrostatic pressure "P"
{"PerfectFluid",uμ,ρ,P}the stress-energy tensor describing a static perfect fluid distribution in thermal equilibrium (i.e. an idealized fluid with no heat conduction, viscosity or shear stresses), with numerical spacetime velocity uμ, numerical mass-energy density ρ and numerical hydrostatic pressure P
"PerfectFluidField"the stress-energy tensor field describing a dynamic perfect fluid distribution in thermal equilibrium (i.e. an idealized fluid with no heat conduction, viscosity or shear stresses), with purely symbolic spacetime velocity function "u", purely symbolic mass-energy density function "" and purely symbolic hydrostatic pressure function "P" (with all three being functions of the chosen spacetime coordinates)
{"PerfectFluidField",uμ}the stress-energy tensor field describing a dynamic perfect fluid distribution in thermal equilibrium (i.e. an idealized fluid with no heat conduction, viscosity or shear stresses), with numerical spacetime velocity function uμ, purely symbolic mass-energy density function "" and purely symbolic hydrostatic pressure function "P" (with all three being functions of the chosen spacetime coordinates)
{"PerfectFluidField",uμ,ρ}the stress-energy tensor field describing a dynamic perfect fluid distribution in thermal equilibrium (i.e. an idealized fluid with no heat conduction, viscosity or shear stresses), with numerical spacetime velocity function uμ, numerical mass-energy density function ρ and purely symbolic hydrostatic pressure function "P" (with all three being functions of the chosen spacetime coordinates)
{"PerfectFluidField",uμ,ρ,P}the stress-energy tensor field describing a dynamic perfect fluid distribution in thermal equilibrium (i.e. an idealized fluid with no heat conduction, viscosity or shear stresses), with numerical spacetime velocity function uμ, numerical mass-energy density function ρ and numerical hydrostatic pressure function P (with all three being functions of the chosen spacetime coordinates)
"Dust"the stress-energy tensor describing a static distribution of idealized dust particles (i.e. a perfect relativistic fluid with vanishing hydrostatic pressure), with purely symbolic spacetime velocity "u" and purely symbolic mass-energy density ""
{"Dust",uμ}the stress-energy tensor describing a static distribution of idealized dust particles (i.e. a perfect relativistic fluid with vanishing hydrostatic pressure), with numerical spacetime velocity uμ and purely symbolic mass-energy density ""
{"Dust",uμ,ρ}the stress-energy tensor describing a static distribution of idealized dust particles (i.e. a perfect relativistic fluid with vanishing hydrostatic pressure), with numerical spacetime velocity uμ and numerical mass-energy density ρ
"DustField"the stress-energy tensor field describing a dynamic distribution of idealized dust particles (i.e. a perfect relativistic fluid with vanishing hydrostatic pressure), with purely symbolic spacetime velocity function "u" and purely symbolic mass-energy density function ""
{"DustField",uμ}the stress-energy tensor field describing a dynamic distribution of idealized dust particles (i.e. a perfect relativistic fluid with vanishing hydrostatic pressure), with numerical spacetime velocity function uμ and purely symbolic mass-energy density function ""
{"DustField",uμ,ρ}the stress-energy tensor field describing a dynamic distribution of idealized dust particles (i.e. a perfect relativistic fluid with vanishing hydrostatic pressure), with numerical spacetime velocity function uμ and numerical mass-energy density function ρ
"Radiation"the stress-energy tensor describing a static distribution of idealized radiation (i.e. a perfect relativistic fluid whose mass-energy density is equal to the number of spatial dimensions multiplied by the radiation pressure), with purely symbolic spacetime velocity "u" and purely symbolic radiation pressure "P"
{"Radiation",uμ}the stress-energy tensor describing a static distribution of idealized radiation (i.e. a perfect relativistic fluid whose mass-energy density is equal to the number of spatial dimensions multiplied by the radiation pressure), with numerical spacetime velocity uμ and purely symbolic radiation pressure "P"
{"Radiation",uμ,P}the stress-energy tensor describing a static distribution of idealized radiation (i.e. a perfect relativistic fluid whose mass-energy density is equal to the number of spatial dimensions multiplied by the radiation pressure), with numerical spacetime velocity uμ and numerical radiation pressure P
"RadiationField"the stress-energy tensor field describing a dynamic distribution of idealized radiation (i.e. a perfect relativistic fluid whose mass-energy density is equal to the number of spatial dimensions multiplied by the radiation pressure), with purely symbolic spacetime velocity function "u" and purely symbolic radiation pressure function "P"
{"RadiationField",uμ}the stress-energy tensor field describing a dynamic distribution of idealized radiation (i.e. a perfect relativistic fluid whose mass-energy density is equal to the number of spatial dimensions multiplied by the radiation pressure), with numerical spacetime velocity function uμ and purely symbolic radiation pressure function "P"
{"RadiationField",uμ,P}the stress-energy tensor field describing a dynamic distribution of idealized radiation (i.e. a perfect relativistic fluid whose mass-energy density is equal to the number of spatial dimensions multiplied by the radiation pressure), with numerical spacetime velocity function uμ and numerical radiation pressure function P
"ElectromagneticField"the stress-energy tensor field describing a dynamic, source-free electromagnetic field, with purely symbolic spacetime electromagnetic potential "A" (combining both the symbolic electric scalar potential “" and the symbolic magnetic vector potential "Ai") and purely symbolic vacuum magnetic permeability constant "0"
{"ElectromagneticField",Aμ}the stress-energy tensor field describing a dynamic, source-free electromagnetic field, with numerical spacetime electromagnetic potential Aμ (combining both the numerical electric scalar potential Φ and the numerical magnetic vector potential Ai) and purely symbolic vacuum magnetic permeability constant "0"
{"ElectromagneticField",Aμ,μ0}the stress-energy tensor field describing a dynamic, source-free electromagnetic field, with numerical spacetime electromagnetic potential Aμ (combining both the numerical electric scalar potential Φ and the numerical magnetic vector potential Ai) and numerical vacuum magnetic permeability constant μ0
"MassiveScalarField"the stress-energy tensor field describing a dynamic, complex scalar field satisfying the massive Klein-Gordon equation, with purely symbolic mass "m" and purely symbolic scalar function ""
{"MassiveScalarField",m}the stress-energy tensor field describing a dynamic, complex scalar field satisfying the massive Klein-Gordon equation, with numerical mass m and purely symbolic scalar function ""
{"MassiveScalarField",m,ψ}the stress-energy tensor field describing a dynamic, complex scalar field satisfying the massive Klein-Gordon equation, with numerical mass m and numerical scalar function ψ
Calling ResourceFunction["StressEnergyTensor"][] returns a list of all named (in-built) stress-energy models.
If the function succeeds in constructing the specified stress-energy tensor, it will return a ResourceFunction["StressEnergyTensor"] expression.
Calling ResourceFunction["StressEnergyTensor"][][i,j] returns the entry in the i-th column and the j-th row of the matrix representation of the stress-energy tensor; similarly ResourceFunction["StressEnergyTensor"][][i,All] and ResourceFunction["StressEnergyTensor"][All,j] return the complete i-th row and the complete j-th column of the matrix representation, respectively.
Calling ResourceFunction["StressEnergyTensor"][ResourceFunction["StressEnergyTensor"][],coords] has the effect of transforming the stress-energy tensor (as well as its underlying metric tensor) to the new coordinate system coords. Calling ResourceFunction["StressEnergyTensor"][ResourceFunction["StressEnergyTensor"][],i1,i2] has the effect of raising and lowering appropriate indices of the stress-energy tensor to match i1 and i2 (with True representing lowered/covariant and False representing raised/contravariant). Calling ResourceFunction["StressEnergyTensor"][ResourceFunction["StressEnergyTensor"][],coords,i1,i2] has the effect of performing both transformations simultaneously.
By default, ResourceFunction["StressEnergyTensor"] keeps track of the positions of all indices and performs all raising and lowering operations automatically, as required for a given computation.
Based on the eigenvalues of the matrix representation of the underlying metric tensor in covariant form, the underlying manifold will be classified by ResourceFunction["StressEnergyTensor"] as either Riemannian (all eigenvalues positive or all eigenvalues negative), pseudo-Riemannian (some eigenvalues positive and some eigenvalues negative), Lorentzian (all eigenvalues positive except for one negative, or all eigenvalues negative except for one positive) or Indeterminate.
The property "RiemannianConditions" returns the conditions necessary to guarantee that the eigenvalues of the matrix representation of the underlying metric tensor are strictly positive; "PseudoRiemannianConditions" returns the conditions necessary to guarantee that the eigenvalues of the matrix representation of the underlying metric tensor are all non-zero; "LorentzianConditions" returns the conditions necessary to guarantee that the eigenvalue corresponding to the {1,0,0,} eigenvector of the underlying metric tensor (if it exists) is negative, with all other eigenvalues being positive. Note that this is strictly less general than the behavior of properties such as "RiemannianQ" (described in the point above), since it assumes certain features of the metric signature.
In ResourceFunction["StressEnergyTensor"], the following properties are supported:
"MatrixRepresentation"stress-energy tensor represented in explicit matrix form
"ReducedMatrixRepresentation"stress-energy tensor represented in explicit matrix form, modulo all tensor equivalences
"Trace"trace of the stress-energy tensor
"ReducedTrace"trace of the stress-energy tensor, modulo all tensor equivalences
"MetricTensor"underlying metric tensor associated to the stress-energy tensor
"Coordinates"list of coordinate symbols for the stress-energy tensor
"CoordinateOneForms"list of differential 1-form symbols for the coordinates of the stress-energy tensor
"Indices"list of booleans specifying whether each index of the stress-energy tensor is lowered/covariant (True) or raised/contravariant (False)
"CovariantQ"whether the stress-energy tensor is covariant (i.e. both indices are lowered/covariant)
"ContravariantQ"whether the stress-energy tensor is contravariant (i.e. both indices are raised/contravariant)
"MixedQ"whether the stress-energy tensor is mixed (i.e. one index is lowered/covariant and one index is raised/contravariant)
"Symbol"symbolic representation of the stress-energy tensor with approriately raised/lowered indices
"EnergyDensity"relativistic mass-energy density (i.e. the time-time component of the stress-energy tensor in contravariant/raised-index form)
"ReducedEnergyDensity"relativistic mass-energy density (i.e. the time-time component of the stress-energy tensor in contravariant/raised-index form), modulo all tensor equivalences
"MomentumDensity"relativistic spatial momentum density (i.e. the time-space/space-time components of the stress-energy tensor in contravariant/raised-index form)
"ReducedMomentumDensity"relativistic spatial momentum density (i.e. the time-space/space-time components of the stress-energy tensor in contravariant/raised-index form), modulo all tensor equivalences
"SpacetimeMomentumDensity"relativistic spacetime momentum density (i.e. the time-time component plus the time-space/space-time components of the stress energy tensor in contravariant/raised-index form)
"ReducedSpacetimeMomentumDensity"relativistic spacetime momentum density (i.e. the time-time component plus the time-space/space-time components of the stress-energy tensor in contravariant/raised-index form), modulo all tensor equivalences
"Pressure"relativistic pressure (i.e. the directional average of the trace part of the space-space components of the stress-energy tensor in contravariant/raised-index form)
"ReducedPressure"relativistic pressure (i.e. the directional average of the trace part of the space-space components of the stress-energy tensor in contravariant/raised-index form), modulo all tensor equivalences
"StressTensor"relativistic Cauchy stress tensor (i.e. the space-space components of the stress-energy tensor in contravariant/raised-index form)
"ReducedStressTensor"relativistic Cauchy stress tensor (i.e. the space-space components of the stress-energy tensor in contravariant/raised-index form), modulo all tensor equivalences
"ShearStressTensor"relativistic shear stress tensor (i.e. the trace-free part of the space-space components of the stress-energy tensor in contravariant/raised-index form)
"ReducedShearStressTensor"relativistic shear stress tensor (i.e. the trace-free part of the space-space components of the stress-energy tensor in contravariant/raised-index form), modulo all tensor equivalences
"CovariantDerivatives"association of covariant derivatives (i.e. derivatives along tangent vectors of the underlying manifold) of the stress-energy tensor
"ReducedCovariantDerivatives"association of covariant derviatives (i.e. derivatives along tangent vectors of the underlying manifold) of the stress-energy tensor, modulo all tensor equivalences
"SymbolicCovariantDerivatives"association of covariant derivatives (i.e. derivatives along tangent vectors of the underlying manifold) of the stress-energy tensor, with purely symbolic partial derivative operators
"ContinuityEquations"list of continuity equations asserting that the covariant divergence of the stress-energy tensor vanishes (i.e. energy and momentum are conserved)
"ReducedContinuityEquations"list of continuity equations asserting that the covariant divergence of the stress-energy tensor vanishes (i.e. energy and momentum are conserved), modulo all tensor equivalences
"SymbolicContinuityEquations"list of continuity equations asserting that the covariant divergence of the stress-energy tensor vanishes (i.e. energy and momentum are conserved), with purely symbolic partial derivative operators
"Dimensions"number of dimensions of the underlying manifold/spacetime associated to the stress-energy tensor
"SymmetricQ"whether the stress-energy tensor is symmetric (i.e. is represented by a symmetric matrix in contravariant form)
"DiagonalQ"whether the stress-energy tensor is diagonal (i.e. is represented by a diagonal matrix in contravariant form)
"Signature"list of +1s and -1s designating the signature of the underlying manifold described by the stress-energy tensor (+1 for each positive eigenvalue of the metric, -1 for each negative eigenvalue of the metric)
"RiemannianQ"whether the underlying manifold described by the stress-energy tensor is Riemannian (i.e. all eigenvalues of the metric have the same sign)
"PseudoRiemannianQ"whether the underlying manifold described by the stress-energy tensor is pseudo-Riemannian (i.e. all eigenvalues of the metric are non-zero, but not all have the same sign)
"LorentzianQ"whether the underlying manifold described by the stress-energy tensor is Lorentzian (i.e. all eigenvalues of the metric have the same sign, except for one eigenvalue which has the opposite sign)
"RiemannianConditions"list of conditions required to guarantee that the underlying manifold described by the stress-energy tensor is Riemannian (i.e. all eigenvalues of the metric are positive)
"PseudoRiemannianConditions"list of conditions required to guarantee that the underlying manifold described by the stress-energy tensor is pseudo-Riemannian (i.e. all eigenvalues of the metric are non-zero)
"LorentzianConditions"list of conditions required to guarantee that the underlying manifold described by the stress-energy tensor is Lorentzian (i.e. the "time" eigenvalue of the metric is negative and all other eigenvalues are positive)
"StressEnergySingularities"list of possible coordinate values that cause the stress-energy tensor (in contravariant/raised-index form) to become singular
"TraceSingularities"list of possible coordinate values that cause the trace of the stress-energy tensor to become singular
"Determinant"determinant of the stress-energy tensor (represented in contravariant matrix form)
"ReducedDeterminant"determinant of the stress-energy tensor (represented in contravariant matrix form), modulo all tensor equivalences
"Eigenvalues"eigenvalues of the stress-energy tensor (represented in contravariant matrix form)
"ReducedEigenvalues"eigenvalues of the stress-energy tensor (represented in contravariant matrix form), modulo all tensor equivalences
"Eigenvectors"eigenvectors of the stress-energy tensor (represented in contravariant matrix form)
"ReducedEigenvectors"eigenvectors of the stress-energy tensor (represented in contravariant matrix form), modulo all tensor equivalences
"CovariantStressEnergyTensor"covariant form of the stress-energy tensor (i.e. both indices are lowered/covariant)
"ContravariantStressEnergyTensor"contravariant form of the stress-energy tensor (i.e. both indices are raised/contravariant)
"NullEnergyCondition"null energy condition for the stress-energy tensor (i.e. the condition that all observers following a future-pointing, null vector field always observe a non-negative mass-energy density)
"ReducedNullEnergyCondition"null energy condition for the stress-energy tensor (i.e. the condition that all observers following a future-pointing, null vector field always observe a non-negative mass-energy density), modulo all tensor equivalences
"WeakEnergyCondition"weak energy condition for the stress-energy tensor (i.e. the condition that all observers following a timelike vector field always observe a non-negative mass-energy density)
"ReducedWeakEnergyCondition"weak energy condition for the stress-energy tensor (i.e. the condition that all observers following a timelike vector field always observe a non-negative mass-energy density), modulo all tensor equivalences
"DominantEnergyCondition"dominant energy condition for the stress-energy tensor (i.e. the condition that, in addition to the weak energy condition, all observers following a future-pointing, causal vector field always observe mass-energy to be flowing no faster than light)
"ReducedDominantEnergyCondition"dominant energy condition for the stress-energy tensor (i.e. the condition that, in addition to the weak energy condition, all observers following a future-pointing, causal vector field always observe mass-energy to be flowing no faster than light), modulo all tensor equivalences
"StrongEnergyCondition"strong energy condition for the stress-energy tensor (i.e. the condition that all observers following a timelike vector field always observe the tidal tensor/electrogravitic tensor to have a non-negative trace)
"ReducedStrongEnergyCondition"strong energy condition for the stress-energy tensor (i.e. the condition that all observers following a timelike vector field always observe the tidal tensor/electrogravitic tensor to have a non-negative trace), modulo all tensor equivalences
"Properties"list of properties

Examples

Basic Examples (3) 

Construct the stress-energy tensor for a perfect and static relativistic fluid (with symbolic 4-velocity "u", symbolic density "" and symbolic pressure "P") in the default 4-dimensional flat/Minkowski spacetime:

In[1]:=
stressEnergy = ResourceFunction["StressEnergyTensor"]["PerfectFluid"]
Out[1]=
In[2]:=
stressEnergy["MetricTensor"]
Out[2]=

Show the stress-energy tensor for a perfect relativistic fluid in 4-dimensional Minkowski space in explicit (contravariant) matrix form:

In[3]:=
stressEnergy["MatrixRepresentation"] // MatrixForm
Out[3]=

Show the covariant matrix form instead:

In[4]:=
stressEnergy["CovariantStressEnergyTensor"]
Out[4]=
In[5]:=
%["MatrixRepresentation"] // MatrixForm
Out[5]=

Show the mass-energy density of a perfect relativistic fluid in 4-dimensional Minkowski space:

In[6]:=
stressEnergy["EnergyDensity"]
Out[6]=

Show the pressure of a perfect relativistic fluid in 4-dimensional Minkowski space:

In[7]:=
stressEnergy["Pressure"]
Out[7]=

Show the pressure of a perfect relativistic fluid in 4-dimensional Minkowski space, with all algebraic equivalences imposed:

In[8]:=
stressEnergy["ReducedPressure"]
Out[8]=

Construct the stress-energy tensor for the same perfect and static relativistic fluid in the Schwarzschild geometry (e.g. for an uncharged, non-rotating black hole with symbolic mass "M") in standard spherical polar coordinates, and with both indices lowered/covariant:

In[9]:=
metric = ResourceFunction["MetricTensor"]["Schwarzschild"]
Out[9]=
In[10]:=
stressEnergy2 = ResourceFunction["StressEnergyTensor"]["PerfectFluid", metric, True, True]
Out[10]=

Show the explicit (covariant) matrix form:

In[11]:=
stressEnergy2["MatrixRepresentation"] // MatrixForm
Out[11]=

Show the explicit (covariant) matrix form, with all algebraic equivalences imposed:

In[12]:=
stressEnergy2["ReducedMatrixRepresentation"] // MatrixForm
Out[12]=

Show the mass-energy density and pressure of a perfect relativistic fluid in the Schwarzschild geometry, with all algebraic equivalences imposed:

In[13]:=
stressEnergy2["ReducedEnergyDensity"]
Out[13]=
In[14]:=
stressEnergy2["ReducedPressure"]
Out[14]=

Show the momentum density, Cauchy stress tensor and shear stress tensor of a perfect relativistic fluid in the Schwarzschild geometry, with all algebraic equivalences imposed:

In[15]:=
stressEnergy2["ReducedMomentumDensity"]
Out[15]=
In[16]:=
stressEnergy2["ReducedStressTensor"] // MatrixForm
Out[16]=
In[17]:=
stressEnergy2["ReducedShearStressTensor"] // MatrixForm
Out[17]=

Show the null energy condition for a perfect relativistic fluid in the Schwarzschild geometry:

In[18]:=
stressEnergy2["NullEnergyCondition"]
Out[18]=

Show the null energy condition with all algebraic equivalences imposed:

In[19]:=
stressEnergy2["ReducedNullEnergyCondition"]
Out[19]=

Show the weak energy condition for a perfect relativistic fluid in the Schwarzschild geometry:

In[20]:=
stressEnergy2["WeakEnergyCondition"]
Out[20]=

Construct the stress-energy tensor for a perfect and static relativistic fluid in the same Schwarzschild geometry as above, but with numerical 4-velocity {-1,0,0,0}, numerical density 1/2 and numerical pressure 1/3:

In[21]:=
stressEnergy3 = ResourceFunction[
  "StressEnergyTensor"][{"PerfectFluid", {-1, 0, 0, 0}, 1/2, 1/3}, ResourceFunction["MetricTensor"]["Schwarzschild"]]
Out[21]=
In[22]:=
stressEnergy3["MatrixRepresentation"] // MatrixForm
Out[22]=
In[23]:=
stressEnergy3["ReducedMatrixRepresentation"] // MatrixForm
Out[23]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic fluid (with symbolic 4-velocity function "u", symbolic density function "" and symbolic pressure function "P") in the same Schwarzschild geometry as above:

In[24]:=
stressEnergy4 = ResourceFunction["StressEnergyTensor"]["PerfectFluidField", ResourceFunction["MetricTensor"]["Schwarzschild"]]
Out[24]=
In[25]:=
stressEnergy4["ReducedMatrixRepresentation"] // MatrixForm
Out[25]=

Show the association of all covariant derivatives of the stress-energy tensor field for a perfect and dynamic relativistic fluid in the Schwarzschild geometry:

In[26]:=
stressEnergy4["CovariantDerivatives"]
Out[26]=

Show the association of all covariant derivatives, with all algebraic equivalences imposed:

In[27]:=
stressEnergy4["ReducedCovariantDerivatives"]
Out[27]=

Show the association of all covariant derivatives of the stress-energy tensor in covariant form instead, with all algebraic equivalences imposed:

In[28]:=
stressEnergy4[
  "CovariantStressEnergyTensor"]["ReducedCovariantDerivatives"]
Out[28]=

Show the list of all continuity equations for the stress-energy tensor for a perfect and dynamic relativistic fluid in the Schwarzschild geometry, asserting that energy and momentum are conserved (i.e. the covariant divergence of the stress-energy tensor vanishes), with all algebraic equivalences imposed:

In[29]:=
Short[stressEnergy4["ReducedContinuityEquations"], 10]
Out[29]=

Construct stress-energy tensors for a static relativistic dust (i.e. a static perfect fluid with vanishing pressure) and a static relativistic radiation distribution (i.e. a static perfect fluid whose density is equal to three times its pressure) in the default 4-dimensional flat/Minkowski spacetime:

In[30]:=
stressEnergy5 = ResourceFunction["StressEnergyTensor"]["Dust"]
Out[30]=
In[31]:=
stressEnergy5["MatrixRepresentation"] // MatrixForm
Out[31]=
In[32]:=
stressEnergy6 = ResourceFunction["StressEnergyTensor"]["Radiation"]
Out[32]=
In[33]:=
stressEnergy6["MatrixRepresentation"] // MatrixForm
Out[33]=

Construct the stress-energy tensor for a dynamic, source-free electromagnetic field (with purely symbolic spacetime electromagnetic potential "A" and purely symbolic vacuum magnetic permeability constant "0") in the default 4-dimensional flat/Minkowski spacetime:

In[34]:=
stressEnergy = ResourceFunction["StressEnergyTensor"]["ElectromagneticField"]
Out[34]=
In[35]:=
stressEnergy["ReducedMatrixRepresentation"] // MatrixForm
Out[35]=

Show the list of all continuity equations for the stress-energy tensor for a dynamic, source-free electromagnetic field in 4-dimensional Minkowski space (i.e. special relativistic Maxwell equations), with all algebraic equivalences imposed:

In[36]:=
Short[stressEnergy["ReducedContinuityEquations"], 10]
Out[36]=

Show that the stress-energy tensor for a dynamic, source-free electromagnetic field in 4-dimensional Minkowski space has a vanishing trace:

In[37]:=
stressEnergy["ReducedTrace"]
Out[37]=

Show the pressure and the stress tensor of a dynamic, source-free electromagnetic field in 4-dimensional Minkowski space (i.e. the magnetic pressure and the Maxwell stress tensor, respectively), with all algebraic equivalences imposed:

In[38]:=
stressEnergy["ReducedPressure"]
Out[38]=
In[39]:=
stressEnergy["ReducedStressTensor"] // MatrixForm
Out[39]=

Show the momentum density of a dynamic, source free-electromagnetic field in 4-dimensional Minkowski space (i.e. the Poynting vector), with all algebraic equivalences imposed:

In[40]:=
stressEnergy["ReducedMomentumDensity"]
Out[40]=

Construct the stress-energy tensor for the same dynamic, source-free electromagnetic field in the Reissner-Nordström geometry (e.g. for a charged, non-rotating black hole with symbolic mass "M" and symbolic electric charge "Q") in standard spherical polar coordinates:

In[41]:=
metric = ResourceFunction["MetricTensor"]["ReissnerNordstrom"]
Out[41]=
In[42]:=
stressEnergy2 = ResourceFunction["StressEnergyTensor"]["ElectromagneticField", metric]
Out[42]=
In[43]:=
stressEnergy2["MatrixRepresentation"]
Out[43]=

Show that the electromagnetic stress-energy tensor for the Reissner-Nordström geometry is still trace-free:

In[44]:=
stressEnergy2["ReducedTrace"]
Out[44]=

Show the list of continuity equations for the stress-energy tensor for a dynamic, source-free electromagnetic field in the Reissner-Nordström geometry (i.e. general relativistic Maxwell equations):

In[45]:=
stressEnergy2["ContinuityEquations"]
Out[45]=

Show the mass-energy density of a dynamic, source-free electromagnetic field in the Reissner-Nordström geometry:

In[46]:=
Short[stressEnergy2["EnergyDensity"], 10]
Out[46]=

Construct the stress-energy tensor for a dynamic, complex scalar field obeying the massive Klein-Gordon equation (with purely symbolic mass "m" and purely symbolic scalar function "") in the default 4-dimensional flat/Minkowski spacetime, and with both indices lowered/covariant:

In[47]:=
stressEnergy = ResourceFunction["StressEnergyTensor"]["MassiveScalarField", True, True]
Out[47]=
In[48]:=
stressEnergy["ReducedMatrixRepresentation"] // MatrixForm
Out[48]=

Extract the time-time component of the stress-energy tensor for a dynamic, complex scalar field obeying the massive Klein-Gordon equation in 4-dimensional Minkowski space:

In[49]:=
stressEnergy[1, 1]
Out[49]=

Extract the first row of the stress-energy tensor for a dynamic, complex scalar field obeying the massive Klein-Gordon equation in 4-dimensional Minkowski space:

In[50]:=
stressEnergy[1, All]
Out[50]=

Extract the first column of the stress-energy tensor for a dynamic, complex scalar field obeying the massive Klein-Gordon equation in 4-dimensional Minkowski space:

In[51]:=
stressEnergy[All, 1]
Out[51]=

Transform to use the new coordinate symbols T, x, y and z:

In[52]:=
stressEnergy2 = ResourceFunction["StressEnergyTensor"][stressEnergy, {T, x, y, z}]
Out[52]=
In[53]:=
stressEnergy2["ReducedMatrixRepresentation"] // MatrixForm
Out[53]=

Transform to use the new coordinate symbols T, x, y and z, and raise one index, simultaneously:

In[54]:=
stressEnergy3 = ResourceFunction["StressEnergyTensor"][stressEnergy, {T, x, y, z}, True, False]
Out[54]=
In[55]:=
stressEnergy3["ReducedMatrixRepresentation"] // MatrixForm
Out[55]=

Scope (5) 

Stress-energy tensors can be constructed directly from a matrix representation:

In[56]:=
stressEnergy = ResourceFunction["StressEnergyTensor"][
  DiagonalMatrix[{-p, Px, Py, Pz}]]
Out[56]=
In[57]:=
stressEnergy["NullEnergyCondition"]
Out[57]=

Additional arguments can be used to specify the underlying metric tensor (otherwise the flat spacetime/Minkowski metric will be chosen automatically):

In[58]:=
stressEnergy2 = ResourceFunction["StressEnergyTensor"][
  DiagonalMatrix[{-p, Px, Py, Pz}], ResourceFunction["MetricTensor"]["Schwarzschild"]]
Out[58]=
In[59]:=
stressEnergy2["NullEnergyCondition"]
Out[59]=

Or the indices (True for lowered/covariant and False for raised/contravariant - otherwise both indices will be set as lowered/covariant by default):

In[60]:=
stressEnergy3 = ResourceFunction["StressEnergyTensor"][
  DiagonalMatrix[{-p, Px, Py, Pz}], True, True]
Out[60]=
In[61]:=
stressEnergy3["Symbol"]
Out[61]=

Or both simultaneously:

In[62]:=
stressEnergy4 = ResourceFunction["StressEnergyTensor"][
  DiagonalMatrix[{-p, Px, Py, Pz}], ResourceFunction["MetricTensor"]["Schwarzschild"], True, False]
Out[62]=
In[63]:=
stressEnergy4["NullEnergyCondition"]
Out[63]=
In[64]:=
stressEnergy4["Symbol"]
Out[64]=

Common stress-energy tensors can also be constructed using an in-built name:

In[65]:=
stressEnergy = ResourceFunction["StressEnergyTensor"]["PerfectFluid"]
Out[65]=
In[66]:=
stressEnergy["MatrixRepresentation"] // MatrixForm
Out[66]=

When an in-built/named stress-energy tensor has one or more parameters, those parameters can be left unspecified (in which case they are filled with purely symbolic defaults, such as "" in the above), or can be specified explicitly in list form:

In[67]:=
stressEnergy2 = ResourceFunction[
  "StressEnergyTensor"][{"PerfectFluid", {-1, 1/2, 1/2, 1/3}, 1, 2}]
Out[67]=
In[68]:=
stressEnergy2["MatrixRepresentation"] // MatrixForm
Out[68]=

If only some parameters are explicitly specified, then the remainder are filled with symbolic defaults (e.g. if one specifies only a numerical 4-velocity for the perfect fluid stress-energy tensor, then StressEnergyTensor will use a purely symbolic density and a purely symbolic pressure, namely "" and "P", respectively):

In[69]:=
stressEnergy3 = ResourceFunction[
  "StressEnergyTensor"][{"PerfectFluid", {-1, 0, 0, 0}}]
Out[69]=
In[70]:=
stressEnergy3["MatrixRepresentation"] // MatrixForm
Out[70]=

Metric and index information can also be specified for in-built/named stress-energy tensors:

In[71]:=
stressEnergy4 = ResourceFunction[
  "StressEnergyTensor"][{"PerfectFluid", {-1, 0, 0, 0}}, ResourceFunction["MetricTensor"]["Schwarzschild"], True, True]
Out[71]=
In[72]:=
stressEnergy4["MatrixRepresentation"] // MatrixForm
Out[72]=
In[73]:=
stressEnergy4["NullEnergyCondition"]
Out[73]=

All named/in-built metric tensors can be generalized to arbitrary numbers of spacetime dimensions, as necessary:

In[74]:=
stressEnergy5 = ResourceFunction[
  "StressEnergyTensor"][{"PerfectFluid", {-1, ux, uy, uz, uw}}]
Out[74]=
In[75]:=
stressEnergy5["MatrixRepresentation"] // MatrixForm
Out[75]=

New coordinate symbols can be specified for any stress-energy tensor:

In[76]:=
stressEnergy = ResourceFunction["StressEnergyTensor"]["Dust", ResourceFunction["MetricTensor"]["Kerr"]]
Out[76]=
In[77]:=
stressEnergy["Coordinates"]
Out[77]=
In[78]:=
stressEnergy2 = ResourceFunction["StressEnergyTensor"][stressEnergy, {T, R, a1, a2}]
Out[78]=
In[79]:=
stressEnergy2["Coordinates"]
Out[79]=

Indices can also be raised and lowered on any stress-energy tensor:

In[80]:=
stressEnergy3 = ResourceFunction["StressEnergyTensor"][stressEnergy, True, True]
Out[80]=
In[81]:=
stressEnergy3["Symbol"]
Out[81]=

New coordinate symbols and new index positions can also be specified simultaneously:

In[82]:=
stressEnergy4 = ResourceFunction["StressEnergyTensor"][stressEnergy, {T, R, a1, a2}, True, True]
Out[82]=
In[83]:=
stressEnergy4["Symbol"]
Out[83]=
In[84]:=
stressEnergy4["Coordinates"]
Out[84]=

Show the list of all in-built/named stress-energy tensors:

In[85]:=
ResourceFunction["StressEnergyTensor"][]
Out[85]=

Construct a generic 4-dimensional symmetric stress-energy tensor (default):

In[86]:=
ResourceFunction["StressEnergyTensor"]["Symmetric"][
  "MatrixRepresentation"] // MatrixForm
Out[86]=

Construct a generic 5-dimensional symmetric stress-energy tensor:

In[87]:=
ResourceFunction["StressEnergyTensor"][{"Symmetric", 5}][
  "MatrixRepresentation"] // MatrixForm
Out[87]=

Calling StressEnergyTensor[d] is a shorthand version, equivalent to calling StressEnergyTensor[{"Symmetric",d}]:

In[88]:=
ResourceFunction["StressEnergyTensor"][5][
  "MatrixRepresentation"] // MatrixForm
Out[88]=

Construct a generic 4-dimensional symmetric stress-energy tensor field (default):

In[89]:=
ResourceFunction["StressEnergyTensor"]["SymmetricField"][
  "MatrixRepresentation"] // MatrixForm
Out[89]=

Construct a generic 5-dimensional symmetric stress-energy tensor field:

In[90]:=
ResourceFunction["StressEnergyTensor"][{"SymmetricField", 5}][
  "MatrixRepresentation"] // MatrixForm
Out[90]=

Construct a generic 4-dimensional asymmetric stress-energy tensor (default):

In[91]:=
ResourceFunction["StressEnergyTensor"]["Asymmetric"][
  "MatrixRepresentation"] // MatrixForm
Out[91]=

Construct a generic 5-dimensional asymmetric stress-energy tensor:

In[92]:=
ResourceFunction["StressEnergyTensor"][{"Asymmetric", 5}][
  "MatrixRepresentation"] // MatrixForm
Out[92]=

Construct a generic 4-dimensional asymmetric stress-energy tensor field (default):

In[93]:=
ResourceFunction["StressEnergyTensor"]["AsymmetricField"][
  "MatrixRepresentation"] // MatrixForm
Out[93]=

Construct a generic 5-dimensional asymmetric stress-energy tensor field:

In[94]:=
ResourceFunction["StressEnergyTensor"][{"AsymmetricField", 5}][
  "MatrixRepresentation"] // MatrixForm
Out[94]=

Construct the stress-energy tensor for a perfect and static relativistic fluid, i.e. an idealized fluid distribution with vanishing conductivity, viscosity and shear stress, with symbolic spacetime velocity "u", symbolic mass-energy density "" and symbolic hydrostatic pressure "P" (default):

In[95]:=
ResourceFunction["StressEnergyTensor"]["PerfectFluid"][
  "MatrixRepresentation"] // MatrixForm
Out[95]=

Construct the stress-energy tensor for a perfect and static relativistic fluid with numerical spacetime velocity {-1,1/2,1/2,1/3}, symbolic mass-energy density "" and symbolic hydrostatic pressure "P":

In[96]:=
ResourceFunction[
   "StressEnergyTensor"][{"PerfectFluid", {-1, 1/2, 1/2, 1/3}}][
  "MatrixRepresentation"] // MatrixForm
Out[96]=

Construct the stress-energy tensor for a perfect and static relativistic fluid with numerical spacetime velocity {-1,1/2,1/2,1/3}, numerical mass-energy density 1 and symbolic hydrostatic pressure "P":

In[97]:=
ResourceFunction[
   "StressEnergyTensor"][{"PerfectFluid", {-1, 1/2, 1/2, 1/3}, 1}][
  "MatrixRepresentation"] // MatrixForm
Out[97]=

Construct the stress-energy tensor for a perfect and static relativistic fluid with numerical spacetime velocity {-1,1/2,1/2,1/3}, numerical mass-energy density 1 and numerical hydrostatic pressure 2:

In[98]:=
ResourceFunction[
   "StressEnergyTensor"][{"PerfectFluid", {-1, 1/2, 1/2, 1/3}, 1, 2}][
  "MatrixRepresentation"] // MatrixForm
Out[98]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic fluid, i.e. an idealized fluid distribution with vanishing conductivity, viscosity and shear stress, with symbolic spacetime velocity function "u", symbolic mass-energy density function "" and symbolic hydrostatic pressure function "P" (default):

In[99]:=
ResourceFunction["StressEnergyTensor"][
  "PerfectFluidField"]["MatrixRepresentation"]
Out[99]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic fluid with numerical spacetime velocity function {(-#1)&,(#2/2)&,(#3/2)&,(#4/3)&}, symbolic mass-energy density function "" and symbolic hydrostatic pressure function "P":

In[100]:=
ResourceFunction[
   "StressEnergyTensor"][{"PerfectFluidField", {(-#1) &, (#2/
        2) &, (#3/2) &, (#4/3) &}}][
  "MatrixRepresentation"] // MatrixForm
Out[100]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic fluid with numerical spacetime velocity function {(-#1)&,(#2/2)&,(#3/2)&,(#4/3)&}, numerical mass-energy density function (#1^2)& and symbolic hydrostatic pressure function "P":

In[101]:=
ResourceFunction[
   "StressEnergyTensor"][{"PerfectFluidField", {(-#1) &, (#2/
        2) &, (#3/2) &, (#4/3) &}, (#1^2) &}][
  "MatrixRepresentation"] // MatrixForm
Out[101]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic fluid with numerical spacetime velocity function {(-#1)&,(#2/2)&,(#3/2)&,(#4/3)&}, numerical mass-energy density function (#1^2)& and numerical hydrostatic pressure function (#4^3)&:

In[102]:=
ResourceFunction[
   "StressEnergyTensor"][{"PerfectFluidField", {(-#1) &, (#2/
        2) &, (#3/2) &, (#4/3) &}, (#1^2) &, (#4^3) &}][
  "MatrixRepresentation"] // MatrixForm
Out[102]=

Construct the stress-energy tensor for a perfect and static relativistic dust, i.e. a perfect relativistic fluid with vanishing hydrostatic pressure, with symbolic spacetime velocity "u" and symbolic mass-energy density "":

In[103]:=
ResourceFunction["StressEnergyTensor"]["Dust"][
  "MatrixRepresentation"] // MatrixForm
Out[103]=

Construct the stress-energy tensor for a perfect and static relativistic dust with numerical spacetime velocity {-1,1/2,1/2,1/3} and symbolic mass-energy density "":

In[104]:=
ResourceFunction["StressEnergyTensor"][{"Dust", {-1, 1/2, 1/2, 1/3}}][
  "MatrixRepresentation"] // MatrixForm
Out[104]=

Construct the stress-energy tensor for a perfect and static relativistic dust with numerical spacetime velocity {-1,1/2,1/2,1/3} and numerical mass energy-density 1:

In[105]:=
ResourceFunction[
   "StressEnergyTensor"][{"Dust", {-1, 1/2, 1/2, 1/3}, 1}][
  "MatrixRepresentation"] // MatrixForm
Out[105]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic dust, i.e. a perfect relativistic fluid with vanishing hydrostatic pressure, with symbolic spacetime velocity function "u" and symbolic mass-energy density function "":

In[106]:=
ResourceFunction["StressEnergyTensor"]["DustField"][
  "MatrixRepresentation"] // MatrixForm
Out[106]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic dust with numerical spacetime velocity function {(-#1)&,(#2/2)&,(#3/2)&,(#4/3)&} and symbolic mass-energy density function "":

In[107]:=
ResourceFunction[
   "StressEnergyTensor"][{"DustField", {(-#1) &, (#2/2) &, (#3/
        2) &, (#4/3) &}}]["MatrixRepresentation"] // MatrixForm
Out[107]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic dust with numerical spacetime velocity function {(-#1)&,(#2/2)&,(#3/2)&,(#4/3)&} and numerical mass-energy density function (#1^2)&:

In[108]:=
ResourceFunction[
   "StressEnergyTensor"][{"DustField", {(-#1) &, (#2/2) &, (#3/
        2) &, (#4/3) &}, (#1^2) &}][
  "MatrixRepresentation"] // MatrixForm
Out[108]=

Construct the stress-energy tensor for a perfect and static relativistic radiation distribution, i.e. a perfect relativistic fluid whose mass-energy density is equal to the number of spatial dimensions multiplied by the radiation pressure, with symbolic spacetime velocity "u" and symbolic radiation pressure "P" (default):

In[109]:=
ResourceFunction["StressEnergyTensor"]["Radiation"][
  "MatrixRepresentation"] // MatrixForm
Out[109]=

Construct the stress-energy tensor for a perfect and static relativistic radiation distribution with numerical spacetime velocity {-1,1/2,1/2,1/3} and symbolic radiation pressure "P":

In[110]:=
ResourceFunction[
   "StressEnergyTensor"][{"Radiation", {-1, 1/2, 1/2, 1/3}}][
  "MatrixRepresentation"] // MatrixForm
Out[110]=

Construct the stress-energy tensor for a perfect and static relativistic radiation distribution with numerical spacetime velocity {-1,1/2,1/2,1/3} and numerical radiation pressure 2:

In[111]:=
ResourceFunction[
   "StressEnergyTensor"][{"Radiation", {-1, 1/2, 1/2, 1/3}, 2}][
  "MatrixRepresentation"] // MatrixForm
Out[111]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic radiation distribution, i.e. a perfect relativistic fluid whose mass-energy density is equal to the number of spatial dimensions multiplied by the radiation pressure, with symbolic spacetime velocity function "u" and symbolic radiation pressure function "P" (default):

In[112]:=
ResourceFunction["StressEnergyTensor"]["RadiationField"][
  "MatrixRepresentation"] // MatrixForm
Out[112]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic radiation distribution with numerical spacetime velocity function {(-#1)&,(#2/2)&,(#3/2)&,(#4/3)&} and symbolic radiation pressure function "P":

In[113]:=
ResourceFunction[
   "StressEnergyTensor"][{"RadiationField", {(-#1) &, (#2/2) &, (#3/
        2) &, (#4/3) &}}]["MatrixRepresentation"] // MatrixForm
Out[113]=

Construct the stress-energy tensor field for a perfect and dynamic relativistic radiation distribution with numerical spacetime velocity function {(-#1)&,(#2/2)&,(#3/2)&,(#4/3)&} and numerical radiation pressure function (#4^3)&:

In[114]:=
ResourceFunction[
   "StressEnergyTensor"][{"RadiationField", {(-#1) &, (#2/2) &, (#3/
        2) &, (#4/3) &}, (#4^3) &}][
  "MatrixRepresentation"] // MatrixForm
Out[114]=

Construct the stress-energy tensor field for a source-free and dynamic electromagnetic field with symbolic spacetime electromagnetic potential "A" (combining the symbolic electric scalar potential "" and the symbolic magnetic vector potential "Ai") and symbolic vacuum magnetic permeability constant "0" (default):

In[115]:=
ResourceFunction["StressEnergyTensor"]["ElectromagneticField"][
  "ReducedMatrixRepresentation"] // MatrixForm
Out[115]=

Construct the stress-energy tensor field for a source-free and dynamic electromagnetic field with numerical spacetime electromagnetic potential {(#4)&,(#3/2)&,(#2/2)&,(#1/3)&} (combining the numerical electric scalar potential (#4)& with the numerical magnetic vector potential {(#3/2)&,(#2/2)&,(#1/3)&}) and symbolic magnetic permeability constant "0":

In[116]:=
ResourceFunction[
   "StressEnergyTensor"][{"ElectromagneticField", {(#4) &, (#3/
        2) &, (#2/2) &, (#1/3) &}}][
  "MatrixRepresentation"] // MatrixForm
Out[116]=

Construct the stress-energy tensor field for a source-free and dynamic electromagnetic field with numerical spacetime electromagnetic potential {(#4)&,(#3/2)&,(#2/2)&,(#1/3)&} (combining the numerical electric scalar potential (#4)& with the numerical magnetic vector potential {(#3/2)&,(#2/2)&,(#1/3)&}) and numerical magnetic permeability constant 4*Pi:

In[117]:=
ResourceFunction[
   "StressEnergyTensor"][{"ElectromagneticField", {(#4) &, (#3/
        2) &, (#2/2) &, (#1/3) &}, 4*Pi}][
  "MatrixRepresentation"] // MatrixForm
Out[117]=

Construct the stress-energy tensor field for a massive, dynamic, complex scalar field, i.e. a complex scalar function obeying the massive Klein-Gordon equation, with symbolic mass "m" and symbolic scalar function "" (default):

In[118]:=
ResourceFunction["StressEnergyTensor"]["MassiveScalarField"][
  "MatrixRepresentation"] // MatrixForm
Out[118]=

Construct the stress-energy tensor field for a massive, dynamic, complex scalar field with numerical mass 1 and symbolic scalar function "":

In[119]:=
ResourceFunction["StressEnergyTensor"][{"MassiveScalarField", 1}][
  "MatrixRepresentation"] // MatrixForm
Out[119]=

Construct the stress-energy tensor field for a massive, dynamic, complex scalar field with numerical mass 1 and numerical scalar function {(-#1)&,(I*#2/2)&,(-I*#3/2)&,(#4/3)&}:

In[120]:=
ResourceFunction[
  "StressEnergyTensor"][{"MassiveScalarField", 1, {(-#1) &, (I*#2/2) &, (-I*#3/2) &, (#4/3) &}}]["ReducedTrace"]
Out[120]=

Construct the stress-energy tensor for a perfect and static relativistic fluid (with symbolic 4-velocity "u", symbolic density "" and symbolic pressure "P") in the Schwarzschild metric, with symbolic mass "M":

In[121]:=
stressEnergy = ResourceFunction["StressEnergyTensor"]["PerfectFluid", ResourceFunction["MetricTensor"]["Schwarzschild"]]
Out[121]=

Show the list of properties:

In[122]:=
stressEnergy["Properties"]
Out[122]=

Show the explicit matrix representation of the stress-energy tensor:

In[123]:=
stressEnergy["MatrixRepresentation"]
Out[123]=

Show the explicit matrix representation of the stress-energy tensor, with all algebraic equivalences imposed:

In[124]:=
stressEnergy["ReducedMatrixRepresentation"]
Out[124]=

Show the trace of the stress-energy tensor:

In[125]:=
stressEnergy["Trace"]
Out[125]=

Show the trace of the stress-energy tensor, with all algebraic equivalences imposed:

In[126]:=
stressEnergy["ReducedTrace"]
Out[126]=

Show the metric tensor for the underlying manifold associated to the stress-energy tensor:

In[127]:=
stressEnergy["MetricTensor"]
Out[127]=

Show the list of coordinate symbols for the stress-energy tensor:

In[128]:=
stressEnergy["Coordinates"]
Out[128]=

Show the list of differential 1-form symbols for the coordinates of the stress-energy tensor:

In[129]:=
stressEnergy["CoordinateOneForms"]
Out[129]=

Show the list of booleans specifying the positions of the indices of the stress-energy tensor (True for lowered/covariant and False for raised/contravariant):

In[130]:=
stressEnergy["Indices"]
Out[130]=

Determine whether the stress-energy tensor is covariant (i.e. both indices are lowered/covariant):

In[131]:=
stressEnergy["CovariantQ"]
Out[131]=

Determine whether the stress-energy tensor is contravariant (i.e. both indices are raised/contravariant):

In[132]:=
stressEnergy["ContravariantQ"]
Out[132]=

Determine whether the stress-energy tensor is mixed (i.e. one index is lowered/covariant and one index is raised/contravariant):

In[133]:=
stressEnergy["MixedQ"]
Out[133]=

Show a symbolic representation of the stress-energy tensor with appropriately raised/lowered indices:

In[134]:=
stressEnergy["Symbol"]
Out[134]=

Show the relativistic mass-energy density (i.e. the time-time component of the contravariant stress-energy tensor):

In[135]:=
stressEnergy["EnergyDensity"]
Out[135]=

Show the relativistic mass-energy density (i.e. the time-time component of the contravariant stress-energy tensor), with all algebraic equivalences imposed:

In[136]:=
stressEnergy["ReducedEnergyDensity"]
Out[136]=

Show the relativistic spatial momentum density (i.e. the time-space/space-time components of the contravariant stress-energy tensor):

In[137]:=
stressEnergy["MomentumDensity"]
Out[137]=

Show the relativistic spatial momentum density (i.e. the time-space/space-time components of the contravariant stress-energy tensor), with all algebraic equivalences imposed:

In[138]:=
stressEnergy["ReducedMomentumDensity"]
Out[138]=

Show the relativistic spacetime momentum density (i.e. the time-time component plus the time-space/space-time components of the contravariant stress-energy tensor):

In[139]:=
stressEnergy["SpacetimeMomentumDensity"]
Out[139]=

Show the relativistic spacetime momentum density (i.e. the time-time component plus the time-space/space-time components of the contravariant stress-energy tensor), with all algebraic equivalences imposed:

In[140]:=
stressEnergy["ReducedSpacetimeMomentumDensity"]
Out[140]=

Show the relativistic pressure (i.e. the directional average of the trace part of the space-space components of the contravariant stress-energy tensor):

In[141]:=
stressEnergy["Pressure"]
Out[141]=

Show the relativistic pressure (i.e. the directional average of the trace part of the space-space components of the contravariant stress-energy tensor), with all algebraic equivalences imposed:

In[142]:=
stressEnergy["ReducedPressure"]
Out[142]=

Show the relativistic Cauchy stress tensor (i.e. the space-space components of the contravariant stress-energy tensor):

In[143]:=
stressEnergy["StressTensor"]
Out[143]=

Show the relativistic Cauchy stress tensor (i.e. the space-space components of the contravariant stress-energy tensor), with all algebraic equivalences imposed:

In[144]:=
stressEnergy["ReducedStressTensor"]
Out[144]=

Show the relativistic shear stress tensor (i.e. the trace-free part of the space-space components of the contravariant stress-energy tensor):

In[145]:=
Short[stressEnergy["ShearStressTensor"], 10]
Out[145]=

Show the relativistic shear stress tensor (i.e. the trace-free part of the space-space components of the contravariant stress-energy tensor), with all algebraic equivalences imposed:

In[146]:=
stressEnergy["ReducedShearStressTensor"]
Out[146]=

Show the association of all covariant derivatives (i.e. all derivatives along tangent vectors of the underlying manifold) of the stress-energy tensor:

In[147]:=
Short[stressEnergy["CovariantDerivatives"], 10]
Out[147]=

Show the association of all covariant derivatives (i.e. all derivatives along tangent vectors of the underlying manifold) of the stress-energy tensor, with all algebraic equivalences imposed:

In[148]:=
Short[stressEnergy["ReducedCovariantDerivatives"], 10]
Out[148]=

Show the association of all covariant derivatives (i.e. all derivatives along tangent vectors of the underlying manifold) of the stress-energy tensor, with all partial derivative operators left purely symbolic:

In[149]:=
stressEnergy["SymbolicCovariantDerivatives"]
Out[149]=

Show the list of all continuity equations asserting that the covariant divergence of the stress-energy tensor must vanish (i.e. energy and momentum are conserved):

In[150]:=
Short[stressEnergy["ContinuityEquations"], 10]
Out[150]=

Show the list of all continuity equations asserting that the covariant divergence of the stress-energy tensor must vanish (i.e. energy and momentum are conserved), with all algebraic equivalences imposed:

In[151]:=
stressEnergy["ReducedContinuityEquations"]
Out[151]=

Show the list of all continuity equations asserting that the covariant divergence of the stress-energy tensor must vanish (i.e. energy and momentum are conserved), with all partial derivative operators left purely symbolic:

In[152]:=
Short[stressEnergy["SymbolicContinuityEquations"], 10]
Out[152]=

Show the number of dimensions of the underlying manifold associated to the stress-energy tensor:

In[153]:=
stressEnergy["Dimensions"]
Out[153]=

Determine whether the stress-energy tensor is symmetric (in explicit, contravariant matrix form):

In[154]:=
stressEnergy["SymmetricQ"]
Out[154]=

Determine whether the stress-energy tensor is diagonal (in explicit, contravariant matrix form):

In[155]:=
stressEnergy["DiagonalQ"]
Out[155]=

Show the signature of the underlying manifold associated to the stress-energy tensor (with +1s representing positive eigenvalues and -1s representing negative eigenvalues of the metric tensor):

In[156]:=
stressEnergy["Signature"]
Out[156]=

Determine whether the underlying manifold associated to the stress-energy tensor is Riemannian (i.e. all eigenvalues of the metric tensor have the same sign):

In[157]:=
stressEnergy["RiemannianQ"]
Out[157]=

Determine whether the underlying manifold associated to the stress-energy tensor is pseudo-Riemannian (i.e. all eigenvalues are non-zero, but not all have the same sign):

In[158]:=
stressEnergy["PseudoRiemannianQ"]
Out[158]=

Determine whether the underlying manifold associated to the stress-energy tensor is Lorentzian (i.e. all eigenvalues of the metric tensor have the same sign, except for one eigenvalue which has the opposite sign):

In[159]:=
stressEnergy["LorentzianQ"]
Out[159]=

Show the list of conditions on the coordinates required to guarantee that the underlying manifold associated to the stress-energy tensor is Riemannian (i.e. all eigenvalues of the metric tensor are positive):

In[160]:=
stressEnergy["RiemannianConditions"]
Out[160]=

Show the list of conditions on the coordinates required to guarantee that the underlying manifold associated to the stress-energy tensor is pseudo-Riemannian (i.e. all eigenvalues of the metric tensor are non-zero):

In[161]:=
stressEnergy["PseudoRiemannianConditions"]
Out[161]=

Show the list of conditions on the coordinates required to guarantee that the underlying manifold associated to the stress-energy tensor is Lorentzian (i.e. the "time" eigenvalue is negative, and all other eigenvalues are positive):

In[162]:=
stressEnergy["LorentzianConditions"]
Out[162]=

Show the list of coordinate values that cause the stress-energy tensor to become singular:

In[163]:=
stressEnergy["StressEnergySingularities"]
Out[163]=

Show the list of coordinate values that cause the trace of the stress-energy tensor to become singular:

In[164]:=
stressEnergy["TraceSingularities"]
Out[164]=

Construct the stress-energy tensor for a perfect and static relativistic fluid (with symbolic 4-velocity "u", symbolic density "" and symbolic pressure "P") in the default 4-dimensional flat/Minkowski spacetime:

In[165]:=
stressEnergy2 = ResourceFunction["StressEnergyTensor"]["PerfectFluid"]
Out[165]=

Show the determinant of the stress-energy tensor (when represented as a contravariant matrix):

In[166]:=
stressEnergy2["Determinant"]
Out[166]=

Show the determinant of the stress-energy tensor (when represented as a contravariant matrix), with all algebraic equivalences imposed:

In[167]:=
stressEnergy2["ReducedDeterminant"]
Out[167]=

Show the eigenvalues of the stress-energy tensor (when represented as a contravariant matrix):

In[168]:=
stressEnergy2["Eigenvalues"]
Out[168]=

Show the eigenvalues of the stress-energy tensor (when represented as a contravariant matrix), with all algebraic equivalences imposed:

In[169]:=
stressEnergy2["ReducedEigenvalues"]
Out[169]=

Show the eigenvectors of the stress-energy tensor (when represented as a contravariant matrix):

In[170]:=
Short[stressEnergy2["Eigenvectors"], 10]
Out[170]=

Show the eigenvectors of the stress-energy tensor (when represented as a contravariant matrix), with all algebraic equivalences imposed:

In[171]:=
stressEnergy2["ReducedEigenvectors"]
Out[171]=

Compute the covariant form of the stress-energy tensor (with both indices lowered/covariant):

In[172]:=
stressEnergy2["CovariantStressEnergyTensor"]
Out[172]=

Compute the contravariant form of the stress-energy tensor (with both indices raised/contravariant):

In[173]:=
stressEnergy2["ContravariantStressEnergyTensor"]
Out[173]=

Show the null energy condition (i.e. all observers following future-pointing, null vector fields always observe a non-negative mass-energy density) for the stress-energy tensor:

In[174]:=
stressEnergy2["NullEnergyCondition"]
Out[174]=

Show the null energy condition (i.e. all observers following future-pointing, null vector fields always observe a non-negative mass-energy density) for the stress-energy tensor, with all algebraic equivalences imposed:

In[175]:=
stressEnergy2["ReducedNullEnergyCondition"]
Out[175]=

Show the weak energy condition (i.e. all observers following timelike vector fields always observe a non-negative mass-energy density) for the stress-energy tensor:

In[176]:=
stressEnergy2["WeakEnergyCondition"]
Out[176]=

Show the weak energy condition (i.e. all observers following timelike vector fields always observe a non-negative mass-energy density) for the stress-energy tensor, with all algebraic equivalences imposed:

In[177]:=
stressEnergy2["ReducedWeakEnergyCondition"]
Out[177]=

Show the dominant energy condition (i.e. the weak energy condition, plus all observers following future-pointing, causal vector fields always observe mass-energy to be flowing no faster than light) for the stress-energy tensor:

In[178]:=
stressEnergy2["DominantEnergyCondition"]
Out[178]=

Show the dominant energy condition (i.e. the weak energy condition, plus all observers following future-pointing, causal vector fields always observe mass-energy to be flowing no faster than light) for the stress-energy tensor, with all algebraic equivalences imposed:

In[179]:=
stressEnergy2["ReducedDominantEnergyCondition"]
Out[179]=

Show the strong energy condition (i.e. all observers following timelike vector fields always observe the tidal tensor to have a non-negative trace) for the stress energy tensor:

In[180]:=
stressEnergy2["StrongEnergyCondition"]
Out[180]=

Show the strong energy condition (i.e. all observers following timelike vector fields always observe the tidal tensor to have a non-negative trace) for the stress-energy tensor, with all algebraic equivalences imposed:

In[181]:=
stressEnergy2["ReducedStrongEnergyCondition"]
Out[181]=

Publisher

Jonathan Gorard

Version History

  • 1.0.0 – 22 March 2023

Source Metadata

Related Resources

License Information