Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
jofrevalles committed Nov 29, 2024
1 parent a2ca518 commit d8688e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/MPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,14 @@ Evolve the [`AbstractAnsatz`](@ref) `ψ` with the [`AbstractMPO`](@ref) `mpo` al
If `threshold` or `maxdim` are not `nothing`, the tensors are truncated after each sweep at the proper value, and the
bond is normalized if `normalize=true`. If `reset_index=true`, the indices of the `ψ` are reset to the original ones.
"""
function evolve!::AbstractAnsatz, mpo::AbstractMPO; threshold=nothing, maxdim=nothing, normalize=true, reset_index=true)
function evolve!(
ψ::AbstractAnsatz, mpo::AbstractMPO; threshold=nothing, maxdim=nothing, normalize=true, reset_index=true
)
original_sites = copy(Quantum(ψ).sites)
evolve!(form(ψ), ψ, mpo; threshold, maxdim, normalize)

if reset_index
resetindex!(Quantum(ψ); init=ninds(TensorNetwork(ψ))+1)
resetindex!(Quantum(ψ); init=ninds(TensorNetwork(ψ)) + 1)

replacements = [(Quantum(ψ).sites[key] => original_sites[key]) for key in keys(original_sites)]
replace!(Quantum(ψ), replacements)
Expand Down

0 comments on commit d8688e8

Please sign in to comment.