# \[?\] Plot tensor networks diagrams?

**URL:** <https://community.wolfram.com/t/plot-tensor-networks-diagrams/14637>\
**Category:** Questions\
**Tags:** discrete-mathematics, graphics-and-visualization, graphs-and-networks\
**Created:** [August 22, 2019, 10:36am UTC](https://community.wolfram.com/t/plot-tensor-networks-diagrams/14637 "2019-08-22T10:36:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgjha1989](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@rgjha1989](https://community.wolfram.com/u/rgjha1989)\
**Post date:** [August 22, 2019, 10:36am UTC](https://community.wolfram.com/t/plot-tensor-networks-diagrams/14637/1 "2019-08-22T10:36:10Z")

</div>

I am trying to draw useful tensor networks in Mathematica (for ex: two of these are shown below). I was not sure that people use Mathematica for this until I came across

```
GraphPlot[Table[1, {10}, {10}], Method -> "CircularEmbedding", VertexLabeling -> False]

```

which is a good start. So, I figured there must be some way of taking it from there.  
I would appreciate any help on this. Thanks.

 ![mathematica.jpg](https://global.discourse-cdn.com/wolfram/original/3X/c/1/c1a8c632159ce46c1f6c486bc8587a368b407ea0.jpeg)

 ![Screenshot2019-08-22at4.01.07PM.jpg](https://global.discourse-cdn.com/wolfram/original/3X/a/7/a7834efab1e4050034d5f4cbc7049a719d3a23ea.jpeg)

---

<div class="post-metadata">

**Author:** ![Vitaliyk](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/vitaliyk/32/45591_2.png) [@Vitaliyk](https://community.wolfram.com/u/Vitaliyk)\
**Post date:** [August 22, 2019, 11:30am UTC](https://community.wolfram.com/t/plot-tensor-networks-diagrams/14637/2 "2019-08-22T11:30:10Z")

</div>

You can do something similar. Take a look at the following function:

```
diagramsJHA[branch_Integer,level_Integer,opts:OptionsPattern[]]:=
KaryTree[Sum[branch^k,{k,0,level}],branch,
	FilterRules[{opts}, Options[KaryTree]],
	GraphLayout->"RadialEmbedding",
	PlotTheme->"LargeGraph"
]

```

To understand how it works look up in docs every single function from this definition starting with [KaryTree](http://reference.wolfram.com/language/ref/KaryTree.html). Example with different branches and levels:

```
Grid[Table[diagramsJHA[b, l], {b, 2, 5}, {l, 4}]]

```

 ![weR32.png](https://global.discourse-cdn.com/wolfram/original/2X/d/d7c56525fdfb5380048043061070bc0256435e95.png)

Example of a large diagram:

```
diagramsJHA[5, 5, ImageSize -> 1000]

```

 ![sdfdfads.png](https://global.discourse-cdn.com/wolfram/original/2X/8/8db3342e1d74af8200310d2ad9d4cd0e35a0ad60.png)

---

<div class="post-metadata">

**Author:** ![rgjha1989](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@rgjha1989](https://community.wolfram.com/u/rgjha1989)\
**Post date:** [August 22, 2019, 11:54am UTC](https://community.wolfram.com/t/plot-tensor-networks-diagrams/14637/3 "2019-08-22T11:54:53Z")

</div>

Thank you [@Vitaliy Kaurov](https://community.wolfram.com/web/vitaliyk) for your answer. It is very helpful!

Useful link to play around with branches and levels of the tree -  
[http://demonstrations.wolfram.com/RegularKAryTrees/](http://demonstrations.wolfram.com/RegularKAryTrees/)
