FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix `truncrank` when kept rank is larger than input rank by Yue-Zhengyuan · Pull Request #368 · QuantumKitHub/TensorKit.jl · GitHub

Fix truncrank when kept rank is larger than input rank - #368

Merged
lkdvos merged 2 commits into
mainfrom
zy/truncrank-fix
Feb 8, 2026
Merged

lkdvos merged 2 commits into
mainfrom
zy/truncrank-fix

Conversation

Copy link
Copy Markdown
Member

This PR fixes truncrank when the rank to be kept is already larger than the input tensor, so it should be the same as notrunc. The old code breaks only when the fusion style is UniqueFusion (including Trivial and abelian symmetries).

I bumped into the issue in QuantumKitHub/PEPSKit.jl#314 for finite-T time evolution. The infinite-T PEPO D = 1, and I rely on truncrank(D) to automatically keep fewer than D singular values when possible.

There was a similar bug in eig(h)_trunc that can be solved by this PR, but I didn't add a test for it.

Copy link
Copy Markdown
Member Author

I wanted to directly short-circuit to the NoTruncation function, but then I noticed the rev option, which is absent in notrunc.

codecov Bot commented Feb 8, 2026 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/factorizations/truncation.jl 94.40% <100.00%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

lkdvos 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the fix and added test ❤️

lkdvos merged commit c050c64 into main Feb 8, 2026
42 checks passed
lkdvos deleted the zy/truncrank-fix branch February 8, 2026 18:49
lkdvos mentioned this pull request Feb 10, 2026
lkdvos referenced this pull request Feb 10, 2026
* update changelog

* Bump v0.16.2
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL