Skip to content

Conversation

@Yue-Zhengyuan
Copy link
Member

@Yue-Zhengyuan Yue-Zhengyuan commented Jan 22, 2026

This PR mainly "standardizes" bond_truncate with ALSTruncation algorithm. Previously, ALS was optimizing reduced bond tensors with a physical leg. But now, the physical legs of the reduced bond tensors are first absorbed into the bond environment before further optimization, so it is now solving the same problem as bond_truncate with FullEnvTruncation.

Besides, I also squeeze in a generalization of bondenv_ctm (full update bond environment) for iPEPO.

(Note that during Trotter gate time evolution, absorbing the physical legs from reduced bond tensors will increase the dimension of the bond env, it is still better to fix the gauge of the bond env before doing so. This is why the gauge-fixing code for bond envs is unchanged.)


Edit: see the original notes for this PR below.

Details

This PR prepares for a future change of _qr_bond: the physical leg will not be transferred to the reduced matrix when doing the QR decomposition. More concretely, instead of

        2                   1                                   1
        |                   |                                   |
    5 -A/B- 3   ====>   4 - X ← 2   1 ← a - 3   1 - b → 3   4 → Y - 2
        | ↘                 |            ↘           ↘          |
        4   1               3             2           2         3

it will be changed to

        2                   2                                   2
        |                   |                                   |
    5 -A/B- 3   ====>   5 - X ← 3   1 ← a - 2   1 - b → 2   5 → Y - 3
        | ↘                 | ↘                                 | ↘
        4   1               4   1                               4  1

I want to do this mainly because keeping the physical leg in the reduced matrix is not easily generalized to longer-range (e.g. next-nearest neighbor) gates when performing Trotter time evolution (consider how the middle site in the 3-site cluster should be treated).

In this way, the two-site gate is not directly applied to the two reduced matrices a, b. Instead, it is also first decomposed into an MPO to avoid SVD-ing a large tensor. (I decide to follow YASTN approach this time; see also PhysRevB.106.195105)

Without physical legs there, the code of ALS and FET truncation will become more similar, reducing difficulty in maintenance.

@Yue-Zhengyuan
Copy link
Member Author

After some tests with simple update, this gate MPO approach is not optimal, at least for nearest neighbor Hamiltonians. For moderate D around 8, the current master branch is about 3x faster for the Heisenberg model. Then I'd better keep the current design using reduced bond tensors with the physical leg...

@Yue-Zhengyuan
Copy link
Member Author

Yue-Zhengyuan commented Jan 23, 2026

I managed to come up with a "hybrid" approach: the gate still acts on reduced bond tensors with physical index, but when optimizing them with bond environment, the physical index is first transferred into the environment using QR (as I previously do with FET). Then we can maintain the current speed of simple update, and this change has little effect on ALS in my test with full update.

Another possible benefit is in dealing with next-nearest neighbor (NNN) gates: if we decompose the NNN into two NN gates, then the middle site physical dimension will temporarily grow during the evolution. But since it is absorbed and contracted into the bond environment, it seems that the difficulty in optimizing the bond matrices is not changed.

Now that both ALS and FET solves the "standard" problem of finding the best "weighted low-rank approximation" of a bond matrix (without any extra legs) with a given positive definite environment, I guess the "standardization" of ALS code may still be worth merging.

@Yue-Zhengyuan Yue-Zhengyuan reopened this Jan 23, 2026
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/algorithms/contractions/bondenv/als_solve.jl 100.00% <100.00%> (ø)
src/algorithms/contractions/bondenv/benv_ctm.jl 100.00% <100.00%> (ø)
src/algorithms/truncation/bond_truncation.jl 93.65% <100.00%> (-1.09%) ⬇️
src/algorithms/truncation/fullenv_truncation.jl 96.92% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 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 ready for review January 24, 2026 03:25
@Yue-Zhengyuan
Copy link
Member Author

With more testing with larger D and chi in full update, the hybrid approach still has somewhat deteriorated performance compared to the current approach.

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.

1 participant