@@ -30,7 +30,6 @@ function classicalisingmpo(β; J=1.0, h=0.0)
3030 return statmechmpo (β, (s1, s2) -> - J * (- 1 )^ (s1 != s2) - h / 2 * (s1 == 1 + s2 == 1 ), 2 )
3131end
3232
33-
3433function exactZ (β)
3534 function quad_midpoint (f, a, b, N)
3635 h = (b - a) / N
8079 @testset " Using $(typeof (alg)) with χ = $(alg. bonddim) " for (alg, tol) in zip (
8180 algs, (1e-3 , 1e-6 , 1e-9 , 1e-3 , 1e-6 , 1e-9 )
8281 )
83- rt = @constinferred (initialize (alg, zbulk ))
84- st = @constinferred (newproblem (alg, zbulk, rt))
82+ rt = @constinferred (initialize (zbulk, alg ))
83+ st = @constinferred (newcontraction ( zbulk, rt; alg = alg ))
8584
8685 runcontraction! (st)
8786
101100 @testset " Using $(typeof (alg)) with χ = $(alg. trunc. dim) " for (alg, tol) in zip (
102101 trgalgs, (1e-2 , 1e-3 , 1e-4 )
103102 )
104- rt = @constinferred (initialize (alg, zbulk ))
105- st = @constinferred (newproblem (alg, zbulk, rt))
103+ rt = @constinferred (initialize (zbulk, alg ))
104+ st = @constinferred (newcontraction ( zbulk, rt; alg = alg ))
106105
107106 runcontraction! (st)
108107
@@ -111,58 +110,59 @@ end
111110 @test abs (z_val[1 , 1 ]) ≈ z_exact atol = tol
112111 end
113112 end
114-
115- @testset " Interacting dimers" verbose = true begin
116- β = 1 / 0.85
117-
118- a = zeros (4 , 4 , 4 , 4 )
119- b = zeros (4 , 4 , 4 , 4 )
120-
121- for I in CartesianIndices (a)
122- if I[1 ] == mod (I[2 ] + 1 , 1 : 4 ) == mod (I[3 ] + 2 , 1 : 4 ) == mod (I[4 ] + 3 , 1 : 4 )
123- a[I] = 1
113+ #=
114+ @testset "Interacting dimers" verbose = true begin
115+ β = 1 / 0.85
116+
117+ a = zeros(4, 4, 4, 4)
118+ b = zeros(4, 4, 4, 4)
119+
120+ for I in CartesianIndices(a)
121+ if I[1] == mod(I[2] + 1, 1:4) == mod(I[3] + 2, 1:4) == mod(I[4] + 3, 1:4)
122+ a[I] = 1
123+ end
124+ if I[1] == mod(I[2] - 1, 1:4) == mod(I[3] - 2, 1:4) == mod(I[4] - 3, 1:4)
125+ b[I] = 1
126+ end
124127 end
125- if I[1 ] == mod (I[2 ] - 1 , 1 : 4 ) == mod (I[3 ] - 2 , 1 : 4 ) == mod (I[4 ] - 3 , 1 : 4 )
126- b[I] = 1
127- end
128- end
129128
130- q = sqrt ([1 0 0 0 ; 0 exp (β / 2 ) 1 1 ; 0 1 1 1 ; 0 1 1 exp (β / 2 )])
129+ q = sqrt([1 0 0 0; 0 exp(β / 2) 1 1; 0 1 1 1; 0 1 1 exp(β / 2)])
131130
132- qh = diagm ([1 , - 1 , 1 , - 1 ]) * q
133- qv = diagm ([- 1 , 1 , - 1 , 1 ]) * q
131+ qh = diagm([1, -1, 1, -1]) * q
132+ qv = diagm([-1, 1, -1, 1]) * q
134133
135- @tensoropt aa[ii, jj, kk, ll] :=
136- a[i, j, k, l] * q[i, ii] * q[j, jj] * q[k, kk] * q[l, ll]
137- @tensoropt bb[ii, jj, kk, ll] :=
138- b[i, j, k, l] * q[i, ii] * q[j, jj] * q[k, kk] * q[l, ll]
134+ @tensoropt aa[ii, jj, kk, ll] :=
135+ a[i, j, k, l] * q[i, ii] * q[j, jj] * q[k, kk] * q[l, ll]
136+ @tensoropt bb[ii, jj, kk, ll] :=
137+ b[i, j, k, l] * q[i, ii] * q[j, jj] * q[k, kk] * q[l, ll]
139138
140- δa = zeros (4 , 4 )
141- δa[1 , 1 ] = δa[3 , 3 ] = 1
142- δa[2 , 2 ] = δa[4 , 4 ] = - 1
139+ δa = zeros(4, 4)
140+ δa[1, 1] = δa[3, 3] = 1
141+ δa[2, 2] = δa[4, 4] = -1
143142
144- @tensoropt aad[i, j, k, l] := a[ii, j, k, l] * δa[i, ii]
145- @tensoropt bbd[i, j, k, l] := b[ii, j, k, l] * δa[i, ii]
143+ @tensoropt aad[i, j, k, l] := a[ii, j, k, l] * δa[i, ii]
144+ @tensoropt bbd[i, j, k, l] := b[ii, j, k, l] * δa[i, ii]
146145
147- s = ℂ^ 4
146+ s = ℂ^4
148147
149- A = TensorMap (aa, one (s), s * s * s' * s' )
150- B = TensorMap (bb, one (s), s * s * s' * s' )
148+ A = TensorMap(aa, one(s), s * s * s' * s')
149+ B = TensorMap(bb, one(s), s * s * s' * s')
151150
152- AD = TensorMap (aad, one (s), s * s * s' * s' )
153- BD = TensorMap (bbd, one (s), s * s * s' * s' )
151+ AD = TensorMap(aad, one(s), s * s * s' * s')
152+ BD = TensorMap(bbd, one(s), s * s * s' * s')
154153
155- alg = VUMPS (; bonddim= 5 , maxiter= 1000 )
154+ alg = VUMPS(; bonddim=5, maxiter=1000)
156155
157- bulk = UnitCell (([A B; B A]))
158- dbulk = UnitCell (([AD BD; BD AD]))
156+ bulk = UnitCell(([A B; B A]))
157+ dbulk = UnitCell(([AD BD; BD AD]))
159158
160- st = initialize (bulk, alg)
161- dst = initialize (dbulk, alg)
159+ st = initialize(bulk, alg)
160+ dst = initialize(dbulk, alg)
162161
163- sto = calculate (st)
164- contract (sto. tensors, dbulk) ./ contract (sto. tensors, bulk)
165- end
162+ sto = calculate(st)
163+ contract(sto.tensors, dbulk) ./ contract(sto.tensors, bulk)
164+ end
165+ =#
166166end
167167
168168#=
0 commit comments