Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/algorithms/groundstate/find_groundstate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ function find_groundstate(
tol = Defaults.tol, maxiter = Defaults.maxiter,
verbosity = Defaults.verbosity, trscheme = nothing
)
if isa(ψ, InfiniteMPS)
if GeometryStyle(ψ) == InfiniteChainStyle()
alg = VUMPS(; tol = max(1.0e-4, tol), verbosity, maxiter)
if tol < 1.0e-4
alg = alg & GradientGrassmann(; tol = tol, maxiter, verbosity)
end
if !isnothing(trscheme)
alg = IDMRG2(; tol = min(1.0e-2, 100tol), verbosity, trscheme) & alg
end
elseif isa(ψ, AbstractFiniteMPS)
elseif GeometryStyle(ψ) == FiniteChainStyle()
alg = DMRG(; tol, maxiter, verbosity)
if !isnothing(trscheme)
alg = DMRG2(; tol = min(1.0e-2, 100tol), verbosity, trscheme) & alg
Expand Down
1 change: 1 addition & 0 deletions src/algorithms/groundstate/idmrg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ end

function find_groundstate(mps, operator, alg::alg_type, envs = environments(mps, operator)) where {alg_type <: Union{<:IDMRG, <:IDMRG2}}
(length(mps) ≤ 1 && alg isa IDMRG2) && throw(ArgumentError("unit cell should be >= 2"))
GeometryStyle(operator, mps) != InfiniteChainStyle() && throw(ArgumentError("IDMRG only supports infinite systems."))
log = alg isa IDMRG ? IterLog("IDMRG") : IterLog("IDMRG2")
mps = copy(mps)
iter = 0
Expand Down
3 changes: 2 additions & 1 deletion src/algorithms/groundstate/vumps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct VUMPSState{S, O, E}
end

function find_groundstate(
mps::InfiniteMPS, operator, alg::VUMPS, envs = environments(mps, operator)
mps, operator, alg::VUMPS, envs = environments(mps, operator)
)
return dominant_eigsolve(operator, mps, alg, envs; which = :SR)
end
Expand All @@ -55,6 +55,7 @@ function dominant_eigsolve(
operator, mps, alg::VUMPS, envs = environments(mps, operator);
which
)
GeometryStyle(operator, mps) != InfiniteChainStyle() && throw(ArgumentError("VUMPS only supports infinite systems."))
log = IterLog("VUMPS")
iter = 0
ϵ = calc_galerkin(mps, operator, mps, envs)
Expand Down
3 changes: 3 additions & 0 deletions src/operators/lazysum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ Base.complex(x::LazySum) = LazySum(complex.(x.ops))
TimeDependence(x::LazySum) = istimed(x) ? TimeDependent() : NotTimeDependent()
istimed(x::LazySum) = any(istimed, x)

OperatorStyle(::Type{LazySum{O}}) where {O} = OperatorStyle(O)
GeometryStyle(::Type{LazySum{O}}) where {O} = GeometryStyle(O)

# constructors
LazySum(x) = LazySum([x])
LazySum(ops::AbstractVector, fs::AbstractVector) = LazySum(map(MultipliedOperator, ops, fs))
Expand Down