From 5ef72372b1ff35721d928465c089d8292255ac98 Mon Sep 17 00:00:00 2001 From: lkdvos Date: Mon, 30 Oct 2023 11:53:36 +1100 Subject: [PATCH] small formatting --- src/algorithms/approximate/fvomps.jl | 5 +++-- src/algorithms/derivatives.jl | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/algorithms/approximate/fvomps.jl b/src/algorithms/approximate/fvomps.jl index ce4afc5a4..d93cc93ce 100644 --- a/src/algorithms/approximate/fvomps.jl +++ b/src/algorithms/approximate/fvomps.jl @@ -1,5 +1,6 @@ -function approximate(state, toapprox, alg::Union{DMRG,DMRG2}, envs...) - return approximate!(copy(state), toapprox, alg, envs...) +# dispatch to in-place method +function approximate(ψ, toapprox, alg::Union{DMRG,DMRG2}, envs...) + return approximate!(copy(ψ), toapprox, alg, envs...) end function approximate!(init::AbstractFiniteMPS, sq, alg, envs=environments(init, sq)) diff --git a/src/algorithms/derivatives.jl b/src/algorithms/derivatives.jl index 3c6453f23..9470efc6e 100644 --- a/src/algorithms/derivatives.jl +++ b/src/algorithms/derivatives.jl @@ -228,6 +228,7 @@ function c_proj(row, col, below, envs::PerMPOInfEnv) ) end +# TODO: rewrite this to not use operator from cache? function ac_proj(pos, below, envs) le = leftenv(envs, pos, below) re = rightenv(envs, pos, below) @@ -316,7 +317,7 @@ end function ∂∂AC(pos::Int, state, opp::ProjectionOperator, env) return AC_EffProj(opp.ket.AC[pos], leftenv(env, pos, state), rightenv(env, pos, state)) -end; +end function ∂∂AC2(pos::Int, state, opp::ProjectionOperator, env) return AC2_EffProj( opp.ket.AC[pos], @@ -324,4 +325,4 @@ function ∂∂AC2(pos::Int, state, opp::ProjectionOperator, env) leftenv(env, pos, state), rightenv(env, pos + 1, state), ) -end; +end