# Associativity of hypermatrix multiplication

Matrix multiplication can be done only by juxtaposing A and B in one direction i.e. putting A and B adjacent to each other horizontally as AB or BA. i.e. as jigsaw pieces each matrix has only two connectors: on the left or right.

Is it the case that hypermatrices have more jigsaw-connectors so hypermatrix multiplication can go in different directions and that algebraic expressions are no longer limited to one-dimensional strings (e.g. ABABABA) but can now occur as tree graphs with the vertices being the variables and the edges being multiplcation?

Is it also the case that associativity applies to this graph so that associativity is not just a phenomenon of strings but also of trees ?

If so, I'm looking for suitable references to add to the Wikipedia article on associativity.

-

A hypermatrix is more commonly known among mathematicians as a tensor. The possible ways of composing tensors are all essentially given by repeated applications of tensor contraction, but can also be represented pictorially in various ways, and this generalized composition is also associative.

Some relevant keywords: operad, monoidal category, multicategory, ...

-