Skip to content

Add CheckpointedProjMPO: exact low-memory environments - #228

Open
NihalShriv wants to merge 1 commit into
ITensor:mainfrom
NihalShriv:checkpointed-projmpo
Open

NihalShriv wants to merge 1 commit into
ITensor:mainfrom
NihalShriv:checkpointed-projmpo

Conversation

@NihalShriv

Copy link
Copy Markdown

Implements #227.

CheckpointedProjMPO(H; k) is a drop-in AbstractProjMPO that stores only every k-th environment block (plus the blocks next to the current position) and rebuilds dropped ones from the nearest stored block when a sweep moves back onto them.

  • Exact: rebuilt blocks are the same contractions ProjMPO does, so dmrg/tdvp results match ProjMPO.
  • Memory: about N/k + 2k blocks instead of N (default k = round(√N)), for about one extra environment update per site and sweep.
  • after_drop hook, e.g. () -> (GC.gc(false); CUDA.reclaim()) to return GPU memory right away.
dmrg(CheckpointedProjMPO(H), psi0; nsweeps, maxdim)
tdvp(CheckpointedProjMPO(H), t, psi0; nsweeps)

Changes

  • src/abstractprojmpo/checkpointedprojmpo.jl (new), included and exported
  • test/base/test_checkpointedprojmpo.jl: DMRG energies/states match ProjMPO for k = 1, 3, 4, 7; TDVP state matches; fewer blocks stored; with and without QNs
  • Docstring added to docs/src/ProjMPO.md; exported-names test list updated; version 0.4.2 → 0.4.3
  • Formatted with itpkgfmt

Local: new tests 24/24 and exports test 180/180 pass (Julia 1.12). Aqua shows the same 3 failures as on main (ambiguities, unbound type params, piracy), none from this file.

Happy to adjust the design, e.g. make it a keyword option of ProjMPO instead of a new type. A same-design PR is under review in TeNPy (tenpy/tenpy#713).

Keeps every k-th environment block (default k = round(sqrt(N))) plus the
blocks next to the current position, and rebuilds dropped blocks from the
nearest stored one. Same contractions as ProjMPO, so DMRG/TDVP results are
identical; memory ~ N/k + 2k blocks instead of N.

Implements ITensor#227.

This branch has not been deployed

No deployments
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