From a643644984ae147ecb791c52bfdc21d0da5b2ed0 Mon Sep 17 00:00:00 2001 From: Paul Brehmer Date: Wed, 17 Jul 2024 14:02:57 +0200 Subject: [PATCH] Undo updated row/column indexing convention in mpskit_glue --- src/mpskit_glue/transferpepo_environments.jl | 18 ++++++++---------- src/mpskit_glue/transferpeps_environments.jl | 15 +++++++-------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/mpskit_glue/transferpepo_environments.jl b/src/mpskit_glue/transferpepo_environments.jl index 05ab9479..e6f00161 100644 --- a/src/mpskit_glue/transferpepo_environments.jl +++ b/src/mpskit_glue/transferpepo_environments.jl @@ -30,15 +30,14 @@ function MPSKit.mixed_fixpoints( righties = PeriodicArray{envtype,2}(undef, numrows, numcols) @threads for cr in 1:numrows - c_above = above[cr - 1] - O_middle = O[cr] + c_above = above[cr] c_below = below[cr + 1] (L0, R0) = init[cr] @sync begin Threads.@spawn begin - E_LL = TransferMatrix($c_above.AL, $O_middle, $c_below.AL) + E_LL = TransferMatrix($c_above.AL, $O[cr], $c_below.AL) (_, Ls, convhist) = eigsolve(flip(E_LL), $L0, 1, :LM, $solver) convhist.converged < 1 && @info "left eigenvalue failed to converge $(convhist.normres)" @@ -46,7 +45,7 @@ function MPSKit.mixed_fixpoints( end Threads.@spawn begin - E_RR = TransferMatrix($c_above.AR, $O_middle, $c_below.AR) + E_RR = TransferMatrix($c_above.AR, $O[cr], $c_below.AR) (_, Rs, convhist) = eigsolve(E_RR, $R0, 1, :LM, $solver) convhist.converged < 1 && @info "right eigenvalue failed to converge $(convhist.normres)" @@ -58,7 +57,7 @@ function MPSKit.mixed_fixpoints( for loc in 2:numcols lefties[cr, loc] = lefties[cr, loc - 1] * - TransferMatrix(c_above.AL[loc - 1], O_middle[loc - 1], c_below.AL[loc - 1]) + TransferMatrix(c_above.AL[loc - 1], O[cr, loc - 1], c_below.AL[loc - 1]) end renormfact::scalartype(T) = dot(c_below.CR[0], PEPO_∂∂C(L0, R0) * c_above.CR[0]) @@ -68,9 +67,8 @@ function MPSKit.mixed_fixpoints( for loc in (numcols - 1):-1:1 righties[cr, loc] = - TransferMatrix( - c_above.AR[loc + 1], O_middle[loc + 1], c_below.AR[loc + 1] - ) * righties[cr, loc + 1] + TransferMatrix(c_above.AR[loc + 1], O[cr, loc + 1], c_below.AR[loc + 1]) * + righties[cr, loc + 1] renormfact = dot( c_below.CR[loc], @@ -92,12 +90,12 @@ function gen_init_fps(above::MPSMultiline, O::TransferPEPOMultiline, below::MPSM rand, scalartype(T), left_virtualspace(below, cr + 1, 0) * prod(adjoint.(west_spaces(O[cr], 1))), - left_virtualspace(above, cr - 1, 0), + left_virtualspace(above, cr, 0), ) R0::T = TensorMap( rand, scalartype(T), - right_virtualspace(above, cr - 1, 0) * prod(adjoint.(east_spaces(O[cr], 1))), + right_virtualspace(above, cr, 0) * prod(adjoint.(east_spaces(O[cr], 1))), right_virtualspace(below, cr + 1, 0), ) (L0, R0) diff --git a/src/mpskit_glue/transferpeps_environments.jl b/src/mpskit_glue/transferpeps_environments.jl index 0648fba8..d8b1cf47 100644 --- a/src/mpskit_glue/transferpeps_environments.jl +++ b/src/mpskit_glue/transferpeps_environments.jl @@ -32,15 +32,14 @@ function MPSKit.mixed_fixpoints( righties = PeriodicArray{envtype,2}(undef, numrows, numcols) @threads for cr in 1:numrows - c_above = above[cr - 1] - O_middle = O[cr] + c_above = above[cr] c_below = below[cr + 1] (L0, R0) = init[cr] @sync begin Threads.@spawn begin - E_LL = TransferMatrix($c_above.AL, $O_middle, $c_below.AL) + E_LL = TransferMatrix($c_above.AL, $O[cr], $c_below.AL) (_, Ls, convhist) = eigsolve(flip(E_LL), $L0, 1, :LM, $solver) convhist.converged < 1 && @info "left eigenvalue failed to converge $(convhist.normres)" @@ -48,7 +47,7 @@ function MPSKit.mixed_fixpoints( end Threads.@spawn begin - E_RR = TransferMatrix($c_above.AR, $O_middle, $c_below.AR) + E_RR = TransferMatrix($c_above.AR, $O[cr], $c_below.AR) (_, Rs, convhist) = eigsolve(E_RR, $R0, 1, :LM, $solver) convhist.converged < 1 && @info "right eigenvalue failed to converge $(convhist.normres)" @@ -60,7 +59,7 @@ function MPSKit.mixed_fixpoints( for loc in 2:numcols lefties[cr, loc] = lefties[cr, loc - 1] * - TransferMatrix(c_above.AL[loc - 1], O_middle[loc - 1], c_below.AL[loc - 1]) + TransferMatrix(c_above.AL[loc - 1], O[cr, loc - 1], c_below.AL[loc - 1]) end renormfact::scalartype(T) = dot(c_below.CR[0], PEPS_∂∂C(L0, R0) * c_above.CR[0]) @@ -70,7 +69,7 @@ function MPSKit.mixed_fixpoints( for loc in (numcols - 1):-1:1 righties[cr, loc] = - TransferMatrix(c_above.AR[loc + 1], O_middle[loc + 1], c_below.AR[loc + 1]) * + TransferMatrix(c_above.AR[loc + 1], O[cr, loc + 1], c_below.AR[loc + 1]) * righties[cr, loc + 1] renormfact = dot( @@ -95,12 +94,12 @@ function gen_init_fps(above::MPSMultiline, O::TransferPEPSMultiline, below::MPSM left_virtualspace(below, cr + 1, 0) * space(O[cr].top[1], 5)' * space(O[cr].bot[1], 5), - left_virtualspace(above, cr - 1, 0), + left_virtualspace(above, cr, 0), ) R0::T = TensorMap( rand, scalartype(T), - right_virtualspace(above, cr - 1, 0) * + right_virtualspace(above, cr, 0) * space(O[cr].top[1], 3)' * space(O[cr].bot[1], 3), right_virtualspace(below, cr + 1, 0),