Skip to content

Conversation

@Yue-Zhengyuan
Copy link
Member

This PR splits src/algorithms/contractions/ctmrg_contractions.jl into several shorter files in the folder src/algorithms/contractions/ctmrg/ for easier navigation among different parts.

No changes are made in docstrings or code body, so the PR can be safely merged as long as the tests pass.

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 50.89820% with 246 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/contractions/ctmrg/fullinf_env.jl 2.89% 67 Missing ⚠️
...lgorithms/contractions/ctmrg/renormalize_corner.jl 43.85% 64 Missing ⚠️
src/algorithms/contractions/ctmrg/halfinf_env.jl 6.81% 41 Missing ⚠️
.../algorithms/contractions/ctmrg/renormalize_edge.jl 65.88% 29 Missing ⚠️
...rc/algorithms/contractions/ctmrg/enlarge_corner.jl 65.00% 28 Missing ⚠️
src/algorithms/contractions/ctmrg/projector.jl 38.46% 8 Missing ⚠️
src/algorithms/contractions/ctmrg/expr.jl 82.05% 7 Missing ⚠️
src/algorithms/contractions/ctmrg/gaugefix.jl 95.45% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/PEPSKit.jl 100.00% <ø> (ø)
src/algorithms/contractions/ctmrg/contract_site.jl 100.00% <100.00%> (ø)
src/algorithms/contractions/ctmrg/gaugefix.jl 95.45% <95.45%> (ø)
src/algorithms/contractions/ctmrg/expr.jl 82.05% <82.05%> (ø)
src/algorithms/contractions/ctmrg/projector.jl 38.46% <38.46%> (ø)
...rc/algorithms/contractions/ctmrg/enlarge_corner.jl 65.00% <65.00%> (ø)
.../algorithms/contractions/ctmrg/renormalize_edge.jl 65.88% <65.88%> (ø)
src/algorithms/contractions/ctmrg/halfinf_env.jl 6.81% <6.81%> (ø)
...lgorithms/contractions/ctmrg/renormalize_corner.jl 43.85% <43.85%> (ø)
src/algorithms/contractions/ctmrg/fullinf_env.jl 2.89% <2.89%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kshyatt kshyatt requested a review from lkdvos January 28, 2026 09:59
@Yue-Zhengyuan
Copy link
Member Author

I still have some reordering to push, but I'll wait until the current test finishes.

@Yue-Zhengyuan
Copy link
Member Author

Yue-Zhengyuan commented Jan 28, 2026

Bad news: we can't just merge this PR due to the poor test coverage (50%).

It appears to be mainly due to not testing CTMRG for PEPS-PEPO-PEPS sandwich. The very low coverage of fullinf_inv and halfinf_inv (< 10%) is also surprising to me (maybe due to not testing IterSVD?).

@pbrehmer We may need your help to increase test coverage, or identify and remove things that are not used.

@pbrehmer
Copy link
Collaborator

The low test coverage of halfinf_env and fullinf_env indeed stems from the fact that we don't have a sparse CTMRG implementation yet. By sparse I mean that we never explicitly construct the environment and then use a sparse SVD with a function handle. Still, I added these sparse contractions at some point because I had them lying around or I was trying out something (can't remember) and I decided to leave them in for future use. All the code that is actually in use should be tested if I remember correctly.

So at least with respect to the half/full-infinite environment things, the low test coverage isn't saying much. We could easily increase it by just commenting out the unused parts. I could do that if we want to do it. (Not sure about the PEPS-PEPO-PEPS things though, I assumed there was tests for that...)

Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

In any case, I would suggest to not do any of that in this PR, I really like that this is only reorganizing the files.

Overall I think this is a great change, let's wait for the tests to run just to be sure but since we aren't actually changing any of the test coverage I would just merge afterwards.

@Yue-Zhengyuan Yue-Zhengyuan enabled auto-merge (squash) January 28, 2026 14:24
@lkdvos lkdvos disabled auto-merge January 28, 2026 17:44
@lkdvos lkdvos merged commit 18703b2 into QuantumKitHub:master Jan 28, 2026
61 of 63 checks passed
@Yue-Zhengyuan Yue-Zhengyuan deleted the reorganize-ctmrg branch January 29, 2026 06:27
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