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
The returned object `tn` contains a field `code` that specifies the tensor network with optimized contraction order. To check the contraction complexity, please type
39
-
```julia
40
-
julia>contraction_complexity(problem)
28
+
```@repl performance
29
+
contraction_complexity(tn)
41
30
```
42
31
43
32
The returned object contains log2 values of the number of multiplications, the number elements in the largest tensor during contraction and the number of read-write operations to tensor elements.
44
33
45
-
```julia
46
-
julia> p1 =probability(tn)
34
+
```@repl performance
35
+
probability(tn)
47
36
```
48
37
49
38
## Slicing technique
50
39
51
40
For large scale applications, it is also possible to slice over certain degrees of freedom to reduce the space complexity, i.e.
52
41
loop and accumulate over certain degrees of freedom so that one can have a smaller tensor network inside the loop due to the removal of these degrees of freedom.
53
42
In the [`TreeSA`](@ref) optimizer, one can set `nslices` to a value larger than zero to turn on this feature.
As a comparision we slice over 5 degrees of freedom, which can reduce the space complexity by at most 5.
43
+
As a comparison we slice over 5 degrees of freedom, which can reduce the space complexity by at most 5.
63
44
In this application, the slicing achieves the largest possible space complexity reduction 5, while the time and read-write complexity are only increased by less than 1,
64
45
i.e. the peak memory usage is reduced by a factor ``32``, while the (theoretical) computing time is increased by at a factor ``< 2``.
0 commit comments