Skip to content

Infinite MPOHamiltonian compression via SvdCut - #539

Merged
lkdvos merged 8 commits into
mainfrom
ld-impo-compression
Oct 13, 2026
Merged

lkdvos merged 8 commits into
mainfrom
ld-impo-compression

Conversation

@lkdvos

@lkdvos lkdvos commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Supersedes #458 (thanks @TymoteuszTula, whose commits are kept here, rebased on main): this takes the infinite compression from that PR and integrates it with the existing finite left_canonicalize!/right_canonicalize! + SvdCut machinery, following Parker et al..

Changes

  • changebonds(::InfiniteMPOHamiltonian, ::SvdCut) (Algorithm 5): bring H into right-canonical form, then left-canonicalize while tracking the gauge between both forms, truncate the singular values of that gauge's interaction-channel block, and project.
  • left_canonicalize! / right_canonicalize!(::InfiniteMPOHamiltonian; tol, maxiter, verbosity) (Algorithm 3): iterate block QR/LQ decompositions in place until the gauge transformation is unitary, with rank-revealing (truncated SVD at relative tol) on the channel block, so redundant channels are removed and the iteration converges also for non-minimal MPOs. They return (H, L) with L the accumulated gauge.
  • Changed: left_canonicalize!/right_canonicalize!(::FiniteMPOHamiltonian; alg) now sweep the whole chain (instead of a single site i) and also return (H, L), so finite and infinite share one signature and return type. The finite SvdCut becomes three calls. The per-site steps live in _left_orth_jordan/_absorb_left_gauge (and mirrors), shared between both.
  • Removes mpo_compression and the Dictionaries dependency introduced in Added MPO compression for Finite and Infinite MPO Hamiltonians #458.

Fix for finite canonical forms

The finite canonicalization on main did not produce canonical tensors whenever C/B contain identity components (e.g. any generic two-site term):

  • the identity projection t = ⟨1, C⟩ was missing the 1 / dim(P) normalization;
  • for rank-deficient blocks, Householder completes Q with directions that may overlap with the identity column.

The operator itself stays exact, but truncation then happens in a non-orthonormal basis. Both are fixed by factorizing the full block [1 C; 0 A] with the identity as first column (eq. 21 of the paper); truncating algorithms (as used by the finite SvdCut) are still only applied to the interaction channels.

Tests

  • Infinite canonical forms (orthonormality + energy) for trivial/U1/SU2 spaces.
  • Infinite SvdCut: duplicated channels (H0 + 2H0) compress below dim(H0) with exact energies; an explicitly written-out exponential interaction compresses with controlled error; on-site-only Hamiltonians.
  • Finite canonical forms with identity components, folded into the existing canonicalization testset.

Not run locally: GPU tests and the docs build.

🤖 Generated with Claude Code

TymoteuszTula and others added 6 commits October 12, 2026 10:46
Replace the standalone `mpo_compression` implementation by an integration with the existing
`left_canonicalize!`/`right_canonicalize!` and `SvdCut` machinery:

- factor the finite canonicalization steps into `_left_orth_jordan`/`_absorb_left_gauge` and
  their mirrors, which are shared with the infinite case
- `left_canonicalize!`/`right_canonicalize!(::InfiniteMPOHamiltonian)` iterate rank-revealing
  block QR/LQ decompositions in place until the gauge transformation is unitary
- `changebonds(::InfiniteMPOHamiltonian, ::SvdCut)` implements Algorithm 5 of Parker et al.,
  truncating the singular values of the gauge between the right- and left-canonical forms

This also fixes the canonical form of (finite) MPOHamiltonians when `C`/`B` contain identity
components: the projection onto the identity was missing a `1 / dim(P)` normalization, and
rank-deficient blocks could leave directions in `Q` that overlap with the identity. Both are
resolved by decomposing the full block with the identity as its first column/row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the separate `uniform_leftorth!`/`uniform_rightorth!` helpers: the infinite
`left_canonicalize!`/`right_canonicalize!` now run the iteration themselves and return the
accumulated gauge alongside `H`. Fold the finite canonical-form tests into the existing
canonicalization testset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lkdvos and others added 2 commits October 12, 2026 14:02
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The finite methods now sweep over the whole chain and return the gauge transformations alongside
the operator, matching the infinite versions, which simplifies the finite `SvdCut`. Also add
changelog entries for the API change and the canonical-form fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lkdvos
lkdvos requested review from VictorVanthilt and borisdevos and removed request for VictorVanthilt October 12, 2026 20:41
@VictorVanthilt

Copy link
Copy Markdown
Member

I have spent the last week doing somewhat illegal trickery to get this exact functionality. Thanks for this PR, it comes just at the right time. I'll look at this first thing in the morning

@VictorVanthilt

Copy link
Copy Markdown
Member

Looks good to me, waiting to approve to give others (@borisdevos ?) the time to take a look at this.


# purely on-site terms have no channels to compress
H_onsite = InfiniteMPOHamiltonian(PeriodicVector([pspace]), (1,) => Z)
@test expectation_value(ψ1, changebonds(H_onsite, SvdCut(; trunc = truncrank(0)))) ≈

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fancy way to write notrunc() 😆

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the exact opposite, it's a fancy way to write alltrunc(). notrunc() is equivalent to truncrank(inf)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow yeah i brainlagged there

@borisdevos borisdevos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a lot less qualified than Victor, but looks good to me!

@lkdvos
lkdvos merged commit 5254e7f into main Oct 13, 2026
70 of 71 checks passed
@lkdvos
lkdvos deleted the ld-impo-compression branch October 13, 2026 09:40
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.

5 participants