Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All sweep-based iterators now share DMRG's shape: `Base.iterate` runs `sweep!(it, state, Val(:right), iter)` and `sweep!(it, state, Val(:left), iter)`, with finite sweeps taking their sites from `_sweep_ranges`. The IDMRG convergence measure is shared as `_center_change`. `IterLog(::Algorithm)` names logs after the algorithm, and the redundant `= it.state` defaults on `Base.iterate` are dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`bond_change` replaces the three copies of the center-bond convergence measure (groundstate, multiline approximation and leading boundary IDMRG/IDMRG2). It compares bond tensors of different dimension on their common subspace through block views instead of isometry products, and sums the changes over the rows of a multiline MPS, as IDMRG2 already did. The multiline approximation and leading boundary searches now use the groundstate `IDMRGState`, dispatching on its MPS and operator types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Restructures MPSKit's sweep-based solvers as iterators with a common shape. This is a pure refactor: results, logging and returned values are unchanged.
Every converted solver now has a state struct, and
Base.iteraterunssweep!(it, state, Val(:right), iter)followed bysweep!(it, state, Val(:left), iter), then any finalize or error step. Finite sweeps take their sites from_sweep_ranges. Converted:find_groundstatewithDMRG/DMRG2(DMRGState,sweep_converged)approximate!withDMRG/DMRG2propagatorwithDynamicalDMRG(NaiveInvert,Jeckelmann)approximate!andleading_boundarywithIDMRG/IDMRG2time_evolve/time_evolve!: one iteration is one time step plusfinalizeFinite
TDVP/TDVP2timestep!is now a per-sitelocal_update!plus a plain sweep, followingBUG.Smaller cleanups:
IterLog(::Algorithm)names logs after the algorithm type.= it.statedefaults onBase.iterateare removed;iterativesolvers.jlalready provides the one-argument method.statearguments are now typed, which avoids method ambiguities with the generictime_evolveiterator.This gives the finite environment cache from
ld-envsper-site hook points in DMRG, TDVP/TDVP2, BUG and dynamical DMRG.ld-envswill be rebased onto this branch; the rebase applies cleanly. It is also a step towards migrating these solvers to AlgorithmsInterface.jl, which will be a separate PR.Verification
main: equivalence scripts ran the same cases onmainand on this branch with fixed seeds, comparing withisequal. Compared: the raw MPS tensors,AlgorithmInfofields, energies and returned values, every iteration log record and warning, and the arguments offinalizecalls. All 168 cases are identical: 28 DMRG/approximate, 8 dynamical DMRG, 18 IDMRG and 114 TDVP/BUG/time_evolve.maxiter = 0, CBE and DMRG3S, nearest-neighbour and long-range models, real-valued initial states, time-dependent operators, and empty or single-pointt_span.timeevolution/*,states/*, fidelity susceptibility and anyonic braiding test files pass.Test.detect_ambiguities(MPSKit)is unchanged frommain(135).Checklist
[Unreleased]indocs/src/changelog.md🤖 Generated with Claude Code