You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. If you are a developer, you can install it in develop mode
25
32
```julia
26
33
pkg> dev https://github.com/Happy-Diode/GraphTensorNetworks.jl.git
27
34
```
28
35
29
-
Please use **Julia-1.7**, otherwise you will suffer from huge overheads when contracting large tensor networks. If you have to use a lower version,
36
+
Packages installed in developer mode will not be updated by the `up` command, you should go to the develop folder and use `git` to manage your versions. For more [details](https://docs.julialang.org/en/v1/stdlib/Pkg/).
37
+
38
+
Please use **Julia version >= 1.7**, otherwise you will suffer from huge overheads when contracting large tensor networks. If you have to use an old version Julia,
30
39
you can avoid the overhead by overriding the `permutedims!` is `LinearAlgebra`, i.e. add the following code to your own project.
31
40
32
41
```julia
@@ -43,7 +52,7 @@ end
43
52
44
53
## Examples
45
54
46
-
Let us use the Petersen graph as an example, we first generate its tensor network contraction tree.
55
+
In this example, we will show how to compute the independent set properties of the Petersen graph, we first generate its tensor network contraction tree.
Copy file name to clipboardExpand all lines: docs/src/performancetips.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,31 @@ One can check the time, space and read-write complexity with the following funct
28
28
29
29
```julia
30
30
julia>timespacereadwrite_complexity(problem)
31
+
(21.90683335864693, 17.0, 20.03588509836998)
31
32
```
32
33
33
-
The return values are `log2` of the the number of iterations, the number elements in the max tensor and the number of read-write operations to tensor elements.
34
+
The return values are `log2` of the the number of iterations, the number elements in the largest tensor during contraction and the number of read-write operations to tensor elements.
35
+
In this example, the number of `+` and `*` operations are both `\sim 2^{21.9}`
36
+
and the number of read-write operations are `\sim 2^{20}`.
37
+
The largest tensor size is ``2^17``, one can check the element size by typing
38
+
```julia
39
+
julia>sizeof(TropicalF64)
40
+
8
41
+
42
+
julia>sizeof(TropicalF32)
43
+
4
44
+
45
+
julia>sizeof(StaticBitVector{200,4})
46
+
32
47
+
48
+
julia>sizeof(TruncatedPoly{5,Float64,Float64})
49
+
48
50
+
```
51
+
52
+
!!! note
53
+
* The actual run time memory can be several times larger than the size of the maximum tensor.
54
+
There is no constant bound for the factor, an empirical value for it is 3x.
55
+
* For mutable types like [`Polynomial`](@ref) and [`ConfigEnumerater`](@ref), the `sizeof` function does not measure the actual element size.
34
56
35
57
## GEMM for Tropical numbers
36
58
You can speed up the Tropical number matrix multiplication when computing `SizeMax()` by using the Tropical GEMM routines implemented in package [`TropicalGEMM.jl`](https://github.com/TensorBFS/TropicalGEMM.jl/).
Copy file name to clipboardExpand all lines: examples/IndependentSet.jl
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,13 @@ locations = [[rot15(0.0, 1.0, i) for i=0:4]..., [rot15(0.0, 0.6, i) for i=0:4]..
15
15
16
16
show_graph(graph; locs=locations)
17
17
18
+
# In order to display your plot with [`show_graph`](@ref), you need to call this function in
19
+
# * a [VSCode](https://github.com/julia-vscode/julia-vscode) editor,
20
+
# * a [Jupyter](https://github.com/JunoLab/Juno.jl) notebook,
21
+
# * or a [Pluto](https://github.com/fonsp/Pluto.jl) notebook,
22
+
#
23
+
# rather than a Julia REPL that does not have a graphical display.
24
+
18
25
# ## Tensor network representation
19
26
# Let ``G=(V,E)`` be the target graph that we want to solve.
20
27
# The tensor network representation map a vertex ``i\in V`` to a label ``s_i \in \{0, 1\}`` of dimension ``2`` in a tensor network, where we use ``0`` (``1``) to denote a vertex is absent (present) in the set.
@@ -47,7 +54,7 @@ problem = IndependentSet(graph; optimizer=TreeSA());
47
54
48
55
timespacereadwrite_complexity(problem)
49
56
50
-
# The return values are `log2` of the the number of iterations, the number elements in the tensor with maximum size during contraction and the number of tensor element read-write operations.
57
+
# The return values are `log2` of the the number of iterations, the number elements in the largest tensor during contraction and the number of tensor element read-write operations.
51
58
# For more information about how to improve the contraction order, please check the [Performance Tips](@ref).
0 commit comments