This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Tr

Tr[list]
finds the trace of the matrix or tensor list.
Tr
finds a generalized trace, combining terms with f instead of Plus.
Tr
goes down to level n in list.
  • Tr[list] sums the diagonal elements .
  • Tr works for rectangular as well as square matrices and tensors.
The trace of a matrix is the sum of the diagonal elements:
The trace of a matrix is the sum of the diagonal elements:
In[1]:=
Click for copyable input
Out[1]=
Symbolic trace:
Trace of a numerical matrix:
Trace of a sparse matrix:
For a vector Tr gives the sum of the elements:
For a higher-rank tensor, Tr gives the sum of elements with equal indices:
Apply a function to the diagonal elements of a matrix:
Extract the diagonal of a matrix as a list:
Only consider down to level 1; this adds the rows of the matrix:
Only consider down to level 2:
Find the determinant of a triangular matrix:
Define an inner product for the cone of positive definite matrices using :
Project the matrix onto the space spanned by the matrix :
The trace of a matrix is invariant under similarity transformations:
The invariance means that the sum of the eigenvalues must equal the trace:
The Frobenius norm is defined as :
New in 4 | Last modified in 5