Skip to content

Use the full corner inverse in C4v characteristic equations for C4vQRProjector - #435

Merged
leburgel merged 1 commit into
mainfrom
lb/c4v_qr_corner_inverse
Oct 13, 2026
Merged

leburgel merged 1 commit into
mainfrom
lb/c4v_qr_corner_inverse

Conversation

@leburgel

@leburgel leburgel commented Oct 9, 2026

Copy link
Copy Markdown
Member

The C4v characteristic equation for the projector parametrization u contains the inverse of the fixed-point corner. generate_symmetric_characteristic_equation computed it as sdiag_pow(real(DiagonalTensorMap(Cfp)), -1), which inverts only the diagonal of Cfp. That is exact for C4vEighProjector, whose fixed-point corner is the diagonal matrix of eigenvalues, but not for C4vQRProjector: its corner is the Hermitian part of the contracted edges, which is not diagonal. ImplicitGradient with C4vQRProjector therefore solved the wrong linear problem and returned a slightly wrong gradient.

This PR selects the inverse by projector algorithm, through a new internal _c4v_corner_inverse(projector_alg, C):

  • C4vEighProjector: unchanged, the inverse of the diagonal.
  • C4vQRProjector: the full inverse, computed as V * sdiag_pow(D, -1) * V' from eigh_full(C). This uses the same sdiag_pow as the diagonal case, including its cutoff on small eigenvalues.

generate_symmetric_characteristic_equation takes the projector algorithm as a new projector_alg keyword, which the ImplicitGradient rrule passes.

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
...hms/contractions/ctmrg/characteristic_equations.jl 93.14% <100.00%> (+93.14%) ⬆️
src/algorithms/ctmrg/projectors/c4v_eigh.jl 76.47% <100.00%> (+76.47%) ⬆️
src/algorithms/ctmrg/projectors/c4v_qr.jl 64.28% <100.00%> (+64.28%) ⬆️
...lgorithms/optimization/implicit_differentiation.jl 90.71% <100.00%> (+90.71%) ⬆️

... and 94 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.

Great catch! I have nothing to add, so this looks good to me. (CTMRG failures are unrelated, so this should be ready to be merged.)

@leburgel
leburgel force-pushed the lb/c4v_qr_corner_inverse branch from 28febd8 to 4ee61c9 Compare October 12, 2026 16:18
@leburgel
leburgel merged commit 81b43df into main Oct 13, 2026
76 of 77 checks passed
@leburgel
leburgel deleted the lb/c4v_qr_corner_inverse branch October 13, 2026 03:58
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.

2 participants