Skip to content

Fix indefinite GradientGrassmann preconditioner on nearly rank-deficient bonds - #532

Merged
lkdvos merged 1 commit into
mainfrom
fix-grassmann-precondition
Oct 2, 2026
Merged

lkdvos merged 1 commit into
mainfrom
fix-grassmann-precondition

Conversation

@lkdvos

@lkdvos lkdvos commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Fixes the intermittent ArgumentError: invalid argument #4 to LAPACK call in the finite GradientGrassmann test for the long-range Ising model (12 of 20 seeds failed on main).

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 regularized inv(S² + δ²) has a condition number above 1 / eps, so the explicit U * inv(S² + δ²) * U' is not numerically positive definite (⟨g, P g⟩ = -1.2e-17). The linesearch then returns a zero step, the next CG β is 0/0 = NaN, and the NaN reaches the SVD in Grassmann.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

  • New testset "GradientGrassmann preconditioner is positive definite": fails with the old explicit form, passes with the fix.
  • Seeds 1–20 of the original reproduction pass. With tol 1e-12, all seeds fail before and pass after (10 finite, 6 infinite long-range).
  • groundstate/groundstate passes (109/109).

Related hardening in OptimKit: Jutho/OptimKit.jl#48.

🤖 Generated with Claude Code

…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>
@lkdvos lkdvos linked an issue Oct 1, 2026 that may be closed by this pull request
@lkdvos
lkdvos merged commit 67bee5e into main Oct 2, 2026
69 of 70 checks passed
@lkdvos
lkdvos deleted the fix-grassmann-precondition branch October 2, 2026 01:45
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.

negative Grassmann inner product

1 participant