{
  "site": "at://did:plc:ngokl2gnmpbvuvrfckja3g7p/site.standard.publication/3mjkon2am6k2k",
  "$type": "site.standard.document",
  "title": "capability based tensor network",
  "content": {
    "$type": "pub.leaflet.content",
    "pages": [
      {
        "$type": "pub.leaflet.pages.linearDocument",
        "blocks": [
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "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."
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "Here is a table mapping linear algebra concepts to tensor algebra concepts to make it obvious what I'll be talking about"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "| Linear Algebra | Tensor Algebra |\n| -------------- | -------------- |\n| Scalar         | Rank-0         |\n| Vector         | Rank-1         |"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 88,
                    "byteStart": 83
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#italic"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "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"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 25,
                    "byteStart": 20
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#italic"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "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."
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 5,
                    "byteStart": 0
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#italic"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "Lower-index values, also called co-vectors, represent requirements of our tensor network."
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 93,
                    "byteStart": 89
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                },
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 114,
                    "byteStart": 106
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "Using DisCoCat we can model this with natural language\nFor 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"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "We model our natural language as tensor products with what's called adjoints"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 43,
                    "byteStart": 39
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                },
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 98,
                    "byteStart": 94
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                },
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 111,
                    "byteStart": 107
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                },
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 162,
                    "byteStart": 158
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "$Server$: $n$ $\\leftarrow$ Server is a Noun\n$Needs$: $n^r \\otimes s \\otimes n^l$ $\\leftarrow$ Noun needs a Noun\n$Database$: $n \\leftarrow$ Database is also a Noun\n$Data$: $n$"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "We can model the requirements \"Server needs database\" and \"Database needs data\" as the tensor product:"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "$$Server \\otimes Needs \\otimes Database \\otimes Needs \\otimes Data$$"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 26,
                    "byteStart": 13
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#italic"
                    }
                  ]
                },
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 85,
                    "byteStart": 81
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "$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."
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "facets": [
                {
                  "$type": "pub.leaflet.richtext.facet",
                  "index": {
                    "$type": "pub.leaflet.richtext.facet#byteSlice",
                    "byteEnd": 59,
                    "byteStart": 54
                  },
                  "features": [
                    {
                      "$type": "pub.leaflet.richtext.facet#bold"
                    }
                  ]
                }
              ],
              "textSize": "default",
              "plaintext": "$n^l$ is the left-adjoint. Same thing just pairs with Nouns when it's on the left of them."
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "$n^r$ and $n^l$ are our co-vectors in the tensor network. They are requirements."
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "We can expand the tensor product of  $$Server \\otimes Needs \\otimes Database \\otimes Needs \\otimes Data$$ to be explicit:\n$$n \\otimes (n^r \\otimes s \\otimes n^l) \\otimes n \\otimes (n^r \\otimes s \\otimes n^l) \\otimes n$$"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "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$"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          },
          {
            "block": {
              "$type": "pub.leaflet.blocks.text",
              "textSize": "default",
              "plaintext": "$Server$ and $Data$ both pair with their adjoints and cancel out leaving us with\n$$s \\otimes s$$\nWe'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?"
            },
            "alignment": "pub.leaflet.pages.linearDocument#textAlignLeft"
          }
        ]
      }
    ]
  },
  "updatedAt": "2026-04-21T16:41:50.859Z",
  "publishedAt": "2026-04-21T16:41:50.859Z",
  "textContent": "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.\n\nHere is a table mapping linear algebra concepts to tensor algebra concepts to make it obvious what I'll be talking about\n\n| Linear Algebra | Tensor Algebra |\n| -------------- | -------------- |\n| Scalar         | Rank-0         |\n| Vector         | Rank-1         |\n\nA vector is written in tensor form like so: $v^i$. The superscript means it has an upper index. Vectors represent capabilities of our network\n\nIf $v^i$ pairs to a lower index $v_i$ it contracts and we get a scalar. When vectors pair, they cancel each other out.\n\nLower-index values, also called co-vectors, represent requirements of our tensor network.\n\nUsing DisCoCat we can model this with natural language\nFor 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\n\nWe model our natural language as tensor products with what's called adjoints\n\n$Server$: $n$ $\\leftarrow$ Server is a Noun\n$Needs$: $n^r \\otimes s \\otimes n^l$ $\\leftarrow$ Noun needs a Noun\n$Database$: $n \\leftarrow$ Database is also a Noun\n$Data$: $n$\n\nWe can model the requirements \"Server needs database\" and \"Database needs data\" as the tensor product:\n\n$$Server \\otimes Needs \\otimes Database \\otimes Needs \\otimes Data$$\n\n$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\n$n^l$ is the left-adjoint. Same thing just pairs with Nouns when it's on the left of them.\n\n$n^r$ and $n^l$ are our co-vectors in the tensor network. They are requirements.\n\nWe can expand the tensor product of  $$Server \\otimes Needs \\otimes Database \\otimes Needs \\otimes Data$$ to be explicit:\n$$n \\otimes (n^r \\otimes s \\otimes n^l) \\otimes n \\otimes (n^r \\otimes s \\otimes n^l) \\otimes n$$\n\nLet'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$\n\n$Server$ and $Data$ both pair with their adjoints and cancel out leaving us with\n$$s \\otimes s$$\nWe'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?"
}