Skip to content

Commit c260733

Browse files
authored
Merge branch 'master' into finalizer
2 parents dc6f196 + a868108 commit c260733

27 files changed

+160
-160
lines changed

docs/src/lib/lib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
FiniteMPS
66
InfiniteMPS
77
WindowMPS
8-
MPSMultiline
8+
MultilineMPS
99
```
1010

1111
## Operators

docs/src/man/states.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ Such a set can be created by
133133

134134
```julia
135135
data = fill(TensorMap(rand,ComplexF64,ℂ^10*^2,ℂ^10),2,2);
136-
MPSMultiline(data);
136+
MultilineMPS(data);
137137
```
138-
MPSMultiline is also used extensively in as of yet unreleased peps code.
138+
MultilineMPS is also used extensively in as of yet unreleased peps code.
139139

140140
You can access properties by calling
141141
```julia
@@ -153,7 +153,7 @@ struct Multiline{T}
153153
end
154154
```
155155

156-
MPSMultiline/MPOMultiline are then defined as
156+
MultilineMPS/MultilineMPO are then defined as
157157
```julia
158-
const MPSMultiline = Multiline{<:InfiniteMPS}
159-
const MPOMultiline = Multiline{<:DenseMPO}
158+
const MultilineMPS = Multiline{<:InfiniteMPS}
159+
const MultilineMPO = Multiline{<:DenseMPO}

src/MPSKit.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using Base: @kwdef
1818
using LoggingExtras
1919

2020
# bells and whistles for mpses
21-
export InfiniteMPS, FiniteMPS, WindowMPS, MPSMultiline
21+
export InfiniteMPS, FiniteMPS, WindowMPS, MultilineMPS
2222
export PeriodicArray, PeriodicVector, PeriodicMatrix, WindowArray
2323
export MPSTensor
2424
export QP, LeftGaugedQP, RightGaugedQP
@@ -34,7 +34,7 @@ export braille
3434
export AbstractMPO
3535
export MPO, FiniteMPO, InfiniteMPO
3636
export MPOHamiltonian, FiniteMPOHamiltonian, InfiniteMPOHamiltonian
37-
export SparseMPO, DenseMPO, MPOMultiline
37+
export SparseMPO, DenseMPO, MultilineMPO
3838
export UntimedOperator, TimedOperator, MultipliedOperator, LazySum
3939

4040
export ∂C, ∂AC, ∂AC2, environments, expectation_value, effective_excitation_hamiltonian
@@ -83,7 +83,7 @@ include("utility/linearcombination.jl")
8383
# maybe we should introduce an abstract state type
8484
include("states/abstractmps.jl")
8585
include("states/infinitemps.jl")
86-
include("states/mpsmultiline.jl")
86+
include("states/multilinemps.jl")
8787
include("states/finitemps.jl")
8888
include("states/windowmps.jl")
8989
include("states/orthoview.jl")
@@ -93,7 +93,7 @@ include("states/ortho.jl")
9393
include("operators/abstractmpo.jl")
9494
include("operators/mpo.jl")
9595
include("operators/mpohamiltonian.jl") # the mpohamiltonian objects
96-
include("operators/mpomultiline.jl")
96+
include("operators/multilinempo.jl")
9797
include("operators/projection.jl")
9898
include("operators/timedependence.jl")
9999
include("operators/multipliedoperator.jl")

src/algorithms/approximate/idmrg.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function approximate(ost::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMultiline},
1+
function approximate(ost::MultilineMPS, toapprox::Tuple{<:MultilineMPO,<:MultilineMPS},
22
alg::IDMRG1, oenvs=environments(ost, toapprox))
33
ψ = copy(ost)
44
mpo, above = toapprox
@@ -52,12 +52,12 @@ function approximate(ost::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMult
5252
end
5353
end
5454

55-
nst = MPSMultiline(map(x -> x, ψ.AR); tol=alg.tol_gauge)
55+
nst = MultilineMPS(map(x -> x, ψ.AR); tol=alg.tol_gauge)
5656
nenvs = environments(nst, toapprox)
5757
return nst, nenvs, ϵ
5858
end
5959

60-
function approximate(ost::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMultiline},
60+
function approximate(ost::MultilineMPS, toapprox::Tuple{<:MultilineMPO,<:MultilineMPS},
6161
alg::IDMRG2, oenvs=environments(ost, toapprox))
6262
length(ost) < 2 && throw(ArgumentError("unit cell should be >= 2"))
6363
mpo, above = toapprox
@@ -139,7 +139,7 @@ function approximate(ost::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMult
139139
end
140140
end
141141

142-
nst = MPSMultiline(map(x -> x, ψ.AR); tol=alg.tol_gauge)
142+
nst = MultilineMPS(map(x -> x, ψ.AR); tol=alg.tol_gauge)
143143
nenvs = environments(nst, toapprox)
144144
return nst, nenvs, ϵ
145145
end

src/algorithms/approximate/vomps.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
function approximate::InfiniteMPS,
22
toapprox::Tuple{<:InfiniteMPO,<:InfiniteMPS}, algorithm,
33
envs=environments(ψ, toapprox))
4-
# PeriodicMPO's always act on MPSMultiline's. To avoid code duplication, define everything in terms of MPSMultiline's.
5-
multi, envs = approximate(convert(MPSMultiline, ψ),
6-
(convert(MPOMultiline, toapprox[1]),
7-
convert(MPSMultiline, toapprox[2])), algorithm, envs)
4+
# PeriodicMPO's always act on MultilineMPS's. To avoid code duplication, define everything in terms of MultilineMPS's.
5+
multi, envs = approximate(convert(MultilineMPS, ψ),
6+
(convert(MultilineMPO, toapprox[1]),
7+
convert(MultilineMPS, toapprox[2])), algorithm, envs)
88
ψ = convert(InfiniteMPS, multi)
99
return ψ, envs
1010
end
1111

12-
Base.@deprecate(approximate::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMultiline},
12+
Base.@deprecate(approximate::MultilineMPS, toapprox::Tuple{<:MultilineMPO,<:MultilineMPS},
1313
alg::VUMPS, envs...; kwargs...),
1414
approximate(ψ, toapprox,
1515
VOMPS(; alg.tol, alg.maxiter, alg.finalize,
1616
alg.verbosity, alg.alg_gauge, alg.alg_environments),
1717
envs...; kwargs...))
1818

19-
function approximate::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMultiline},
19+
function approximate::MultilineMPS, toapprox::Tuple{<:MultilineMPO,<:MultilineMPS},
2020
alg::VOMPS, envs=environments(ψ, toapprox))
2121
ϵ::Float64 = calc_galerkin(ψ, envs)
2222
temp_ACs = similar.(ψ.AC)
@@ -38,7 +38,7 @@ function approximate(ψ::MPSMultiline, toapprox::Tuple{<:MPOMultiline,<:MPSMulti
3838
end
3939

4040
alg_gauge = updatetol(alg.alg_gauge, iter, ϵ)
41-
ψ = MPSMultiline(temp_ACs, ψ.CR[:, end]; alg_gauge.tol, alg_gauge.maxiter)
41+
ψ = MultilineMPS(temp_ACs, ψ.CR[:, end]; alg_gauge.tol, alg_gauge.maxiter)
4242

4343
alg_environments = updatetol(alg.alg_environments, iter, ϵ)
4444
recalculate!(envs, ψ; alg_environments.tol)

src/algorithms/changebonds/changebonds.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function _expand!(ψ::InfiniteMPS, AL′::PeriodicVector, AR′::PeriodicVector)
3636
end
3737
return normalize!(ψ)
3838
end
39-
function _expand!::MPSMultiline, AL′::PeriodicMatrix, AR′::PeriodicMatrix)
39+
function _expand!::MultilineMPS, AL′::PeriodicMatrix, AR′::PeriodicMatrix)
4040
for i in 1:size(ψ, 1)
4141
_expand!(ψ[i], AL′[i, :], AR′[i, :])
4242
end

src/algorithms/changebonds/optimalexpand.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ end
3838

3939
function changebonds::InfiniteMPS, H::DenseMPO, alg::OptimalExpand,
4040
envs=environments(ψ, H))
41-
(nmψ, envs) = changebonds(convert(MPSMultiline, ψ), convert(MPOMultiline, H), alg, envs)
41+
(nmψ, envs) = changebonds(convert(MultilineMPS, ψ), convert(MultilineMPO, H), alg, envs)
4242
return (convert(InfiniteMPS, nmψ), envs)
4343
end
4444

45-
function changebonds::MPSMultiline, H, alg::OptimalExpand, envs=environments(ψ, H))
45+
function changebonds::MultilineMPS, H, alg::OptimalExpand, envs=environments(ψ, H))
4646
TL = eltype.AL)
4747
AL′ = PeriodicMatrix{TL}(undef, size.AL))
4848
TR = tensormaptype(spacetype(TL), 1, numind(TL) - 1, storagetype(TL))

src/algorithms/changebonds/randexpand.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function changebonds(ψ::InfiniteMPS, alg::RandExpand)
3333
return _expand(ψ, AL′, AR′)
3434
end
3535

36-
function changebonds::MPSMultiline, alg::RandExpand)
36+
function changebonds::MultilineMPS, alg::RandExpand)
3737
return Multiline(map(x -> changebonds(x, alg), ψ.data))
3838
end
3939

src/algorithms/changebonds/svdcut.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ end
6868
function changebonds::InfiniteMPO, alg::SvdCut)
6969
return convert(InfiniteMPO, changebonds(convert(InfiniteMPS, ψ), alg))
7070
end
71-
function changebonds::MPOMultiline, alg::SvdCut)
72-
return convert(MPOMultiline, changebonds(convert(MPSMultiline, ψ), alg))
71+
function changebonds::MultilineMPO, alg::SvdCut)
72+
return convert(MultilineMPO, changebonds(convert(MultilineMPS, ψ), alg))
7373
end
74-
function changebonds::MPSMultiline, alg::SvdCut)
74+
function changebonds::MultilineMPS, alg::SvdCut)
7575
return Multiline(map(x -> changebonds(x, alg), ψ.data))
7676
end
7777
function changebonds::InfiniteMPS, alg::SvdCut)

src/algorithms/derivatives.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ Base.:*(h::Union{MPO_∂∂C,MPO_∂∂AC,MPO_∂∂AC2}, v) = h(v);
3434
function ∂∂C(pos::Int, mps, operator::AbstractMPO, cache)
3535
return MPO_∂∂C(leftenv(cache, pos + 1, mps), rightenv(cache, pos, mps))
3636
end
37-
function ∂∂C(col::Int, mps, operator::MPOMultiline, envs)
37+
function ∂∂C(col::Int, mps, operator::MultilineMPO, envs)
3838
return MPO_∂∂C(leftenv(envs, col + 1, mps), rightenv(envs, col, mps))
3939
end
40-
function ∂∂C(row::Int, col::Int, mps, operator::MPOMultiline, envs)
40+
function ∂∂C(row::Int, col::Int, mps, operator::MultilineMPO, envs)
4141
return MPO_∂∂C(leftenv(envs, row, col + 1, mps), rightenv(envs, row, col, mps))
4242
end
4343

4444
function ∂∂AC(pos::Int, mps, operator::AbstractMPO, cache)
4545
return MPO_∂∂AC(operator[pos], leftenv(cache, pos, mps), rightenv(cache, pos, mps))
4646
end
47-
function ∂∂AC(row::Int, col::Int, mps, operator::MPOMultiline, envs)
47+
function ∂∂AC(row::Int, col::Int, mps, operator::MultilineMPO, envs)
4848
return MPO_∂∂AC(operator[row, col], leftenv(envs, row, col, mps),
4949
rightenv(envs, row, col, mps))
5050
end
51-
function ∂∂AC(col::Int, mps, operator::MPOMultiline, envs)
51+
function ∂∂AC(col::Int, mps, operator::MultilineMPO, envs)
5252
return MPO_∂∂AC(envs.operator[:, col], leftenv(envs, col, mps),
5353
rightenv(envs, col, mps))
5454
end;
@@ -57,11 +57,11 @@ function ∂∂AC2(pos::Int, mps, operator::AbstractMPO, cache)
5757
return MPO_∂∂AC2(operator[pos], operator[pos + 1], leftenv(cache, pos, mps),
5858
rightenv(cache, pos + 1, mps))
5959
end;
60-
function ∂∂AC2(col::Int, mps, operator::MPOMultiline, envs)
60+
function ∂∂AC2(col::Int, mps, operator::MultilineMPO, envs)
6161
return MPO_∂∂AC2(operator[:, col], operator[:, col + 1], leftenv(envs, col, mps),
6262
rightenv(envs, col + 1, mps))
6363
end
64-
function ∂∂AC2(row::Int, col::Int, mps, operator::MPOMultiline, envs)
64+
function ∂∂AC2(row::Int, col::Int, mps, operator::MultilineMPO, envs)
6565
return MPO_∂∂AC2(operator[row, col], operator[row, col + 1],
6666
leftenv(envs, row, col, mps), rightenv(envs, row, col + 1, mps))
6767
end

0 commit comments

Comments
 (0)