Function Repository Resource:

RiemannTensor

Source Notebook

Represent the Riemann curvature tensor (field) for a Riemannian or pseudo-Riemannian manifold

Contributed by: Jonathan Gorard

ResourceFunction["RiemannTensor"][MetricTensor[],i1,i2,i3,i4]

represents the Riemann curvature tensor associated to the given MetricTensor, with indices i1,i2,i3 and i4 (with True representing a covariant index and False representing a contravariant one).

ResourceFunction["RiemannTensor"][ResourceFunction["RiemannTensor"][],coords]

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

ResourceFunction["RiemannTensor"][ResourceFunction["RiemannTensor"][],i1,i2,i3,i4]

transforms a specified RiemannTensor into one with new indices i1,i2,i3 and i4 (with True representing a covariant index and False representing a contravariant one), raising and lowering existing indices as necessary.

ResourceFunction["RiemannTensor"][ResourceFunction["RiemannTensor"][],coords,i1,i2,i3,i4]

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

Details

Formally, the Riemann curvature tensor is a (highly symmetrical) rank-4 tensor defined on the tangent space at a specified point of a manifold, and the Riemann curvature tensor field associates a Riemann curvature tensor to every such point in that manifold. Informally, the Riemann curvature tensor quantifies both the volume deformation and the tidal deformation (i.e. deformation of shape/angle) experienced by a small geodesic cone as it moves along a geodesic in the manifold.
Strictly speaking, ResourceFunction["RiemannTensor"] represents a Riemann curvature tensor field rather than a single Riemann curvature tensor (this terminological ambiguity is commonplace in both geometry and physics, and ResourceFunction["RiemannTensor"] generally does not make any such distinction).
By default, ResourceFunction["RiemannTensor"][MetricTensor[],i1,i2,i3,i4] represents a Riemann curvature tensor by a highly symmetrical array representation of linear combinations of second (covariant) derivatives of the metric tensor in a given coordinate basis, such that the entries of this array transform either covariantly or contravariantly, or some mixture of the two, with respect to transformations of the coordinates. The indices i1, i2, i3 and i4 can either be set to True (covariant) or False (contravariant). By default, the first index is set to False (i.e. contravariant) and the remaining three are set to True (i.e. covariant).
In differential geometry, the mathematical significance of the Riemann curvature tensor is that it quantifies the degree to which geometrical information (i.e. information regarding the directions of certain tangent vectors) fails to be preserved when tangent vectors are parallel transported around a closed curve in the manifold. Algebraically, the Riemann curvature tensor thus quantifies the extent to which the covariant derivative operator (i.e. the derivative operator along tangent vectors in the manifold) fails to commute, or, equivalently, the degree to which the connection fails to be exact. It constitutes the canonical (and, in some sense, most general) way of expressing the curvature of a (pseudo-)Riemannian manifold.
In general relativity, the physical significance of the Riemann curvature tensor is that it quantifies the overall gravitational force exerted on a small rigid body (including both the compressive/expansive forces distorting the object's volume and the tidal forces distorting the object's shape/angles) as it moves along a spacetime geodesic. It constitutes the canonical and, in some sense, most general way of expressing the total curvature of spacetime. By contracting the Riemann curvature tensor along the first and third indices, one obtains the Ricci curvature tensor, as it appears in the Einstein field equations.
ResourceFunction["RiemannTensor"] 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). ResourceFunction["RiemannTensor"] also does not require the metric to be strictly symmetric (i.e. spin and torsion connections are also supported), although the computation of the Riemann curvature tensor implicitly assumes the torsion-free Levi-Civita connection by default.
ResourceFunction["RiemannTensor"] 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["RiemannTensor"] evaluates all partial derivatives of the metric tensor 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 derivative operators unevaluated instead (note that this can have the effect of increasing expression length significantly).
If the function succeeds in constructing the specified Riemann curvature tensor, it will return a ResourceFunction["RiemannTensor"] expression.
Calling ResourceFunction["RiemannTensor"][][i,j,k,l] returns the entry at the i-th depth, the j-th layer, the k-th column and the l-th row of the array representation of the Riemann curvature tensor.
ResourceFunction["RiemannTensor"][ResourceFunction["RiemannTensor"][],coords] has the effect of transforming the metric tensor (and hence the Riemann curvature tensor) to the new coordinate system coords. ResourceFunction["RiemannTensor"][ResourceFunction["RiemannTensor"][],i1,i2,i3,i4] has the effect of raising and lowering appropriate indices of the Riemann curvature tensor to match i1, i2, i3 and i4 (with True representing lowered/covariant and False representing raised/contravariant). ResourceFunction["RiemannTensor"][ResourceFunction["RiemannTensor"][],coords,i1,i2,i3,i4] has the effect of performing both transformations simultaneously.
By default, ResourceFunction["RiemannTensor"] 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["RiemannTensor"] 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["RiemannTensor"], the following properties are supported:
"TensorRepresentation"Riemann curvature tensor represented in explicit array form
"ReducedTensorRepresentation"Riemann curvature tensor represented in explicit array form, modulo all tensor equivalences
"SymbolicTensorRepresentation"Riemann curvature tensor represented in explicit array form, with purely symbolic partial derivative operators
"KretschmannScalar"Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor)
"ReducedKretschmannScalar"Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor), modulo all tensor equivalences
"SymbolicKretschmannScalar"Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor), with purely symbolic partial derivative operators
"ChernPontryaginScalar"Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number)
"ReducedChernPontryaginScalar"Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number), modulo all tensor equivalences
"SymbolicChernPontryaginScalar"Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number), with purely symbolic partial derivative operators
"EulerScalar"Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic)
"ReducedEulerScalar"Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic), modulo all tensor equivalences
"SymbolicEulerScalar"Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic), with purely symbolic partial derivative operators
"MetricTensor"underlying metric tensor associated to the Riemann curvature tensor
"Coordinates"list of coordinate symbols associated to the Riemann curvature tensor
"CoordinateOneForms"list of differential 1-form symbols for the coordinates of the Riemann curvature tensor
"Indices"list of booleans specifying whether each index of the Riemann curvature tensor is lowered/covariant (True) or raised/contravariant (False)
"CovariantQ"whether the Riemann curvature tensor is covariant (i.e. all indices are lowered/covariant)
"ContravariantQ"whether the Riemann curvature tensor is contravariant (i.e. all indices are raised/contravariant)
"MixedQ"whether the Riemann curvature tensor is mixed (i.e. some indices are lowered/covariant and some indices are raised/contravariant)
"Symbol"symbolic representation of the Riemann curvature tensor with appropriately raised/lowered indices
"RiemannFlatQ"whether the underlying manifold is Riemann-flat (i.e. all components of the Riemann curvature tensor vanish)
"VanishingKretschmannScalarQ"whether the Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor) vanishes
"VanishingChernPontryaginScalarQ"whether the Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number) vanishes
"VanishingEulerScalarQ"whether the Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic) vanishes
"RiemannFlatConditions"list of conditions required to guarantee that the underlying manifold is Riemann-flat (i.e. all components of the Riemann curvature tensor vanish)
"VanishingKretschmannScalarCondition"condition required to guarantee that the underlying manifold has a vanishing Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor)
"VanishingChernPontryaginScalarCondition"condition required to guarantee that the underlying manifold has a vanishing Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number)
"VanishingEulerScalarCondition"condition required to guarantee that the underlying manifold has a vanishing Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic)
"IndexContractions"association of possible index contractions of the Riemann curvature tensor
"ReducedIndexContractions"association of possible index contractions of the Riemann curvature tensor, modulo all tensor equivalences
"SymbolicIndexContractions"association of possible index contractions of the Riemann curvature tensor, with purely symbolic partial derivative operators
"CovariantDerivatives"association of covariant derivatives (i.e. derivatives along tangent vectors of the underlying manifold) of the Riemann curvature tensor
"ReducedCovariantDerivatives"association of covariant derivatives (i.e. derivatives along tangent vectors of the underlying manifold) of the Riemann curvature tensor, modulo all tensor equivalences
"SymbolicCovariantDerivatives"association of covariant derivatives (i.e. derivatives along tangent vectors of the underlying manifold) of the Riemann curvature tensor, with purely symbolic partial derivative operators
"BianchiIdentities"list of Bianchi identities asserting the symmetries of the covariant derivative of the Riemann curvature tensor
"SymbolicBianchiIdentities"list of Bianchi identities asserting the symmetries of the covariant derivative of the Riemann curvature tensor, with purely symbolic partial derivative operators
"Dimensions"number of dimensions of the underlying manifold/spacetime described by the Riemann curvature tensor
"Signature"list of +1s and -1s designating the signature of the underlying manifold described by the Riemann curvature 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 Riemann curvature tensor is Riemannian (i.e. all eigenvalues of the metric have the same sign)
"PseudoRiemannianQ"whether the underlying manifold described by the Riemann curvature 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 Riemann curvature 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 Riemann curvature 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 Riemann curvature 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 Riemann curvature tensor is Lorentzian (i.e. the "time" eigenvalue of the metric is negative and all other eigenvalues are positive)
"CurvatureSingularities"list of possible coordinate values that cause the Riemann curvature tensor to become singular
"KretschmannSingularities"list of possible coordinate values that cause the Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor) to become singular
"ChernPontryaginSingularities"list of possible coordinate values that cause the Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number) to become singular
"EulerSingularities"list of possible coordinate values that cause the Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic) to become singular
"CovariantRiemannTensor"covariant form of the Riemann curvature tensor (i.e. both indices are lowered/covariant)
"ContravariantRiemannTensor"contravariant form of the Riemann curvature tensor (i.e. both indices are raised/contravariant)
"Properties"list of properties

Examples

Basic Examples (3) 

Construct the Riemann curvature tensor for the Schwarzschild metric (e.g. for an uncharged, non-rotating black hole with symbolic mass "M") in standard spherical polar coordinates:

In[1]:=
metric = ResourceFunction["MetricTensor"]["Schwarzschild"]
Out[1]=
In[2]:=
riemann = ResourceFunction["RiemannTensor"][metric]
Out[2]=

Show the Riemann curvature tensor for the Schwarzschild metric in explicit (mixed) array form:

In[3]:=
riemann["TensorRepresentation"] // MatrixForm
Out[3]=

Show the Riemann curvature tensor for the Schwarzschild metric in explicit (mixed) array form, with all algebraic equivalences imposed:

In[4]:=
riemann["ReducedTensorRepresentation"] // MatrixForm
Out[4]=

Deduce that the Schwarzschild metric is not Riemann-flat:

In[5]:=
riemann["RiemannFlatQ"]
Out[5]=

Show the list of Schwarzschild coordinate symbols:

In[6]:=
riemann["Coordinates"]
Out[6]=

Show the list of differential 1-form symbols for each of the Schwarzschild coordinates:

In[7]:=
riemann["CoordinateOneForms"]
Out[7]=

Show the list of coordinate conditions that must hold for the Schwarzschild metric to be Lorentzian:

In[8]:=
riemann["LorentzianConditions"]
Out[8]=

Construct the Riemann curvature tensor for the Friedmann-Lemaître-Robertson-Walker (FLRW) metric (for a homogeneous, isotropic and uniformly-expanding/contracting universe, with symbolic curvature parameter "k" and symbolic scale factor "a") in standard spherical polar coordinates:

In[9]:=
metric = ResourceFunction["MetricTensor"]["FLRW"]
Out[9]=
In[10]:=
riemann = ResourceFunction["RiemannTensor"][metric, False, True, True, True]
Out[10]=
In[11]:=
riemann["TensorRepresentation"] // MatrixForm
Out[11]=

Show the explicit array form, with all algebraic equivalences imposed:

In[12]:=
riemann["ReducedTensorRepresentation"] // MatrixForm
Out[12]=

Deduce that the FLRW metric is not Riemann-flat:

In[13]:=
riemann["RiemannFlatQ"]
Out[13]=

Show the list of conditions that must hold for the FLRW metric to be Riemann-flat:

In[14]:=
riemann["RiemannFlatConditions"]
Out[14]=

Show the first principal invariant (i.e. the Kretschmann quadratic scalar invariant) of the Riemann curvature tensor for the FLRW metric:

In[15]:=
riemann["KretschmannScalar"]
Out[15]=

Show the first principal invariant (i.e. the Kretschmann quadratic scalar invariant) of the Riemann curvature tensor for the FLRW metric, with all algebraic equivalences imposed:

In[16]:=
riemann["ReducedKretschmannScalar"]
Out[16]=

Deduce that the Kreschmann scalar for the FLRW metric is non-vanishing:

In[17]:=
riemann["VanishingKretschmannScalarQ"]
Out[17]=

Show the condition that must hold for the FLRW metric to have a vanishing Kretschmann scalar:

In[18]:=
riemann["VanishingKretschmannScalarCondition"]
Out[18]=

Show the second principal invariant (i.e. the Chern-Pontryagin quadratic scalar invariant, whose integral is related to the instanton number) of the Riemann curvature tensor for the FLRW metric:

In[19]:=
riemann["ChernPontryaginScalar"]
Out[19]=

Deduce that the Chern-Pontryagin scalar for the FLRW metric vanishes:

In[20]:=
riemann["VanishingChernPontryaginScalarQ"]
Out[20]=

Show the third principal invariant (i.e. the Euler quadratic scalar invariant, whose integral is related to the Euler characteristic) of the Riemann curvature tensor for the FLRW metric:

In[21]:=
riemann["EulerScalar"]
Out[21]=

Show the third principal invariant (i.e. the Euler quadratic scalar invariant, whose integral is related to the Euler characteristic) of the Riemann curvature tensor for the FLRW metric, with all algebraic equivalences imposed:

In[22]:=
riemann["ReducedEulerScalar"]
Out[22]=

Deduce that the Euler scalar for the FLRW metric is non-vanishing:

In[23]:=
riemann["VanishingEulerScalarQ"]
Out[23]=

Show the condition that must hold for the FLRW metric to have a vanishing Euler scalar:

In[24]:=
riemann["VanishingEulerScalarCondition"]
Out[24]=

Show the list of coordinate values that cause the Riemann curvature tensor for the FLRW metric to become singular:

In[25]:=
riemann["CurvatureSingularities"]
Out[25]=

Show the list of coordinate values that cause the first principal invariant (i.e. the Kretschmann quadratic scalar invariant) of the Riemann curvature tensor for the FLRW metric to become singular:

In[26]:=
riemann["KretschmannSingularities"]
Out[26]=

Show the list of coordinate values that cause the third principal invariant (i.e. the Euler quadratic scalar invariant, whose integral is related to the Euler characteristic) of the Riemann curvature tensor for the FLRW metric to become singular:

In[27]:=
riemann["EulerSingularities"]
Out[27]=

Show the association of all possible index contractions of the Riemann curvature tensor for the FLRW metric:

In[28]:=
riemann["IndexContractions"]
Out[28]=

Show the association of all possible index contractions of the Riemann curvature tensor for the FLRW metric, with all algebraic equivalences imposed:

In[29]:=
riemann["ReducedIndexContractions"]
Out[29]=

Show the association of all covariant derivatives (i.e. derivatives along tangent vectors of the manifold) of the Riemann curvature tensor for the FLRW metric:

In[30]:=
riemann["CovariantDerivatives"]
Out[30]=

Show the association of all covariant derivatives of the Riemann curvature tensor for the FLRW metric, with all algebraic equivalences imposed:

In[31]:=
Short[riemann["ReducedCovariantDerivatives"], 500]
Out[31]=

Show the list of all Bianchi identities asserting the symmetries of the covariant derivative of the Riemann curvature tensor for the FLRW metric:

In[32]:=
riemann["BianchiIdentities"]
Out[32]=

Show that the Bianchi identities for the FLRW metric all hold identically:

In[33]:=
Short[FullSimplify[%], 20]
Out[33]=
In[34]:=
Union[FullSimplify[riemann["BianchiIdentities"]]]
Out[34]=

Raise the second index of the Riemann curvature tensor for the FLRW metric:

In[35]:=
riemann2 = ResourceFunction["RiemannTensor"][metric, False, False, True, True]
Out[35]=
In[36]:=
riemann2["TensorRepresentation"] // MatrixForm
Out[36]=

Show the explicit array form, with all algebraic equivalences imposed:

In[37]:=
riemann2["ReducedTensorRepresentation"] // MatrixForm
Out[37]=

Show the association of all possible index contractions of the Riemann curvature tensor (with second index raised) for the FLRW metric:

In[38]:=
riemann2["IndexContractions"]
Out[38]=

Show the association of all possible index contractions of the Riemann curvature tensor (with second index raised) for the FLRW metric, with all algebraic equivalences imposed:

In[39]:=
riemann2["ReducedIndexContractions"]
Out[39]=

Show the association of all covariant derivatives (i.e. derivatives along tangent vectors of the manifold) of the Riemann curvature tensor (with second index raised) for the FLRW metric:

In[40]:=
riemann2["CovariantDerivatives"]
Out[40]=

Show the association of all covariant derivatives of the Riemann curvature tensor (with second index raised) for the FLRW metric, with all algebraic equivalences imposed:

In[41]:=
Short[riemann2["ReducedCovariantDerivatives"], 500]
Out[41]=

Construct the Riemann curvature tensor for the Kerr-Newman metric (e.g. for a charged, spinning black hole with symbolic mass "M", symbolic angular momentum "J" and symbolic electric charge "Q") in Boyer-Lindquist/oblate spheroidal coordinates:

In[42]:=
metric = ResourceFunction["MetricTensor"]["KerrNewman"]
Out[42]=
In[43]:=
riemann = ResourceFunction["RiemannTensor"][metric]
Out[43]=
In[44]:=
riemann["ReducedTensorRepresentation"] // MatrixForm
Out[44]=

Extract (and simplify) the time-radial-time-radial component of the Riemann curvature tensor for the Kerr-Newman metric:

In[45]:=
riemann[1, 2, 1, 2] // Simplify
Out[45]=

Compute the covariant form of the Riemann curvature tensor (with all indices lowered):

In[46]:=
riemann2 = riemann["CovariantRiemannTensor"]
Out[46]=
In[47]:=
Short[riemann2["ReducedTensorRepresentation"], 25]
Out[47]=
In[48]:=
riemann2["CovariantQ"]
Out[48]=
In[49]:=
riemann2["Symbol"]
Out[49]=

Show that no index contractions are possible for the Riemann curvature tensor in covariant form:

In[50]:=
riemann2["IndexContractions"]
Out[50]=

Compute the contravariant form of the Riemann curvature tensor (with all indices raised):

In[51]:=
riemann3 = riemann["ContravariantRiemannTensor"]
Out[51]=
In[52]:=
Short[riemann3["ReducedTensorRepresentation"], 25]
Out[52]=
In[53]:=
riemann3["ContravariantQ"]
Out[53]=
In[54]:=
riemann3["Symbol"]
Out[54]=

Show that no index contractions are possible for the Riemann curvature tensor in contravariant form:

In[55]:=
riemann3["IndexContractions"]
Out[55]=

Compute a mixed form of the Riemann curvature tensor with first and last indices raised/contravariant and the second and third indices lowered/covariant:

In[56]:=
riemann4 = ResourceFunction["RiemannTensor"][riemann, False, True, True, False]
Out[56]=
In[57]:=
riemann4["ReducedTensorRepresentation"] // MatrixForm
Out[57]=
In[58]:=
riemann4["MixedQ"]
Out[58]=
In[59]:=
riemann4["Symbol"]
Out[59]=

Show that index contractions are only possible for the Riemann curvature tensor in mixed form:

In[60]:=
riemann4["IndexContractions"]
Out[60]=

Transform to use the new coordinate symbols t, r, a1 and a2:

In[61]:=
riemann5 = ResourceFunction["RiemannTensor"][riemann, {t, r, a1, a2}]
Out[61]=
In[62]:=
riemann5["ReducedTensorRepresentation"] // MatrixForm
Out[62]=

Transform to use the new coordinate symbols t, r, a1 and a2, and raise all indices, simultaneously:

In[63]:=
riemann6 = ResourceFunction["RiemannTensor"][riemann, {t, r, a1, a2}, False, False, False, False]
Out[63]=
In[64]:=
Short[riemann6["ReducedTensorRepresentation"], 20]
Out[64]=

Scope (3) 

Riemann curvature tensors can be constructed directly from a MetricTensor expression:

In[65]:=
riemann = ResourceFunction["RiemannTensor"][
  ResourceFunction["MetricTensor"]["Godel"]]
Out[65]=
In[66]:=
Short[riemann["CovariantDerivatives"], 500]
Out[66]=

Additional arguments can be used to specify the coordinate symbols (otherwise default symbols will be chosen automatically):

In[67]:=
riemann2 = ResourceFunction["RiemannTensor"][
  ResourceFunction["MetricTensor"]["Godel"], {T, X, Y, Z}]
Out[67]=
In[68]:=
Short[riemann2["CovariantDerivatives"], 500]
Out[68]=

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

In[69]:=
riemann3 = ResourceFunction["RiemannTensor"][
  ResourceFunction["MetricTensor"]["Godel"], True, False, True, False]
Out[69]=
In[70]:=
Short[riemann3["CovariantDerivatives"], 500]
Out[70]=

Or both simultaneously:

In[71]:=
riemann4 = ResourceFunction["RiemannTensor"][
  ResourceFunction["MetricTensor"]["Godel"], {T, X, Y, Z}, True, False, True, False]
Out[71]=
In[72]:=
Short[riemann4["CovariantDerivatives"], 500]
Out[72]=

New coordinate symbols can be specified for any Riemann curvature tensor:

In[73]:=
riemann = ResourceFunction["RiemannTensor"][
  ResourceFunction["MetricTensor"]["Kerr"]]
Out[73]=
In[74]:=
riemann["Coordinates"]
Out[74]=
In[75]:=
riemann2 = ResourceFunction["RiemannTensor"][riemann, {T, R, a1, a2}]
Out[75]=
In[76]:=
riemann2["Coordinates"]
Out[76]=

Indices can also be raised and lowered on any Riemann curvature tensor:

In[77]:=
riemann3 = ResourceFunction["RiemannTensor"][riemann, True, False, True, False]
Out[77]=
In[78]:=
riemann3["Symbol"]
Out[78]=

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

In[79]:=
riemann4 = ResourceFunction["RiemannTensor"][riemann, {T, R, a1, a2}, True, False, True, False]
Out[79]=
In[80]:=
riemann4["Symbol"]
Out[80]=
In[81]:=
riemann4["Coordinates"]
Out[81]=

Construct the Riemann curvature tensor for the FLRW metric, with symbolic curvature parameter "k" and symbolic scale factor "a":

In[82]:=
metric = ResourceFunction["MetricTensor"]["FLRW"]
Out[82]=
In[83]:=
riemann = ResourceFunction["RiemannTensor"][metric]
Out[83]=

Show the list of properties:

In[84]:=
riemann["Properties"]
Out[84]=

Show the explicit array representation of the Riemann curvature tensor:

In[85]:=
riemann["TensorRepresentation"]
Out[85]=

Show the explicit array representation of the Riemann curvature tensor, with all algebraic equivalences imposed:

In[86]:=
riemann["ReducedTensorRepresentation"]
Out[86]=

Show the explicit array representation of the Riemann curvature tensor, with all partial derivative operators left purely symbolic:

In[87]:=
riemann["SymbolicTensorRepresentation"]
Out[87]=

Show the Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor):

In[88]:=
riemann["KretschmannScalar"]
Out[88]=

Show the Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor), with all algebraic equivalences imposed:

In[89]:=
riemann["ReducedKretschmannScalar"]
Out[89]=

Show the Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor), with all partial derivative operators left purely symbolic:

In[90]:=
riemann["SymbolicKretschmannScalar"]
Out[90]=

Show the Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number):

In[91]:=
riemann["ChernPontryaginScalar"]
Out[91]=

Show the Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number), with all algebraic equivalences imposed:

In[92]:=
riemann["ReducedChernPontryaginScalar"]
Out[92]=

Show the Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number), with all partial derivative operators left purely symbolic:

In[93]:=
riemann["SymbolicChernPontryaginScalar"]
Out[93]=

Show the Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic):

In[94]:=
riemann["EulerScalar"]
Out[94]=

Show the Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic), with all algebraic equivalences imposed:

In[95]:=
riemann["ReducedEulerScalar"]
Out[95]=

Show the Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic), with all partial derivative operators left purely symbolic:

In[96]:=
riemann["SymbolicEulerScalar"]
Out[96]=

Show the metric tensor for the underlying manifold represented by the Riemann curvature tensor:

In[97]:=
riemann["MetricTensor"]
Out[97]=

Show the list of coordinate symbols for the Riemann curvature tensor:

In[98]:=
riemann["Coordinates"]
Out[98]=

Show the list of differential 1-form symbols for the coordinates of the Riemann curvature tensor:

In[99]:=
riemann["CoordinateOneForms"]
Out[99]=

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

In[100]:=
riemann["Indices"]
Out[100]=

Determine whether the Riemann curvature tensor is covariant (i.e. all indices are lowered/covariant):

In[101]:=
riemann["CovariantQ"]
Out[101]=

Determine whether the Riemann curvature tensor is contravariant (i.e. all indices are raised/contravariant):

In[102]:=
riemann["ContravariantQ"]
Out[102]=

Determine whether the Riemann curvature tensor is mixed (i.e. some indices are lowered/covariant and some indices are raised/contravariant):

In[103]:=
riemann["MixedQ"]
Out[103]=

Show a symbolic representation of the Riemann curvature tensor with appropriately raised/lowered indices:

In[104]:=
riemann["Symbol"]
Out[104]=

Determine whether the underlying manifold is Riemann-flat (i.e. all components of the Riemann curvature tensor vanish):

In[105]:=
riemann["RiemannFlatQ"]
Out[105]=

Determine whether the underlying manifold has a vanishing Kretschmann quadratic scalar invariant (i.e. whether the first principal invariant of the Riemann curvature tensor vanishes):

In[106]:=
riemann["VanishingKretschmannScalarQ"]
Out[106]=

Determine whether the underlying manifold has a vanishing Chern-Pontryagin quadratic scalar invariant (i.e. whether the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number, vanishes):

In[107]:=
riemann["VanishingChernPontryaginScalarQ"]
Out[107]=

Determine whether the underlying manifold has a vanishing Euler quadratic scalar invariant (i.e. whether the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic, vanishes):

In[108]:=
riemann["VanishingEulerScalarQ"]
Out[108]=

Show the list of conditions required to guarantee that the underlying manifold is Riemann-flat (i.e. all components of the Riemann curvature tensor vanish):

In[109]:=
riemann["RiemannFlatConditions"]
Out[109]=

Show the condition required to guarantee that the underlying manifold has a vanishing Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor vanishes):

In[110]:=
riemann["VanishingKretschmannScalarCondition"]
Out[110]=

Show the condition required to guarantee that the underlying manifold has a vanishing Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number, vanishes):

In[111]:=
riemann["VanishingChernPontryaginScalarCondition"]
Out[111]=

Show the condition required to guarantee that the underlying manifold has a vanishing Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic, vanishes):

In[112]:=
riemann["VanishingEulerScalarCondition"]
Out[112]=

Show the association of all possible index contractions of the Riemann curvature tensor:

In[113]:=
riemann["IndexContractions"]
Out[113]=

Show the association of all possible index contractions of the Riemann curvature tensor, with all algebraic equivalences imposed:

In[114]:=
riemann["ReducedIndexContractions"]
Out[114]=

Show the association of all possible index contractions of the Riemann curvature tensor, with all partial derivative operators left purely symbolic:

In[115]:=
riemann["SymbolicIndexContractions"]
Out[115]=

Show the association of all covariant derivatives (i.e. all derivatives along tangent vectors of the underlying manifold) of the Riemann curvature tensor:

In[116]:=
riemann["CovariantDerivatives"]
Out[116]=

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

In[117]:=
Short[riemann["ReducedCovariantDerivatives"], 500]
Out[117]=

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

In[118]:=
riemann["SymbolicCovariantDerivatives"]
Out[118]=

Show the list of all Bianchi identities asserting the symmetries of the covariant derivative of the Riemann curvature tensor:

In[119]:=
riemann["BianchiIdentities"]
Out[119]=

Show the list of all Bianchi identities asserting the symmetries of the covariant derivative of the Riemann curvature tensor, with all partial derivative operators left purely symbolic:

In[120]:=
riemann["SymbolicBianchiIdentities"]
Out[120]=

Show the number of dimensions of the underlying manifold represented by the Riemann curvature tensor:

In[121]:=
riemann["Dimensions"]
Out[121]=

Show the signature of the underlying manifold represented by the Riemann curvature tensor (with +1s representing positive eigenvalues and -1s representing negative eigenvalues of the metric tensor):

In[122]:=
riemann["Signature"]
Out[122]=

Determine whether the underlying manifold represented by the Riemann curvature tensor is Riemannian (i.e. all eigenvalues of the metric tensor have the same sign):

In[123]:=
riemann["RiemannianQ"]
Out[123]=

Determine whether the underlying manifold represented by the Riemann curvature tensor is pseudo-Riemannian (i.e. all eigenvalues are non-zero, but not all have the same sign):

In[124]:=
riemann["PseudoRiemannianQ"]
Out[124]=

Determine whether the underlying manifold represented by the Riemann curvature 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[125]:=
riemann["LorentzianQ"]
Out[125]=

Show the list of conditions on the coordinates required to guarantee that the underlying manifold represented by the Riemann curvature tensor is Riemannian (i.e. all eigenvalues of the metric tensor are positive):

In[126]:=
riemann["RiemannianConditions"]
Out[126]=

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

In[127]:=
riemann["PseudoRiemannianConditions"]
Out[127]=

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

In[128]:=
riemann["LorentzianConditions"]
Out[128]=

Show the list of coordinate values that cause the Riemann curvature tensor to become singular:

In[129]:=
riemann["CurvatureSingularities"]
Out[129]=

Show the list of coordinate values that cause the Kretschmann quadratic scalar invariant (i.e. the first principal invariant of the Riemann curvature tensor) to become singular:

In[130]:=
riemann["KretschmannSingularities"]
Out[130]=

Show the list of coordinate values that cause the Chern-Pontryagin quadratic scalar invariant (i.e. the second principal invariant of the Riemann curvature tensor, whose integral is related to the instanton number) to become singular:

In[131]:=
riemann["ChernPontryaginSingularities"]
Out[131]=

Show the list of coordinate values that cause the Euler quadratic scalar invariant (i.e. the third principal invariant of the Riemann curvature tensor, whose integral is related to the Euler characteristic) to become singular:

In[132]:=
riemann["EulerSingularities"]
Out[132]=

Compute the covariant form of the Riemann curvature tensor (with all indices lowered/covariant):

In[133]:=
riemann["CovariantRiemannTensor"]
Out[133]=

Compute the contravariant form of the Riemann curvature tensor (with all indices raised/contravariant):

In[134]:=
riemann["ContravariantRiemannTensor"]
Out[134]=

Neat Examples (6) 

Plot the so-called "monkey saddle" surface:

In[135]:=
ParametricPlot3D[{u, v, u^3 - 3*u*v^2}, {u, -Pi, Pi}, {v, -Pi, Pi}, BoxRatios -> {1, 1, 1}]
Out[135]=

Construct the metric tensor for the monkey saddle surface:

In[136]:=
metric = ResourceFunction[
   "MetricTensor"][{{1 + (3*u^2 - 3*v^2)^2, -6*u*
     v*(3*u^2 - 3*v^2)}, {-6*u*v*(3*u^2 - 3*v^2), 1 + 36*u^2*v^2}}, {u, v}]
Out[136]=
In[137]:=
metric["MatrixRepresentation"] // MatrixForm
Out[137]=

Construct the Riemann curvature tensor for the monkey saddle surface:

In[138]:=
riemann = ResourceFunction["RiemannTensor"][metric]
Out[138]=
In[139]:=
riemann["ReducedTensorRepresentation"] // MatrixForm
Out[139]=

Show the association of all covariant derivatives (i.e. all derivatives along tangent vectors of the underlying manifold) of the Riemann curvature tensor for the monkey saddle surface, with all algebraic equivalences imposed:

In[140]:=
riemann["ReducedCovariantDerivatives"]
Out[140]=

Compute the covariant form of the Riemann curvature tensor for the monkey saddle surface (with all indices lowered):

In[141]:=
riemann2 = riemann["CovariantRiemannTensor"]
Out[141]=
In[142]:=
riemann2["ReducedTensorRepresentation"] // MatrixForm
Out[142]=

Show the association of all covariant derivatives of the Riemann curvature tensor for the monkey saddle surface (with all indices lowered), with all algebraic equivalences imposed:

In[143]:=
riemann2["ReducedCovariantDerivatives"]
Out[143]=

Version History

  • 2.0.0 – 01 May 2023
  • 1.0.0 – 06 October 2020

Source Metadata

Related Resources

License Information