Skip to content

Fix canonicalize! SpaceMismatch for partially decoupled Hamiltonian sites - #526

Merged
lkdvos merged 2 commits into
mainfrom
marc2
Sep 25, 2026
Merged

lkdvos merged 2 commits into
mainfrom
marc2

Conversation

@lkdvos

@lkdvos lkdvos commented Sep 24, 2026

Copy link
Copy Markdown
Member

Fixes #522

left_canonicalize!/right_canonicalize! forced both virtual legs of
the reconstructed A-block empty in the "fully truncated" branch, but
only the leg actually being decomposed collapses when a bond only
partially decouples. Inherit the other leg's real space instead.

Also bumps the BlockTensorKit compat bound to 0.3.19, which fixes an
unrelated upstream bug where sparse block-tensor contractions with 3+
legs silently returned zero.

Test plan

  • test/operators/mpohamiltonian.jl (new regression testset + full file): 229/229 pass
  • test/algorithms/changebonds.jl: 68/68 pass

🤖 Generated with Claude Code

lkdvos and others added 2 commits September 25, 2026 15:18
…n sites

left_canonicalize!/right_canonicalize! forced both virtual legs of the
reconstructed A-block empty in the "fully truncated" (dim(R)==0) branch,
but only the leg actually being decomposed collapses when a bond only
partially decouples. Inherit the other leg's real space instead.

Fixes #522

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
BlockTensorKit 0.3.17/0.3.18 silently returned zero from sparse
block-tensor contractions with 3+ legs, corrupting
convert(TensorMap, ::FiniteMPOHamiltonian) and related densification
paths for essentially any Hamiltonian. 0.3.19 fixes this upstream;
tests (operators/mpohamiltonian, algorithms/changebonds) pass cleanly
against it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@lkdvos
lkdvos merged commit 1c4fb96 into main Sep 25, 2026
3 of 70 checks passed
@lkdvos
lkdvos deleted the marc2 branch September 25, 2026 21:39
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.

Canonicalizing Hamiltonians throws an exception when sites are decoupled

1 participant