# Riemannian quasi-Newton methods

`Manopt.quasi_Newton`

— Function`quasi_Newton(M, f, grad_f, p)`

Perform a quasi Newton iteration for `f`

on the manifold `M`

starting in the point `p`

.

The $k$th iteration consists of

- Compute the search direction $η_k = -\mathcal{B}_k [\operatorname{grad}f (p_k)]$ or solve $\mathcal{H}_k [η_k] = -\operatorname{grad}f (p_k)]$.
- Determine a suitable stepsize $α_k$ along the curve $\gamma(α) = R_{p_k}(α η_k)$, usually by using
`WolfePowellLinesearch`

. - Compute
`p_{k+1} = R_{p_k}(α_k η_k)`

`. - Define $s_k = T_{p_k, α_k η_k}(α_k η_k)$ and $y_k = \operatorname{grad}f(p_{k+1}) - T_{p_k, α_k η_k}(\operatorname{grad}f(p_k))$.
- Compute the new approximate Hessian $H_{k+1}$ or its inverse $B_k$.

**Input**

`M`

a manifold $\mathcal{M}$.`f`

a cost function $F : \mathcal{M} →ℝ$ to minimize.`grad_f`

the gradient $\operatorname{grad}F : \mathcal{M} →T_x\mathcal M$ of $F$.`p`

an initial value $p ∈ \mathcal{M}$.

**Optional**

`basis`

: (`DefaultOrthonormalBasis()`

) basis within the tangent spaces

to represent the Hessian (inverse).

`cautious_update`

: (`false`

) whether or not to use a`QuasiNewtonCautiousDirectionUpdate`

`cautious_function`

: (`(x) -> x*10^(-4)`

) a monotone increasing function that is zero at 0 and strictly increasing at 0 for the cautious update.`direction_update`

: (`InverseBFGS`

`()`

) the update rule to use.`evaluation`

: (`AllocatingEvaluation`

) specify whether the gradient works by allocation (default) form`gradF(M, x)`

or`InplaceEvaluation`

in place of form`gradF!(M, X, x)`

.`initial_operator`

: (`Matrix{Float64}(I,n,n)`

) initial matrix to use die the approximation, where`n=manifold_dimension(M)`

, see also`scale_initial_operator`

.`memory_size`

: (`20`

) limited memory, number of $s_k, y_k$ to store. Set to a negative value to use a full memory representation`retraction_method`

: (`default_retraction_method(M, typeof(p))`

) a retraction method to use`scale_initial_operator`

: (`true`

) scale initial operator with $\frac{⟨s_k,y_k⟩_{p_k}}{\lVert y_k\rVert_{p_k}}$ in the computation`stabilize`

: (`true`

) stabilize the method numerically by projecting computed (Newton-) directions to the tangent space to reduce numerical errors`stepsize`

: (`WolfePowellLinesearch`

`(retraction_method, vector_transport_method)`

) specify a`Stepsize`

.`stopping_criterion`

: (`StopAfterIteration`

`(max(1000, memory_size)) |`

`StopWhenGradientNormLess`

`(1e-6)`

) specify a`StoppingCriterion`

`vector_transport_method`

: (`default_vector_transport_method(M, typeof(p))`

) a vector transport to use.

**Output**

the obtained (approximate) minimizer $p^*$, see `get_solver_return`

for details.

`Manopt.quasi_Newton!`

— Function`quasi_Newton!(M, F, gradF, x; options...)`

Perform a quasi Newton iteration for `F`

on the manifold `M`

starting in the point `x`

using a retraction $R$ and a vector transport $T$.

**Input**

`M`

a manifold $\mathcal{M}$.`F`

a cost function $F: \mathcal{M} →ℝ$ to minimize.`gradF`

the gradient $\operatorname{grad}F : \mathcal{M} → T_x\mathcal M$ of $F$ implemented as`gradF(M,p)`

.`x`

an initial value $x ∈ \mathcal{M}$.

For all optional parameters, see `quasi_Newton`

.

## Background

The aim is to minimize a real-valued function on a Riemannian manifold, that is

\[\min f(x), \quad x ∈ \mathcal{M}.\]

Riemannian quasi-Newtonian methods are as generalizations of their Euclidean counterparts Riemannian line search methods. These methods determine a search direction $η_k ∈ T_{x_k} \mathcal{M}$ at the current iterate $x_k$ and a suitable stepsize $α_k$ along $\gamma(α) = R_{x_k}(α η_k)$, where $R: T \mathcal{M} →\mathcal{M}$ is a retraction. The next iterate is obtained by

\[x_{k+1} = R_{x_k}(α_k η_k).\]

In quasi-Newton methods, the search direction is given by

\[η_k = -{\mathcal{H}_k}^{-1}[\operatorname{grad}f (x_k)] = -\mathcal{B}_k [\operatorname{grad} (x_k)],\]

where $\mathcal{H}_k : T_{x_k} \mathcal{M} →T_{x_k} \mathcal{M}$ is a positive definite self-adjoint operator, which approximates the action of the Hessian $\operatorname{Hess} f (x_k)[⋅]$ and $\mathcal{B}_k = {\mathcal{H}_k}^{-1}$. The idea of quasi-Newton methods is instead of creating a complete new approximation of the Hessian operator $\operatorname{Hess} f(x_{k+1})$ or its inverse at every iteration, the previous operator $\mathcal{H}_k$ or $\mathcal{B}_k$ is updated by a convenient formula using the obtained information about the curvature of the objective function during the iteration. The resulting operator $\mathcal{H}_{k+1}$ or $\mathcal{B}_{k+1}$ acts on the tangent space $T_{x_{k+1}} \mathcal{M}$ of the freshly computed iterate $x_{k+1}$. In order to get a well-defined method, the following requirements are placed on the new operator $\mathcal{H}_{k+1}$ or $\mathcal{B}_{k+1}$ that is created by an update. Since the Hessian $\operatorname{Hess} f(x_{k+1})$ is a self-adjoint operator on the tangent space $T_{x_{k+1}} \mathcal{M}$, and $\mathcal{H}_{k+1}$ approximates it, one requirement is, that $\mathcal{H}_{k+1}$ or $\mathcal{B}_{k+1}$ is also self-adjoint on $T_{x_{k+1}} \mathcal{M}$. In order to achieve a steady descent, the next requirement is that $η_k$ is a descent direction in each iteration. Hence a further requirement is that $\mathcal{H}_{k+1}$ or $\mathcal{B}_{k+1}$ is a positive definite operator on $T_{x_{k+1}} \mathcal{M}$. In order to get information about the curvature of the objective function into the new operator $\mathcal{H}_{k+1}$ or $\mathcal{B}_{k+1}$, the last requirement is a form of a Riemannian quasi-Newton equation:

\[\mathcal{H}_{k+1} [T_{x_k \rightarrow x_{k+1}}({R_{x_k}}^{-1}(x_{k+1}))] = \operatorname{grad}(x_{k+1}) - T_{x_k \rightarrow x_{k+1}}(\operatorname{grad}f(x_k))\]

or

\[\mathcal{B}_{k+1} [\operatorname{grad}f(x_{k+1}) - T_{x_k \rightarrow x_{k+1}}(\operatorname{grad}f(x_k))] = T_{x_k \rightarrow x_{k+1}}({R_{x_k}}^{-1}(x_{k+1}))\]

where $T_{x_k \rightarrow x_{k+1}} : T_{x_k} \mathcal{M} →T_{x_{k+1}} \mathcal{M}$ and the chosen retraction $R$ is the associated retraction of $T$. Note that, of course, not all updates in all situations meet these conditions in every iteration. For specific quasi-Newton updates, the fulfilment of the Riemannian curvature condition, which requires that

\[g_{x_{k+1}}(s_k, y_k) > 0\]

holds, is a requirement for the inheritance of the self-adjointness and positive definiteness of the $\mathcal{H}_k$ or $\mathcal{B}_k$ to the operator $\mathcal{H}_{k+1}$ or $\mathcal{B}_{k+1}$. Unfortunately, the fulfilment of the Riemannian curvature condition is not given by a step size $\alpha_k > 0$ that satisfies the generalized Wolfe conditions. However, to create a positive definite operator $\mathcal{H}_{k+1}$ or $\mathcal{B}_{k+1}$ in each iteration, the so-called locking condition was introduced in [HGA15], which requires that the isometric vector transport $T^S$, which is used in the update formula, and its associate retraction $R$ fulfil

\[T^{S}{x, ξ_x}(ξ_x) = β T^{R}{x, ξ_x}(ξ_x), \quad β = \frac{\lVert ξ_x \rVert_x}{\lVert T^{R}{x, ξ_x}(ξ_x) \rVert_{R_{x}(ξ_x)}},\]

where $T^R$ is the vector transport by differentiated retraction. With the requirement that the isometric vector transport $T^S$ and its associated retraction $R$ satisfies the locking condition and using the tangent vector

\[y_k = {β_k}^{-1} \operatorname{grad}f(x_{k+1}) - T^{S}{x_k, α_k η_k}(\operatorname{grad}f(x_k)),\]

where

\[β_k = \frac{\lVert α_k η_k \rVert_{x_k}}{\lVert T^{R}{x_k, α_k η_k}(α_k η_k) \rVert_{x_{k+1}}},\]

in the update, it can be shown that choosing a stepsize $α_k > 0$ that satisfies the Riemannian Wolfe conditions leads to the fulfilment of the Riemannian curvature condition, which in turn implies that the operator generated by the updates is positive definite. In the following the specific operators are denoted in matrix notation and hence use $H_k$ and $B_k$, respectively.

## Direction updates

In general there are different ways to compute a fixed `AbstractQuasiNewtonUpdateRule`

. In general these are represented by

`Manopt.AbstractQuasiNewtonDirectionUpdate`

— Type`AbstractQuasiNewtonDirectionUpdate`

An abstract representation of an Quasi Newton Update rule to determine the next direction given current `QuasiNewtonState`

.

All subtypes should be functors, they should be callable as `H(M,x,d)`

to compute a new direction update.

`Manopt.QuasiNewtonMatrixDirectionUpdate`

— Type`QuasiNewtonMatrixDirectionUpdate <: AbstractQuasiNewtonDirectionUpdate`

The `QuasiNewtonMatrixDirectionUpdate`

represent a quasi-Newton update rule, where the operator is stored as a matrix. A distinction is made between the update of the approximation of the Hessian, $H_k \mapsto H_{k+1}$, and the update of the approximation of the Hessian inverse, $B_k \mapsto B_{k+1}$. For the first case, the coordinates of the search direction $η_k$ with respect to a basis $\{b_i\}^{n}_{i=1}$ are determined by solving a linear system of equations

\[\text{Solve} \quad \hat{η_k} = - H_k \widehat{\operatorname{grad}f(x_k)},\]

where $H_k$ is the matrix representing the operator with respect to the basis $\{b_i\}^{n}_{i=1}$ and $\widehat{\operatorname{grad}f(x_k)}$ represents the coordinates of the gradient of the objective function $f$ in $x_k$ with respect to the basis $\{b_i\}^{n}_{i=1}$. If a method is chosen where Hessian inverse is approximated, the coordinates of the search direction $η_k$ with respect to a basis $\{b_i\}^{n}_{i=1}$ are obtained simply by matrix-vector multiplication

\[\hat{η_k} = - B_k \widehat{\operatorname{grad}f(x_k)},\]

where $B_k$ is the matrix representing the operator with respect to the basis $\{b_i\}^{n}_{i=1}$ and $\widehat{\operatorname{grad}f(x_k)}$. In the end, the search direction $η_k$ is generated from the coordinates $\hat{eta_k}$ and the vectors of the basis $\{b_i\}^{n}_{i=1}$ in both variants. The `AbstractQuasiNewtonUpdateRule`

indicates which quasi-Newton update rule is used. In all of them, the Euclidean update formula is used to generate the matrix $H_{k+1}$ and $B_{k+1}$, and the basis $\{b_i\}^{n}_{i=1}$ is transported into the upcoming tangent space $T_{x_{k+1}} \mathcal{M}$, preferably with an isometric vector transport, or generated there.

**Provided functors**

`(mp::AbstractManoptproblem, st::QuasiNewtonState) -> η`

to compute the update direction`(η, mp::AbstractManoptproblem, st::QuasiNewtonState) -> η`

to compute the update direction in-place of`η`

**Fields**

`basis`

: an`AbstractBasis`

to use in the tangent spaces`matrix`

: (`Matrix{Float64}(I, manifold_dimension(M), manifold_dimension(M))`

) the matrix which represents the approximating operator.`scale`

: (`true) indicates whether the initial matrix (= identity matrix) should be scaled before the first update.`update`

: a`AbstractQuasiNewtonUpdateRule`

.`vector_transport_method`

: (`vector_transport_method`

)an`AbstractVectorTransportMethod`

**Constructor**

```
QuasiNewtonMatrixDirectionUpdate(
M::AbstractManifold,
update,
basis::B=DefaultOrthonormalBasis(),
m=Matrix{Float64}(I, manifold_dimension(M), manifold_dimension(M));
kwargs...
)
```

**Keyword arguments**

`scale`

,`vector_transport_method`

for the two fields

Generate the Update rule with defaults from a manifold and the names corresponding to the fields.

**See also**

`QuasiNewtonLimitedMemoryDirectionUpdate`

`QuasiNewtonCautiousDirectionUpdate`

`AbstractQuasiNewtonDirectionUpdate`

`Manopt.QuasiNewtonLimitedMemoryDirectionUpdate`

— Type`QuasiNewtonLimitedMemoryDirectionUpdate <: AbstractQuasiNewtonDirectionUpdate`

This `AbstractQuasiNewtonDirectionUpdate`

represents the limited-memory Riemannian BFGS update, where the approximating operator is represented by $m$ stored pairs of tangent vectors $\{ \widetilde{s}_i, \widetilde{y}_i\}_{i=k-m}^{k-1}$ in the $k$-th iteration. For the calculation of the search direction $η_k$, the generalisation of the two-loop recursion is used (see [HGA15]), since it only requires inner products and linear combinations of tangent vectors in $T_{x_k} \mathcal{M}$. For that the stored pairs of tangent vectors $\{ \widetilde{s}_i, \widetilde{y}_i\}_{i=k-m}^{k-1}$, the gradient $\operatorname{grad}f(x_k)$ of the objective function $f$ in $x_k$ and the positive definite self-adjoint operator

\[\mathcal{B}^{(0)}_k[⋅] = \frac{g_{x_k}(s_{k-1}, y_{k-1})}{g_{x_k}(y_{k-1}, y_{k-1})} \; \mathrm{id}_{T_{x_k} \mathcal{M}}[⋅]\]

are used. The two-loop recursion can be understood as that the `InverseBFGS`

update is executed $m$ times in a row on $\mathcal{B}^{(0)}_k[⋅]$ using the tangent vectors $\{ \widetilde{s}_i, \widetilde{y}_i\}_{i=k-m}^{k-1}$, and in the same time the resulting operator $\mathcal{B}^{LRBFGS}_k [⋅]$ is directly applied on $\operatorname{grad}f(x_k)$. When updating there are two cases: if there is still free memory, $k < m$, the previously stored vector pairs $\{ \widetilde{s}_i, \widetilde{y}_i\}_{i=k-m}^{k-1}$ have to be transported into the upcoming tangent space $T_{x_{k+1}} \mathcal{M}$. If there is no free memory, the oldest pair $\{ \widetilde{s}_{k−m}, \widetilde{y}_{k−m}\}$ has to be discarded and then all the remaining vector pairs $\{ \widetilde{s}_i, \widetilde{y}_i\}_{i=k-m+1}^{k-1}$ are transported into the tangent space $T_{x_{k+1}} \mathcal{M}$. After that the new values $s_k = \widetilde{s}_k = T^{S}_{x_k, α_k η_k}(α_k η_k)$ and $y_k = \widetilde{y}_k$ are stored at the beginning. This process ensures that new information about the objective function is always included and the old, probably no longer relevant, information is discarded.

**Provided functors**

`(mp::AbstractManoptproblem, st::QuasiNewtonState) -> η`

to compute the update direction`(η, mp::AbstractManoptproblem, st::QuasiNewtonState) -> η`

to compute the update direction in-place of`η`

**Fields**

`memory_s`

the set of the stored (and transported) search directions times step size $\{ \widetilde{s}_i\}_{i=k-m}^{k-1}$.`memory_y`

set of the stored gradient differences $\{ \widetilde{y}_i\}_{i=k-m}^{k-1}$.`ξ`

a variable used in the two-loop recursion.`ρ`

a variable used in the two-loop recursion.`scale`

initial scaling of the Hessian`vector_transport_method`

a`AbstractVectorTransportMethod`

`message`

a string containing a potential warning that might have appeared

**Constructor**

```
QuasiNewtonLimitedMemoryDirectionUpdate(
M::AbstractManifold,
x,
update::AbstractQuasiNewtonUpdateRule,
memory_size;
initial_vector=zero_vector(M,x),
scale::Real=1.0
project::Bool=true
)
```

**See also**

`InverseBFGS`

`QuasiNewtonCautiousDirectionUpdate`

`AbstractQuasiNewtonDirectionUpdate`

`Manopt.QuasiNewtonCautiousDirectionUpdate`

— Type`QuasiNewtonCautiousDirectionUpdate <: AbstractQuasiNewtonDirectionUpdate`

These `AbstractQuasiNewtonDirectionUpdate`

s represent any quasi-Newton update rule, which are based on the idea of a so-called cautious update. The search direction is calculated as given in `QuasiNewtonMatrixDirectionUpdate`

or `QuasiNewtonLimitedMemoryDirectionUpdate`

, butut the update then is only executed if

\[\frac{g_{x_{k+1}}(y_k,s_k)}{\lVert s_k \rVert^{2}_{x_{k+1}}} ≥ θ(\lVert \operatorname{grad}f(x_k) \rVert_{x_k}),\]

is satisfied, where $θ$ is a monotone increasing function satisfying $θ(0) = 0$ and $θ$ is strictly increasing at $0$. If this is not the case, the corresponding update is skipped, which means that for `QuasiNewtonMatrixDirectionUpdate`

the matrix $H_k$ or $B_k$ is not updated. The basis $\{b_i\}^{n}_{i=1}$ is nevertheless transported into the upcoming tangent space $T_{x_{k+1}} \mathcal{M}$, and for `QuasiNewtonLimitedMemoryDirectionUpdate`

neither the oldest vector pair $\{ \widetilde{s}_{k−m}, \widetilde{y}_{k−m}\}$ is discarded nor the newest vector pair $\{ \widetilde{s}_{k}, \widetilde{y}_{k}\}$ is added into storage, but all stored vector pairs $\{ \widetilde{s}_i, \widetilde{y}_i\}_{i=k-m}^{k-1}$ are transported into the tangent space $T_{x_{k+1}} \mathcal{M}$. If `InverseBFGS`

or `InverseBFGS`

is chosen as update, then the resulting method follows the method of [HAG18], taking into account that the corresponding step size is chosen.

**Provided functors**

`(mp::AbstractManoptproblem, st::QuasiNewtonState) -> η`

to compute the update direction`(η, mp::AbstractManoptproblem, st::QuasiNewtonState) -> η`

to compute the update direction in-place of`η`

**Fields**

`update`

: an`AbstractQuasiNewtonDirectionUpdate`

`θ`

: a monotone increasing function satisfying $θ(0) = 0$ and $θ$ is strictly increasing at $0$.

**Constructor**

```
QuasiNewtonCautiousDirectionUpdate(U::QuasiNewtonMatrixDirectionUpdate; θ = x -> x)
QuasiNewtonCautiousDirectionUpdate(U::QuasiNewtonLimitedMemoryDirectionUpdate; θ = x -> x)
```

Generate a cautious update for either a matrix based or a limited memory based update rule.

**See also**

`QuasiNewtonMatrixDirectionUpdate`

`QuasiNewtonLimitedMemoryDirectionUpdate`

## Hessian update rules

Using

`Manopt.update_hessian!`

— Function`update_hessian!(d, amp, st, p_old, iter)`

update the Hessian within the `QuasiNewtonState`

`o`

given a `AbstractManoptProblem`

`amp`

as well as the an `AbstractQuasiNewtonDirectionUpdate`

`d`

and the last iterate `p_old`

. Note that the current (`iter`

th) iterate is already stored in `o.x`

.

See also `AbstractQuasiNewtonUpdateRule`

for the different rules that are available within `d`

.

the following update formulae for either $H_{k+1}$ or $B_{k+1}$ are available.

`Manopt.AbstractQuasiNewtonUpdateRule`

— Type`AbstractQuasiNewtonUpdateRule`

Specify a type for the different `AbstractQuasiNewtonDirectionUpdate`

s, that is for a `QuasiNewtonMatrixDirectionUpdate`

there are several different updates to the matrix, while the default for `QuasiNewtonLimitedMemoryDirectionUpdate`

the most prominent is `InverseBFGS`

.

`Manopt.BFGS`

— Type`BFGS <: AbstractQuasiNewtonUpdateRule`

indicates in `AbstractQuasiNewtonDirectionUpdate`

that the Riemannian BFGS update is used in the Riemannian quasi-Newton method.

Denote by $\widetilde{H}_k^\mathrm{BFGS}$ the operator concatenated with a vector transport and its inverse before and after to act on $x_{k+1} = R_{x_k}(α_k η_k)$. Then the update formula reads

\[H^\mathrm{BFGS}_{k+1} = \widetilde{H}^\mathrm{BFGS}_k + \frac{y_k y^{\mathrm{T}}_k }{s^{\mathrm{T}}_k y_k} - \frac{\widetilde{H}^\mathrm{BFGS}_k s_k s^{\mathrm{T}}_k \widetilde{H}^\mathrm{BFGS}_k }{s^{\mathrm{T}}_k \widetilde{H}^\mathrm{BFGS}_k s_k}\]

where $s_k$ and $y_k$ are the coordinate vectors with respect to the current basis (from `QuasiNewtonState`

) of

\[T^{S}_{x_k, α_k η_k}(α_k η_k) \quad\text{and}\quad \operatorname{grad}f(x_{k+1}) - T^{S}_{x_k, α_k η_k}(\operatorname{grad}f(x_k)) ∈ T_{x_{k+1}} \mathcal{M},\]

respectively.

`Manopt.DFP`

— Type`DFP <: AbstractQuasiNewtonUpdateRule`

indicates in an `AbstractQuasiNewtonDirectionUpdate`

that the Riemannian DFP update is used in the Riemannian quasi-Newton method.

Denote by $\widetilde{H}_k^\mathrm{DFP}$ the operator concatenated with a vector transport and its inverse before and after to act on $x_{k+1} = R_{x_k}(α_k η_k)$. Then the update formula reads

\[H^\mathrm{DFP}_{k+1} = \Bigl( \mathrm{id}_{T_{x_{k+1}} \mathcal{M}} - \frac{y_k s^{\mathrm{T}}_k}{s^{\mathrm{T}}_k y_k} \Bigr) \widetilde{H}^\mathrm{DFP}_k \Bigl( \mathrm{id}_{T_{x_{k+1}} \mathcal{M}} - \frac{s_k y^{\mathrm{T}}_k}{s^{\mathrm{T}}_k y_k} \Bigr) + \frac{y_k y^{\mathrm{T}}_k}{s^{\mathrm{T}}_k y_k}\]

where $s_k$ and $y_k$ are the coordinate vectors with respect to the current basis (from `QuasiNewtonState`

) of

\[T^{S}_{x_k, α_k η_k}(α_k η_k) \quad\text{and}\quad \operatorname{grad}f(x_{k+1}) - T^{S}_{x_k, α_k η_k}(\operatorname{grad}f(x_k)) ∈ T_{x_{k+1}} \mathcal{M},\]

respectively.

`Manopt.Broyden`

— Type`Broyden <: AbstractQuasiNewtonUpdateRule`

indicates in `AbstractQuasiNewtonDirectionUpdate`

that the Riemannian Broyden update is used in the Riemannian quasi-Newton method, which is as a convex combination of `BFGS`

and `DFP`

.

Denote by $\widetilde{H}_k^\mathrm{Br}$ the operator concatenated with a vector transport and its inverse before and after to act on $x_{k+1} = R_{x_k}(α_k η_k)$. Then the update formula reads

\[H^\mathrm{Br}_{k+1} = \widetilde{H}^\mathrm{Br}_k - \frac{\widetilde{H}^\mathrm{Br}_k s_k s^{\mathrm{T}}_k \widetilde{H}^\mathrm{Br}_k}{s^{\mathrm{T}}_k \widetilde{H}^\mathrm{Br}_k s_k} + \frac{y_k y^{\mathrm{T}}_k}{s^{\mathrm{T}}_k y_k} + φ_k s^{\mathrm{T}}_k \widetilde{H}^\mathrm{Br}_k s_k \Bigl( \frac{y_k}{s^{\mathrm{T}}_k y_k} - \frac{\widetilde{H}^\mathrm{Br}_k s_k}{s^{\mathrm{T}}_k \widetilde{H}^\mathrm{Br}_k s_k} \Bigr) \Bigl( \frac{y_k}{s^{\mathrm{T}}_k y_k} - \frac{\widetilde{H}^\mathrm{Br}_k s_k}{s^{\mathrm{T}}_k \widetilde{H}^\mathrm{Br}_k s_k} \Bigr)^{\mathrm{T}}\]

where $s_k$ and $y_k$ are the coordinate vectors with respect to the current basis (from `QuasiNewtonState`

) of

\[T^{S}_{x_k, α_k η_k}(α_k η_k) \quad\text{and}\quad \operatorname{grad}f(x_{k+1}) - T^{S}_{x_k, α_k η_k}(\operatorname{grad}f(x_k)) ∈ T_{x_{k+1}} \mathcal{M},\]

respectively, and $φ_k$ is the Broyden factor which is `:constant`

by default but can also be set to `:Davidon`

.

**Constructor**

`Broyden(φ, update_rule::Symbol = :constant)`

`Manopt.SR1`

— Type`SR1 <: AbstractQuasiNewtonUpdateRule`

indicates in `AbstractQuasiNewtonDirectionUpdate`

that the Riemannian SR1 update is used in the Riemannian quasi-Newton method.

Denote by $\widetilde{H}_k^\mathrm{SR1}$ the operator concatenated with a vector transport and its inverse before and after to act on $x_{k+1} = R_{x_k}(α_k η_k)$. Then the update formula reads

\[H^\mathrm{SR1}_{k+1} = \widetilde{H}^\mathrm{SR1}_k + \frac{ (y_k - \widetilde{H}^\mathrm{SR1}_k s_k) (y_k - \widetilde{H}^\mathrm{SR1}_k s_k)^{\mathrm{T}} }{ (y_k - \widetilde{H}^\mathrm{SR1}_k s_k)^{\mathrm{T}} s_k }\]

`QuasiNewtonState`

) of

respectively.

This method can be stabilized by only performing the update if denominator is larger than $r\lVert s_k\rVert_{x_{k+1}}\lVert y_k - \widetilde{H}^\mathrm{SR1}_k s_k \rVert_{x_{k+1}}$ for some $r>0$. For more details, see Section 6.2 in [NW06].

**Constructor**

`SR1(r::Float64=-1.0)`

Generate the `SR1`

update.

`Manopt.InverseBFGS`

— Type`InverseBFGS <: AbstractQuasiNewtonUpdateRule`

indicates in `AbstractQuasiNewtonDirectionUpdate`

that the inverse Riemannian BFGS update is used in the Riemannian quasi-Newton method.

Denote by $\widetilde{B}_k^\mathrm{BFGS}$ the operator concatenated with a vector transport and its inverse before and after to act on $x_{k+1} = R_{x_k}(α_k η_k)$. Then the update formula reads

\[B^\mathrm{BFGS}_{k+1} = \Bigl( \mathrm{id}_{T_{x_{k+1}} \mathcal{M}} - \frac{s_k y^{\mathrm{T}}_k }{s^{\mathrm{T}}_k y_k} \Bigr) \widetilde{B}^\mathrm{BFGS}_k \Bigl( \mathrm{id}_{T_{x_{k+1}} \mathcal{M}} - \frac{y_k s^{\mathrm{T}}_k }{s^{\mathrm{T}}_k y_k} \Bigr) + \frac{s_k s^{\mathrm{T}}_k}{s^{\mathrm{T}}_k y_k}\]

`QuasiNewtonState`

) of

respectively.

`Manopt.InverseDFP`

— Type`InverseDFP <: AbstractQuasiNewtonUpdateRule`

indicates in `AbstractQuasiNewtonDirectionUpdate`

that the inverse Riemannian DFP update is used in the Riemannian quasi-Newton method.

Denote by $\widetilde{B}_k^\mathrm{DFP}$ the operator concatenated with a vector transport and its inverse before and after to act on $x_{k+1} = R_{x_k}(α_k η_k)$. Then the update formula reads

\[B^\mathrm{DFP}_{k+1} = \widetilde{B}^\mathrm{DFP}_k + \frac{s_k s^{\mathrm{T}}_k}{s^{\mathrm{T}}_k y_k} - \frac{\widetilde{B}^\mathrm{DFP}_k y_k y^{\mathrm{T}}_k \widetilde{B}^\mathrm{DFP}_k}{y^{\mathrm{T}}_k \widetilde{B}^\mathrm{DFP}_k y_k}\]

`QuasiNewtonState`

) of

respectively.

`Manopt.InverseBroyden`

— Type`InverseBroyden <: AbstractQuasiNewtonUpdateRule`

Indicates in `AbstractQuasiNewtonDirectionUpdate`

that the Riemannian Broyden update is used in the Riemannian quasi-Newton method, which is as a convex combination of `InverseBFGS`

and `InverseDFP`

.

Denote by $\widetilde{H}_k^\mathrm{Br}$ the operator concatenated with a vector transport and its inverse before and after to act on $x_{k+1} = R_{x_k}(α_k η_k)$. Then the update formula reads

\[B^\mathrm{Br}_{k+1} = \widetilde{B}^\mathrm{Br}_k - \frac{\widetilde{B}^\mathrm{Br}_k y_k y^{\mathrm{T}}_k \widetilde{B}^\mathrm{Br}_k}{y^{\mathrm{T}}_k \widetilde{B}^\mathrm{Br}_k y_k} + \frac{s_k s^{\mathrm{T}}_k}{s^{\mathrm{T}}_k y_k} + φ_k y^{\mathrm{T}}_k \widetilde{B}^\mathrm{Br}_k y_k \Bigl( \frac{s_k}{s^{\mathrm{T}}_k y_k} - \frac{\widetilde{B}^\mathrm{Br}_k y_k}{y^{\mathrm{T}}_k \widetilde{B}^\mathrm{Br}_k y_k} \Bigr) \Bigl( \frac{s_k}{s^{\mathrm{T}}_k y_k} - \frac{\widetilde{B}^\mathrm{Br}_k y_k}{y^{\mathrm{T}}_k \widetilde{B}^\mathrm{Br}_k y_k} \Bigr)^{\mathrm{T}}\]

`QuasiNewtonState`

) of

respectively, and $φ_k$ is the Broyden factor which is `:constant`

by default but can also be set to `:Davidon`

.

**Constructor**

`InverseBroyden(φ, update_rule::Symbol = :constant)`

`Manopt.InverseSR1`

— Type`InverseSR1 <: AbstractQuasiNewtonUpdateRule`

indicates in `AbstractQuasiNewtonDirectionUpdate`

that the inverse Riemannian SR1 update is used in the Riemannian quasi-Newton method.

Denote by $\widetilde{B}_k^\mathrm{SR1}$ the operator concatenated with a vector transport and its inverse before and after to act on $x_{k+1} = R_{x_k}(α_k η_k)$. Then the update formula reads

\[B^\mathrm{SR1}_{k+1} = \widetilde{B}^\mathrm{SR1}_k + \frac{ (s_k - \widetilde{B}^\mathrm{SR1}_k y_k) (s_k - \widetilde{B}^\mathrm{SR1}_k y_k)^{\mathrm{T}} }{ (s_k - \widetilde{B}^\mathrm{SR1}_k y_k)^{\mathrm{T}} y_k }\]

`QuasiNewtonState`

) of

respectively.

This method can be stabilized by only performing the update if denominator is larger than $r\lVert y_k\rVert_{x_{k+1}}\lVert s_k - \widetilde{H}^\mathrm{SR1}_k y_k \rVert_{x_{k+1}}$ for some $r>0$. For more details, see Section 6.2 in [NW06].

**Constructor**

`InverseSR1(r::Float64=-1.0)`

Generate the `InverseSR1`

.

## State

The quasi Newton algorithm is based on a `DefaultManoptProblem`

.

`Manopt.QuasiNewtonState`

— Type`QuasiNewtonState <: AbstractManoptSolverState`

These Quasi Newton `AbstractManoptSolverState`

represent any quasi-Newton based method and can be used with any update rule for the direction.

**Fields**

`p`

the current iterate, a point on a manifold`X`

the current gradient`sk`

the current step`yk`

the current gradient difference`direction_update`

an`AbstractQuasiNewtonDirectionUpdate`

rule.`retraction_method`

an`AbstractRetractionMethod`

`stop`

a`StoppingCriterion`

as well as for internal use

`p_old`

the last iterate`η`

the current update direction`X_old`

the last gradient

**Constructor**

```
QuasiNewtonState(
M::AbstractManifold,
x;
initial_vector=zero_vector(M,x),
direction_update::D=QuasiNewtonLimitedMemoryDirectionUpdate(M, x, InverseBFGS(), 20;
vector_transport_method=vector_transport_method,
)
stopping_criterion=StopAfterIteration(1000) | StopWhenGradientNormLess(1e-6),
retraction_method::RM=default_retraction_method(M, typeof(p)),
vector_transport_method::VTM=default_vector_transport_method(M, typeof(p)),
stepsize=default_stepsize(M; QuasiNewtonState)
)
```

**See also**

## Technical details

The `quasi_Newton`

solver requires the following functions of a manifold to be available

- A
`retract!`

`(M, q, p, X)`

; it is recommended to set the`default_retraction_method`

to a favourite retraction. If this default is set, a`retraction_method=`

does not have to be specified. - A
`vector_transport_to!`

`M, Y, p, X, q)`

; it is recommended to set the`default_vector_transport_method`

to a favourite retraction. If this default is set, a`vector_transport_method=`

or`vector_transport_method_dual=`

(for $\mathcal N$) does not have to be specified. - By default quasi Newton uses
`ArmijoLinesearch`

which requires`max_stepsize`

`(M)`

to be set and an implementation of`inner`

`(M, p, X)`

. - the
`norm`

as well, to stop when the norm of the gradient is small, but if you implemented`inner`

, the norm is provided already. - A
`copyto!`

`(M, q, p)`

and`copy`

`(M,p)`

for points and similarly`copy(M, p, X)`

for tangent vectors. - By default the tangent vector storing the gradient is initialized calling
`zero_vector`

`(M,p)`

.

Most Hessian approximations further require `get_coordinates`

`(M, p, X, b)`

with respect to the `AbstractBasis`

`b`

provided, which is `DefaultOrthonormalBasis`

by default from the `basis=`

keyword.

## Literature

- [HAG18]
- W. Huang, P.-A. Absil and K. A. Gallivan.
*A Riemannian BFGS method without differentiated retraction for nonconvex optimization problems*. SIAM Journal on Optimization**28**, 470–495 (2018). - [HGA15]
- W. Huang, K. A. Gallivan and P.-A. Absil.
*A Broyden class of quasi-Newton methods for Riemannian optimization*. SIAM Journal on Optimization**25**, 1660–1685 (2015). - [NW06]
- J. Nocedal and S. J. Wright.
*Numerical Optimization*. 2 Edition (Springer, New York, 2006).