sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.2k stars 413 forks source link

Graphical representations of tensors #32034

Open f20dad3f-90ee-447a-8dc6-e89527084234 opened 3 years ago

f20dad3f-90ee-447a-8dc6-e89527084234 commented 3 years ago

As outlined in Meta Ticket #31991, a tensor can admit different types of decompositions / tensor networks. We propose to add visualizations to the tensors (depending on decomposition used), possibly by implementing the __repr__ method.

In the diagrams of a tensor network, we may represent a tensor as a node, and the indices in different dimensions as edges. E.g. an order-3 tensor T(j_1,j_2,j_3 ) would look like a node with 3 edges. And connecting two edges from two tensors will denote tensor contractions. In this way, one may visualize the various decompositions of a tensor more intuitively via a tensor network / graph, along with additional information (such as tensor ranks).

CC: @mkoeppe @egourgoulhon @dimpase

Component: graphics

Issue created by migration from https://trac.sagemath.org/ticket/32034

f20dad3f-90ee-447a-8dc6-e89527084234 commented 3 years ago

Description changed:

--- 
+++ 
@@ -1,3 +1,6 @@
 As outlined in Meta Ticket #31991, a tensor can admit different types of decompositions / tensor networks. We propose to add visualizations to the tensors (depending on decomposition used), possibly by implementing the ```__repr__``` method. 

 In the diagrams of a tensor network, we may represent a tensor as a node, and the indices in different dimensions as edges. E.g. an order-3 tensor T(j_1,j_2,j_3 ) would look like a node with 3 edges. And connecting two edges from two tensors will denote tensor contractions. In this way, one may visualize the various decompositions of a tensor more intuitively via a tensor network / graph, along with additional information (such as tensor ranks).
+
+- common tensor softwares (https://tensornetwork.org/software/)
+- graphical explanation (https://www.math3ma.com/blog/matrices-as-tensor-network-diagrams)
egourgoulhon commented 3 years ago
comment:2

This would be very nice. I'd love to see Penrose graphical notation for tensors in Sage!