Matrices as Tensor Network Diagrams
math3ma.com
math3ma.com
I find this notation great for simple applications, but potentially unwieldy for dim > 2. For instance, how would I represent the tensor (or outer) product of two matrices? the inputs would be two circles with two lines attached to each, the result would need to be a single circle with four lines attached. The natural attempt would be something like:
a - o -
/ /
| /
\ |
ab ---o---
| \
/ |
/ /
b - o -
But I suspect the above diagram isn't correct because there are no "open" indices at the end of this. Rather, this diagram seems to represent the contraction of a 4D tensor with 2, 2D tensors.It seems we we would need a way of connecting circles without implying a contraction of a particular index.
Anyone know how to annotate the outer product of two matrices in this diagrammatic convention?
---A---
---B---
A_ab B_cd = (A⊗B)_acbd. If a,c=1...N then you can think of (ac) as being an index with N^2 possible values, which is what the double line now means... if you like, you may compact it a bit: ===(A⊗B)===I prefer your second notation, with the tensor product happening in parenthesis, but it kind of defeats the point of the graphical nature of the notation if we need to explictly write the tensor product I think..
If you wish, you can draw a circle around A and B to "factor out" that part of the diagram as a sub tensor product. Here might be a way to show that matrix multiplication is both "tensor product then contract" and "function composition": https://imgur.com/tcCycYj.png (though I didn't give this gray-circle notation much thought).
Think about this: how is it in a product abcd of plain old numbers am I supposed to see the mathematical object ad without putting them arbitrarily close together? (Well, in standard notation, you do put them close together and write (ad)bc or something.)
What you need is two parallel walls where lines can start and end. The rest is all fine.
Using two vectors and the epsilon tensor (Levi-Chivita-symbol), I guess?
Edit: So like this: two circles with one connection each as input, i.e. vectors (a and b), and a tensor with three connections, leaving one, meaning the result will be a vector again.
a o
\
o - (-o c)
/
b o
Multiplying with another vector c gives the parallelepipedial product (a x b) c, a scalar (also = det(a,b,c)).Cool :)
(a x b )(c x d) => ???
o o o o
\ / \ /
o - o => o
/ \ / \
o o o o
Would the circle in the middle of the cross be a tensor of order 4 then?Edit: It's been a while since I did that but wouldn't that be the following in sum notation?
eps_ijk a_j b_k eps_ilm c_l d_m = (new tensor)_jklm a_j b_k c_l d_mIf you take a 3-regular planar graph and put the determinant/Levi-Civita tensor on each vertex, you get plus-or-minus the number of edge-3-colorings of that graph. The four-color theorem is merely to show this tensor contraction is always non-zero :-) (Nobody's managed to prove it this way, yet.)
Here are some notes showing how to contract two Levi-Civita symbols together graphically: https://imgur.com/HmaLSaB.png
This is in Penrose's 1971 paper ("Applications of negative-dimensional tensors"). He went on to notice that you can do a "puff-up-and-contract" construction to completely get rid of all the Levi-Civita tensors: https://imgur.com/eK9ZCkc.png
From here, he recognized that this sort of tensor network on 3-dimensional space was equivalent to an abstract tensor network on "(-2)-dimensional space", where there is an identity that let him remove all the places the strings cross https://imgur.com/65z0zov.png (This element placed at each edge in (-2)-dimensional space is known as the "second Jones-Wenzl projector for the Temperley-Lieb algebra.")
From a more recent point of view, what he did was find a graphical way to go from an SO(3) tensor network to an SL(2) tensor network (which should be possible since both Lie groups are isomorphic).
Locally isomorphic, but not isomorphic: SL(2) is the simply connected double cover Spin(3) of SO(3). As you probably know, the non-simply-connectedness of SO(3) is what's witnessed by Dirac's belt trick (https://en.wikipedia.org/wiki/Plate_trick).
Practical things: who want to co-write a library (JS I guess) for drawing such tensor diagrams? I think it has a lot of potential for representing formulae, form Markov Chains, through Quantum Computing to Deep Learning!
These days physicists who do tensor-network analysis and simulations of many-body quantum systems (e.g., MPS in 1D) probably use the diagrams more than relativists, and in those cases the indices can come with arbitrary dimensions.
(This is just a comment on the "graphical proofs", they are beautiful but they cannot be "proofs" unless you provide the background).
https://graphicallinearalgebra.net/2015/06/09/matrices-diagr...
Examples of areas in which these techniques are being used include logic, for the study of propositions and deductions [43]; physics, for the study of space and spacetime [8, 32]; linguistics, to model the interaction of words within a sentence [21]; knowledge, to represent information and belief revision [22]; and computation, for the study of data and computer programs [1, 10]. These diagrams have been provided with a rigorous underpinning using category theory, a powerful branch of mathematics which relates these diagrammatic theories to algebraic structures. More deeply, this approach can also be applied to the study of diagrammatic theories themselves [12, 33]. As such, it is its own ‘metatheory’. One major goal of the project will be to understand to what extent this can serve as a foundation for mathematics itself, as a replacement for set theory. To work towards this, one goal will be to understand how various mathematical structures can be defined from this perspective, a rich line of enquiry for which some answers are already known, but much more is left to still be discovered. An interesting feature of categorical approaches to foundations is that standard limitative theorems, such as the incompleteness theorem of Godel, are no longer set in stone [7, 39]; instead, they become malleable, and can be directly ¨ controlled by changing the categorical universe in which one works.
Switching to the field of artificial intelligence and automation — perhaps, so it seems, a world away from the abstraction of higher mathematics — the diagrammatic categories themselves have been implemented as the actual language and deduction mechanism of automated reasoning software packages. These tools make it possible to automatically explore the theories formulated in the diagrammatic language. For the case of the abstract mathematical expressions, the package quantomatic, currently in development at the Computing Laboratory at the University of Oxford, performs this function. For the particular case of diagrammatic models of language and meaning, parsers and tools for corpus exploration are currently under development.
The study of each of these ‘diagrammatic theories’, each modelling a separate part of cognitive, physical, or mathematical reality, are currently separate. Our grand vision is to develop a fully integrated framework, in which all of the above can be comprehended and dealt with together. This would be a foundation for mathematics, not in isolation but in direct relation to the cognitive and physical worlds; not only as an exercise in abstract thought, but directly implemented computationally, with tools available for automatic calculation and deduction. The unique perspective given by categorical foundations on Godel-style theorems will allow their relevance to cognition to be rigorously studied. The strong mathematical similarities between the diagrammatic techniques used in these different fields, which have only recently begun to be appreciated, provides a good impetus for this research programme.
Source: An integrated diagrammatic universe for knowledge, language and artificial reasoning. Abramsky & Coecke, Oxford.
> The study of each of these ‘diagrammatic theories’, each modelling a separate part of cognitive, physical, or mathematical reality, are currently separate. Our grand vision is to develop a fully integrated framework, in which all of the above can be comprehended and dealt with together.
> More deeply, this approach can also be applied to the study of diagrammatic theories themselves [12, 33]. As such, it is its own ‘metatheory’. One major goal of the project will be to understand to what extent this can serve as a foundation for mathematics itself, as a replacement for set theory.
Also, as an ironic side note in relation with the article, some of the diagrammatic theories that have been elaborated by this group include diagrams that contain (and not just represent) matrices. I don't know why I'm commenting in this thread, I don't understand anything in these papers, I just know it describes what I see, i.e. the great universal diagram. Don't you see it ?
https://ncatlab.org/nlab/show/tensor+network https://ncatlab.org/nlab/show/string+diagram