Skip to content

Improve efficiency of bond truncation#366

Merged
lkdvos merged 8 commits into
QuantumKitHub:masterfrom
Yue-Zhengyuan:als-efficiency
Apr 29, 2026
Merged

Improve efficiency of bond truncation#366
lkdvos merged 8 commits into
QuantumKitHub:masterfrom
Yue-Zhengyuan:als-efficiency

Conversation

@Yue-Zhengyuan

Copy link
Copy Markdown
Member

This PR improves the efficiency of bond_truncate (for both ALSTruncation and FullEnvTruncation) by reusing intermediate partial contraction results.

The test test/bondenv/bond_truncate.jl is rewritten to simulate the more realistic scenario of applying a 2-site gate on an iPEPS with physical dimension d and virtual dimension D. It can reveal that FET is much slower when d is large (due to physical leg not transferred to the reduced bond tensors to be optimized).

@Yue-Zhengyuan

Copy link
Copy Markdown
Member Author

@sanderdemeyer I recommend you (squash-)merge this PR to the NTU branch (#144) when trying it.

@codecov

codecov Bot commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.14286% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/contractions/bondenv/als_solve.jl 95.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/algorithms/truncation/bond_truncation.jl 94.87% <100.00%> (+0.35%) ⬆️
src/algorithms/truncation/fullenv_truncation.jl 96.82% <100.00%> (+0.05%) ⬆️
src/algorithms/contractions/bondenv/als_solve.jl 96.36% <95.00%> (-3.64%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Yue-Zhengyuan Yue-Zhengyuan marked this pull request as draft April 23, 2026 14:18
@Yue-Zhengyuan Yue-Zhengyuan marked this pull request as ready for review April 24, 2026 02:39
@Yue-Zhengyuan Yue-Zhengyuan requested a review from leburgel April 24, 2026 13:12

@leburgel leburgel 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.

Just a few questions, but otherwise looks good to me.

Test failures and timeouts are unrelated, and will be solved by #364.

Comment thread src/algorithms/contractions/bondenv/als_solve.jl Outdated
Comment thread src/algorithms/truncation/bond_truncation.jl
Comment thread src/algorithms/truncation/fullenv_truncation.jl
@Yue-Zhengyuan

Yue-Zhengyuan commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

I dropped the ::Val{i} dispatch on _als_tensor_R, _als_tensor_S so that I can reuse the underlying contraction without having to pass the entire xs vector all the time.

@lkdvos lkdvos merged commit 34b27d8 into QuantumKitHub:master Apr 29, 2026
57 of 63 checks passed
@Yue-Zhengyuan Yue-Zhengyuan deleted the als-efficiency branch April 30, 2026 12:57
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.

3 participants