Skip to content

Controlled Bond Expansion: randomized SVD approach#438

Open
lkdvos wants to merge 20 commits into
mainfrom
ld-cbe
Open

Controlled Bond Expansion: randomized SVD approach#438
lkdvos wants to merge 20 commits into
mainfrom
ld-cbe

Conversation

@lkdvos

@lkdvos lkdvos commented Jun 19, 2026

Copy link
Copy Markdown
Member

This is a WIP implementation of a CBE-like expansion scheme based on randomized SVD.
The long story short is that instead of a full twosite (OptimalExpand) -based approach, we can sketch out this update to select the expansion directions.
Mainly I'm still struggling slightly with committing to an interface, and checking what goes where.
I'm somewhat convinced that the changebond! (as opposed to changebonds!) abstraction for doing a single expansion on a bond is probably good, but still struggling a bit to see if I want to default this into DMRG (and TDVP), or get a dedicated CBE_DMRG algorithm for it.
Interestingly, I think I've set it up in such a way that the various expansion schemes can be used interchangibly, so it is quite modular.

The main source of complexity/messiness is mostly that the FiniteMPS structs and environments are very untransparant about what they do, so trying to reuse functionality involves a lot of assumptions on which tensors exactly are where and which ones are used.
It would be nice to revisit that at some point, but I also just don't have the time to actually go ahead and do this...

Still to do:

  • Implement for TDVP
  • Clean up DMRG implementation
  • Verify interaction with symmetries and block selection / oversampling
  • Check this works for density matrices
  • correctly rebase with timeroutputs

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Your PR no longer requires formatting changes. Thank you for your contribution!

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.28571% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/changebonds/randexpand.jl 50.00% 18 Missing ⚠️
src/algorithms/groundstate/dmrg.jl 69.56% 7 Missing ⚠️
src/states/orthoview.jl 87.50% 3 Missing ⚠️
src/algorithms/changebonds/changebonds.jl 80.00% 2 Missing ⚠️
src/algorithms/changebonds/optimalexpand.jl 97.43% 1 Missing ⚠️
src/algorithms/changebonds/sketchedexpand.jl 98.43% 1 Missing ⚠️
src/algorithms/timestep/tdvp.jl 90.90% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/MPSKit.jl 100.00% <ø> (ø)
src/algorithms/toolbox.jl 96.39% <100.00%> (-0.02%) ⬇️
src/utility/utility.jl 59.76% <100.00%> (+0.48%) ⬆️
src/algorithms/changebonds/optimalexpand.jl 98.73% <97.43%> (-1.27%) ⬇️
src/algorithms/changebonds/sketchedexpand.jl 98.43% <98.43%> (ø)
src/algorithms/timestep/tdvp.jl 83.15% <90.90%> (+0.39%) ⬆️
src/algorithms/changebonds/changebonds.jl 91.30% <80.00%> (-8.70%) ⬇️
src/states/orthoview.jl 88.88% <87.50%> (+0.79%) ⬆️
src/algorithms/groundstate/dmrg.jl 91.96% <69.56%> (-4.88%) ⬇️
src/algorithms/changebonds/randexpand.jl 64.38% <50.00%> (-18.95%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lkdvos lkdvos marked this pull request as ready for review June 30, 2026 15:51
lkdvos and others added 20 commits June 30, 2026 16:17
Reconcile CBE with main after rebase:
- migrate CBEDMRG/SketchedExpand to the 3-arg environments(ψ, H, ψ) API
  (#436 removed the defaulted operator-environments form)
- instrument CBEDMRG/cbe_sweep! with TimerOutputs (expand / AC_eigsolve /
  svd_trunc / sweep / finalize), matching the #431 DMRG/DMRG2 style

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Restore the `isnothing(alg.alg_expand)` guard around `changebond!` in the
finite TDVP sweep. It was dropped together with the verbosity `withlevel`
wrapper during cleanup, so `TDVP()` (default `alg_expand = nothing`) called
`changebond!(..., nothing, ...)` — which has no method — erroring for any
`AbstractFiniteMPS` (e.g. WindowMPS evolution with an InfiniteMPOHamiltonian).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lkdvos lkdvos enabled auto-merge (squash) July 1, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant