capability based tensor network

In order to assemble an application stack, I'm building what I'm calling a "capability based tensor network". Tensor algebra is essentially linear algebra's older brother. In linear algebra, you have concepts like scalars and vectors. In tensor algebra you just have tensors.

Here is a table mapping linear algebra concepts to tensor algebra concepts to make it obvious what I'll be talking about

| Linear Algebra | Tensor Algebra |
| -------------- | -------------- |
| Scalar | Rank-0 |
| Vector | Rank-1 |

A vector is written in tensor form like so: $v^i$. The superscript means it has an upper index. Vectors represent capabilities of our network

If $v^i$ pairs to a lower index $v_i$ it contracts and we get a scalar. When vectors pair, they cancel each other out.

Lower-index values, also called co-vectors, represent requirements of our tensor network.

Using DisCoCat we can model this with natural language
For our lexicon let's use $n$ for Noun and $s$ for Sentence (standard DisCoCat naming convention). They represent the vectors in our network. They are capabilities

We model our natural language as tensor products with what's called adjoints

$Server$: $n$ $\leftarrow$ Server is a Noun
$Needs$: $n^r \otimes s \otimes n^l$ $\leftarrow$ Noun needs a Noun
$Database$: $n \leftarrow$ Database is also a Noun
$Data$: $n$

We can model the requirements "Server needs database" and "Database needs data" as the tensor product:

$$Server \otimes Needs \otimes Database \otimes Needs \otimes Data$$

$n^r$ is the right-adjoint. That means that if it is on the right hand side of a Noun then it will pair with it.

$n^l$ is the left-adjoint. Same thing just pairs with Nouns when it's on the left of them.

$n^r$ and $n^l$ are our co-vectors in the tensor network. They are requirements.

We can expand the tensor product of $$Server \otimes Needs \otimes Database \otimes Needs \otimes Data$$ to be explicit:
$$n \otimes (n^r \otimes s \otimes n^l) \otimes n \otimes (n^r \otimes s \otimes n^l) \otimes n$$

Let's start with $Database$. Since it has a left-adjoint on the left, and a right-adjoint on the right, that entire term $n^l \otimes n \otimes n^r$ pairs and cancels out. The astute reader might say "Hey, wait a minute! There are two co-vectors and only one vector! What gives?!" frobenius algebra says that we can use the comultiplication map ($\Delta$) to make as many copies of a vector as we need because we are talking about the concept of a database, not an actual instance of a database. $n \rightarrow n \otimes n$

$Server$ and $Data$ both pair with their adjoints and cancel out leaving us with
$$s \otimes s$$
We've just used the Curry-Howard Isomorphism as a mathematical proof that our $Server$ is related to our $Data$ through quantum entanglement. How's that for system requirements?