Skip to content

Add LQNOperator: a hybrid limited-memory BFGS/SR1 quasi-Newton operator - #427

Open
arnavk23 wants to merge 2 commits into
JuliaSmoothOptimizers:mainfrom
arnavk23:issue-257-general-qn-operator
Open

arnavk23 wants to merge 2 commits into
JuliaSmoothOptimizers:mainfrom
arnavk23:issue-257-general-qn-operator

Conversation

@arnavk23

@arnavk23 arnavk23 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@tmigot @dpo Fixes #257
At each push!, it attempts a BFGS update (preserving positive definiteness) and falls back to an SR1 update (capturing negative curvature) when BFGS's numerical safeguards (sᵀy > 0, sᵀBs > 0) are not satisfied, rejecting the pair only if neither is well defined. Internally each memory slot is stored as one or two signed rank-one dyads, recomputed each push in chronological order (as LBFGSOperator and LSR1Operator already do), so mixed BFGS/SR1 histories share the same compact-representation machinery.

Implements the operator proposed in issue JuliaSmoothOptimizers#257: at each push!, it attempts a
BFGS update (preserving positive definiteness) and falls back to an SR1
update (capturing negative curvature) when BFGS's numerical safeguards
(sᵀy > 0, sᵀBs > 0) are not satisfied, rejecting the pair only if neither is
well defined. Internally each memory slot is stored as one or two signed
rank-one dyads, recomputed each push in chronological order (as LBFGSOperator
and LSR1Operator already do), so mixed BFGS/SR1 histories share the same
compact-representation machinery.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 3, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

LQNData can become internally inconsistent when mem <= 0 (allocated slot buffers length mem but data.mem == max(mem,1)), leading to out-of-bounds indexing.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new limited-memory quasi-Newton operator (LQNOperator) to LinearOperators.jl that hybridizes BFGS and SR1 updates by selecting the first numerically well-defined update at each push!, and wires it into the existing quasi-Newton module and test suite.

Changes:

  • Introduce LQNOperator with automatic BFGS-first, SR1-fallback update selection and a compact signed rank-one representation.
  • Add comprehensive tests covering selection behavior, rejection behavior, dense-reference agreement, allocations, and eigenvalue sanity.
  • Register the new operator in src/qn.jl and ensure tests run via test/runtests.jl.
File summaries
File Description
src/lqn.jl Implements LQNOperator and its storage/update logic (BFGS/SR1 hybrid).
src/qn.jl Includes the new lqn.jl module into the quasi-Newton entry point.
test/test_lqn.jl Adds test coverage for correctness, rejection rules, allocations, and eigen behavior.
test/runtests.jl Ensures the new tests are executed in CI/local test runs.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lqn.jl
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@arnavk23 arnavk23 changed the title Add LQNOperator: a hybrid limited-memory BFGS/SR1 quasi-Newton operator Add LQNOperator: a hybrid limited-memory BFGS/SR1 quasi-Newton operator Sep 15, 2026

This branch has not been deployed

No deployments
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.

A general QNOperator

2 participants