Mathematica 9 is now available

Tr

Usage

Tr[list]求矩阵或张量list的迹。
Tr[list, f]求一个广义迹,代替Plus,结合具有f 的项。
Tr[list, f, n]向下到list中的第n层。


Notes

Tr[list]list[[i, i, ... ]]中的对角元素的和。
Tr 对矩阵、方阵和张量使用。
• 参见Mathematica 全书: 3.7.7.
• 同时参见: Transpose, Det, DiagonalMatrix, Eigenvalues.
Further Examples

This gives the trace of a  x  matrix.

In[1]:=  

Out[1]=

This gives a generalized trace of the same matrix.

In[2]:=  

Out[2]=

This gives another generalized trace.

In[3]:=  

In[4]:=  

Out[4]=

Here is a tensor.

In[5]:=  

Out[5]//MatrixForm=

Here are its dimensions.

In[6]:=  

Out[6]=

This gives the trace.

In[7]:=  

Out[7]=

This gives a generalized trace.

In[8]:=  

Out[8]=

This gives a generalized trace down to level  .

In[9]:=  

Out[9]=

In[10]:=  



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.