I’m trying to implement the free tensor algebra functor T: given a vector space V it creates another vector space T(V). This vector space T(V) has many nice properties, for example, T(V) is not just a vector space but also forms an algebra. It is used in many constructions; see https://en.wikipedia.org/wiki/Tensor_algebra for details.

What is nice is that it can be realized as a direct sum of tensor products of V. In fact, I’m only interested in the case when V is R^d and I’m only interested in the first k entries in the direct sum that forms T(V).

What matters is that the basic operations, addition and multiplication of elements in T(V), are carried out quickly. I had a look at the various tensor packages available but to be honest I’m a bit overhelmed with the choice and some of them look like they are no longer maintained. Any recommendations would be appreciated.