Repository navigation
Infinite MPOHamiltonian compression via SvdCut - #539
Merged
Merged
Conversation
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>
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
requested review from
VictorVanthilt and
borisdevos
and removed request for
VictorVanthilt
October 12, 2026 20:41
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 |
Member
|
Looks good to me, waiting to approve to give others (@borisdevos ?) the time to take a look at this. |
borisdevos
reviewed
Oct 13, 2026
|
|
||
| # 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)))) ≈ |
Member
There was a problem hiding this comment.
This is a fancy way to write notrunc() 😆
Member
There was a problem hiding this comment.
it's the exact opposite, it's a fancy way to write alltrunc(). notrunc() is equivalent to truncrank(inf)
Member
There was a problem hiding this comment.
oh wow yeah i brainlagged there
borisdevos
approved these changes
Oct 13, 2026
borisdevos
left a comment
Member
There was a problem hiding this comment.
I'm a lot less qualified than Victor, but looks good to me!
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.
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 finiteleft_canonicalize!/right_canonicalize!+SvdCutmachinery, following Parker et al..Changes
changebonds(::InfiniteMPOHamiltonian, ::SvdCut)(Algorithm 5): bringHinto 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 relativetol) on the channel block, so redundant channels are removed and the iteration converges also for non-minimal MPOs. They return(H, L)withLthe accumulated gauge.left_canonicalize!/right_canonicalize!(::FiniteMPOHamiltonian; alg)now sweep the whole chain (instead of a single sitei) and also return(H, L), so finite and infinite share one signature and return type. The finiteSvdCutbecomes three calls. The per-site steps live in_left_orth_jordan/_absorb_left_gauge(and mirrors), shared between both.mpo_compressionand theDictionariesdependency introduced in Added MPO compression for Finite and Infinite MPO Hamiltonians #458.Fix for finite canonical forms
The finite canonicalization on
maindid not produce canonical tensors wheneverC/Bcontain identity components (e.g. any generic two-site term):t = ⟨1, C⟩was missing the1 / dim(P)normalization;Qwith 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 finiteSvdCut) are still only applied to the interaction channels.Tests
SvdCut: duplicated channels (H0 + 2H0) compress belowdim(H0)with exact energies; an explicitly written-out exponential interaction compresses with controlled error; on-site-only Hamiltonians.Not run locally: GPU tests and the docs build.
🤖 Generated with Claude Code