Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/schemes/ctm/onesite_ctm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ function CTM_init(T; bc = ones, bc_free = false)
if bc_free
V = Vps[1]
end
C = TensorMap(bc, elt, V ← V)
El, Eb, Et, Er = [TensorMap(bc, elt, V ⊗ Vps[i] ← V) for i in 1:4]
C = bc(elt, V ← V)
El, Eb, Et, Er = [bc(elt, V ⊗ Vps[i] ← V) for i in 1:4]
return C, C, C, C, El, Eb, Et, Er
end

Expand Down Expand Up @@ -122,7 +122,7 @@ end
function rotate_T(T; num = 1)
Tnew = copy(T)
for _ in 1:num
Tnew = permute(Tnew, (3, 1), (4, 2))
Tnew = permute(Tnew, ((3, 1), (4, 2)))
end
return Tnew
end
Expand Down Expand Up @@ -178,7 +178,7 @@ function run!(ctm::CTM, trunc::TruncationStrategy, criterion::maxiter; conv_crit
@infov 1 "Starting CTM calculation\n $(ctm)\n"
while crit
ES_new = step!(ctm, trunc)
if space(ES) == space(ES_new)
if size(ES) == size(ES_new)
normdiff = norm(ES - ES_new)
@infov 2 "Step $(steps + 1), |ES - ES_new| = $(normdiff)"
push!(hist, normdiff)
Expand All @@ -195,7 +195,7 @@ function run!(ctm::CTM, trunc::TruncationStrategy, criterion::maxiter; conv_crit
@infov 1 "CTM reached the maximum iteration $(steps)"
end
end
return hist
return lnz(ctm)
end

function Base.show(io::IO, scheme::CTM)
Expand Down
71 changes: 0 additions & 71 deletions test/finalize.jl

This file was deleted.

11 changes: 11 additions & 0 deletions test/schemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,17 @@ end
@test free_energy(data, ising_βc) ≈ f_onsager rtol = 1.0e-5
end

# ctm
@testset "CTM - Ising Model" begin
@info "CTM ising free energy"
scheme = CTM(T)

lz = run!(scheme, truncrank(32), maxiter(256))
fs = lz * -1 / ising_βc

@test fs ≈ f_onsager rtol = 1.0e-6
end

# ctm_TRG
@testset "ctm_TRG - Ising Model" begin
@info "ctm_TRG ising free energy"
Expand Down
Loading