[ANN] TensorAlgebra.jl: Taking covariance seriously

Hi @juthohaegeman,

Likewise, thank you for having patience with me and for your helpful comments :raised_hands:

Cool. I suspected you were doing something like this, but I couldn’t quite get my head around it :slight_smile:

From my days as court jester on the n-Category Cafe and nLab, I know how this works with Set with objects being sets and morphisms being functions. We know a set has elements so we handle this by identifying elements s\in S as maps from a one-element set, i.e.

s: \{\bullet \}\to S

but I struggled a bit to translate this concept to Vect. What is a one-element vector space? The only thing I could think of was 0\in K, but then there is only one morphism

0: 0\to V

since it needs to be linear, i.e. 0 maps to 0 in vector space so that can’t be right :thinking:

Sometimes I’m a “little” slow :sweat_smile:

I see what you mean now, but it doesn’t feel 100% satisfying :thinking:

Sure. K is a vector space, but a morphism

m: K\to V

doesn’t give you a vector v \in V. It gives you a line passing through 0\in V and v\in V with

1 \mapsto v.

On the other hand,

v: V^*\to K

is truly a single vector represented as a morphism.

Another issue with K\to U\otimes V\otimes W is that you cannot support partial evaluation, which then forces you into a situation where you do need a different TensorMap for each incantation of a tensor as you’ve implemented.

So given the choice of defining a tensor as map to a “line”

m: K\to V

in V versus defining it as map to a single element

v: V^*\to K,

in K, the latter feels more natural to me especially when you consider the benefits of partial evaluation.

BUT… nevertheless, regardless of how you define your type, either way can support the other operations that you mention.

This sounds cool :blush:

I’ll read through Sectors, representation spaces and fusion trees · TensorKit.jl, but is there any other publication / article that describes the way you use TensorKit.jl? That might motivate me to try to implement similar functionality in TensorAlgebra.jl so we can compare notes further :slight_smile:

Braiding is something I want to look into as well so we can implement things like skew-symmetric differential forms, wedge product, etc.

Thank you again for sharing your thoughts and for your patience :blush: