diff --git a/src/algorithms/expval.jl b/src/algorithms/expval.jl index 0668a82c..cc119fe8 100644 --- a/src/algorithms/expval.jl +++ b/src/algorithms/expval.jl @@ -162,19 +162,19 @@ expectation_value(Ψ::WindowMPS,windowH::Window, at::Int64) = expectation_value( expectation_value(Ψ::WindowMPS,windowH::Window, windowEnvs=environments(Ψ,windowH)) = expectation_value(Ψ,windowH, 0., windowEnvs) # with time argument -function expectation_value(Ψ::WindowMPS,windowH::Window,t::Number,at::Int64) +function expectation_value(Ψ::WindowMPS,windowOp::Window,t::Number,at::Int64) if at < 1 - return expectation_value(Ψ.left_gs,windowH.left,t,at) + return expectation_value(Ψ.left_gs,windowOp.left,t,at) elseif 1 <= at <= length(Ψ.window) - return expectation_value(Ψ,windowH.middle,t,at) + return expectation_value(Ψ,windowOp.middle,t,at) else - return expectation_value(Ψ.right_gs,windowH.right,t,at) + return expectation_value(Ψ.right_gs,windowOp.right,t,at) end end function expectation_value(Ψ::WindowMPS,windowH::Window,t::Number,windowEnvs::Window{C,D,C}=environments(Ψ,windowH)) where {C <: Union{MultipleEnvironments,Cache}, D <: Union{MultipleEnvironments,Cache}} left = expectation_value(Ψ.left_gs,windowH.left,t,windowEnvs.left) - middle = expectation_value(Ψ,windowH.middle,t,windowEnvs.middle) + middle = expectation_value(Ψ.window,windowH.middle,t,windowEnvs.middle) right = expectation_value(Ψ.right_gs,windowH.right,t,windowEnvs.right) return [left.data...,middle...,right.data...] end \ No newline at end of file diff --git a/src/algorithms/timestep/windowtdvp.jl b/src/algorithms/timestep/windowtdvp.jl index 4208abaa..22bc064d 100644 --- a/src/algorithms/timestep/windowtdvp.jl +++ b/src/algorithms/timestep/windowtdvp.jl @@ -98,18 +98,18 @@ function timestep!(Ψ::WindowMPS, H::Window, t::Number, dt::Number,alg::TDVP,env #left to right sweep on window for i in 1:(length(Ψ)-1) h_ac = ∂∂AC(i,Ψ,H.middle,env.middle); - Ψ.AC[i], converged, convhist = integrate(h_ac,Ψ.AC[i],t,-1im,dt/2,alg.integrator) + Ψ.AC[i], converged, convhist = integrate(h_ac,Ψ.AC[i],t+dt/2,-1im,dt/2,alg.integrator) converged == 0 && @info "time evolving ac($i) failed $(convhist.normres)" h_c = ∂∂C(i,Ψ,H.middle,env.middle); - Ψ.CR[i], converged, convhist = integrate(h_c,Ψ.CR[i],t,-1im,-dt/2,alg.integrator) + Ψ.CR[i], converged, convhist = integrate(h_c,Ψ.CR[i],t+dt/2,-1im,-dt/2,alg.integrator) converged == 0 && @info "time evolving c($i) failed $(convhist.normres)" end h_ac = ∂∂AC(length(Ψ),Ψ,H.middle,env.middle); - Ψ.AC[end], converged, convhist = integrate(h_ac,Ψ.AC[end],t,-1im,dt/2,alg.integrator) + Ψ.AC[end], converged, convhist = integrate(h_ac,Ψ.AC[end],t+dt/2,-1im,dt/2,alg.integrator) converged == 0 && @info "time evolving ac($(length(Ψ))) failed $(convhist.normres)" @@ -159,7 +159,7 @@ function timestep!(Ψ::WindowMPS, H::Window, t::Number, dt::Number,alg::TDVP2,en for i in 1:(length(Ψ)-1) h_ac2 = ∂∂AC2(i,Ψ,H.middle,env.middle); ac2 = Ψ.AC[i]*_transpose_tail(Ψ.AR[i+1]); - ac2, converged, convhist = integrate(h_ac2,ac2,t,-1im,dt/2,alg.integrator) + ac2, converged, convhist = integrate(h_ac2,ac2,t+dt/2,-1im,dt/2,alg.integrator) converged == 0 && @info "time evolving ac2($i) failed $(convhist.normres)" (U,S,V) = tsvd(ac2, alg = TensorKit.SVD(), trunc = alg.trscheme); @@ -169,7 +169,7 @@ function timestep!(Ψ::WindowMPS, H::Window, t::Number, dt::Number,alg::TDVP2,en if i < length(Ψ) - 1 h_ac = ∂∂AC(i+1,Ψ,H.middle,env.middle); - Ψ.AC[i+1], converged, convhist = integrate(h_ac,Ψ.AC[i+1],t,-1im,-dt/2,alg.integrator) + Ψ.AC[i+1], converged, convhist = integrate(h_ac,Ψ.AC[i+1],t+dt/2,-1im,-dt/2,alg.integrator) converged == 0 && @info "time evolving ac($i) failed $(convhist.normres)" end