diff --git a/src/algorithms/approximate/idmrg.jl b/src/algorithms/approximate/idmrg.jl index 0a80603b..7e18cac9 100644 --- a/src/algorithms/approximate/idmrg.jl +++ b/src/algorithms/approximate/idmrg.jl @@ -1,4 +1,4 @@ -function approximate(ost::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMultiline}, +function approximate(ost::MultilineMPS, toapprox::Tuple{<:MPOMultiline,<:MultilineMPS}, alg::IDMRG1, oenvs=environments(ost, toapprox)) ψ = copy(ost) mpo, above = toapprox @@ -52,12 +52,12 @@ function approximate(ost::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMult end end - nst = MPSMultiline(map(x -> x, ψ.AR); tol=alg.tol_gauge) + nst = MultilineMPS(map(x -> x, ψ.AR); tol=alg.tol_gauge) nenvs = environments(nst, toapprox) return nst, nenvs, ϵ end -function approximate(ost::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMultiline}, +function approximate(ost::MultilineMPS, toapprox::Tuple{<:MPOMultiline,<:MultilineMPS}, alg::IDMRG2, oenvs=environments(ost, toapprox)) length(ost) < 2 && throw(ArgumentError("unit cell should be >= 2")) mpo, above = toapprox @@ -139,7 +139,7 @@ function approximate(ost::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMult end end - nst = MPSMultiline(map(x -> x, ψ.AR); tol=alg.tol_gauge) + nst = MultilineMPS(map(x -> x, ψ.AR); tol=alg.tol_gauge) nenvs = environments(nst, toapprox) return nst, nenvs, ϵ end diff --git a/src/algorithms/changebonds/changebonds.jl b/src/algorithms/changebonds/changebonds.jl index 0f06d21c..0c35bbc8 100644 --- a/src/algorithms/changebonds/changebonds.jl +++ b/src/algorithms/changebonds/changebonds.jl @@ -36,7 +36,7 @@ function _expand!(ψ::InfiniteMPS, AL′::PeriodicVector, AR′::PeriodicVector) end return normalize!(ψ) end -function _expand!(ψ::MPSMultiline, AL′::PeriodicMatrix, AR′::PeriodicMatrix) +function _expand!(ψ::MultilineMPS, AL′::PeriodicMatrix, AR′::PeriodicMatrix) for i in 1:size(ψ, 1) _expand!(ψ[i], AL′[i, :], AR′[i, :]) end diff --git a/src/algorithms/expval.jl b/src/algorithms/expval.jl index 0f4caf52..ef97947f 100644 --- a/src/algorithms/expval.jl +++ b/src/algorithms/expval.jl @@ -118,9 +118,9 @@ function expectation_value(ψ::FiniteQP, mpo::FiniteMPO) return expectation_value(convert(FiniteMPS, ψ), mpo) end function expectation_value(ψ::InfiniteMPS, mpo::InfiniteMPO, envs...) - return expectation_value(convert(MPSMultiline, ψ), convert(MPOMultiline, mpo), envs...) + return expectation_value(convert(MultilineMPS, ψ), convert(MPOMultiline, mpo), envs...) end -function expectation_value(ψ::MPSMultiline, O::MPOMultiline{<:Union{DenseMPO,SparseMPO}}, +function expectation_value(ψ::MultilineMPS, O::MPOMultiline{<:Union{DenseMPO,SparseMPO}}, envs::InfiniteMPOEnvironments=environments(ψ, O)) return prod(product(1:size(ψ, 1), 1:size(ψ, 2))) do (i, j) GL = leftenv(envs, i, j, ψ) @@ -130,7 +130,7 @@ function expectation_value(ψ::MPSMultiline, O::MPOMultiline{<:Union{DenseMPO,Sp conj(ψ.AC[i + 1, j][1 4; 8]) end end -function expectation_value(ψ::MPSMultiline, mpo::MPOMultiline, envs...) +function expectation_value(ψ::MultilineMPS, mpo::MPOMultiline, envs...) # TODO: fix environments return prod(x -> expectation_value(x...), zip(parent(ψ), parent(mpo))) end diff --git a/src/algorithms/grassmann.jl b/src/algorithms/grassmann.jl index 04b71497..9e6ab547 100644 --- a/src/algorithms/grassmann.jl +++ b/src/algorithms/grassmann.jl @@ -85,9 +85,9 @@ function ManifoldPoint(state::Union{InfiniteMPS,FiniteMPS}, envs) return ManifoldPoint(state, envs, g, Rhoreg) end -function ManifoldPoint(state::MPSMultiline, envs) +function ManifoldPoint(state::MultilineMPS, envs) # FIXME: add support for unitcells - @assert length(state.AL) == 1 "GradientGrassmann only supports MPSMultiline without unitcells for now" + @assert length(state.AL) == 1 "GradientGrassmann only supports MultilineMPS without unitcells for now" # TODO: this really should not use the operator from the environment f = expectation_value(state, envs.operator, envs) @@ -128,8 +128,8 @@ function fg(x::ManifoldPoint{T}) where {T<:Union{InfiniteMPS,FiniteMPS}} return real(f), g_prec end -function fg(x::ManifoldPoint{<:MPSMultiline}) - @assert length(x.state) == 1 "GradientGrassmann only supports MPSMultiline without unitcells for now" +function fg(x::ManifoldPoint{<:MultilineMPS}) + @assert length(x.state) == 1 "GradientGrassmann only supports MultilineMPS without unitcells for now" # the gradient I want to return is the preconditioned gradient! g_prec = map(enumerate(x.g)) do (i, cg) return PrecGrad(rmul!(copy(cg), x.state.CR[i]'), x.Rhoreg[i]) @@ -145,9 +145,9 @@ function fg(x::ManifoldPoint{<:MPSMultiline}) end """ -Retract a left-canonical MPSMultiline along Grassmann tangent `g` by distance `alpha`. +Retract a left-canonical MultilineMPS along Grassmann tangent `g` by distance `alpha`. """ -function retract(x::ManifoldPoint{<:MPSMultiline}, tg, alpha) +function retract(x::ManifoldPoint{<:MultilineMPS}, tg, alpha) g = reshape(tg, size(x.state)) nal = similar(x.state.AL) @@ -157,7 +157,7 @@ function retract(x::ManifoldPoint{<:MPSMultiline}, tg, alpha) h[i] = PrecGrad(th) end - nstate = MPSKit.MPSMultiline(nal, x.state.CR[:, end]) + nstate = MPSKit.MultilineMPS(nal, x.state.CR[:, end]) newpoint = ManifoldPoint(nstate, x.envs) return newpoint, h[:]