---
abstract: 'We consider a minimization scheme based on the Householder transport operator for the Grassman manifold, where a point on the manifold is represented by an $m\times n$ matrix with orthonormal columns. In particular, we consider the case where $m \gg n$ and present a method with asymptotic complexity $mn^2$. To avoid explicit parametrization of the manifold we use Householder transforms to move on the manifold, and present a formulation for simultaneous Householder reflections for ${\mathbf{S}}$-orthonormal columns. We compare a quasi-Newton and nonlinear conjugate gradient implementation adapted to the manifold with a projected nonlinear conjugate gradient method, and demonstrate that the convergence rate is significantly improved if the manifold is taken into account when designing the optimization procedure.'
author:
- 'K. Baarman[^1], T. Eirola$^*$, and V. Havu[^2]'
bibliography:
- 'references.bib'
title: Direct minimization of electronic structure calculations with Householder reflections
---

Introduction
============

We consider the optimization problem $$\label{eq:minimization}
\min_{{\mathbf{X}}^T{\mathbf{X}}={\mathbf{I}}} f({\mathbf{X}}),$$ that is, we attempt to minimize the real valued function $f$ of ${\mathbf{X}}\in{\mathbb{R}}^{m\times n}$ where $m \gg n$, subject to the constraint ${\mathbf{X}}^T{\mathbf{X}}= {\mathbf{I}}$, and with the computable derivative $df({\mathbf{X}})$. The constraint on ${\mathbf{X}}$ ensures that $f$ has a minimum, but this minimum is not necessarily unique. The method we present requires that $m \ge 2n$. Extending the method to cover cases where just $m > n$ is, however, possible.

A special property we assume of $f$ is the homogeneity condition: $f({\mathbf{X}}) = f({\mathbf{X}}{\mathbf{Q}})$, where ${\mathbf{Q}}$ is any $n\times n$ orthonormal matrix. This property means that $f$ only depends on the span of the columns of ${\mathbf{X}}$. The set of subspaces that are spanned by the columns of orthonormal $m\times n$ matrices is called the Grassman manifold, ${\mathcal{M}}$. While the solution to (\[eq:minimization\]) is an equivalence class, we choose an arbitrary representative of the class since we are interested in the value of $f$. The closely related Stiefel manifold consists of the same problem without the homogeneity condition. While the Householder transformation is suitable for both the Grassman and Stiefel manifolds, the optimization method presented does not optimize with respect to the basis and is therefore suitable only for the Grassman manifold.

In the applications we have in mind the evaluation of $f$ and $df$ is expensive. For this reason we cannot employ a high quality line search to decide the step length, and the optimization method must be robust. Furthermore, we will measure the number of evaluations of $f$ and $df$ necessary to obtain a solution. One iteration of the optimization procedure requires the two evaluations, once to evaluate the solution candidate and once to construct a quadratic approximation along the search direction.

For computational reasons we choose an $m \times n$ matrix, ${\mathbf{X}}$, as a representative of a point on ${\mathcal{M}}$, and enforce the requirement $$\label{eq:constraint}
{\mathbf{X}}^T{\mathbf{X}}= {\mathbf{I}}.$$ While this representation includes more degrees of freedom than strictly necessary, the approach is suitable for use in practice @edelman1998.

We use the inner product for matrices $$\label{eq:innerproduct}
({\mathbf{A}}, {\mathbf{B}}) = \mathrm{trace} ({\mathbf{A}}^T {\mathbf{B}}),$$ and the tangent spaces at ${\mathbf{X}}$ satisfying ${\mathbf{X}}^T{\mathbf{X}}={\mathbf{I}}$ $$\{{\mathbf{Z}}={\mathbf{X}}{\mathbf{A}}+{\mathbf{Y}}\, | \,{\mathbf{Y}}^T {\mathbf{X}}= {\mathbf{0}}\;\mathrm{and}\; {\mathbf{A}}^T=-{\mathbf{A}}\}.$$ On the Grassman manifold the value of $f$ depends only on the space spanned by the columns of ${\mathbf{X}}$. We can therefore ignore the ${\mathbf{X}}{\mathbf{A}}$ component of the tangent space, and denote $${\mathcal{T}_{{\mathbf{X}}}\mathcal{M}} = \{{\mathbf{Y}}\, | \,{\mathbf{Y}}^T {\mathbf{X}}= {\mathbf{0}}\}.$$ On the Grassman manifold it is possible to substitute equivalence classes for the representatives we have chosen, but practical computations require us to always use a specific matrix.

We also assume that we are given a direction ${\mathbf{W}}$ by the minimization method in which we want to move on the manifold. We project the direction on to ${\mathcal{T}_{{\mathbf{X}}}\mathcal{M}}$ by $${\mathbf{Y}}= ({\mathbf{I}}- {\mathbf{X}}{\mathbf{X}}^T){\mathbf{W}}.$$ The motivation for the problem under consideration comes from density functional theory (DFT) electronic structure calculations @marx [@saad]. We construct a simultaneous Householder operator that can be used to ensure that the optimization method naturally enforces the orthogonality constraint. This approach differs from several other approaches in that it does not solve the canonical electron orbitals @kresse1 [@marzari; @voorhis2002; @cances2001; @vandevondele2003; @saad], instead we only solve the electron density that would be given by the orbitals. To obtain the canonical orbitals from the electron density a linear eigenvalue problem must then be solved in the space spanned by the columns of ${\mathbf{X}}$. A similar approach using polynomial filtering can be found in @zhou2006 [@bekas2008]. It is also possible to solve a nonlinear eigenvalue problem instead of the minimization problem @pulay [@kresse1; @luke; @saad].

In @edelman1998 a framework for optimization methods on the Stiefel and Grassmann manifolds is presented, while @chu1983 discusses a Newton-like iteration scheme on a more general manifold. Univariate optimization methods for the Stiefel manifold is presented in @celledoni2008, where identity plus rank one Householder transforms are given as one possible choice for moving on the manifold. The choice of coordinates can also be based on a QR factorization and polar decompositions @celledoni2002 [@dieci2003] or Lie groups @krogstad2003. An overview of geometric numerical integration techniques can be found in @lubich_hairer_wanner.

First, we present a simultaneous Householder transformation in Section \[sec:householder\] that we can use to move on both the Stiefel and Grassman manifolds. Then in Section \[sec:optimization\] we recall the method of steepest descent, the quasi-Newton (QN), and the nonlinear conjugate gradient (NLCG) methods adapted for use with the Householder operator. In Section \[sec:numerics\] we numerically demonstrate the method on a model problem that includes nonlinearities similar to a DFT problem. Finally, Section \[sec:conclusion\] presents the conclusion.

Householder operator {#sec:householder}
====================

We ensure that ${\mathbf{X}}\in{\mathcal{M}}$ during the solution process by using the Householder transformation to move from one solution candidate to the next.

![\[fig:update\]Conceptual difference between reorthogonalization and Householder approach. In Subfigure a) the step is taken without regard to the manifold, and after the step is taken the new solution candidate ${\mathbf{X}}_{k+1}$ is constructed by reorthogonalizing ${\mathbf{X}}_k+{\mathbf{Y}}_k$. Subfigure b) illustrates the case where the Householder operator, ${\mathbf{H}}$, constructs an update ${\mathbf{X}}_{k+1}$ that immediately satisfies the orthogonality condition.](Fig1){width="90.00000%"}

To do this we need to find an operator $$\label{eq:householder}
{\mathbf{H}}({\tau}) = {\mathbf{I}}- 2 {\mathbf{Q}}({\tau}){\mathbf{Q}}({\tau})^T,$$ where $$\label{eq:q_orth}
{\mathbf{Q}}({\tau})^T{\mathbf{Q}}({\tau}) = {\mathbf{I}}\quad\forall {\tau},$$ and ${\tau}$ is a parametrization of ${\mathbf{H}}$ such that $$\label{eq:qinit}
{\mathbf{H}}(0){\mathbf{X}}= {\mathbf{X}}.$$ This requirement leads to $$\label{eq:q_init}
{\mathbf{Q}}(0)^T{\mathbf{X}}={\mathbf{0}}.$$

${\mathbf{H}}$ is unitary, and if we let $${\mathbf{X}}_{k+1} = {\mathbf{H}}({\tau}){\mathbf{X}}_k,$$ we obtain a sequence $\{{\mathbf{X}}_k\}$ that satisfies $${\mathbf{X}}_{k+1}^T{\mathbf{X}}_{k+1} = {\mathbf{X}}_k^T{\mathbf{X}}_k \quad \forall\; k, {\tau}.$$

The orthonormality requirement (\[eq:q\_orth\]) on ${\mathbf{Q}}({\tau})$ leads to the constraint $$\label{eq:diff}
\frac{\partial{\mathbf{Q}}}{\partial{\tau}}^T{\mathbf{Q}}+ {\mathbf{Q}}^T\frac{\partial{\mathbf{Q}}}{\partial{\tau}} = {\mathbf{0}}.$$

We set the initial condition for $\tfrac{\partial{\mathbf{Q}}}{\partial {\tau}}$ by requiring that $$\label{eq:qdotinit}
\frac{\partial}{\partial {\tau}} \left( {\mathbf{H}}({\tau}){\mathbf{X}}\right)\Big|_{{\tau}=0} = {\mathbf{Y}},$$ where ${\mathbf{Y}}\in{\mathcal{T}_{{\mathbf{X}}}\mathcal{M}}$ is a projected direction given by the minimization method we choose to employ. Differentiating with respect to ${\tau}$, and using property (\[eq:q\_init\]), we obtain from (\[eq:qdotinit\]) $$-2  {\mathbf{Q}}(0)\frac{\partial{\mathbf{Q}}}{\partial{\tau}}(0)^T {\mathbf{X}}= {\mathbf{Y}}.$$

We set $$\label{eq:v}
{\mathbf{Q}}(0) = {\mathbf{V}},$$ where ${\mathbf{V}}{\mathbf{R}}$ is the compact QR decomposition of ${\mathbf{Y}}$, and choose $$\frac{\partial{\mathbf{Q}}}{\partial{\tau}}(0) = - \tfrac{1}{2} {\mathbf{X}}{\mathbf{R}}^T.$$

A solution satisfying Equation  and conditions (\[eq:qinit\]) and (\[eq:qdotinit\]) is $$\label{eq:qsolve}
\tilde{{\mathbf{Q}}}({\tau}) = \tilde{{\mathbf{Q}}}_0 \exp\Bigl({\tau}\begin{bmatrix}{\mathbf{0}}&\frac{1}{2}{\mathbf{R}}\\ -\frac{1}{2}{\mathbf{R}}^T&{\mathbf{0}}\end{bmatrix}\Bigr).$$ Here $\tilde{{\mathbf{Q}}}_0=\begin{bmatrix}{\mathbf{V}}& {\mathbf{X}}\end{bmatrix}$ and ${\mathbf{Q}}({\tau})$ corresponds to the first $n$ columns of $\tilde{{\mathbf{Q}}}({\tau})$. Given any ${\mathbf{Q}}$ with orthonormal columns ${\mathbf{H}}$ constructed by (\[eq:householder\]) ensures that ${\mathbf{X}}_{k+1}^T{\mathbf{X}}_{k+1} = {\mathbf{I}}$. For this reason we also consider a Householder operator constructed from a second order expansion of the matrix exponential that has subsequently been orthonormalized by the QR method to ensure that the orthogonality constraint is satisfied. This approach is similar to the orbital transformation but includes orthogonalization after every evaluation of the matrix exponential function @vandevondele2003. To distinguish these from the basic algorithms we use AEQN and AENLCG to denote the approximate exponential versions.

**Remark:** If $m < 2 n$ the requirement ${\mathbf{Y}}^T{\mathbf{X}}= {\mathbf{0}}$ restricts the number of columns in ${\mathbf{Y}}$ to below $n$. In this case the size of the first block in Equation (\[eq:qsolve\]) should be reduced accordingly. A similar modification must be made if ${\mathbf{Y}}$ is not full column rank. For the Householder transformation to work we must still have $m > n$.

Descent methods with orthogonality constraints {#sec:optimization}
==============================================

In this section we consider the method of steepest descent, a quasi-Newton method, and a nonlinear conjugate gradient method for minimization with orthogonality constraints. We also present the Householder operator for an ${\mathbf{S}}$-orthonormal basis, and combine this with the optimization methods.

The method of steepest descent {#sec:sd}
------------------------------

The method of steepest descent for the Stiefel manifold is also known as the projected gradient method @chu1990. At each step we simply set $$\label{eq:direction}
{\mathbf{Y}}_k = -\sigma({\mathbf{I}}- {\mathbf{X}}_k{\mathbf{X}}_k^T)\nabla f({\mathbf{X}}_k).$$ The parameter $\sigma > 0$ is almost redundant for the method of steepest descent, but will become important for the quasi-Newton methods presented later.

To decide the step length we evaluate $f({\mathbf{H}}({\tau}_k^e){\mathbf{X}}_k)$, where ${\tau}_k^e$ is an estimate step length, and construct the quadratic approximation $p({\tau})$ of $f({\mathbf{H}}({\tau}){\mathbf{X}}_k)$. We then solve ${\tau}_\mathrm{min} = \mathrm{argmin}\;p({\tau})$ from the system $$\begin{aligned}
\label{eq:step}
p(0) &= f({\mathbf{H}}(0){\mathbf{X}}),\\
p({\tau}_k^e) &= f({\mathbf{H}}({\tau}_k^e){\mathbf{X}}),\\
p'(0) &= (\nabla f({\mathbf{H}}(0){\mathbf{X}}), {\mathbf{Y}}).\end{aligned}$$ This permits us to compute ${\mathbf{H}}(\beta{\tau}_\mathrm{min})$ and evaluate $f({\mathbf{H}}(\beta{\tau}_\mathrm{min}){\mathbf{X}})$ as well as $\nabla f({\mathbf{H}}(\beta{\tau}_\mathrm{min}){\mathbf{X}})$, where $\beta$ is an underrelaxation parameter. To ensure that we obtain a non-increasing iteration we choose the step length ${\tau}_k$ from the set $\{0, \beta{\tau}_\mathrm{min}, {\tau}_k^e\}$, such that we obtain the lowest value of $f$ evaluated so far. If ${\tau}_{k} = 0$ we set ${\tau}_{k+1}^e = 0.25\times{\tau}_k^e$ and otherwise we set ${\tau}_{k+1}^e = \mathrm{min} (|{\tau}_\mathrm{min}|, 2\,{\tau}_k^e)$.

**Remark:** It turns out that ${\tau}_k^e$ often is an acceptable choice for step length, and we believe that it is possible to construct a completely line search free minimization method with adaptive step length @baarman2011b. However, it must be tuned for a real-world problem, and we will not explore this option here.

Vector transport on the manifold
--------------------------------

![\[fig:transport\]The curvature of the manifold must be taken into account when the trial solution is updated. The update operator, ${\mathbf{H}}$, corresponds to a reflection in the illustrated plane.](Fig2){width="90.00000%"}

To reduce the number of iterations we use information from previous evaluations to improve the search direction. To this end we construct a transport operator, ${\mathbf{T}}: {\mathcal{T}_{{\mathbf{X}}_k}\mathcal{M}} \rightarrow {\mathcal{T}_{{\mathbf{X}}_{k+1}}\mathcal{M}}$, that moves tangent vectors at ${\mathbf{X}}_k$to the tangent space at ${\mathbf{X}}_{k+1}$.

Any given vector, ${\mathbf{Z}}_k \in {\mathbb{R}}^{m\times n}$, associated with a candidate solution, ${\mathbf{X}}_k$, and search direction, ${\mathbf{V}}$, can be decomposed into $$\label{eq:decomposition}
{\mathbf{Z}}_k = {\mathbf{X}}_k{\mathbf{A}}+ {\mathbf{V}}{\mathbf{B}}+ {\mathbf{U}}{\mathbf{C}},$$ and we demand that ${\mathbf{X}}_k^T{\mathbf{U}}= {\mathbf{V}}^T{\mathbf{U}}= {\mathbf{0}}$, and ${\mathbf{U}}^T{\mathbf{U}}= {\mathbf{I}}$ in addition to ${\mathbf{X}}_k^T{\mathbf{V}}= {\mathbf{0}}$ which is satisfied by construction. For simplicity we assume that ${\mathbf{Z}}_k$ is such that ${\mathbf{U}}\in{\mathbb{R}}^{m\times n}$ and ${\mathbf{A}}, {\mathbf{B}}, {\mathbf{C}}\in {\mathbb{R}}^{n\times n}$. ${\mathbf{A}}$ and ${\mathbf{B}}$ can be computed by projecting ${\mathbf{Z}}_k$ onto ${\mathbf{X}}_k$ and ${\mathbf{V}}$ respectively, while ${\mathbf{U}}{\mathbf{C}}$ is for example the QR-decomposition of the remainder. In practice the decomposition is not explicitly constructed.

The different parts of the decompostion (\[eq:decomposition\]) must be transported separately when the position is updated to ${\mathbf{X}}_{k+1} = {\mathbf{H}}{\mathbf{X}}_k$. The component spanned by ${\mathbf{X}}_k$ is reflected correctly by ${\mathbf{H}}$, however a reflection gives the wrong sign to the ${\mathbf{V}}$ component of ${\mathbf{Z}}_k$. The final component ${\mathbf{U}}$ is orthogonal to both ${\mathbf{X}}_k$ and ${\mathbf{V}}$, and should not change when ${\mathbf{H}}$ is applied. The transport operation is shown in Figure \[fig:transport\]. We construct the transport operator by separating the components of ${\mathbf{Z}}_k$ by projection and subsequent application of ${\mathbf{H}}$. The transport operator therefore becomes $${\mathbf{H}}{\mathbf{X}}_k{\mathbf{X}}_k^T - {\mathbf{H}}{\mathbf{V}}{\mathbf{V}}^T + ({\mathbf{I}}- {\mathbf{X}}_k{\mathbf{X}}_k^T - {\mathbf{V}}{\mathbf{V}}^T).$$ In practice we apply this for vectors ${\mathbf{Z}}_{k} \in {\mathcal{T}_{{\mathbf{X}}_k}\mathcal{M}}$ which satisfy ${\mathbf{Z}}_{k}^T{\mathbf{X}}_k = {\mathbf{0}}$, and we can use the simplified transport operator $$\label{eq:transport}
{\mathbf{T}}({\tau}) = - {\mathbf{H}}({\tau}){\mathbf{V}}{\mathbf{V}}^T + ({\mathbf{I}}- {\mathbf{V}}{\mathbf{V}}^T),$$ and the tangent vector corresponding to ${\mathbf{Z}}_k$ at ${\mathbf{X}}_{k+1}$ is $${\mathbf{Z}}_{k+1} = {\mathbf{T}}({\tau}_k){\mathbf{Z}}_{k} \in {\mathcal{T}_{{\mathbf{X}}_{k+1}}\mathcal{M}}.$$

${\mathbf{S}}$-orthonormal Householder and transport operator
-------------------------------------------------------------

In practice ${\mathbf{X}}$ is often represented by a discretization that requires a generalization of the orthonormality constraint (\[eq:constraint\]). The generalized constraint is $$\label{eq:sorth}
{\mathbf{X}}^T{\mathbf{S}}{\mathbf{X}}= {\mathbf{I}},$$ where ${\mathbf{S}}$ is symmetric and positive definite. This constraint arises for example as an overlap matrix in DFT or a mass matrix in finite element calculations. If ${\mathbf{S}}$ is sparse or has other structure that can be exploited it can be preferable not to change basis for the optimization procedure. We therefore also present the Householder transform and optimization procedure for the ${\mathbf{S}}$-orthonormal case. We can construct both the Householder transform and the transport operator using the same argument as for the regular orthonormal case, as long as we account for ${\mathbf{S}}$ orthonormality (\[eq:sorth\]). However, if ${\mathbf{S}}$ is full, and lacks exploitable structure, the operation ${\mathbf{S}}{\mathbf{X}}$ has asymptotic complexity $m^2n$ and overshadows the rest of the procedure.

The projection of the direction of steepest descent onto the ${\mathbf{S}}$-orthogonal manifold is $${\mathbf{Y}}= -\sigma({\mathbf{I}}- {\mathbf{X}}{\mathbf{X}}^T{\mathbf{S}})\nabla f({\mathbf{X}})$$ instead of (\[eq:direction\]) and satisfies ${\mathbf{Y}}^T{\mathbf{S}}{\mathbf{X}}= {\mathbf{0}}$. We must also use the ${\mathbf{S}}$ weighted compact QR decomposition to compute a factorization ${\mathbf{Y}}={\mathbf{V}}{\mathbf{R}}$ where ${\mathbf{V}}^T{\mathbf{S}}{\mathbf{V}}= {\mathbf{I}}$, and ${\mathbf{R}}$ is upper triangular.

With these modifications, the Householder operator in (\[eq:householder\]) becomes $${\mathbf{H}}_{\mathbf{S}}({\tau}) = {\mathbf{I}}- 2 {\mathbf{Q}}({\tau}){\mathbf{Q}}({\tau})^T{\mathbf{S}},$$ where ${\mathbf{Q}}({\tau})$ is as in Equation (\[eq:qsolve\]), and remains unchanged. The ${\mathbf{S}}$-orthonormal transport operator corresponding to (\[eq:transport\]) is $$\label{eq:transport_operator}
{\mathbf{T}}_{\mathbf{S}}({\tau}) = - {\mathbf{H}}_{\mathbf{S}}({\tau}){\mathbf{V}}{\mathbf{V}}^T{\mathbf{S}}+ ({\mathbf{I}}-  {\mathbf{V}}{\mathbf{V}}^T{\mathbf{S}}).$$

The quasi-Newton method based on Householder transforms
-------------------------------------------------------

The method of steepest descent generally performs poorly if the minimum of the target function is at the bottom of a narrow valley. Newton's method solves this problem, but requires that the Hessian of the function is available to determine the search direction. When the Hessian is not available we can replace it with an approximation of the true inverse Hessian of the system to obtain a quasi-Newton method.

We base our method on Broyden's second or *bad* update to construct the approximate inverse Hessian, ${\mathbf{G}}_k$, of $f$ at ${\mathbf{X}}_k$. While Broyden's second update does not construct a symmetric approximation, or ensure that the approximation is positive definite it is a robust choice for electronic structure calculations @luke [@baarman2011a; @baarman2011b]. However, we must take into account that our vectors are actually ${\mathbb{R}}^{m\times n}$ matrices, which will lead to a method identical to the generalized Broyden update. The secant condition is then $$\label{eq:secant}
{\mathbf{G}}_{k+1} \Delta {\mathbf{F}}_k = \Delta {\mathbf{X}}_k,$$ where we project the orbital differences $$\Delta{\mathbf{X}}_k = ({\mathbf{I}}- {\mathbf{X}}_{k+1}{\mathbf{X}}_{k+1}^T{\mathbf{S}})({\mathbf{X}}_{k+1}-{\mathbf{X}}_{k}),$$ and gradient differences $$\Delta{\mathbf{F}}_k = ({\mathbf{I}}- {\mathbf{X}}_{k+1}{\mathbf{X}}_{k+1}^T{\mathbf{S}})\nabla f({\mathbf{X}}_{k+1})-{\mathbf{T}}({\tau}_k)({\mathbf{I}}-{\mathbf{X}}_k{\mathbf{X}}_k^T)\nabla f({\mathbf{X}}_{k})$$ onto ${\mathcal{T}_{{\mathbf{X}}_{k+1}}\mathcal{M}}$. The no change condition is now $${\mathbf{G}}_k{\mathbf{Z}}= {\mathbf{G}}_{k+1}{\mathbf{Z}}\quad \forall\,{\mathbf{Z}}\;:\,{\mathbf{Z}}^T\Delta {\mathbf{F}}_k = {\mathbf{0}}.$$ These conditions corresponds to the generalized Broyden's second update for groups of size $n$. We can therefore use the generalized update formula @fang $${\mathbf{G}}_{k+1} = {\mathbf{G}}_{k} + (\Delta {\mathbf{X}}_k - {\mathbf{G}}_k \Delta {\mathbf{F}}_k) (\Delta {\mathbf{F}}_k^T{\mathbf{S}}\Delta{\mathbf{F}}_k)^{-1}\Delta{\mathbf{F}}_k^T{\mathbf{S}}.$$ As initial guess we use ${\mathbf{G}}_0 = \sigma {\mathbf{I}}$. With this choice, the quasi-Newton method is identical with the method of steepest descent if we do not enforce any secant conditions (\[eq:secant\]). When secant conditions are enforced we can use $\sigma$ to control the influence of ${\mathbf{G}}_0$ compared to the information gained from the secant conditions. In general, the information gained from these is reliable, and therefore $\sigma$ should be small @baarman2011a [@baarman2011b].

To construct the search direction we use $${\mathbf{Y}}_k = -{\mathbf{G}}_k({\mathbf{I}}- {\mathbf{X}}_k{\mathbf{X}}_k^T{\mathbf{S}})\nabla f({\mathbf{X}}_k).$$

In practice, we do not store ${\mathbf{G}}_k$ as a full matrix. Instead we represent it as a low rank update. Details on recursive or low rank implementation of ${\mathbf{G}}_k$ can be found in @kawata [@nocedal; @baarman2011a; @baarman2011b].

We also limit the number of secant conditions used to construct ${\mathbf{G}}_k$. Each condition requires storage of two $m\times n$ matrices, $\Delta {\mathbf{X}}$ and $\Delta {\mathbf{F}}$, and these matrices must be transported to ${\mathcal{T}_{{\mathbf{X}}_k}\mathcal{M}}$ after each step. This is done with the transport operator, ${\mathbf{T}}_{\mathbf{S}}({\tau})$, defined in Equation (\[eq:transport\_operator\]). As we demonstrate in Section \[sec:numerics\] the first few secant conditions offer dramatic improvement over the method of steepest descent, but further secant conditions do not give the same benefit. For this reason we limit the secant conditions by a pre-determined history length, and simply discard older conditions.

We use the same line search as the one presented in Section \[sec:sd\]. If, however $$({\mathbf{Y}}_k,{\mathbf{S}}({\mathbf{I}}- {\mathbf{X}}_k{\mathbf{X}}_k^T{\mathbf{S}})\nabla f({\mathbf{X}}_k)) \ge 0$$ then the proposed direction is not a descent direction. In this case we restart the optimization method and forget the secant history. If the line search returns the current point ${\mathbf{X}}_k$, we update ${\mathbf{G}}_k$ but stay at ${\mathbf{X}}_k$.

Nonlinear conjugate gradients {#sec:nlcg}
-----------------------------

The linear conjugate gradient (CG) method can be viewed as a optimization method for a quadratic problem. Several generalizations of the CG method have been presented to solve optimization problems that are not of quadratic form @nocedal. Below, we review a nonlinear CG method adapted to account for the curvature of the manifold @edelman1998.

Given ${\mathbf{X}}_0$ which satisfies ${\mathbf{X}}_0^T{\mathbf{X}}_0 = {\mathbf{I}}$, the gradient projected onto ${\mathcal{T}_{{\mathbf{X}}_0}\mathcal{M}}$ is $${\mathbf{Y}}_0 = ({\mathbf{I}}- {\mathbf{X}}_0{\mathbf{X}}_0^T{\mathbf{S}})\nabla f({\mathbf{X}}_0),$$ and the initial search direction is the direction of steepest descent $${\mathbf{P}}_0 = -{\mathbf{Y}}_0.$$

On the manifold the NLCG method then proceeds by minimizing $f$ along the path defined by the search direction ${\mathbf{P}}_k$. In practice we evaluate $f$ once along the search direction and minimize the quadratic approximation as in Section \[sec:sd\]. The next candidate is chosen as the best evaluated step, ${\tau}_k$, $${\mathbf{X}}_{k+1} = {\mathbf{H}}({\tau}_k){\mathbf{X}}_k,$$ and the gradient and conjugate directions are transported to ${\mathcal{T}_{{\mathbf{X}}_{k+1}}\mathcal{M}}$ by ${\mathbf{T}}({\tau}_k)$ in Equation . The new gradient $${\mathbf{Y}}_{k+1} = ({\mathbf{I}}- {\mathbf{X}}_{k+1}{\mathbf{X}}^T_{k+1}{\mathbf{S}})\nabla f({\mathbf{X}}_{k+1}),$$ and conjugate direction $${\mathbf{P}}_{k+1} = -{\mathbf{Y}}_{k+1} + \gamma_k {\mathbf{T}}_{\mathbf{S}}({\tau}_k) {\mathbf{P}}_k,$$ are then computed where $$\gamma_k = \frac{({\mathbf{Y}}_{k+1}-{\mathbf{T}}_{\mathbf{S}}({\tau}_k){\mathbf{Y}}_k,{\mathbf{Y}}_{k+1})}{({\mathbf{Y}}_k,{\mathbf{Y}}_k)}.$$

For comparison we also implement a projected NLCG (PNLCG) method. Instead of ensuring that orbital updates satisfy ${\mathbf{X}}_{k+1}^T{\mathbf{X}}_{k+1} = {\mathbf{I}}$ we orthogonalize ${\mathbf{X}}_{k+1}$ after every update with the QR method. The conjugate directions and gradient are not transported to ${\mathcal{T}_{{\mathbf{X}}_{k+1}}\mathcal{M}}$, instead they are updated with the ${\mathbf{I}}- {\mathbf{X}}_{k+1}{\mathbf{X}}_{k+1}^T{\mathbf{S}}$ projector onto ${\mathcal{T}_{{\mathbf{X}}_{k+1}}\mathcal{M}}$.

Numerical experiments {#sec:numerics}
=====================

We use a two dimensional model problem with the condition ${\mathbf{X}}^T{\mathbf{S}}{\mathbf{X}}= {\mathbf{I}}$ to compare the projected NLCG method with the NLCG and QN methods where satisfaction the orthonormality condition is ensured by the update operator. The model problem is inspired by electronic structure theory, and corresponds to a three dimensional system constrained to two dimensions without exchange-correlation terms.

The target function is @marx $$\label{eq:model_problem}
f({\mathbf{X}}) = -\tfrac{1}{2}\mathrm{tr}(({\mathbf{S}}^{1/2}{\mathbf{X}})^T{\mathbf{L}}{\mathbf{S}}^{1/2}{\mathbf{X}}) + {\mathbf{v}}^T{\mathbf{n}}+\tfrac{1}{2} {\mathbf{n}}^T{\mathbf{P}}{\mathbf{n}},$$ where ${\mathbf{L}}\in{\mathbb{R}}^{m\times m}$ is the discretized Laplace operator, ${\mathbf{v}}\in{\mathbb{R}}^{m}$ the external potential, ${\mathbf{n}}\in{\mathbb{R}}^m$ the electron density, and ${\mathbf{P}}{\mathbf{n}}$ the Hartree potential. The electron density is $${\mathbf{n}}_i = \sum_{j=1}^n(({\mathbf{S}}^{1/2}{\mathbf{X}})\circ({\mathbf{S}}^{1/2}{\mathbf{X}}))_{ij},$$ where $\circ$ is the entrywise, or Hadamard, product. We use the overlap matrix $${\mathbf{S}}= \frac{1}{9h^2}
\begin{bmatrix}
{\mathbf{M}}& \tfrac{{\mathbf{M}}}{4} & 0 & \cdots\\
\tfrac{{\mathbf{M}}}{4} & {\mathbf{M}}& \tfrac{{\mathbf{M}}}{4} & \ddots \\
0 & \tfrac{{\mathbf{M}}}{4} & {\mathbf{M}}& \ddots \\
\vdots & \ddots & \ddots & \ddots \\
\end{bmatrix},$$ where $h$ is the one dimensional grid size and $${\mathbf{M}}= 
\begin{bmatrix}
4 & 1 & 0 & \cdots\\
1 & 4 & 1 & \ddots \\
0 & 1 & 4 & \ddots \\
\vdots & \ddots & \ddots & \ddots \\
\end{bmatrix}.$$ This corresponds to the mass matrix of a finite element discretization with bilinear quadratic element. The calculations have also been performed with a symmetric and positive definite random matrix. It turns out that as long as ${\mathbf{S}}$ is well conditioned, it has only a small effect on the rate of convergence.

To calculate the potentials we use $${\mathbf{v}}_i = -\sum_{j=1}^N \frac{Z_j}{||{\mathbf{r}}_i - {\mathbf{R}}_j||+\alpha},$$ where the sum is over the nuclei with charge $Z_j$ and position ${\mathbf{R}}_j$. The position corresponding to the discretization point $i$ is ${\mathbf{r}}_i$, and the parameter $\alpha$ is used to regularize the potential. ${\mathbf{P}}\in{\mathbb{R}}^{m\times m}$ is similarly given by $${\mathbf{P}}_{ij} = \frac{1}{||{\mathbf{r}}_i-{\mathbf{r}}_j|| + \alpha}.$$

We solve the problem in the unit square with zero boundary conditions corresponding to an infinite potential well. We use a uniform finite difference discretization with $m$ inner points to obtain a system where ${\mathbf{X}}\in {\mathbb{R}}^{m\times n}$. Here $n$ corresponds to the number of electrons. As initial guess we use the solution of the quadratic problem using the first two terms of (\[eq:model\_problem\]), and choose ${\tau}_0^e = 1.0$ to initialize the minimization procedure, cf. Equation (\[eq:step\]).

As generators for the external potential we use two nuclei, where one is placed at the grid point closest to $(\tfrac{1}{3},\tfrac{1}{3})$, and the other at the grid point closest to $(\tfrac{2}{3},\tfrac{13}{24})$. The off diagonal placement is chosen to break the symmetry of the system. We use $$\epsilon_{\mathbf{X}}= ||({\mathbf{I}}- {\mathbf{X}}{\mathbf{X}}^T)\nabla f({\mathbf{X}})||/\sqrt{mn},$$ to measure convergence, and consider the system converged when $$\epsilon_{\mathbf{X}}< 10^{-2}.$$ At this point $$|f({\mathbf{X}}_\mathrm{Ref})-f({\mathbf{X}})| \approx 10^{-4},$$ where the reference solution has been calculated such that $$\epsilon_{{\mathbf{X}}_\mathrm{Ref}} < 10^{-5}.$$

Figure \[fig:dof\] presents the iterations necessary for convergence for a six and seven electron system. These iterations roughly grows as the square root of the degrees of freedom for the NLCG methods. However, the projected NLCG method performs significantly worse than the NLCG and QN methods adapted for the manifold. It turns out that the AENLCG method requires the same number of iterations to converge as the NLCG method, while a small difference is visible between QN and AEQN methods.

In Figure \[fig:parameters\] the effect of weight, $\sigma$, of the initial approximation of the inverse Hessian and the underrelaxation, $\beta$ are presented. From Figure \[fig:parameters\] b) it is clear that $\sigma$ is particularly important for fast convergence of the quasi-Newton method. The effect of $\beta$ is much smaller, and while $\beta$ can in some cases improve convergence the effect of $\sigma$ is significantly more important. A low $\sigma$ results in slower convergence as long as the more aggressive parameter choice converges well. However, when the rate of convergence begins to suffer from the more aggressive parameter choice the rate of convergence can be improved by a more conservative choice. These results agree with earlier work @baarman2011a, which indicate that the secant conditions offer reliable information of the electronic structure problem, while the initial approximation of ${\mathbf{G}}$ is less reliable. The history length of the QN method must also be sufficient for the method to perform well. This is illustrated in Figure \[fig:history\].

Conclusion {#sec:conclusion}
==========

We have presented a Householder update scheme which ensures that the columns remains orthogonal, and is suitable for both NLCG and QN methods. Furthermore, the operator allows us to transport gradient information and construct secant conditions from previous evaluations of $f$ to the tangent space of the best candidate solution. This approach eliminates the need to parametrize the manifold, and permits us to use standard linear algebra routines to update the solution candidate.

We have demonstrated the methods numerically on a model problem inspired by the electronic structure problem, and compared them to a projected NLCG method. Taking the underlying manifold into account significantly improves convergence rate of the optimization methods, and using a second order orthonormal approximate matrix exponent does not decrease performance of the QN or NLCG methods.

The QN method is significantly improved by taking the first few secant conditions into account when constructing the approximation of the Hessian of $f$. However, for the secant condition history to improve convergence speed of the QN method the manifold must be taken into account. The update of the secant conditions is also based on the Householder operator that is used to update the solution candidate. While the performance of the QN method depends on the weight of the initial approximate Hessian the QN method performs well once the weight is correctly set.

While the QN method is sensitive to the correct choice of $\sigma$, the performance of the NLCG method does not depend on parameter choice. Furthermore, the NLCG method is relatively simple to implement, and only requires a one step history. For these reasons we believe that the NLCG method is a good general purpose optimization method for electronic structure problems if the method is adapted to the manifold.

Acknowledgments
===============

We are grateful towards Dr. Mika Juntunen for suggestions and comments on the manuscript.

[^1]: Department of Mathematics and Systems Analysis, Aalto University School of Science, Espoo, Finland, e-mail: `dennis65@example.net`

[^2]: Department of Applied Physics, Aalto University School of Science, Espoo, Finland

{'source': 'arXiv_out/1204'}