Skip to content

feat: BUG integrator#468

Open
lkdvos wants to merge 6 commits into
mainfrom
ld-bug-consolidate
Open

feat: BUG integrator#468
lkdvos wants to merge 6 commits into
mainfrom
ld-bug-consolidate

Conversation

@lkdvos

@lkdvos lkdvos commented Jul 20, 2026

Copy link
Copy Markdown
Member

This PR adds the BUG integrator as an alternative to TDVP. It's a consolidation of part of #454.
The main purpose is to have a stable integrator to be able to handle (large) imaginary or complex time steps in a way that is more stable than standard TDVP since it does not involve a backwards integration.

@Jutho I would be very happy to hear your opinions on this, I'm still not completely sure I've done everything correctly and many parts still confuse me, so a second set of eyes would be greatly appreciated. 🙃

lkdvos and others added 4 commits July 20, 2026 13:46
Renormalization after each step is now controlled by an explicit `normalize`
kwarg on `timestep`/`time_evolve` (default `false`) instead of being tied to
`imaginary_evolution`. By default the norm is preserved, so it retains useful
information (accumulated truncation error in real time, decaying weight in
imaginary time); pass `normalize = true` to renormalize, e.g. for ground-state
or thermal-state search. Threaded through the driver and both TDVP/TDVP2
integrators; test norm/imaginary-time expectations updated accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the `BUG` time-evolution algorithm: a symmetric second-order Basis-Update
& Galerkin integrator for finite MPS. Unlike `TDVP` it has no backward-in-time
substep (stable for imaginary-time evolution); passing a truncating `trscheme`
enables rank-adaptivity, growing and shrinking the bond dimension to track the
entanglement. Wires up the export, include, docs (`@docs` entry, changelog,
Ceruti & Lubich 2022 reference).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add tests for the sequential `BUG` integrator: energy conservation, eigenstate
phase, agreement with TDVP, second-order convergence vs dense propagation,
imaginary-time cooling, LazySum/time-dependent operators, rank-adaptivity, and
symmetric tensors (U(1)/Z2/SU(2), incl. rank-adaptive-symmetric). Plus unit
tests for the `_bug_augment_*` basis-augmentation helpers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Remove unused `tolgauge`/`gaugemaxiter` fields from the `BUG` struct and
  constructor: they are read only for `InfiniteMPS` gauge reconstruction in
  TDVP, and BUG is finite-only, so they were silently ignored.
- Clarify the `BUG` docstring (single-site, symmetric second-order, finite MPS)
  and correct the `finalize` signature docs (`finalize(t, …)`, not `iter`) in
  BUG, TDVP and TDVP2.
- Document the `normalize` behavior change under changelog "Changed": it is now
  an explicit kwarg (default false) decoupled from `imaginary_evolution`;
  imaginary-time evolution no longer renormalizes unless `normalize = true`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lkdvos
lkdvos requested a review from Jutho July 20, 2026 23:47
@lkdvos
lkdvos force-pushed the ld-bug-consolidate branch from 21e8388 to f8a54a2 Compare July 20, 2026 23:55
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/timestep/bug.jl 96.77% 2 Missing ⚠️
src/algorithms/timestep/tdvp.jl 83.33% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/MPSKit.jl 100.00% <ø> (ø)
src/algorithms/timestep/time_evolve.jl 100.00% <100.00%> (ø)
src/algorithms/timestep/tdvp.jl 83.50% <83.33%> (+0.34%) ⬆️
src/algorithms/timestep/bug.jl 96.77% <96.77%> (ø)

... and 1 file 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 July 21, 2026 01:10
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