Skip to content

Commit e89347f

Browse files
committed
Fix small errors, use IterativeSolver interface for IDMRG and remove unnecessary type requirements
1 parent 52bd374 commit e89347f

File tree

4 files changed

+181
-182
lines changed

4 files changed

+181
-182
lines changed

src/algorithms/grassmann.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ end
9090
"""
9191
retract(state, g, α) -> state′, ξ
9292
93-
Retract a state a distance `α` along a direction `g`, obtaining a new state and the local tangent vector.
93+
Retract a state a distance `α` along a direction `g`, obtaining a new state and the local tangent vector.
9494
"""
9595
function retract(state::FiniteMPS, g, α::Real)
9696
state′ = copy(state)
@@ -142,9 +142,9 @@ end
142142
Compute the cost function and the tangent vector with respect to the `AL` parameters of the state.
143143
"""
144144
function fg(
145-
state::FiniteMPS, operator::Union{O, LazySum{O}},
145+
state::FiniteMPS, operator,
146146
envs::AbstractMPSEnvironments = environments(state, operator)
147-
) where {O <: FiniteMPOHamiltonian}
147+
)
148148
f = expectation_value(state, operator, envs)
149149
isapprox(imag(f), 0; atol = eps(abs(f))^(3 / 4)) || @warn "MPO might not be Hermitian: $f"
150150
gs = map(1:length(state)) do i
@@ -155,7 +155,7 @@ function fg(
155155
return real(f), gs
156156
end
157157
function fg(
158-
state::InfiniteMPS, operator::Union{O, LazySum{O}},
158+
state::InfiniteMPS, operator::Union{O, LazySum{O}}, ## TODO: Get rid of this typecheck. Issue: How do we differentiate between InfiniteMPO and InfiniteMPOHamiltonian?
159159
envs::AbstractMPSEnvironments = environments(state, operator)
160160
) where {O <: InfiniteMPOHamiltonian}
161161
recalculate!(envs, state, operator, state)
@@ -172,7 +172,7 @@ function fg(
172172
return real(f), gs
173173
end
174174
function fg(
175-
state::InfiniteMPS, operator::Union{O, LazySum{O}},
175+
state::InfiniteMPS, operator::Union{O, LazySum{O}}, ## TODO: Get rid of this typecheck. Issue: How do we differentiate between InfiniteMPO and InfiniteMPOHamiltonian?
176176
envs::AbstractMPSEnvironments = environments(state, operator)
177177
) where {O <: InfiniteMPO}
178178
recalculate!(envs, state, operator, state)

0 commit comments

Comments
 (0)