Skip to content

Commit 522c56b

Browse files
authored
Update sweep_contract.jl
1 parent b3e7ac3 commit 522c56b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/sweep_contract.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,20 @@ end
7979
fast=false, valid=false, planar=false, connected=false, report=false)
8080
sweep_contract(TN::TensorNetwork, χ, τ;
8181
fast=false, valid=false, planar=false, connected=false, report=false)
82+
8283
Returns the contraction of the `TensorNetwork TN`, or the `LabelledTensorNetwork LTN` using
8384
the sweepline contraction algorithm of `arXiv:2101.04125`. The MPS is truncated down to a
8485
bond dimension of `χ` whenever any bond dimension exceeds `τ`.
86+
8587
By default the network is checked for validity, planarised, and sweep-connected, where
8688
necessary. The keyword flags `valid`, `planar`, and `connected` can be used to skip these,
8789
or the flag `fast` can be used to skip them all. If these flags are enabled then contraction
8890
may fail on poorly formed networks.
91+
8992
To avoid underflow/overflow issues the contraction value of the network is returned as a
9093
tuple `(f::Float64, i::Int64)` where `1≦f<2` or `f` is `0`, representing a value of `f*2^i`.
9194
The function `ldexp` can be used to convert this back to a Float64.
95+
9296
`sweep_contract` is non-mutating and acts upon a deep copy of the network, where possible
9397
use the more efficient mutating version `sweep_contract!`.
9498
"""
@@ -107,6 +111,7 @@ sweep_contract!(deepcopy(TN), χ, τ;
107111
fast=false, valid=false, planar=false, connected=false, report=false)
108112
sweep_contract!(TN::TensorNetwork, χ, τ;
109113
fast=false, valid=false, planar=false, connected=false, report=false)
114+
110115
The mutating form of `sweep_contract`.
111116
"""
112117
sweep_contract!(LTN::LabelledTensorNetwork, χ::Int, τ::Int;

0 commit comments

Comments
 (0)