Skip to content

Add Neighborhood Tensor Update (NTU) - #144

Open
Yue-Zhengyuan wants to merge 74 commits into
QuantumKitHub:mainfrom
Yue-Zhengyuan:bondenv-ntu
Open

Yue-Zhengyuan wants to merge 74 commits into
QuantumKitHub:mainfrom
Yue-Zhengyuan:bondenv-ntu

Conversation

@Yue-Zhengyuan

@Yue-Zhengyuan Yue-Zhengyuan commented Feb 27, 2025 •

Copy link
Copy Markdown
Member

(Finally, after being delayed for over a year)


This PR adds the Neighborhood Tensor Update (NTU, arXiv 2107.06635), which works for both iPEPS and iPEPO, and supports nearest neighbor 2-site gates and arbitrary MPO gates (in particular, the next-nearest neighbor 3-site MPO).

One caveat to be emphasized is that after applying an N-site gate (N > 2), the updated bonds are truncated sequentially without going back. In other words, it does not perform an ALS optimization of all site tensors that are updated, since producing the environment surrounding a general cluster of sites is complicated, and the following ALS optimization will be extremely costly.

When truncating a bond after applying a time evolution gate, the NTU uses some neighboring tensors as the bond environment, instead of using only a few bond weights (simple update) of the full iPEPS approximated by CTM (full update), "interpolating" between the two extremes. Currently the NN, NN+ and NNN bond environments (see description in the YASTN package) are implemented.

@codecov

codecov Bot commented Feb 27, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.00000% with 28 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/time_evolution/ntupdate.jl 92.80% 9 Missing ⚠️
src/algorithms/contractions/bondenv/benv_tools.jl 82.50% 7 Missing ⚠️
src/utility/util.jl 0.00% 6 Missing ⚠️
src/algorithms/contractions/bondenv/gaugefix.jl 66.66% 4 Missing ⚠️
src/algorithms/contractions/bondenv/benv_ntu.jl 95.83% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/PEPSKit.jl 100.00% <ø> (ø)
src/algorithms/time_evolution/apply_mpo.jl 99.23% <100.00%> (+0.02%) ⬆️
src/algorithms/time_evolution/get_cluster.jl 93.90% <100.00%> (+6.40%) ⬆️
src/algorithms/time_evolution/ntupdate3site.jl 100.00% <100.00%> (ø)
src/algorithms/time_evolution/simpleupdate.jl 97.10% <100.00%> (+0.75%) ⬆️
src/algorithms/time_evolution/simpleupdate3site.jl 88.00% <100.00%> (+2.58%) ⬆️
src/algorithms/truncation/bond_tensor.jl 100.00% <100.00%> (ø)
src/algorithms/contractions/bondenv/benv_ntu.jl 95.83% <95.83%> (ø)
src/algorithms/contractions/bondenv/gaugefix.jl 90.00% <66.66%> (-10.00%) ⬇️
src/utility/util.jl 72.36% <0.00%> (-4.78%) ⬇️
... and 2 more

... and 28 files 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 May 7, 2025 02:58
@Yue-Zhengyuan
Yue-Zhengyuan marked this pull request as draft May 26, 2025 03:37
@lkdvos
lkdvos force-pushed the master branch 2 times, most recently from ad4945f to 37ace4c Compare June 13, 2025 12:14
@Yue-Zhengyuan Yue-Zhengyuan changed the title Add NTU bond environments Add Neighborhood Tensor Update (NTU) Oct 24, 2025
@Yue-Zhengyuan Yue-Zhengyuan mentioned this pull request Oct 29, 2025
2 tasks done
@Yue-Zhengyuan Yue-Zhengyuan self-assigned this Nov 12, 2025
@Yue-Zhengyuan
Yue-Zhengyuan force-pushed the bondenv-ntu branch 2 times, most recently from 85d2c44 to ecbbee4 Compare November 30, 2025 01:56
@Yue-Zhengyuan Yue-Zhengyuan reopened this Apr 8, 2026
@Yue-Zhengyuan
Yue-Zhengyuan marked this pull request as ready for review April 8, 2026 08:39
@Yue-Zhengyuan

Copy link
Copy Markdown
Member Author

Some commits are based on #348, #349.

@Yue-Zhengyuan
Yue-Zhengyuan marked this pull request as draft July 2, 2026 10:56
@Yue-Zhengyuan

Copy link
Copy Markdown
Member Author

@lkdvos I think all comments in the last review are addressed. Ready for another round of review!

@Yue-Zhengyuan
Yue-Zhengyuan requested a review from lkdvos July 16, 2026 09:01
@Yue-Zhengyuan

Copy link
Copy Markdown
Member Author

I'm now going to submit a paper for publication which says that NTU is implemented in PEPSKit. Hopefully we can finish this PR soon.

@leburgel leburgel self-assigned this Aug 31, 2026
@Yue-Zhengyuan

Yue-Zhengyuan commented Sep 25, 2026 •

Copy link
Copy Markdown
Member Author

Exact contraction of NNNEnv is too expensive in practice. I'm trying first compressing the north row and the south row with SvdCut changebonds. I have removed NNNEnv from this PR.

@Yue-Zhengyuan
Yue-Zhengyuan marked this pull request as ready for review September 26, 2026 10:15
The fixed ten-tensor network is independent of the MPO path and its length.
Floating-point costs avoid integer overflow; dense dimensions approximate symmetry-block costs.
"""
function _ntu_contraction_order(tensors::NamedTuple)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 has helped introduce this contraction order selector. It thinks that @tensoropt is not sufficient because it assumes that all legs involved have more or less the same dimension. But for bond environment after applying a gate MPO, such as an L-shapes NNN gate, the dimension of bond connecting, say, Y and NE will be enlarged by a factor of D_MPO, while the others remain D.

Therefore, in determine the contraction order, we need to know where the next bond that's enlarged by the MPO gate is.

I would like some help in reviewing if 🤖's approach is recommended.

This branch has not been deployed

No deployments
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