TensorRank

TensorRank[tensor]

gives the rank of tensor.

Details and Options

  • TensorRank accepts any type of tensor, either symbolic or explicit, including any type of array.
  • On explicit rectangular arrays of scalars, TensorRank coincides with ArrayDepth. On symbolic arrays, TensorRank stays unevaluated unless the array has been assigned a rank through any form of assumption.

Examples

open allclose all

Basic Examples  (1)

Rank of an array:

In[1]:=
Click for copyable input
Out[1]=

Rank of a tensor product of two tensors:

In[2]:=
Click for copyable input
Out[2]=

Rank of a contraction:

In[3]:=
Click for copyable input
Out[3]=

Scope  (3)

Options  (1)

Properties & Relations  (2)

Possible Issues  (3)

See Also

ArrayDepth  Arrays  Matrices  Vectors  TensorDimensions  Dimensions

Tutorials

Introduced in 2012
(9.0)