Repository navigation
Conversation
Compressing a FiniteMPOHamiltonian with a long-range interaction whose operators have non-zero trace lost precision geometrically with distance in v0.14.0 (#550). This was fixed by the canonical-form rewrite in #539; this test guards against regressions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #550.
The bug reported in #550 is already fixed on
mainby #539. This PR only adds the issue's reproducer as a regression test.Cause (v0.14.0)
In v0.14.0, the identity component of
Cwas projected out with an unnormalized identity:t = tr(1ᴴ C), without dividing bydim(P). The gauge transformation stays exact in exact arithmetic, but the identity component is never actually removed. The leftovertgrows by roughly a factor ofdim(P)per site along an interaction channel; for the MWE, the site waiting to absorb it reachednorm(C) ≈ 4e11. The result is catastrophic cancellation that gets worse with interaction distance. Traceless operators havet = 0, so they were unaffected.#539 rewrote the canonicalization as a QR of
[1 C; 0 A]with the identity as its first column, which normalizes the projection correctly.Max
|⟨H⟩ - ⟨Hc⟩|for the MWE in #550 (n ⊗ n,trunctol(rtol = 0), 5 random states):mainTest
test/algorithms/changebonds.jl:n ⊗ non sites (5, 25) of a 30-siteℂ^4chain, compressed withSvdCut(; trunc = trunctol(; rtol = 0.0)). The test checks that the expectation value matches tortol = 1e-10. The existing tests from #539 only cover nearest-neighbour terms, which v0.14.0 already handled correctly.🤖 Generated with Claude Code