Documentation
Mathematica
Built-in Functions
Advanced Documentation
Linear Algebra
Introduction

Tensors and Arrays
A matrix has two indices that label each entry. By convention the values of these indices label the row and column when the matrix is written in a tabular form. A generalization of matrices can have less than or more than two indices. Typically an object with no indices is called a scalar, and one with one index is called a vector. An object with more than two indices is called a tensor, although a scalar, vector, or matrix can also be called a tensor.
Mathematica works with tensors that have arbitrary numbers of indices with the same list structure that is used for matrices. The number of levels of lists represents the number of indices. For example, the following is a vector.
In[1]:=
Out[1]=
In[2]:=
Out[2]=
The following is a tensor with 3 indices, with lengths 2, 3, and 4, respectively. The number of indices required to label a tensor can be called the rank of the tensor.
In[3]:=
Out[3]=
In[4]:=
Out[4]=
It should be noted that the notion of a tensor as used in physics has additional properties beyond the labelling of elements in generalized matrices. This is discussed more in the description of tensors given in MathWorld. In Mathematica the term tensor is used to refer to generalized matrices.
Many of the Mathematica functions that operate on matrices are also generalized to work for vectors and tensors. This important principle will be demonstrated many times in this document, and is covered in the section Matrix and Tensor Operations.