liveBook · Manning

Tensor

As explained in Geometry for Programmers

A multidimensional array is an indexed data structure containing values arranged along two or more dimensions.

A tensor is a multidimensional array equipped with its own algebra: a defined set of operations and rules. Vectors and matrices are tensors too, so the term generalizes both without requiring unfamiliar notation. section 2.5.3 section 2.8

Use the term to connect data layout with the operations that give it mathematical meaning:

  • A matrix is a two-dimensional array whose algebra includes operations such as matrix multiplication. section 2.5.2
  • A tensor generalizes vectors and matrices to multidimensional arrays while retaining an associated algebra. section 2.5.3
  • Tensor terminology can make familiar physical models sound more complicated than they are; a 3D inertia tensor is a 3×3 matrix. section 2.5.2

A matrix-shaped tensor

The nested array [[1, 2, 3], [4, 5, 6], [7, 8, 9]] shows the table-like layout of a two-dimensional tensor. Its entries can participate in matrix-specific operations, rather than being treated as an arbitrary concatenation of values. section 2.5.2

[ [1, 2, 3],
  [4, 5, 6],
  [7, 8, 9] ]

Inspect the nested-bracket representation of a matrix as a concrete two-dimensional tensor layout. section 2.5.2

How Geometry for Programmers covers it

How deep it goes
Defines tensor algebra and connects it to vector and matrix operations without detailing higher-dimensional tensor operations.
Examples
Uses a nested 2D array and a 3×3 inertia tensor to illustrate tensor representations.
What you can do after
Understand tensors as structured arrays and recognize vectors and matrices as tensor cases.
How it connects
Connects tensors with vectors, matrices, matrix algebra, and geometric transformations.

Also explained in

Compare how 7 books explain tensor →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.