Skip to content

Commit

Permalink
Remove gaugefix from regular ctmrg
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Aug 13, 2024
1 parent 5021939 commit 5fdb461
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions src/algorithms/ctmrg/ctmrg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,35 +111,24 @@ function MPSKit.leading_boundary(envinit, state, alg::CTMRG)

return LoggingExtras.withlevel(; alg.verbosity) do
ctmrg_loginit!(log, η, N)
local iter
for outer iter in 1:(alg.maxiter)
for iter in 1:(alg.maxiter)
env, = ctmrg_iter(state, env, alg) # Grow and renormalize in all 4 directions

η, CS, TS = calc_convergence(env, CS, TS)
N = norm(state, env)
ctmrg_logiter!(log, iter, η, N)

(iter > alg.miniter && η <= alg.tol) && break
end

# Do one final iteration that does not change the spaces
alg_fixed = CTMRG(;
verbosity=alg.verbosity,
svd_alg=alg.projector_alg.svd_alg,
trscheme=FixedSpaceTruncation(),
ctmrgscheme=ctmrgscheme(alg),
)
env′, = ctmrg_iter(state, env, alg_fixed)
envfix, = gauge_fix(env, env′)

η = calc_elementwise_convergence(envfix, env; atol=alg.tol^(1 / 2))
N = norm(state, envfix)

if η < alg.tol^(1 / 2)
ctmrg_logfinish!(log, iter, η, N)
else
ctmrg_logcancel!(log, iter, η, N)
if η alg.tol
ctmrg_logfinish!(log, iter, η, N)
break
end
if iter == alg.maxiter
ctmrg_logcancel!(log, iter, η, N)
else
ctmrg_logiter!(log, iter, η, N)
end
end
return envfix
return env
end
end

Expand Down

0 comments on commit 5fdb461

Please sign in to comment.