slsqp_jax.slsqp.hvp¶
Lagrangian Hessian-vector product factories — L-BFGS-backed and exact (obj_hvp_fn + constraint HVP contributions).
slsqp_jax.slsqp.hvp
Lagrangian Hessian-vector product factories.
The QP subproblem needs v -> B v where B is some
positive-definite approximation to the Lagrangian Hessian. Two
strategies are supported:
Frozen L-BFGS (default): the L-BFGS history at the start of the SLSQP step is treated as constant for the duration of the inner CG loop.
v -> B_k vis implemented via the compact representation inslsqp_jax.hessian.lbfgs_hvp().Newton-CG (
QPConfig.use_exact_hvp_in_qp = True): the exact Lagrangian HVP at the current iterate is used directly inside the CG loop. Each CG step costs one forward-over-reverse AD pass; on ill-conditioned problems this dramatically accelerates convergence.
The L-BFGS history is still updated regardless of which mode is active, because (a) it is the canonical source for the preconditioner and (b) it is the fallback in case a future revision skips an exact HVP evaluation.
- slsqp_jax.slsqp.hvp.build_exact_lagrangian_hvp(*, fn, y, args, multipliers_eq, multipliers_ineq, obj_hvp_impl, eq_hvp_contrib_impl, ineq_hvp_contrib_impl, n_ineq_general)[source]¶
Build the exact Lagrangian HVP at the current iterate.
H_L v = H_f v − Σ λ_i H_{c_eq_i} v − Σ μ_j H_{c_ineq_j} v. The dispatch to user-supplied vs AD-computed contribution callables is resolved upstream inslsqp_jax.slsqp.derivatives.make_derivative_closures().- Return type:
Callable[[Float[Array, 'n']],Float[Array, 'n']]- Parameters:
- slsqp_jax.slsqp.hvp.build_lbfgs_lagrangian_hvp(lbfgs_history)[source]¶
Closure over the frozen L-BFGS history.
- Return type:
Callable[[Float[Array, 'n']],Float[Array, 'n']]- Parameters:
lbfgs_history (LBFGSHistory)