Conversation
leburgel
marked this pull request as draft
October 4, 2026 08:08
leburgel
force-pushed
the
lb/trunc_pullback_cg
branch
from
October 4, 2026 08:19
1a38822 to
ffa3c6a
Compare
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For every kept column i,
svd_trunc_pullback!andeigh_trunc_pullback!solve (1 - wᵢ G) xᵢ = bᵢ with G Hermitian (SVD: G = P Pᴴ or Pᴴ P, whichever is smaller, and wᵢ = 1/σᵢ²; eigh: G = P and wᵢ = 1/λᵢ).mainsolves it by doubling, at O(n³) per squaring of G. This PR uses conjugate gradients on all columns at once, at O(n² k) per iteration for k kept columns, which pays off when k ≪ n (which is common in the context of CTMRG runs in PEPSKit.jl, which motivated this investigation). There is no new keyword.CG, batched over the columns.degeneracy_atoltimes the smallest Ritz value, so that its error is aboutdegeneracy_atol, as for doubling.maxiternow caps the conjugate-gradient iterations (default 10 times the dimension), with a warning if they do not converge.hermitian_stein_cg!, goes into a new filesrc/common/stein.jl, together withaccelerative_smith_iteration!, moved there unchanged (still used byeig_trunc_pullback!).Timed against main's solver on the same equations, in one process with the calls interleaved, on 204 cases in real and complex arithmetic (script below,
BENCH_MINTOTAL=1):eig_trunc_pullback!keeps doubling. Its G = APᴴ is not Hermitian, so conjugate gradients do not apply, and for eigenvalues spread over a disk no Krylov method converges faster than the Neumann series itself.Benchmark script
Run with this branch developed; the numbers above used
BENCH_MINTOTAL=1(28 minutes).