Tensor reshaping
In multilinear algebra, a reshaping is any bijective map between an order-d tensor and an order-k tensor, where k < d.
Definition
Let Vk be an nk-dimensional vector space over a field . Then there exist isomorphisms of vector spaces
where is any permutation.
Via these (and other) isomorphisms, a tensor can be interpreted in several ways as an order-k tensor with . Let
denote the projection with . Let be a partition. Then, the -flattening of a simple tensor is defined as
which may be interpreted as a tensor of order by ignoring the tensor product structure on . The standard way to ignore the tensor product structure consists of looking at through an isomorphism , in which case is viewed as an element of , where
.
For general tensors the above definition is extended linearly as follows. Since every tensor admits a tensor rank decomposition, we can define the -flattening of
as follows:
Example
For example, assume that a basis of is and that the tensor is expressed with respect to this basis as
Via the first isomorphism, we can represent as
where is the jth standard basis vector of . Taking and a bijective map , we can construct an isomorphism between and by mapping where is the jth standard basis vector of . Via this identification, we have .
Vectorization
Let be the coordinate representation of an abstract tensor with respect to a basis. A vectorization of is an -reshaping wherein , so that the tensor is simply interpreted as a vector in . A standard choice of is such that
which is consistent with the way in which the colon operator in Matlab and GNU Octave reshapes a higher-order tensor into a vector.
Flattenings
Let be the coordinate representation of an abstract tensor with respect to a basis. A standard factor-k flattening of is an -reshaping in which and . Usually, a standard flattening is denoted by
These reshapings are sometimes called matricizations or unfoldings in the literature. A standard choice of is the one that is consistent with the reshape function in Matlab and GNU Octave, namely