Skip to content

[WIP] Get started with a C4v specific CTMRG environment - #471

Merged
kshyatt merged 8 commits into
mainfrom
ksh/c4venv
Oct 29, 2026
Merged

kshyatt merged 8 commits into
mainfrom
ksh/c4venv

Conversation

@kshyatt

@kshyatt kshyatt commented Oct 22, 2026

Copy link
Copy Markdown
Member

C4v symmetric environments! Here is a first attempt.

I added an abstract supertype AbstractCTMRGEnv that both CTMRGEnv and C4vCTMRGEnv subtype. If we add C6v symmetry later this might also be useful. It also reduces duplication of methods and allows a lot of code to work for both environment types.

The C4vCTMRGEnv uses 3D arrays for the corner and edge with leading dimension 1, the idea being that again we can reuse a lot of logic with this pattern.

@kshyatt

kshyatt commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

There are definitely some performance improvements still to be made here (e.g. 1 layer pepo handling) but I wanted to get some feedback before I kept going :)

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.59276% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/environments/c4v_ctmrg_environments.jl 85.95% 17 Missing ⚠️
src/environments/ctmrg_environments.jl 84.61% 4 Missing ⚠️
src/algorithms/ctmrg/ctmrg.jl 80.00% 1 Missing ⚠️
src/algorithms/ctmrg/gaugefix.jl 96.42% 1 Missing ⚠️
Files with missing lines Coverage Δ
ext/PEPSKitAdaptExt.jl 100.00% <100.00%> (ø)
src/PEPSKit.jl 100.00% <ø> (ø)
.../algorithms/contractions/correlator/pepo_1layer.jl 100.00% <ø> (ø)
...lgorithms/contractions/correlator/pepo_purified.jl 100.00% <ø> (ø)
src/algorithms/contractions/correlator/peps.jl 100.00% <ø> (ø)
src/algorithms/contractions/ctmrg/gaugefix.jl 100.00% <100.00%> (ø)
src/algorithms/contractions/ctmrg/network_value.jl 100.00% <100.00%> (ø)
...lgorithms/contractions/ctmrg/renormalize_corner.jl 100.00% <100.00%> (ø)
.../algorithms/contractions/ctmrg/renormalize_edge.jl 89.41% <ø> (ø)
...ms/contractions/local_patch/densitymatrix/ctmrg.jl 100.00% <ø> (ø)
... and 16 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pbrehmer pbrehmer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for getting this started! I am confused why we don't explicitly restrict to a trivial single-site unit cell but other than that I thinks it's great :~)

Comment thread src/algorithms/contractions/ctmrg/network_value.jl
Comment thread src/algorithms/ctmrg/gaugefix.jl Outdated
Comment thread src/algorithms/toolbox.jl
Comment thread src/environments/c4v_ctmrg_environments.jl Outdated
Comment thread src/environments/c4v_ctmrg_environments.jl Outdated
@kshyatt

kshyatt commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Thanks very much for the comments, I will try to address these today ❤️

@kshyatt

kshyatt commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

OK @pbrehmer @Yue-Zhengyuan I think I responded to everything and tests are passing (so far..), did you have more thoughts?

@pbrehmer pbrehmer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me now, thanks!

@kshyatt

kshyatt commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Let me see if I can't add a few more tests to get coverage up, then I'll try to merge later today

@kshyatt

kshyatt commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Added some tests for contractions with a c4v env that should hit more methods and fixed some rotation bugs along the way :D

@kshyatt
kshyatt marked this pull request as ready for review October 28, 2026 10:40
@kshyatt
kshyatt merged commit 24dc51d into main Oct 29, 2026
83 of 84 checks passed
@kshyatt
kshyatt deleted the ksh/c4venv branch October 29, 2026 07:12
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