Fix indefinite GradientGrassmann preconditioner on nearly rank-deficient bonds - #532
Merged
Merged
Conversation
…ent bonds The regularized inverse of `ρ = C * C'` was formed explicitly as `U * inv(S² + δ²) * U'`. Once the gradient is small, its condition number exceeds `1 / eps` on nearly rank-deficient bonds, and the explicit matrix is no longer numerically positive definite. The preconditioned gradient then need not be a descent direction, the line search returns a zero step, and the Hager-Zhang β in the next CG iteration evaluates to 0/0, feeding a NaN tangent into the Grassmann retraction. Apply the inverse in factored form instead, scaling before mixing back with U'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 1, 2026
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.
Fixes the intermittent
ArgumentError: invalid argument #4 to LAPACK callin the finiteGradientGrassmanntest for the long-range Ising model (12 of 20 seeds failed onmain).Cause
The long-range model's bonds are nearly rank-deficient (Schmidt values
[1.0, 0.062, ~1e-10, …]). Once the gradient is small, the regularizedinv(S² + δ²)has a condition number above1 / eps, so the explicitU * inv(S² + δ²) * U'is not numerically positive definite (⟨g, P g⟩ = -1.2e-17). The linesearch then returns a zero step, the next CG β is0/0 = NaN, and the NaN reaches the SVD inGrassmann.retract. This affects infinite MPS as well and does not depend on the mixed scalartype.Fix
Apply the inverse in factored form,
((Δ.Z * U) * inv(S² + δ²)) * U', so the sign of⟨g, P g⟩stays reliable. The outdated test comment about "overshooting" is removed.Tests
groundstate/groundstatepasses (109/109).Related hardening in OptimKit: Jutho/OptimKit.jl#48.
🤖 Generated with Claude Code