Skip to content

Commit

Permalink
add depth of sweep in zipper
Browse files Browse the repository at this point in the history
  • Loading branch information
annamariadziubyna committed Nov 27, 2023
1 parent efccf1c commit 3468565
Showing 1 changed file with 11 additions and 33 deletions.
44 changes: 11 additions & 33 deletions src/zipper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function zipper(
iters_svd = 1,
iters_var = 1,
Dtemp_multiplier = 2,
mode::Symbol = :Ising,
depth::Int = 0,
kwargs...
) where R <: Real
onGPU = ψ.onGPU && ϕ.onGPU
Expand All @@ -42,6 +42,8 @@ function zipper(
C = onGPU ? CUDA.ones(R, 1, 1, 1) : ones(R, 1, 1, 1)
mpo_li = last.sites)

d = (depth == 0) ? mpo_li : depth

Dtemp = Dtemp_multiplier * Dcut
out = copy(ϕ)
env = EnvironmentMixed(out, C, ψ, ϕ)
Expand Down Expand Up @@ -125,49 +127,25 @@ function zipper(
update_env_left!(env, :central)
_left_sweep_var_site!(env, :central; kwargs...)
for k in reverse.sites)
if mode == :RMF
if (i - 5) <= k < i
_left_sweep_var_site!(env, k; kwargs...)
end
else
if k < i
_left_sweep_var_site!(env, k; kwargs...)
end
if (i - d) <= k < i
_left_sweep_var_site!(env, k; kwargs...)
end
end
for k in ϕ.sites
if mode == :RMF
if (i - 5) <= k < i
_right_sweep_var_site!(env, k; kwargs...)
end
else
if k < i
_right_sweep_var_site!(env, k; kwargs...)
end
if (i - d) <= k < i
_right_sweep_var_site!(env, k; kwargs...)
end
end
_right_sweep_var_site!(env, :central; kwargs...)

for k in ϕ.sites
if mode == :RMF
if (i+5) >= k >= i
_right_sweep_var_site!(env, k; kwargs...)
end
else
if k >= i
_right_sweep_var_site!(env, k; kwargs...)
end
if (i + d) >= k >= i
_right_sweep_var_site!(env, k; kwargs...)
end
end
for k in reverse.sites)
if mode == :RMF
if (i+5) >= k >= i
_left_sweep_var_site!(env, k; kwargs...)
end
else
if k >= i
_left_sweep_var_site!(env, k; kwargs...)
end
if (i + d) >= k >= i
_left_sweep_var_site!(env, k; kwargs...)
end
end
update_env_right!(env, :central)
Expand Down

0 comments on commit 3468565

Please sign in to comment.