Skip to content

feat(ipeps): split_honeycomb_merge — SVD reverse of Honeycomb A/B merge#48

Open
yuchihe wants to merge 2 commits into
XingyuZhang2018:iPEPS-unifiedfrom
yuchihe:feat/split-honeycomb-merge
Open

feat(ipeps): split_honeycomb_merge — SVD reverse of Honeycomb A/B merge#48
yuchihe wants to merge 2 commits into
XingyuZhang2018:iPEPS-unifiedfrom
yuchihe:feat/split-honeycomb-merge

Conversation

@yuchihe
Copy link
Copy Markdown

@yuchihe yuchihe commented May 19, 2026

Summary

Add split_honeycomb_merge(M; convention, χmax, cutoff) in
src/ipeps_optimize/build_A.jl — the inverse of the Honeycomb sublattice
merge. Given a merged single-site iPEPS tensor M of shape
(D, D, D, D, d²), it returns two sublattice tensors A and B with
three virtual legs and one physical leg each, joined by a new internal
virtual bond of dimension χ ≤ D²·d produced by a single SVD.

Details

  • Reshape physical leg σ_AB to (σ_A, σ_B) in Julia's column-major
    order (σ_A is the inner index).
  • Permute legs into an (A-side | B-side) grouping selected by the
    convention keyword:
    • :LU_RD (default, "anti-diagonal" merge): A keeps (L, U),
      B keeps (R, D). Reconstruction
      M[L,D,R,U,σ_AB] = Σ_x A[L,U,σ_A,x] · B[x,R,D,σ_B].
      This matches the natural u/v merge along the a bond in the
      brickwall convention (u with external (L=c, U=b), v with
      external (R=c, D=b)).
    • :LD_RU ("diagonal" merge): A keeps (L, D), B keeps (R, U).
  • SVD on the (D²d × D²d) matrix, distribute singular values evenly
    between A and B (A·√S and √S·B').
  • χmax > 0 caps the bond; cutoff > 0 discards S[i] ≤ cutoff · S[1].

Returns a NamedTuple (A, B, S):

  • A: shape (D, D, d, χ)A[extA1, extA2, σ_A, x_internal]
  • B: shape (χ, D, D, d)B[x_internal, extB1, extB2, σ_B]
  • S: kept singular values (length χ)

Test plan

Added a @testset "split_honeycomb_merge SVD reverse" block in
test/test_ipeps.jl that:

  • Builds random A, B with χ = D²d, contracts to form M, calls
    split_honeycomb_merge, and verifies M_reconstructed ≈ M for
    both :LU_RD and :LD_RU conventions.
  • Checks output shapes: A is (D, D, d, D²d), B is (D²d, D, D, d),
    length(S) == D²d.
  • Verifies χmax = 5 keeps exactly 5 singular values (largest) and
    that the returned S is sorted in descending order.
  • Verifies ArgumentError is thrown for non-square physical dim,
    mismatched virtual bond dims, and unknown convention symbol.

🤖 Generated with Claude Code

Yuchi He and others added 2 commits May 19, 2026 13:28
Add `split_honeycomb_merge(M; convention, χmax, cutoff)` to recover the
two sublattice tensors from a merged single-site Honeycomb iPEPS
tensor of shape `(D, D, D, D, d²)`. The function reshapes the merged
physical leg back to `(σ_A, σ_B)` (column-major, σ_A inner), regroups
external legs into two halves, and performs a single SVD to introduce
a new internal virtual bond of dimension χ ≤ D²·d.

Two conventions are supported:
- `:LU_RD` (default): A=(L,U), B=(R,D) — matches the natural u/v merge
  along the `a` bond in the brickwall convention.
- `:LD_RU`: A=(L,D), B=(R,U) — diagonal partition.

Singular values are distributed evenly (`A·√S` and `√S·B'`). `χmax > 0`
caps the kept bond dimension; `cutoff > 0` discards tails relative to
the largest singular value.

Tests cover roundtrip accuracy for both conventions, truncation, and
argument validation.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
In TeneT, `χ` already denotes the boundary VUMPS environment bond
dimension. Naming the new SVD-introduced internal bond `χ` (and its
keyword `χmax`) is confusing. Rename to `Dtrunc` everywhere — keyword,
internal variables, docstring, and the corresponding test names.

The internal full-rank counterpart (`χfull`) becomes `Dfull`, the kept
rank is `Dkeep`, and the kept singular values are `Skeep`. Default
`Dtrunc=0` still means "no truncation, keep all D²·d singular values".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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