(Redirected from Energy minimization)

Gradient descent is a method for finding extrema of a function by following the direction of fastest change in said function, i.e., its gradient. For energy minimization, we follow the direction corresponding to minus the gradient, that is, we update the atomic positions along the direction given by the forces. Iteratively, we propagate the atomic positions as follows:

$\displaystyle{ \textbf{x}_{n+1} = \textbf{x}_n + \gamma_n \textbf{F}_n, }$

until we reach the criterion for convergence (set with the e_tol keyword), $\displaystyle{ |E_{n+1} - E_n| \lt E_\text{tol} }$. The $\displaystyle{ \gamma }$ parameter determines by how much we update the atomic positions along the search direction, and is allowed to change between iterations. The procedure is detailed below.

### Gradient descent with Armijo-Goldstein backtracking line search and Barzilai-Borwein step optimization

In TurboGAP, the initial $\displaystyle{ \gamma }$ is chosen by specifying the maximum allowed atomic displacement in the first optimization step, max_opt_step, followed by an automated backtracking line search. During the backtracking line search, we start by (over)estimating the position update according to the user provided max_opt_step (default 0.1 Angstrom), $\displaystyle{ \delta x_\text{max} }$:

$\displaystyle{ \gamma_0 = \frac{\delta x_\text{max}}{F_\text{max}}, }$

where $\displaystyle{ F_\text{max} }$ is the maximum force acting on any given atom in the system. Then, we enforce the Armijo-Goldstein condition for accepting this step size:

$\displaystyle{ E_{n+1} \le E_n - \gamma_n c \textbf{F} \cdot \textbf{F}, }$

where $\displaystyle{ c \in (0,1) }$ (hardcoded in TurboGAP to $\displaystyle{ c = 0.5 }$). If the condition is not met, then we reduce $\displaystyle{ \gamma }$ at each time step:

$\displaystyle{ \gamma_{n+1} = \tau \gamma_n, }$

with $\displaystyle{ \tau \in (0,1) }$ (hardcoded in TurboGAP to $\displaystyle{ \tau = 0.5 }$), until the Armijo-Goldstein condition is met ("backtracking").

When the line search is over, we switch to using the Barzilai–Borwein method for finding $\displaystyle{ \gamma }$:

$\displaystyle{ \gamma_{n+1} = \frac{|(\textbf{x}_{n+1} - \textbf{x}_n) \cdot (\textbf{F}_{n+1} - \textbf{F}_n)|}{(\textbf{F}_{n+1} - \textbf{F}_n)^2}. }$

### Example input file

Note: energy minimization is invoked with the turbogap md command.

optimize = "gd"    ! Do gradient descent minimization
e_tol = 1.e-6      ! Energy threshold for convergence (per atom)
f_tol = 0.01       ! Maximum force on any given atom for convergence
md_nsteps = 1000   ! Maximum number of iterations (it will break earlier if convergence to e_tol is reached)
max_opt_step = 0.1 ! Angstrom