Physics[TensorArray] - construct an Array that can be indexed to return the values of a tensorial expression
Calling Sequence
TensorArray(expression, ...)
Parameters
expression
-
any algebraic tensorial expression having spacetime free indices possibly having also repeated indices implying summation
explore
optional, when given, an applet with sliders to give values to the free indices allows for exploration of the tensorial expression; useful when there are more than two free indices
freeindices = [...]
optional, the right-hand side is a list indicating the ordering of the free indices in the returned output - relevant when expression involves products and sums of tensors with free indices.
output = ...
optional, the right-hand side can be setofequations, listofequations or lineelement (synonym: line_element), to return a set or list of equations where each of the components of the Array is equal to 0, instead of the Array itself, or the line_element when expression is the spacetime metric g_.
performmatrixoperations
optional, can be true or false (default), to perform the matrix operations involving Pauli, Dirac or Gell-Mann matrices entering expression as tensors
performsumoverrepeatedindices
optional, can be true (default) or false, to perform the sum over repeated tensor indices in the returned result
rewriteinmatrixform
optional, can be true or false (default), to rewrite in matrix form (without performing matrix operations) the Pauli, Dirac or Gell-Mann matrices entering expression as tensors
simplifier = ...
optional, indicates the simplifier to be used instead; default is none
Description
The TensorArray receives a tensorial expression having n free indices, typically involving sums and products, and returns a corresponding n dimensional Array, which can be indexed as a single object to return the values of the tensorial expression for given values of its free indices.
To check and determine the free and repeated indices of an expression use Check.
The returned Array is constructed taking into account the covariant and contravariant character of each free index in expression. To compute the values of expression you index this array giving values between 1 and the spacetime dimension to the indices.
Pauli, Dirac and Gell-Mann matrices, respectively represented by the Psigma Dgamma and StandardModel:-Glambda commands, are implemented as spacetime and SU(3) vectors, where each component represents a matrix. Thus, when computing tensor arrays of components, one can optionally visualize the matrices behind these tensor representations and rewrite in matrix form, or additionally perform the matrix operations involved if any. For this purpose, pass the optional arguments rewriteinmatrixform or performmatrixoperations.
By default, in the returned result, summation is explicitly performed over all the repeated indices found in expression, taking into account the covariant/contravariant character of each index. To avoid performing this summation and keep repeated indices not summed pass the optional argument performsumoverrepeatedindices = false.
By default, the Array is constructed without simplifying its components; to have them simplified indicate the simplifier on the right-hand-side of the optional argument simplifier = .... A frequently convenient simplification is achieved with simplifier = simplify.
When expression involves sums and products of tensors having free indices, the ordering of the free indices in the returned Array is arbitrary. To indicated a desired ordering of these free indices, use the option freeindices = [...] where the list [...] indicates the desired ordering.
The array of components of a tensorial expression with at most 2 free indices is all visible on the screen as the output TensorArray. Things are not so simple when that number is 3 or larger, when only a slice of the array of components is shown. To visualize the expression's components in these cases you can use the explore option, which launches an applet that allows for giving values to all but two of the free indices, and shows the 2x2 corresponding slice for the other two, with the ordering shown.
Examples
with⁡Physics:
Setup⁡mathematicalnotation=true
mathematicalnotation=true
Set the spacetime metric to be the Schwarzschild metric and construct an Array for the product of the metric tensor g_ contracted and multiplied with an arbitrary tensor A as in gμ,ρ⁢A⁢ρ⁢Aν For this purpose, set first the metric and the coordinates -you can use Setup for that, or because the Schwarzschild metric is known to the system you can directly pass the keyword or an abbreviation of it to the metric g_ to do all in one step
g_sc
⁢_______________________________________________________
⁢Systems of spacetime coordinates are:⁢X=r,θ,φ,t
⁢Default differentiation variables for d_, D_ and dAlembertian are:⁢X=r,θ,φ,t
Setting lowercaselatin_is letters to represent space indices
⁢The Schwarzschild metric in coordinates ⁢r,θ,φ,t
Parameters: m
Signature: - - - +
g_μ,ν=r2⁢m−r0000−r20000−r2⁢sin⁡θ20000r−2⁢mr
Define now an arbitrary tensor A
Define⁡A
Defined objects with tensor properties
A,▿μ,γμ,σμ,Rμ,ν,Rμ,ν,α,β,Cμ,ν,α,β,∂μ,gμ,ν,γi,j,Γμ,ν,α,Gμ,ν,εα,β,μ,ν,Xμ
Construct now the tensorial expression mentioned
g_μ,ρ⁢A`~rho`⁢Aν
gμ,ρ⁢A⁢ρ⁢ρ⁢Aν
Check the indices
Check⁡,all
The repeated indices per term are: ...,...,..., the free indices are: ...
ρ,μ,ν
Construct now the tensor-array
T ≔ TensorArray⁡
A1⁢A~1⁢r2⁢m−rA2⁢A~1⁢r2⁢m−rA3⁢A~1⁢r2⁢m−rA4⁢A~1⁢r2⁢m−r−A1⁢r2⁢A~2−A2⁢r2⁢A~2−A3⁢r2⁢A~2−A4⁢r2⁢A~2−A1⁢A~3⁢r2⁢sin⁡θ2−A2⁢A~3⁢r2⁢sin⁡θ2−A3⁢A~3⁢r2⁢sin⁡θ2−A4⁢A~3⁢r2⁢sin⁡θ2A1⁢A~4⁢r−2⁢mrA2⁢A~4⁢r−2⁢mrA3⁢A~4⁢r−2⁢mrA4⁢A~4⁢r−2⁢mr
In the above, the sum over ρ is performed. With performsumoverrepeatedindices = false the sum is not performed:
TensorArray⁡,performsumoverrepeatedindices=false
g_1,ρ⁢A~rho⁢A1g_1,ρ⁢A~rho⁢A2g_1,ρ⁢A~rho⁢A3g_1,ρ⁢A~rho⁢A4g_2,ρ⁢A~rho⁢A1g_2,ρ⁢A~rho⁢A2g_2,ρ⁢A~rho⁢A3g_2,ρ⁢A~rho⁢A4g_3,ρ⁢A~rho⁢A1g_3,ρ⁢A~rho⁢A2g_3,ρ⁢A~rho⁢A3g_3,ρ⁢A~rho⁢A4g_4,ρ⁢A~rho⁢A1g_4,ρ⁢A~rho⁢A2g_4,ρ⁢A~rho⁢A3g_4,ρ⁢A~rho⁢A4
Also, in (6) the ordering of the free indices μ,ν is not defined. In the computations above, TensorArray choose the ordering μ,ν but one may prefer, for instance, ν,μ, resulting in the transpose of the matrix (8). To indicate any desired ordering you can use the optional argument freeindices = [...]
T ≔ TensorArray⁡,freeindices=ν,μ
A1⁢A~1⁢r2⁢m−r−A1⁢r2⁢A~2−A1⁢A~3⁢r2⁢sin⁡θ2A1⁢A~4⁢r−2⁢mrA2⁢A~1⁢r2⁢m−r−A2⁢r2⁢A~2−A2⁢A~3⁢r2⁢sin⁡θ2A2⁢A~4⁢r−2⁢mrA3⁢A~1⁢r2⁢m−r−A3⁢r2⁢A~2−A3⁢A~3⁢r2⁢sin⁡θ2A3⁢A~4⁢r−2⁢mrA4⁢A~1⁢r2⁢m−r−A4⁢r2⁢A~2−A4⁢A~3⁢r2⁢sin⁡θ2A4⁢A~4⁢r−2⁢mr
Depending on the context, instead of an Array of components, it is more convenient to receive as a set or list of equations with each of components of the Array equal to 0. For that purpose use the output = setofequations (or listofequations on the right-hand side) option
T ≔ TensorArray⁡,freeindices=ν,μ,output=setofequations
T≔A1⁢A⁢1⁢1⁢r2⁢m−r=0,A1⁢A⁢4⁢4⁢r−2⁢mr=0,A2⁢A⁢1⁢1⁢r2⁢m−r=0,A2⁢A⁢4⁢4⁢r−2⁢mr=0,A3⁢A⁢1⁢1⁢r2⁢m−r=0,A3⁢A⁢4⁢4⁢r−2⁢mr=0,A4⁢A⁢1⁢1⁢r2⁢m−r=0,A4⁢A⁢4⁢4⁢r−2⁢mr=0,−A1⁢r2⁢A⁢2⁢2=0,−A2⁢r2⁢A⁢2⁢2=0,−A3⁢r2⁢A⁢2⁢2=0,−