Beruflich Dokumente
Kultur Dokumente
Functions URL
Symbolic Tensors
Symbolic Array Domains Tensor Canonicalization
The Wolfram System offers a large number of functions to efficiently manipulate lists, matrices, and arrays of any depth and dimension. Among
them there are functions to perform algebraic operations, like sums, products, inner or outer products, transpositions, etc. The Wolfram System
also has powerful algorithms to manipulate algebraic combinations of expressions representing those arrays. These expressions are called
symbolic arrays or symbolic tensors. By assuming given properties about those symbolic arrays (mainly rank, dimension, and symmetry), you can
construct and prove results which are valid for arbitrary members of large domains of arrays obeying those properties.
Matrices are rank 2 arrays and can be symmetric, antisymmetric, or not have any symmetry at all. Higher-rank tensors can be fully symmetric or
fully antisymmetric, but they can also have many other types of symmetries under transposition of their levels or slots. Relevant tensors in
physics and mathematics usually have symmetry: the symmetric inertia tensors, the antisymmetric electromagnetic field, the rank 4 stiffness
tensor in elasticity, the rank 4 Riemann curvature tensor of a manifold, the fully antisymmetric volume forms, etc. Even when you work with
elementary objects without symmetry, like vectors, the repeated use of them leads to the appearance of symmetry. The Wolfram System
introduces a general language to describe arbitrary transposition symmetries of arrays of any depth and dimension, both for ordinary arrays and
for symbolic arrays. See "Tensor Symmetries" for a description of the language of symmetries.
In[2]:= TensorRank m
rango de tensor
Out[2]= 2
In[3]:= TensorDimensions m
dimensiones de tensor
Out[3]= 4, 4
In[4]:= TensorSymmetry m
symmetría de tensor
Out[4]= Symmetric 1, 2
In[6]:= TensorRank m v
rango de tensor
Out[6]= 3
In[7]:= TensorDimensions v m v
dimensiones de tensor
Out[7]= 4, 4, 4, 4
In[8]:= TensorSymmetry v v v
symmetría de tensor
Out[8]= Symmetric 1, 2, 3
A general symbolic tensor expression can be understood as a linear combination of terms formed by combining the symbolic tensors using three
basic operations: tensor products, transpositions, and contractions. Other basic algebra operations can be decomposed in terms of these.
In[12]:= TensorTranspose b, 2, 3, 1
traspón tensor
Out[12]= TensorTranspose b, 2, 3, 1
In[13]:= TensorDimensions
dimensiones de tensor
Out[13]= 4, 2, 3
Compare with:
Out[14]= 4, 2, 3
In[15]:= TensorContract a, 1, 3
contrae tensor
Out[15]= TensorContract a, 1, 3
In[16]:= TensorDimensions
dimensiones de tensor
Out[16]= 4
In[17]:= TensorContract b, 1, 3
contrae tensor
All terms in a sum must have the same rank and dimensions, but not necessarily the same symmetry:
In[18]:= 3a 2v v v TensorDimensions
dimensiones de tensor
Out[18]= 4, 4, 4
In[19]:= 3a 2b TensorDimensions
dimensiones de tensor
Tensor Canonicalization
As usual in computer algebra, one of the most important computational steps is converting general expressions into a canonical form, if
possible. When only transposition symmetries are involved, it is always possible to bring symbolic tensor polynomials to such canonical form,
using specialized group theory algorithms. However, for complicated cases involving large ranks, it could consume considerable time and
memory.
Tensor canonicalization.
Now you can have a symbolic tensor expression like the following:
Out[21]= 2M P P M P P TensorContract T A, 1, 5 , 2, 6
Out[22]= TensorContract P T A, 3, 7 , 4, 8 2M P P M P P
TensorReduce applies the same operations, sorts the tensors lexicographically, and uses the symmetry information. In this example, the
contraction term disappears because it involves the contraction of a symmetric and an antisymmetric tensor:
In[23]:= TensorReduce texpr
reduce tensor
Out[23]= 2M P P P TensorTranspose M P, 3, 4, 1, 2
Out[25]= TensorTranspose A M T, 2, 3, 1, 4, 5, 6, 7, 8
Out[27]= TensorContract P, 1, 2 M P
The next example explores the trace of powers of an antisymmetric matrix. For such a matrix A in any dimension, Tr MatrixPower A, n vanishes
for odd n but not for even n. This is illustrated by constructing the power and trace in terms of TensorProduct and TensorContract and then
In[30]:= contract A, 1
Out[30]= TensorContract A, 1, 2
In[31]:= TensorReduce
reduce tensor
Out[31]= 0
In[32]:= contract A, 2
Out[32]= TensorContract A A, 1, 4 , 2, 3
In[33]:= TensorReduce
reduce tensor
Out[33]= TensorContract A A, 1, 3 , 2, 4
In[34]:= contract A, 3
Out[34]= TensorContract A A A, 1, 6 , 2, 3 , 4, 5
In[35]:= TensorReduce
reduce tensor
Out[35]= 0
Out[36]= 1 True, 2 False, 3 True, 4 False, 5 True, 6 False, 7 True, 8 False, 9 True, 10 False, 11 True,
12 False, 13 True, 14 False, 15 True, 16 False, 17 True, 18 False, 19 True, 20 False
A more complicated example is given by the canonicalization of scalar polynomials in the Riemann tensor. Here, only its transposition symme-
tries are used (also known as permutation symmetries or monoterm symmetries), and not the Riemann cyclic symmetries.
In[37]:= Rsym 2, 1, 3, 4 , 1 , 3, 4, 1, 2 , 1 ;
This gives random contraction of m pairs of slots in the tensor product of n Riemann tensors:
In[42]:= SeedRandom 17 ;
semilla aleatoria
randomRprod 2, 3
Out[43]= TensorContract R R, 1, 6 , 2, 3 , 5, 8
Out[45]= TensorContract R R R R R R R R R R R R R R R R R R R R R R R R R,
1, 83 , 2, 17 , 3, 42 , 4, 63 , 6, 31 , 7, 36 , 8, 29 , 10, 85 , 11, 64 , 12, 66 ,
13, 91 , 14, 79 , 16, 53 , 18, 52 , 19, 28 , 20, 88 , 21, 98 , 24, 68 , 26, 33 , 30, 93 ,
34, 96 , 35, 54 , 37, 59 , 39, 74 , 41, 48 , 44, 67 , 45, 78 , 46, 82 , 47, 76 , 49, 65 ,
50, 60 , 51, 58 , 57, 81 , 61, 100 , 62, 77 , 69, 72 , 73, 84 , 75, 87 , 80, 95 , 86, 90
Related Guides
Symbolic Tensors
Related Tutorials
Tensor Symmetries
Symmetrized Arrays