forked from JoeyT1994/TensorNetworkQuantumSimulator.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloopcorrections.jl
More file actions
38 lines (29 loc) · 1.02 KB
/
loopcorrections.jl
File metadata and controls
38 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using TensorNetworkQuantumSimulator
using ITensors
using LinearAlgebra: norm
using EinExprs: Greedy
using Random
Random.seed!(1634)
function main()
nx, ny = 4, 4
χ = 3
ITensors.disable_warn_order()
gs = [
(named_grid((nx, 1)), "line", 0),
(named_hexagonal_lattice_graph(nx, ny), "hexagonal", 6),
(named_grid((nx, ny)), "square", 4),
]
for (g, g_str, smallest_loop_size) in gs
println("Testing for $g_str lattice with $(nv(g)) vertices")
ψ = random_tensornetworkstate(ComplexF32, g, "S=1/2"; bond_dimension = χ)
ψ = normalize(ψ; alg = "bp")
norm_bp = norm(ψ; alg = "bp")
norm_loopcorrected = norm(ψ; alg = "loopcorrections", max_configuration_size = 2 * (smallest_loop_size) - 1)
norm_exact = norm(ψ; alg = "exact")
println("Bp Value for norm is $norm_bp")
println("1st Order Loop Corrected Value for norm is $norm_loopcorrected")
println("Exact Value for norm is $norm_exact")
end
return
end
main()