Skip to content

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Oct 24, 2025

Here I address a range of subtle bugs that were already there and some new ones that got introduced when the TensorKit update happened.
The primary problem is that we shouldn't assume that transpose or any of its variants produces independent data. Obvious offenders were e.g. qr_compact!(repartition(t, 2, 2)), which isn't guaranteed to not alter t.

The problem wasn't caught before because in most cases, a copy has to be made anyways (e.g. when there are symmetries involved, or for most array sizes), but after a bug report by @20akshay00 the issue shows itself when working with product states, since there 1xdx1 arrays can always trivially be permuted without copies.

I hope that I caught all of the cases here, but it's a bit hard to test this in general since some of the algorithms seem to even be somewhat robust against these kinds of issues.

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/utility/utility.jl 75.00% 2 Missing ⚠️
src/states/orthoview.jl 50.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/algorithms/changebonds/optimalexpand.jl 100.00% <100.00%> (ø)
src/algorithms/changebonds/randexpand.jl 100.00% <100.00%> (ø)
src/algorithms/groundstate/idmrg.jl 98.55% <100.00%> (ø)
src/states/quasiparticle_state.jl 86.25% <100.00%> (ø)
src/states/orthoview.jl 89.68% <50.00%> (ø)
src/utility/utility.jl 74.22% <75.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lkdvos lkdvos merged commit 0f52943 into main Oct 24, 2025
26 of 27 checks passed
@lkdvos lkdvos deleted the ld-issue branch October 24, 2025 22:15
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.

2 participants