79
79
fast=false, valid=false, planar=false, connected=false, report=false)
80
80
sweep_contract(TN::TensorNetwork, χ, τ;
81
81
fast=false, valid=false, planar=false, connected=false, report=false)
82
+
82
83
Returns the contraction of the `TensorNetwork TN`, or the `LabelledTensorNetwork LTN` using
83
84
the sweepline contraction algorithm of `arXiv:2101.04125`. The MPS is truncated down to a
84
85
bond dimension of `χ` whenever any bond dimension exceeds `τ`.
86
+
85
87
By default the network is checked for validity, planarised, and sweep-connected, where
86
88
necessary. The keyword flags `valid`, `planar`, and `connected` can be used to skip these,
87
89
or the flag `fast` can be used to skip them all. If these flags are enabled then contraction
88
90
may fail on poorly formed networks.
91
+
89
92
To avoid underflow/overflow issues the contraction value of the network is returned as a
90
93
tuple `(f::Float64, i::Int64)` where `1≦f<2` or `f` is `0`, representing a value of `f*2^i`.
91
94
The function `ldexp` can be used to convert this back to a Float64.
95
+
92
96
`sweep_contract` is non-mutating and acts upon a deep copy of the network, where possible
93
97
use the more efficient mutating version `sweep_contract!`.
94
98
"""
@@ -107,6 +111,7 @@ sweep_contract!(deepcopy(TN), χ, τ;
107
111
fast=false, valid=false, planar=false, connected=false, report=false)
108
112
sweep_contract!(TN::TensorNetwork, χ, τ;
109
113
fast=false, valid=false, planar=false, connected=false, report=false)
114
+
110
115
The mutating form of `sweep_contract`.
111
116
"""
112
117
sweep_contract! (LTN:: LabelledTensorNetwork , χ:: Int , τ:: Int ;
0 commit comments